query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Allows for returning a product. Checks if a transaction has been made in the store. It takes a product and a defect argument. The defect argument if true signals that the product bought has a defect.
def return_product(product, defect = false) if Transaction.find_by(customer: self, product: product).empty? raise NotRecordedTransactionError, "There was no such transaction recorded." else ProductReturn.new(self, product, defect) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purchase(product)\n \t\tif product.in_stock?\n \t\t\tTransaction.new(self, product)\n \t\telse\n \t\t\traise OutOfStockError, \"#{product.title} is out of stock\"\n \t\tend\n \tend", "def determine_valid_product(product)\n valid = true\n if @products.has_key?(product)\n valid\n else\n puts \"Undefined product: #{product}\"\n puts \"\"\n valid = false\n end\n end", "def check_product\n if @product.nil?\n redirect_to products_path, notice: \"Product not found!😢\"\n return\n end\n end", "def check_product\n return unless product_item_params.key?(:product_id)\n\n unless Product.exists?(product_item_params[:product_id])\n raise ActiveRecord::RecordNotFound, \"Product with id='#{product_item_params[:product_id]}' not found\"\n end\n end", "def product\n if PRODUCT_UPDATE_MUST_HAVE.include?(Employee.where(id: session[\"found_user_id\"]).first.admin_rights)\n id = params[\"product_id\"]\n if id == \"new\"\n @product = Product.new\n @product.items_per_bunch = 100\n @product.markup = 100\n else\n @product = Product.where(florist_id: session[\"found_florist_id\"]).where(id: id).first\n end\n render(:product_updates) and return\n else\n redirect_to \"/products\" and return\n end\n end", "def find_product? (aProductId)\r\n return false if (find_product(aProductId) == {})\r\n return true\r\n end", "def show\n assert_product_is_accessible!\n add_to_cart = true\n @login_required = false\n\n # does the product have active price policies?\n unless @product.available_for_purchase?\n add_to_cart = false\n @error = \"not_available\"\n end\n\n # is user logged in?\n if add_to_cart && acting_user.blank?\n @login_required = true\n add_to_cart = false\n end\n\n # when ordering on behalf of, does the staff have permissions for this facility?\n if add_to_cart && acting_as? && !session_user.operator_of?(@product.facility)\n add_to_cart = false\n @error = \"not_authorized_acting_as\"\n end\n\n # does the user have a valid payment source for purchasing this reservation?\n if add_to_cart && acting_user.accounts_for_product(@product).blank?\n add_to_cart = false\n @error = \"no_accounts\"\n end\n\n # does the product have any price policies for any of the groups the user is a member of?\n if add_to_cart && !price_policy_available_for_product?\n add_to_cart = false\n @error = \"not_in_price_group\"\n end\n\n # is the user approved?\n if add_to_cart && !@product.can_be_used_by?(acting_user) && !session_user_can_override_restrictions?(@product)\n if SettingsHelper.feature_on?(:training_requests)\n if TrainingRequest.submitted?(session_user, @product)\n flash[:notice] = text(\".already_requested_access\", product: @product)\n return redirect_to facility_path(current_facility)\n else\n return redirect_to new_facility_product_training_request_path(current_facility, @product)\n end\n else\n add_to_cart = false\n @error = \"requires_approval\"\n end\n end\n\n if @error\n flash.now[:notice] = text(@error, singular: @product.class.model_name.to_s.downcase,\n plural: @product.class.model_name.human(count: 2).downcase)\n end\n\n @add_to_cart = add_to_cart\n @active_tab = \"home\"\n render layout: \"application\"\n end", "def inventory\n product=Product.find(params[:id])\n haveProduct = false\n if product.inventory && product.inventory > 0\n haveProduct = true;\n end\n render plain: haveProduct\n end", "def product\n product_sold = nil\n products = FarMar::Product.all\n products.each do |product|\n if product.id == self.product_id\n product_sold = product\n return product_sold\n end#of if\n end#of do\n end", "def get_product\n @product = Product.find_by_uuid(params[:product_id])\n if @product.nil?\n raise Repia::Errors::NotFound\n end\n end", "def add_product(product_name, product_price)\n if @fulfillment_status == :pending || @fulfillment_status == :paid\n return super\n else\n raise ArgumentError.new(\"ERROR: status is not pending or paid\")\n end\n end", "def obtains_product\n product = Product.find(params[:product_id])\n @product = product.user_id == @current_user.id ? product : nil\n (render(json: { e: 'AUTH' }, status: :unauthorized) && nil) if @product.nil?\n end", "def purchased?(product)\n purchase_items.exists?(product_id: product.id)\n end", "def require_product?\n !!!catalog_request?\n end", "def require_product?\n !!!catalog_request?\n end", "def buying_a_product\n\t\t# Deleting all data from the database\n\t\tLineItem.delete_all\n\t\tOrder.delete_all\n\n\t\truby_book = products(:ruby)\n\n\t\t# A user goes to the store index page\n\t\tget \"/\"\n\t\tassert_response :success\n\t\tassert_template \"index\"\n\n\t\t# They select a product, adding it to their cart\n\t\txml_http_request :post, '/line_items', product_id: ruby_book.id\n\t\tassert_response :success\n\n\t\tcart = Cart.find(session[:cart_id])\n\t\tassert_equal 1, cart.line_items.size\n\t\tassert_equal ruby_book, cart.line_items[0].product\n\n\t\t# Check out\n\t\tget \"/orders/new\"\n\t\tassert_response :success\n\t\tassert_template \"new\"\n\n\t\t# Place Order\n\t\tpost_via_redirect \"/orders\", order: { name: \"Dave Thomas\", address: \"123 The Street\", email: \"dave@example.com\", payment_type_id:\"2\" }\n\t\tassert_response :success\n\t\tassert_template \"index\"\n\t\tcart = Cart.find(session[:cart_id])\n\t\tassert_equal 0, cart.line_items.size\n\n\t\t# Check the Databse is correct\n\t\torders = Order.all\n\t\tassert_equal 1, orders.size\n\t\torder = orders[0]\n\n\t\tassert_equal \"Dave Thomas\", order.name\n\t\tassert_equal \"123 The Street\", order.address\n\t\tassert_equal \"dave@example.com\", order.email\n\t\tassert_equal 2, order.payment_type_id\n\n\t\tassert_equal 1, order.line_items.size\n\t\tline_item = order.line_items[0]\n\t\tassert_equal ruby_book, line_item.product\n\n\t\t# Checking the email is correct\n\t\tmail = ActionMailer::Base.deliveries.last\n\t\tassert_equal [\"dave@example.com\"], mail.to\n\t\tassert_equal 'Sam Ruby <depot@example.com>', mail[:from].value\n\t\tassert_equal 'Pragmatic Store Order Confirmation', mail.subject\n\tend", "def purchase\n begin\n ActiveRecord::Base.transaction do\n @user.coin_credit -= @product.price\n requested_detail = @product.details.available.first\n requested_detail.available = false # makes the detail unavailable\n requested_detail.save!\n @user.save!\n @user.purchased_details << requested_detail # adds the detail to purchased_details of the user\n @purchased_detail = requested_detail\n end\n true\n rescue => e\n Rails.logger.error e\n @user.reload\n @user.errors.add(:base, :purchase_problem)\n false\n end\n end", "def purchase(product, date = Date.today)\n\t\tdate = date.is_a?(String) ? Date.parse(date) : date\n\t\tif product.in_stock?\n\t\t\tTransaction.new(self, product, date)\n\t\telse\n\t\t\traise OutOfStockError, \"'#{product.title}' is out of stock.\"\n\t\tend\n\tend", "def purchase_one\n product = Product.find(params[:id])\n company = Company.first\n if product[:inventory_count] > 0\n if product.decrement!(:inventory_count)\n total = company[:money] + product[:price]\n\n company.update_!(money: total)\n render json: {\n status: :ok,\n message: 'Successfully bought'\n }.to_json\n else\n render json: {\n status: :internal_server_error,\n message: 'Error purchasing product'\n }\n end\n else\n render json: {\n status: :ok,\n message: 'Item is no longer available'\n } \n end\n end", "def check_for_product(product)\n if @products.map(&:name).include?(product.capitalize)\n price = @products.select { |p| p.name == product.capitalize }.map(&:price)[0]\n puts \"Please pay #{price} pennies for the #{product.upcase}\"\n 1\n else\n puts 'Product is unavailable'\n 0\n end\n end", "def product_present\n if product.nil?\n errors.add(:product, 'is not valid.')\n end\n end", "def verify(package, product_id, token)\n execute(\n :get_purchase_product,\n package,\n product_id,\n token\n )\n end", "def create\n @page_title = \"Sell your product\"\n @product = Product.new(params[:product])\n @product.user = current_user\n\n if @product.valid?\n @product.force_save\n return product_success\n else\n flash[:error_stay] = @product.errors.full_messages\n @product.force_save\n redirect_to edit_product_path(@product)\n end\n end", "def chkproduct( product_id, sess)\n @product = TempProduct.where(:product_id => product_id).\n where(:sess => sess)\n if @product.count > 0\n true # return true if exist\n else\n false # return false if don't exist\n end\n end", "def reserved?(product)\n product.status == 'Reserved'\n end", "def save_product!\n product = nil\n if product_id.blank?\n product = Inventory::Product.new\n product.name = name\n product.sku = sku\n product.catalogue_id = catalogue_id\n product.facility_strain_id = facility_strain_id\n product.facility_id = facility_id\n product.transaction_limit = transaction_limit\n product.status = 'available'\n product.save!\n else\n product = Inventory::Product.find(product_id)\n end\n\n product\n end", "def product(product)\n products.find(product.id)\n end", "def verify_product_purchase(package_name:, product_id:, token:)\n verifier = CandyCheck::PlayStore::ProductPurchases::ProductVerification.new(\n package_name: package_name,\n product_id: product_id,\n token: token,\n authorization: @authorization,\n )\n verifier.call!\n end", "def buy\n if self.inventory_count == 0\n return false\n else\n # for now, decrementing the inventory count when purchasing a product will do\n self.decrement!(:inventory_count)\n # in the future, could return a receipt number, etc.\n return true\n end\n end", "def verify(package, product_id, token)\n @api_client.get_purchase_product(\n package,\n product_id,\n token\n )\n end", "def return_item(product)\n Transaction.new(self,product,refund: product.title)\n end", "def call!\n verify!\n if valid?\n CandyCheck::PlayStore::ProductPurchases::ProductPurchase.new(@response[:result])\n else\n CandyCheck::PlayStore::VerificationFailure.new(@response[:error])\n end\n end", "def product?\n self.level == \"product\" && !self.products.blank?\n end", "def consume(accountNo, pin, product)\n \n account = find(accountNo, pin)\n \n raise Exceptions::BruteForce if account.attempts_today > 9\n raise Exceptions::BadCredentials unless account.pin == pin\n \n coupon = product_in_stock?(product)\n \n raise Exceptions::OutOfStock unless coupon\n \n begin\n Coupon.transaction(coupon, account) do\n coupon.account = account\n raise Exceptions::TransactionFailed if coupon.used != 'N'\n coupon.used = 'Y'\n coupon.used_on = Time.now\n account.balance -= coupon.price\n raise Exceptions::TransactionFailed if account.balance < 0\n coupon.save!\n account.save!\n end\n rescue Exceptions::TransactionFailed\n coupon.voucher = nil\n raise Exceptions::VoucherAlreadyUsed if coupon.used != 'N'\n raise Exceptions::InsufficientBalance if (account.balance - coupon.price) < 0 \n raise Exceptions::TransactionFailed # reraise exception\n end\n \n return coupon.voucher\n \n end", "def get_result\n @product\n end", "def buy\n if @product.buy\n render json: {success: true, message: I18n.t(\"products.purchased\")}\n else\n render json: {success: false, message: I18n.t(\"products.no_stock\")}\n end\n end", "def test_create_product \n check_product\n end", "def authorize_product!(product)\n unless product.nil?\n unless current_user.products.include?(product)\n raise Exceptions::ProductAccessDenied\n end\n end\n end", "def in_stock?(product, quantity = 1)\n @inventory[product] && @inventory[product][\"quantity\"] >= quantity\nend", "def create_product(prod)\n\n purchase_price = BigDecimal.new(\"0.0\")\n purchase_price = BigDecimal.new(prod['purchase_price'].to_s) unless prod['purchase_price'].nil?\n sales_price = nil\n sales_price = BigDecimal.new(prod['sales_price']) unless prod['sales_price'].nil?\n weight = 0\n weight = prod['weight'].to_f unless prod['weight'].nil?\n manufacturer_product_code = prod['manufacturer_product_code']\n stock = prod['stock'].to_i unless prod['stock'].nil?\n\n tax_percentage = prod['tax_percentage'] || 8.0\n tax_class = TaxClass.where(:percentage => tax_percentage).first unless tax_percentage.nil?\n if tax_class.nil?\n tax_class = TaxClass.create(:percentage => 8.0, :name => \"8.0\")\n end\n\n prod['description'].blank? ? description = \"No description\" : description = prod['description']\n \n is_featured = false\n is_featured = true if [\"yes\", \"true\", \"1\"].include?(prod['featured'])\n is_visible = true\n is_visible = false if [\"no\", \"false\", \"0\"].include?(prod['visible'])\n is_build_to_order = false\n is_build_to_order = true if [\"yes\", \"true\", \"1\"].include?(prod['build_to_order'])\n \n supplier = Supplier.find_by_name(prod['supplier'])\n\n product = Product.where(:name => prod['name'],\n :description => description,\n :weight => weight,\n :sales_price => sales_price,\n :supplier_id => supplier,\n :tax_class_id => tax_class,\n :purchase_price => purchase_price,\n :manufacturer_product_code => manufacturer_product_code,\n :is_featured => is_featured,\n :is_visible => is_visible,\n :is_build_to_order => is_build_to_order,\n :stock => stock).first\n if product.nil?\n product = Product.create(:name => prod['name'],\n :description => description,\n :weight => weight,\n :sales_price => sales_price,\n :supplier => supplier,\n :tax_class => tax_class,\n :purchase_price => purchase_price,\n :manufacturer_product_code => manufacturer_product_code,\n :is_featured => is_featured,\n :is_visible => is_visible,\n :is_build_to_order => is_build_to_order,\n :stock => stock)\n end\n if prod['category']\n category = Category.where(:name => prod['category']).first\n category = Category.create(:name => prod['category']) if category.nil?\n product.categories << category\n product.save\n end\n\n\n # Ugly, but at least it makes test authors know what went wrong\n if product.errors.empty?\n return product\n else\n puts \"Errors creating product: #{product.errors.full_messages}\"\n return false\n end\nend", "def create\n product = Product.new(\n name: params[:name],\n pricesell: params[:pricesell],\n pricebuy: params[:pricebuy],\n stockvolume: params[:stockvolume],\n reference: params[:reference],\n category: Category.find(params[:category]),\n stockcurrent: current_user.company.stockcurrent\n )\n if Product.find_by(name: params[:name], category: Category.find(params[:category])) == nil\n product.save\n flash[:success] = \"The new product #{params[:name]} was added to your stock\"\n current_user.company.stockcurrent.update(units: current_user.company.stockcurrent.units + params[:stockvolume].to_i)\n else\n Product.find_by(name: params[:name]).update(stockvolume: Product.find_by(name: params[:name]).stockvolume + params[:stockvolume].to_i)\n flash[:success] = \"The quantity of #{params[:name]} was succesfully updated\"\n current_user.company.stockcurrent.update(units: current_user.company.stockcurrent.units + params[:stockvolume].to_i)\n end\n redirect_to products_path\n end", "def call(_obj, args, _ctx)\n product = Product.find_by(id: args[:product_id])\n if product.inventory_count == 0\n raise GraphQL::ExecutionError, \"Product with the ID: #{args[:product_id]} is out of inventory and unavailable.\"\n else\n product.inventory_count -= 1\n product.sold_count += 1\n product.save\n end\n Product.find_by(id: args[:product_id])\n end", "def conditional_product_touch\n stock_changed = (saved_change_to_count_on_hand? && saved_change_to_count_on_hand.any?(&:zero?)) || saved_change_to_product_id?\n product.touch if stock_changed\n end", "def verify(package, product_id, token)\n parameters = {\n 'packageName' => package,\n 'productId' => product_id,\n 'token' => token\n }\n execute(parameters, rpc.purchases.products.get)\n end", "def buy\n if @product.price <= @user.coin_credit # Checks whether the user has enough coin_credit or not\n purchase\n else\n @user.errors.add(:coin_credit, :not_enough_credit)\n false\n end\n end", "def find_product\n @stock_product = Product.where(id: params[:product_id]).take\n if @stock_product.present?\n @stockitem = Stockitem.new\n else\n render json: { msg: 'Produto não existe em estoque' }\n end\n end", "def product_in_stock?(product)\n p = Product.find_by_name(product.to_s)\n return nil unless p\n coupons = Coupon.find_all_by_product_id_and_account_id_and_used(p.id, nil, 'N', :limit => 1) \n return nil unless coupons\n return nil if coupons.length == 0 \n return coupons[0]\n end", "def product\n id = self.product_id\n found_product = FarMar::Product.find(id)\n return found_product\n end", "def test_create_product\n\t\tactually = $zapi.product.create\n\n\t\tassert_not_equal(actually, false)\n\t\tprods = $zapi.product.where(id: actually)\n\t\tprods[0].delete\n\tend", "def set_product\n @product = Product.find(params[:id])\n if not current_user.admin and not @product.provider != current_user.provider\n return\n end\n end", "def dispense_product(product)\n if @products.map(&:name).include?(product)\n @products.delete(@products.find{|p| p.name == product.capitalize})\n puts \"Enjoy your #{product}\"\n 1\n else\n puts \"Sorry the #{product} is no longer available.\"\n 0\n end\n end", "def remove_product(product_name)\n return successfully_remove_product?(product_name)\n end", "def create\n redirect_url = products_url\n Product.transaction do\n begin\n @product = Product.new(params[:product])\n @product.user = current_user\n @product.step = 1\n\n if @product.save\n if @product.sector == 'bio_based'\n @bp_product = BpProduct.new\n @bp_product.product_id = @product.id\n unless @bp_product.save\n raise ProductCreateException\n end \n redirect_url = bp_production_url(@bp_product)\n end\n if @product.sector == 'renewable'\n @ph_product = PhProduct.new\n @ph_product.product_id = @product.id\n unless @ph_product.save\n raise ProductCreateException\n end \n redirect_url = ph_basic_information_path(@ph_product)\n end\n\n if @product.sector == 'sensors'\n @se_product = SeProduct.new\n @se_product.product_id = @product.id\n unless @se_product.save\n raise ProductCreateException\n end \n redirect_url = se_manufacturing_path(@se_product)\n end\n\n if @product.sector == 'textiles'\n @st_product = StProduct.new\n @st_product.product_id = @product.id\n unless @st_product.save\n raise ProductCreateException\n end\n redirect_url = st_material_detail_path(@st_product) \n end\n\n if @product.sector == 'machine'\n @mt_product = MtProduct.new\n @mt_product.product_id = @product.id\n unless @mt_product.save\n raise ProductCreateException\n end\n redirect_url = mt_assessment_url(@mt_product)\n end\n\n if @product.sector == 'printed'\n @pc_product = PcProduct.new\n @pc_product.product_id = @product.id\n unless @pc_product.save\n raise ProductCreateException\n end\n redirect_url = pc_basic_url(@pc_product)\n end\n if @product.sector == 'electronics'\n redirect_url = scenario_url(@product)\n end \n \n \n respond_to do |format|\n format.html { redirect_to(redirect_url )}\n format.xml { render :xml => @product, :status => :created, :location => @product }\n end \n else\n raise ProductCreateException\n end \n rescue ProductCreateException\n # flash.now[:notice] = \"Product was unsuccessfully created\"\n respond_to do |format|\n format.html { render :action => \"new\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n end \n end\n end \n end", "def check_stock(_product, _store, _quantity)\n _check_stock = true\n if _product.product_type.id != 2\n _stock = Stock.find_by_product_and_store(_product, _store)\n if !_stock.nil?\n if (_stock.current - _quantity) < 0\n errors.add(:description, I18n.t(\"activerecord.models.delivery_note_item.quantity_greater_than_stock_item\", stock: _stock.current))\n _check_stock = false\n end\n else\n errors.add(:description, I18n.t(\"activerecord.models.delivery_note_item.no_stock_store\"))\n _check_stock = false\n end\n end\n _check_stock\n end", "def inventory_product_exists?\n ! inventory_product_id.nil? # don't hit the db\n end", "def set_product\n @product = Product.find_by_id(params[:id])\n if @product.nil?\n render json: {success: false, message: I18n.t(\"products.does_not_exist\")}\n return\n end\n end", "def check_new_product\n product_name = query(\"* id:'text_view_product_name'\", :text)\n product_name[0] == @@product_name\n end", "def includes_product?(product)\n products.include?(product)\n end", "def add_product(product_name, product_price)\n if @status == :processing || @status == :shipped || @status == :complete\n raise ArgumentError\n elsif @status == :paid || @status == :pending\n return super\n end\n end", "def create\n project = Project.find(params[:project_id])\n if check_user_permission(project)\n @product = project.products.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\n end", "def find_product_and_release\n params[:product] = { :id => Product.active_products.find_by_short_name( params[:product]).try(:id) } if params[:product]\n params[:release] = { :id => Release.current.enabled.find_by_name( params[:release]).try(:id) } if params[:release]\n end", "def create\n @product = Product.new(product_params)\n @product.provider = current_user.provider\n respond_to do |format|\n if @product.save\n\tformat.html { redirect_to @product, notice: '您已成功提交商品,我们会在1~2个工作日受理您的申请,请耐心等待,如有问题请联系客服0757-82581702。' }\n\tformat.json { render :show, status: :created, location: @product }\n else\n\tformat.html { render :new }\n\tformat.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def purchase\n\t\t\n\t\tif self.inventory >= 1\n\t\t\t#reduce inventory by 1 then save to db\n\t\t\tself.inventory = self.inventory - 1\n\t\t\tself.save\n\t\t\t#successful purchase, return true\n\t\t\tself.show\n\t\t\treturn true\n\t\tend\n\t\t\n\t\t#unsuccessful purchase, return false\n\t\treturn false\n\tend", "def should_install?(product)\n product == @env.nodeProduct || @env.nodeProduct.nil?\n end", "def add_to_cart\n # Params to find product and how much to place in cart\n product_name = params['name']\n product_id = params['item_id']\n product_quantity = params['quantity'].to_s\n\n # Making sure necessary params are not empty\n if (product_name.empty? && product_id.empty?) || product_quantity.empty?\n @return = { 'Error': 'Quantity must be specified'} if product_quantity.empty?\n @return = { 'Error': 'One of name or item_id must be specified' } if product_id.empty? && product_name.empty?\n @return = { 'Error': 'Quantity and one of name or item_id must be specified' } if product_id.empty? && product_name.empty? && product_quantity.empty?\n else\n # Finding product\n if product_name.present?\n product_name.capitalize\n @return = Product.find_by(name: product_name)\n else\n @return = Product.find_by(item_id: product_id)\n end\n\n if @return.nil? # Making sure product was found\n @return = { 'Error': 'Product not found' }\n else\n stock = @return.quantity\n\n if stock == 0\n @return = { 'Error': 'Product is sold out' }\n elsif stock < product_quantity.to_i\n @return = { 'Error': 'Not enough stock left to meet quantity' }\n else\n if Cart.find_by(item_id: @return.item_id).present?\n @return = { 'Error': 'Product already exists in cart'}\n else\n Cart.create(name: @return.name, description: @return.description, item_id: @return.item_id, price: @return.price, quantity: product_quantity)\n @return = { 'Success': product_quantity + ' x ' + @return.name + ' added to cart!' }\n end\n end\n end\n end\n render json: @return\n end", "def sold?(product)\n product.status == 'Sold'\n end", "def add_to_cart(reference_number)\n product = find_product(reference_number)\n if product != nil\n @shopping_cart << product\n puts \"Congratulations. '#{product[:name]}' has been added to the cart!\"\n else\n puts \"Please select a valid reference number\"\n end\nend", "def show\n begin\n set_product\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to access invalid product #{params[:id]}\"\n redirect_to products_path, :notice => 'Invalid product'\n end\n end", "def product\n @product ||= Product.find(params[:id])\n end", "def get_product\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def products_filter_correct?(product)\r\n # initial variables\r\n count = 0\r\n arr_product_info = get_all_product_info\r\n platform = product\r\n\r\n # convert some special string\r\n case product\r\n when 'Toys'\r\n platform = 'toys'\r\n when 'LeapTV'\r\n platform = 'thd1'\r\n when 'LeapBand'\r\n platform = 'lbat'\r\n when 'LeapPad3'\r\n platform = 'pad3'\r\n when 'LeapPad Ultra'\r\n platform = 'phr1'\r\n when 'LeapPad2'\r\n platform = 'pad2'\r\n when 'LeapsterGS Explorer'\r\n platform = 'gam2'\r\n when 'Leapster Explorer'\r\n platform = 'lst3'\r\n when 'LeapReader'\r\n platform = 'lprd'\r\n when 'Tag'\r\n platform = 'tag'\r\n when 'LeapReader Junior'\r\n platform = 'lprj'\r\n when 'Tag Junior'\r\n platform = 'tagj'\r\n when 'DVD'\r\n platform = 'dvd'\r\n end\r\n\r\n # check all product on all results section\r\n (0..arr_product_info.length - 1).each do |i|\r\n if arr_product_info[i][:platforms].include?(platform)\r\n count += 1\r\n else\r\n return \"Fill by #{platform} is failed by #{arr_product_info[i][:title]}\"\r\n end\r\n end\r\n\r\n return true if arr_product_info.count == count\r\n end", "def product(product_id)\n FarMar::Product.all.find { |product| product.id == product_id }\n end", "def added_to_cart?(product)\n return false unless user_signed_in?\n return false if current_user.shopping_cart.blank?\n current_user.shopping_cart.includes_product?(product)\n end", "def out_of_stock_message(product)\r\n \"out of stock\" unless product \r\n end", "def set_product\n @products = Product.find_by_id(params[:id])\n if @products != nil\n return true\n else\n msg = { status: 404 , response: {error:'Value does not exist.'}}\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_use_printrun = ProductUsePrintrun.new(params[:product_use_printrun])\n @product_categories = ProductCategory.find(:all)\n checked_features = check_features_using_helper( params[:product_prints_list], ProductCategory, @product_use_printrun.product_categories )\n respond_to do |format|\n if @product_use_printrun.save\n flash[:notice] = 'ProductUsePrintrun was successfully created.'\n format.html { redirect_to :controller => 'product_categories', :action => \"index\" }\n format.xml { render :xml => @product_use_printrun, :status => :created, :location => @product_use_printrun }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @product_use_printrun.errors, :status => :unprocessable_entity }\n end\n end\n end", "def get_product\n @product = Product.find(params[:id])\n end", "def successfully_add_product?(product_name, product_cost)\n original_num_of_products = @products.length\n add_new_product_if_valid(product_name, product_cost)\n return original_num_of_products != @products.length\n end", "def product\n FarMar::Product.all.select { |product| product.product_id == product_info }\n end", "def product\n FarMar::Product.find(@product_id)\n end", "def checkProduct(selected)\n @@products.each do |product|\n if product.name == selected.capitalize\n return true;\n end\n end\n return false\n end", "def get_product product_id\n # Retrieve the product that was just created\n @server.call(\"call\", @session_id, \"catalog_product.info\", [product_id, @current_store_id, [\"image\"]])\n rescue XMLRPC::FaultException => exception\n return exception\n end", "def successfully_remove_product?(product_name)\n return is_valid_name?(product_name) && !@products.delete(product_name).nil?\n end", "def set_product\n @product = Product.with_deleted.find(params[:id])\n end", "def update\n if check_user_permission(@product.project)\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\n end", "def get_product\n Rpc::GetProductResp.new(\n product: Rpc::Product.new(\n id: 1,\n name: 'name',\n price: 2\n )\n )\n end", "def reserve_product\n \n method = params[:method]\n type = params[:type]\n \n #send out our reserve product notice.\n #find our object description\n if type == 'resource'\n object = Resource.find(params[:id])\n\t\n elsif type =='manifestation'\n object = Manifestation.find(params[:id])\n else\n logger.debug(\"DEBUG: RESERVE: reserve object type not recognised!\")\n return false\n end\n \n if !object.blank? && !method.blank? && !type.blank?\n logger.debug(\"DEBUG: RESERVE: About to send email\")\n \n\tusername = @login.username\n\tusername = @login.username.to_s + \"<info@sounz.org.nz>\" unless username.to_s=~/\\@/\n\t\n\tHireNotice.deliver_email_hire_notice(username, @login.id, type, object.id, object.frbr_ui_desc, '', method)\n else\n\tlogger.debug(\"DEBUG: RESERVE: ERROR \")\n end\n \nend", "def update\n if (!product_params[:is_removal] && @product.update(product_args)) ||\n (product_params[:is_removal] && @product.destroy)\n render json: Product.all, status: :ok\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create_cart_product_for_new_product(product)\n cp = cart_products.create\n cp.product = product\n cp.quantity = 1\n cp.price = product.best_price\n cp\n end", "def add_product(product_name, product_cost)\n return successfully_add_product?(product_name, product_cost)\n end", "def product\r\n\t\t@current_area = 'products'\r\n\t\t@current_menu = 'products'\r\n\r\n\t\tif params[:save]\r\n\t\t\t@product = Product.find(params[:id])\r\n\r\n\t\t\tif params[:delete_image]\r\n\t\t\t\tImage.delete(@product.image.id)\r\n\t\t\t\treturn false # we don't need to process anything more\r\n\t\t\tend\r\n\r\n\t\t\tif params[:product][:categories]\r\n\t\t\t\tparams[:product][:categories].map! { |c| Category.find(c.to_i) }\r\n\t\t\telse\r\n\t\t\t\tparams[:product][:categories] = []\r\n\t\t\tend\r\n\t\t\tparams[:product][:expiry_date] = ffs_parse_date(params[:product][:expiry_date])\r\n\t\t\tif params[:image] and params[:image][:image]\r\n\t\t\t\tif @product.image\r\n\t\t\t\t\tThumbnail.delete_all(\"product_id=#{@product.id}\")\r\n\t\t\t\tend\r\n\r\n\t\t\t\t# != '' works, but .empty? doesn't - .empty? isn't defined for IOString's :x\r\n\t\t\t\tif params[:image][:image] != ''\r\n\t\t\t\t\tif params[:image][:image].original_filename\r\n\t\t\t\t\t\tif !params[:image][:image].original_filename.empty?\r\n\t\t\t\t\t\t\t@product.image ||= Image.new\r\n\t\t\t\t\t\t\t@product.image.image = params[:image][:image]\r\n\t\t\t\t\t\t\t@product.image.save\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\tend\r\n\r\n\t\t\tif params[:product][:product_type_id].to_i != @product[:product_type_id]\r\n\t\t\t\t@product.quirk_values.each do |old_quirk_value|\r\n\t\t\t\t\tQuirkValue.delete(old_quirk_value[:id])\r\n\t\t\t\tend\r\n\t\t\tend\r\n\r\n\t\t\tif @product.update_attributes(params[:product])\r\n\t\t\t\tif params[:product][:product_type_id] && params[:product][:product_type_id].to_i > 0\r\n\t\t\t\t\tthe_product_type = ProductType.find(params[:product][:product_type_id])\r\n\r\n\t\t\t\t\tif the_product_type\r\n\t\t\t\t\t\tthe_product_type.quirks.each do |cur_quirk|\r\n\t\t\t\t\t\t\tedit = false\r\n\t\t\t\t\t\t\t@product.quirk_values.each do |cur_quirk_value|\r\n\t\t\t\t\t\t\t\tif cur_quirk_value[:quirk_id] == cur_quirk[:id]\r\n\t\t\t\t\t\t\t\t\tedit = true\r\n\t\t\t\t\t\t\t\t\tcur_quirk_value[:value] = params[:quirk][cur_quirk[:id].to_s]\r\n\t\t\t\t\t\t\t\t\tcur_quirk_value.save\r\n\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tend\r\n\r\n\t\t\t\t\t\t\tunless edit\r\n\t\t\t\t\t\t\t\tquirk_value = QuirkValue.new({ :product_id => @product[:id], :quirk_id => cur_quirk[:id], :value => params[:quirk][cur_quirk[:id].to_s] })\r\n\t\t\t\t\t\t\t\tquirk_value.save\r\n\t\t\t\t\t\t\tend\r\n\r\n\t\t\t\t\t\t\tif cur_quirk[:required] && (!params[:quirk][cur_quirk[:id].to_s] || params[:quirk][cur_quirk[:id].to_s].empty?)\r\n\t\t\t\t\t\t\t\t@product.errors.add \"product_type_id\", \" #{the_product_type[:name]} is missing the #{cur_quirk[:name]} attribute\"\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif (@product.errors.empty?)\r\n\t\t\t\t\tredirect_to :action => :products and return true\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\telse\r\n\t\t\t@product = Product.find(params[:id], :include => [ :categories, :quirk_values ])\r\n\t\t\t@image = @product.image || Image.new\r\n\t\tend\r\n\r\n\t\tall_product_types = ProductType.find(:all)\r\n\r\n\t\t@product_types = Array.new\r\n\t\t@quirks = Hash.new\r\n\r\n\t\t@product_types << [0, \"(none)\"]\r\n\t\tall_product_types.each do |cur_product_type|\r\n\t\t\t@product_types << [cur_product_type.id, cur_product_type.to_s]\r\n\r\n\t\t\tif !@quirks.has_key?(cur_product_type[:id])\r\n\t\t\t\t@quirks[cur_product_type[:id]] = Hash.new\r\n\t\t\tend\r\n\r\n\t\t\tcur_product_type.quirks.each do |cur_quirk|\r\n\t\t\t\tif !@quirks[cur_product_type[:id]].has_key?(cur_quirk[:id])\r\n\t\t\t\t\t@quirks[cur_product_type[:id]][cur_quirk[:id]] = Hash.new\r\n\t\t\t\tend\r\n\r\n\t\t\t\t@quirks[cur_product_type[:id]][cur_quirk[:id]][\"name\"] = cur_quirk[:name]\r\n\t\t\t\t@quirks[cur_product_type[:id]][cur_quirk[:id]][\"type\"] = cur_quirk[:type]\r\n\t\t\t\t@quirks[cur_product_type[:id]][cur_quirk[:id]][\"required\"] = cur_quirk[:required]\r\n\r\n\t\t\t\t@product.quirk_values.each do |cur_quirk_value|\r\n\t\t\t\t\tif cur_quirk_value[:quirk_id] == cur_quirk[:id]\r\n\t\t\t\t\t\t@quirks[cur_product_type[:id]][cur_quirk[:id]][\"value\"] = cur_quirk_value[:value]\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\t# create the 'option_values' array, which is an array (indexed by Option id) of\r\n\t\t# OptionValue's that this Product uses. The Product will incur a single DB hit (better\r\n\t\t# than before) for its possible OptionValue's, as well as the DB hit to get the Product\r\n\t\tproduct_option_values = @product.product_option_values\r\n\r\n\t\t@option_values = Array.new\r\n\t\tproduct_option_values.each do |cur_product_option_value|\r\n\t\t\tbegin\r\n\t\t\t\tcur_option_value = OptionValue.find(cur_product_option_value[:option_value_id])\r\n\t\t\trescue ActiveRecord::RecordNotFound\r\n\t\t\t\tlogger.error(\"Invalid OptionValue for product \\##{@product.id} - was given \\##{cur_product_option_value[:option_value_id]}\")\r\n\t\t\telse\r\n\t\t\t\tif !@option_values[cur_option_value[:option_id]]\r\n\t\t\t\t\t@option_values[cur_option_value[:option_id]] = Array.new\r\n\t\t\t\tend\r\n\t\t\t\t@option_values[cur_option_value[:option_id]][cur_option_value.id] = cur_option_value\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\t@used_options = Array.new\r\n\t\t@free_options = Array.new\r\n\t\tOption.find(:all).each do |cur_option|\r\n\t\t\tfound = false\r\n\t\t\tproduct_option_values.each do |cur_product_option_value|\r\n\t\t\t\tcur_option_value = OptionValue.find(cur_product_option_value[:option_value_id])\r\n\t\t\t\tif cur_option_value[:option_id] == cur_option.id\r\n\t\t\t\t\tfound = true\r\n\t\t\t\t\tif !@used_options.include?(cur_option)\r\n\t\t\t\t\t\t@used_options << cur_option\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\t\tunless found\r\n\t\t\t\t@free_options << cur_option\r\n\t\t\tend\r\n\t\tend\r\n\tend", "def add_product(product_name, product_price)\n new_product = { product_name => product_price }\n can_successfully_add = false\n @products.has_key?(product_name) ? can_successfully_add = false : can_successfully_add = true\n @products.merge!(new_product) { |key, old_value, new_value| old_value }\n return can_successfully_add\n end", "def create\n puts params\n old_product = Product.find_by_name_and_is_deleted(params[:product][:name],true)\n unless old_product.nil?\n old_product.update_attributes(:version=>params[:product][:version],:release_date=>params[:product][:release_date],:is_deleted=>false)\n respond_to do |format|\n format.html { redirect_to products_url }\n end \n else\n @product = Product.new(params[:product])\n @product.is_deleted = false\n \n respond_to do |format|\n if @product.save\n format.html { redirect_to products_url }\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\n end", "def add_product_to_cart(product_id)\n product = look_up_product(reference_number)\n if product != nil\n @shopping_cart << product\n puts \"Yay! Your #{product[:name]} has been added to your cart.\"\n else\n puts \"We don't have that\"\n end\nend", "def add_product\n product = Product.find(params[:product][:id])\n unless @invoice_service.add_product(product)\n redirect_to products_path\n return\n end\n\n redirect_to_origin(params[:origin][:code], product)\n end", "def product\n FarMar::Product.find(self.product_id)\n end", "def product\n sale_product = Product.new(:id, :name, :vendor_id)\n Product.all.each do |pro_id, pro|\n if pro_id == product_id\n sale_product = pro\n break\n end\n end\n return sale_product\n end", "def update\n respond_to do |format|\n if @product_specification.update(product_specification_params)\n format.html {\n if params[:return_to]\n return_to = URI.parse(params[:return_to]).path\n redirect_to(return_to, notice: \"Specification was successfully updated.\")\n else\n redirect_to(admin_product_product_specifications_path(@product_specification.product), notice: 'Product specification was successfully updated.')\n end\n }\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated #{@product_specification.specification.name} for #{@product_specification.product.name}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @product_specification.errors, status: :unprocessable_entity }\n end\n end\n end", "def prod?\n is_prod\n end", "def check_product_type\n\t\t\tif self.product_category_id == 1\n\t\t\t\tInventory.create!(product_id: self.id, xsmall: 0, small: 0, medium: 0, large: 0, xlarge: 0, xxlarge: 0)\n\t\t\tend\n\t\tend" ]
[ "0.6345241", "0.62344027", "0.6205176", "0.6150152", "0.6091521", "0.6077948", "0.6050113", "0.5984292", "0.5981422", "0.59573865", "0.59494066", "0.5923946", "0.59215933", "0.5913597", "0.5913597", "0.5908349", "0.58826417", "0.5873261", "0.5870277", "0.5859097", "0.582599", "0.5823541", "0.58209187", "0.57963747", "0.5794999", "0.5791671", "0.5780419", "0.57654303", "0.57456917", "0.5721477", "0.56898683", "0.56702", "0.56632286", "0.5662978", "0.5661284", "0.5652782", "0.5639079", "0.5635843", "0.56351393", "0.56307477", "0.56271744", "0.5612273", "0.55776423", "0.55731845", "0.5548704", "0.5545249", "0.553762", "0.55308133", "0.5518203", "0.5516906", "0.55098003", "0.5493905", "0.5493809", "0.5478738", "0.546036", "0.5445428", "0.54390526", "0.54199106", "0.5416722", "0.5400171", "0.5388963", "0.5387337", "0.53732157", "0.5362913", "0.5361065", "0.53600496", "0.5348839", "0.5344808", "0.533992", "0.53376216", "0.5334817", "0.53256494", "0.53213906", "0.5312115", "0.5307999", "0.5307234", "0.52999014", "0.52882355", "0.52879065", "0.52861077", "0.52823335", "0.52819365", "0.52815723", "0.52769864", "0.5262079", "0.5262", "0.5257681", "0.525576", "0.52536076", "0.5252958", "0.5252382", "0.52521884", "0.5243342", "0.52333224", "0.5231444", "0.5225362", "0.5214152", "0.5210397", "0.5209337", "0.5209171" ]
0.8138255
0
returns the difference between the sum of the squares of numbers 1 to n, and the square of the sum of numbers from 1 to n
def difference_between_sum_sq_and_sq_sum(n) square_sum(n) - sum_squares(n) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_square_difference(n)\n integers = (1..n).to_a\n\n square_of_sum = integers.sum ** 2\n sum_of_squares = integers.map { |n| n ** 2 }.sum\n\n square_of_sum - sum_of_squares\nend", "def sum_square_difference(n)\n # square_of_sum = (1..n).reduce(:+) ** 2\n # sum_of_squares = (1..n).reduce { |sum, num| sum + num * num }\n # square_of_sum - sum_of_squares\n # (1..n).reduce(:+)**2 - (1..n).reduce { |sum, num| sum + num * num }\n\n (1..n).sum**2 - (1..n).sum { |num| num**2 }\nend", "def sum_square_difference(n)\n square_of_sum = ((1..n).sum) ** 2\n sum_of_square = (1..n).map{|i| i * i}.sum\n p difference = square_of_sum - sum_of_square\nend", "def sum_square_difference(n)\n n_integers = (1..n).to_a\n square_of_sum = n_integers.inject(:+)**2\n sum_of_squares = n_integers.map {|n|n**2}.inject(:+)\n square_of_sum - sum_of_squares\nend", "def sum_square_diff(n)\r\n sq_of_sum = (1..n).to_a.sum ** 2\r\n sum_of_sq = (1..n).to_a.map{ |num| num *= num }.sum\r\n (sq_of_sum - sum_of_sq).abs\r\nend", "def sum_square_difference(n)\n ((1..n).reduce(:+)**2) - (1..n).reduce{ |sum, i| sum + i**2 }\nend", "def sum_square_difference(n)\n square_of_sums = (1..n).inject(:+) ** 2\n sum_of_squares = (1..n).inject {|sum, num| sum + (num ** 2)}\n square_of_sums - sum_of_squares\nend", "def sum_square_difference(n)\n \n sum = 0 \n for i in 0..n\n sum += i\n end\n \n sq_sum = 0\n for i in 0..n\n sq_sum += (i**2)\n end \n \n (sum*sum) - sq_sum\nend", "def sum_square_difference(n)\r\n square_total = 0\r\n sum_square = 0\r\n 1.upto(n) {|x| square_total += x}\r\n 1.upto(n) {|x| sum_square += (x**2)}\r\n square_sum = square_total**2\r\n square_sum - sum_square\r\nend", "def sum_square_difference(n)\n sum = 0\n sums_squared = 0\n 1.upto(n) do |num|\n sum += num\n sums_squared += num**2\n end\n sum**2 - sums_squared\nend", "def sum_sq_diff(n)\n nums_in_range = (1..n)\n # square_sums = nums_in_range.sum ** 2\n square_sums = nums_in_range.sum.pow(2)\n sums_square = nums_in_range.map { |n| n ** 2 }.sum\n square_sums - sums_square\nend", "def squares_diff(n)\n (1..n).inject(:+)**2 - (1..n).map{|i| i*i}.inject(:+)\nend", "def sum_square_difference(num)\n 1.upto(num).sum**2 - 1.upto(num).reduce(0) { |total, n| total + n**2 }\nend", "def sum_square_difference(num)\n square_of_sum = 1.upto(num).to_a.reduce(:+) ** 2\n sum_of_squares = 1.upto(num).to_a.map{ |n| n ** 2 }.reduce(:+)\n square_of_sum - sum_of_squares\nend", "def sum_square_difference(num)\n square_of_sum = ((1..num).sum)**2\n sum_of_squares = (1..num).map { |n| n**2}.sum\n square_of_sum - sum_of_squares\nend", "def sum_square_difference(num)\n (1..num).sum ** 2 - (1..num).map {|num| num ** 2 }.sum\nend", "def sum_square_diff(num)\n sum_of_squares = 0\n square_of_sum = 0\n\n (1..num).each do |i|\n squared = i**2\n sum_of_squares += squared\n square_of_sum += i\n end\n\n square_of_sum **= 2\n\n difference = square_of_sum - sum_of_squares\n\n puts difference\nend", "def sum_square_difference(num)\n\n sum_squared = (1..num).to_a.sum ** 2\n\n squares = []\n\n (1..num).each { |n| squares << n ** 2 }\n\n squared_sum = squares.sum\n\n sum_squared - squared_sum\nend", "def diff_squares(num)\r\n sum_of_nums = (1..num).inject { |sum, x| sum + x }\r\n sum_of_sq = (1..num).inject { |sum, x| sum + x**2 }\r\n sum_of_nums**2 - sum_of_sq\r\nend", "def sum_square_difference(number)\n squared_sum = 1.upto(number).inject(:+)**2\n sum_squares = 0\n 1.upto(number).each {|num| sum_squares += num**2}\n squared_sum - sum_squares\nend", "def sum_square_difference(num)\n square_of_the_sum = 0\n sum_of_the_squares = 0\n \n 1.upto(num) do |num|\n square_of_the_sum += num\n sum_of_the_squares += (num ** 2)\n end\n\n total = (square_of_the_sum ** 2) - sum_of_the_squares\n total\nend", "def sum_square_difference(num)\n (1..num).inject(:+)**2 - (1..num).map{|x| x**2}.inject(:+)\nend", "def sum_square_difference(num)\n square_of_sum = (0..num).inject(:+) ** 2\n sum_of_square = (0..num).map { |num| num ** 2}.inject(:+)\n square_of_sum - sum_of_square\nend", "def sum_square_difference(num)\n square_of_sum = 0\n sum_of_squares = 0\n\n 1.upto(num) do |i| \n square_of_sum += i\n sum_of_squares += i**2\n end\n\n square_of_sum**2 - sum_of_squares\nend", "def sum_of_squares(n)\n sum = 0\n (1..n).each {|i| sum = sum + (i*i)}\n sum\n end", "def sum_square_difference(num)\n sum = 0\n square_sum = 0\n\n 1.upto(num) do |n|\n sum += n\n square_sum += n**2\n end\n\n sum**2 - square_sum\nend", "def sum_of_squares n\n (n**3)/3 + (n**2)/2 + n/6 \nend", "def square_of_sums\n return (@n * (@n + 1) / 2)**2\n end", "def sum_square_difference(num)\n sum = sum(num)\n square = square(num)\n p sum - square\nend", "def findDiffSquares(n)\n sum = 0\n (1..n).each { |i|\n (1..n).each { |j|\n sum += i*j unless i == j\n }\n }\n sum\nend", "def sum_square_difference(int)\n first_n_ints = (1..int).to_a\n\n sum_1 = first_n_ints.sum\n\n sum_2 = first_n_ints.map{|int| int**2}.sum\n\n (sum_1**2) - sum_2\nend", "def sum_of_squares\n return @n * (@n + 1) * (2 * @n + 1) / 6\n end", "def sum_square_difference(num)\n arr = (1..num).to_a\n square_of_arr_summed = (arr.sum) ** 2\n square_of_each_num = arr.reduce(0) { |sum, n| sum + n**2 }\n\n # Alternatively\n # square_of_each_num = 0\n # arr.each { |element| square_of_each_num += element **2 }\n\n return square_of_arr_summed - square_of_each_num\nend", "def sum_square_difference(num)\n total_square = 0\n num_square = 0\n\n 1.upto(num) do |number|\n total_square += number\n end\n\n 1.upto(num) do |fig|\n num_square += fig**2\n end\n\n product_total = total_square ** 2\n square_difference = product_total - num_square\n square_difference\nend", "def sum_square_difference(num)\r\n arr = (1..num).to_a\r\n sum1 = arr.sum ** 2\r\n sum2 = arr.inject { |sum, number| sum + number**2 }\r\n sum1 - sum2\r\nend", "def square_of_sum(n)\n sum = 0\n (1..n).each {|i| sum = sum + i}\n sum * sum\n end", "def difference\n # square of sums will always be bigger\n square_of_sum - sum_of_squares\n end", "def difference\n square_of_sums - sum_of_squares\n end", "def difference\n square_of_sums - sum_of_squares\n end", "def solution(num)\n sum_of_squares = 0\n\n (1..num).each do |number|\n sum_of_squares += number**2\n end\n\n square_of_sums = (1..num).inject(:+) ** 2\n\n p (square_of_sums - sum_of_squares).abs\nend", "def sum_square_difference(a_num)\r\n first_block = (1..a_num).to_a.reduce(&:+)\r\n first_block **=2\r\n\r\n second_block = (1..a_num).to_a.map { |number| number ** 2 }\r\n second_block = second_block.reduce(&:+)\r\n\r\n first_block - second_block\r\nend", "def sums num\n\tsum_of_squares = 0\n\tsum = 0\n\t1.upto num do |n|\n\t\tsum_of_squares += n*n\n\t\tsum += n\n\tend\n\tsum**2 - sum_of_squares \nend", "def sum_of_squares(n)\n sum = 0\n for i in 1..n\n sum+= i*i\n end \n sum\nend", "def difference\n return square_of_sums - sum_of_squares\n end", "def solve( n = 100 )\n # Sum of squares is given by n(n + 1)(2n + 1) / 6, while square of sums\n # is [n(n + 1)][n(n + 1)] / 4. Subtracting and simplifying the result\n # gives n(n + 1)(n - 1)(3n + 2) / 12.\n n * (n + 1) * (n - 1) * (3*n + 2) / 12\n end", "def difference\n square_of_sum - sum_of_squares\n end", "def sum_squares(n)\nsums = [] \n for i in (1..n)\n i_squared = i**2\n sums.push i_squared \n end\n p sums.reduce(:+)\nend", "def sum_square_difference(integer)\n (1..integer).reduce(:+)**2 - 1.upto(integer).map { |i| i**2 }.reduce(:+)\nend", "def sum_square_difference(int)\n # square_of_sums = (0..int).inject(:+) ** 2\n # sum_of_squares = (0..int).inject(0) { |memo, value| memo + value ** 2 }\n # return square_of_sums - sum_of_squares\n\n (0..int).inject(:+) ** 2 - (0..int).inject(0) { |sum, n| sum + n ** 2 }\nend", "def square_of_sum\n\t\t@n**2*(@n+1)**2/4\n\tend", "def sum_square_difference(integer)\n array = []\n 1.upto(integer) { |num| array << num }\n sum_squared = array.reduce(:+)**2\n\n array = []\n 1.upto(integer) { |num| array << num**2 }\n squared_sums = array.reduce(:+)\n\n sum_squared - squared_sums\nend", "def sum_of_the_squares\n sum = 0\n (1..self).each do |n|\n sum += n**2\n end\n sum\n end", "def sum_of_squares(n)\n (1..n).inject(0) do |total, i|\n total += i**2\n end\nend", "def sum_up_to_squared n=100\r\n (2 * n + 1) * (n + 1) * n / 6\r\nend", "def p6\n\trange = (1..100).to_a\n\tsquare_of_sum = range.reduce(:+) ** 2\n\tsum_of_square = (range.map{|x| x ** 2}).reduce(:+)\n\tsquare_of_sum - sum_of_square\nend", "def square_sum_up_to n=100\r\n (n * (n + 1) / 2)**2\r\nend", "def num_squares1(n)\n helper = [0, 1]\n (2..n).each do |i|\n helper << (1..Math.sqrt(i).to_i).map do |j|\n helper[i - j ** 2] + 1\n end.min\n end\n helper[n]\nend", "def sum_of_squares\n @number_range.sum {|n| n**2}\n end", "def num_squares2(n)\n helper = [0, 1]\n (2..n).each do |i| \n helper[i] = i\n (1..Math.sqrt(i).to_i).each do |j|\n helper[i] = [helper[i - j ** 2] + 1, helper[i]].min\n end \n end \n helper[n]\nend", "def square_sums(n)\n Array(1..n).sum**2\nend", "def sum_squares(n)\n (1..n).inject { |sum, i| sum += i**2 }\nend", "def squareOfSum n\n return triangularNumber(n)**2\nend", "def square_of_sums\n sum=((@num**2+@num)/2)**2\n end", "def sum_square_difference(integer)\n sum = 0\n square_sum = 0\n 1.upto(integer) { |i| sum += i }\n 1.upto(integer) { |i| square_sum += i**2 }\n sum**2 - square_sum\nend", "def sum_of_squares\n self.inject(0) { |sos, n| sos + n**2 }\n end", "def square_of_n_integers n\n ((n/2) * (n+1))**2\nend", "def sum_of_squares\n\t\t\tinject(0) do |sum, elem|\n\t\t\t\tsum + (elem ** 2)\n\t\t\tend\n\t\tend", "def sum_of_the_squares max_number\n sum = 0\n (1..max_number).each { |i| sum += (i ** 2) }\n sum\nend", "def six\n square_of_sum(100) - sum_of_squares(100)\nend", "def sum_of_squares\n @range.sum { |n| n**2 }\n end", "def sum_of_squares(number)\n \n result = 0\n i = 1\n while i <= number\n result += (i ** 2) \n i += 1\n end\n\n result\nend", "def sum_square_difference(i)\n x = 0 \n sum = 0\n square_sum = 0\n loop do\n x += 1\n sum += x\n square_sum += x**2\n break if x == i \n end\n sum**2-square_sum\nend", "def sum_of_squares(numbers)\n numbers.map { |x| x * x }.reduce(0) { |acc, x| acc + x }\nend", "def squareSum(numbers)\n numbers.map { |n| n*n}.reduce(:+)\nend", "def sum_of_squares\n squares = differences_from_mean.map { |diff| diff ** 2 }\n squares.reduce(:+)\n end", "def squareSum(numbers)\n numbers.map { |n| n*n }.reduce(:+)\nend", "def num_squares3(n)\n n /= 4 while n % 4 == 0\n return 4 if n % 8 == 7\n (0..Math.sqrt(n).to_i).each do |a|\n b = Math.sqrt(n - a ** 2).to_i\n if a * a + b * b == n\n if a > 0 && b > 0\n return 2\n elsif a == 0 && b == 0\n return 0\n else\n return 1\n end\n end\n end\n return 3\nend", "def sum_of_squares\n range.reduce { |a, e| a + e**2 }\n end", "def sumSquareDifference( maxValue )\n sumSquares = 0\n sum = 0\n\n Range.new( 1, maxValue ).each do | value |\n sum += value\n sumSquares += value * value\n end\n\n squaresSum = sum * sum\n\n puts squaresSum - sumSquares\nend", "def sum_of_squares(max)\n sum = 0\n (1..max).each do|current|\n sum = sum + current**2\n end\n return sum\nend", "def sum_square_difference(max_num: 100)\n diff = 0\n num_set = (1..max_num).to_a.reverse\n set_sum = num_set.inject(:+)\n until num_set.length == 1\n foo = num_set.pop\n set_sum -= foo\n diff += 2 * foo * set_sum\n end\n puts diff\nend", "def square_sum(numbers)\n squares = numbers.map{|number| number * number}\n squares.reduce(0){|num, sum| num + sum}\nend", "def sumOfSquares(max)\n out = 0\n max.times do |i|\n out += (i+1)**2\n end\n out\nend", "def sum_of_squares\n end", "def sum_sq(n)\n cnt = 1\n sum = 0\n while cnt <= n\n sum += cnt * cnt\n cnt += 1\n end \n puts sum\nend", "def sum_of_squares\n sum(square(sequence))\n end", "def squareSum(numbers)\n numbers.map { |i| i ** 2 }.reduce(:+)\nend", "def euler006\n square_of_sum = (1..100).reduce(:+) ** 2\n sum_of_squares = (1..100).inject { |sum, n| sum + n*n }\n\n return square_of_sum - sum_of_squares\nend", "def sum_of_squares(x)\n sum_of_squares = 0\n (1..x).each do |f|\n sum_of_squares += f**2\n end\n return sum_of_squares\nend", "def squareSum(numbers)\n numbers.reduce(0){|sum, x| sum + (x ** 2)}\nend", "def squareSum(numbers)\n numbers.inject(0) { |sum, n| sum + n*n }\nend", "def square_of_sum\n\tsquare_of = 0\n\n\t(1..100).each do |x|\n\t\tsquare_of += x\n\tend\n\tsquare_of = square_of**2\n\tsquare_of\nend", "def square_of_sum\n @number_range.sum**2\n end", "def arith_sum_squares(max)\n max * (max+1) * (2*max+1) / 6\nend", "def square_sum\n self.inject(0.0){|accum, i| accum +i**2 }\n end", "def squares(a, b)\n diff = (Math.sqrt(b).ceil - Math.sqrt(a).ceil)\n diff = diff + 1 if Math.sqrt(b) % 1 == 0\n # diff = diff + 1 if Math.sqrt(a) % 1 == 0\n return diff\nend", "def square_of_sums\n square(sum(sequence))\n end", "def square_of_sums\n range.reduce(:+)**2\n end", "def subtract_product_and_sum(n)\r\n n=n.to_s.chars.map(&:to_i)\r\n if n[0] == 0\r\n n[1] = n[1]*-1 \r\n n = n[1..-1]\r\n end\r\n n.reduce(:*) - n.sum\r\nend", "def sum_of_squares(numbers)\n result = []\n sum = []\n numbers.map do |number|\n result = number*number\n sum.push result\nend\nsum.sum\nend" ]
[ "0.8952461", "0.8950762", "0.8922446", "0.89194417", "0.8889993", "0.8879714", "0.8869145", "0.88132656", "0.8807752", "0.87976676", "0.87274456", "0.8543132", "0.85014004", "0.8384352", "0.83467937", "0.83293927", "0.8321711", "0.8320477", "0.827168", "0.8260442", "0.8241736", "0.81910414", "0.8153575", "0.815269", "0.81102514", "0.8076968", "0.8062426", "0.8060324", "0.8023822", "0.8004526", "0.7982822", "0.79768634", "0.7946481", "0.78512347", "0.7839485", "0.7821827", "0.7795211", "0.7793759", "0.7793759", "0.77797526", "0.77703077", "0.7745234", "0.772071", "0.76987755", "0.76861537", "0.768507", "0.76255167", "0.76186883", "0.7612392", "0.7603291", "0.75735235", "0.7547336", "0.7528862", "0.74877554", "0.73834777", "0.73834115", "0.73617005", "0.7354385", "0.734801", "0.73237044", "0.7319295", "0.73114383", "0.7309184", "0.7306818", "0.7297562", "0.7273606", "0.7272367", "0.7234483", "0.72280276", "0.7169325", "0.7074354", "0.7073048", "0.70668113", "0.706551", "0.7058283", "0.7049854", "0.7018178", "0.6986328", "0.69723946", "0.6957246", "0.69457954", "0.69433206", "0.69430315", "0.69370943", "0.69315165", "0.6898817", "0.68950355", "0.68799525", "0.6861181", "0.6860569", "0.68538", "0.68526417", "0.6825577", "0.6797495", "0.67856824", "0.67686844", "0.6767953", "0.67668736", "0.6701739", "0.6695149" ]
0.85207313
12
def logo image_tag("logo.png", :height => 75, :alt => "The Hastings Co.") end
def logo content_tag(:span, "HASTINGS FINE HOMES", class: "logo") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logo\n image_tag(\"boulder.png\", :width => \"100\", \n :height => \"75\",\n :alt => \"Learning RoR\", \n :class => \"round\")\n end", "def logo\n image_tag('rubyLogo.png', alt: 'Ruby on Rails Sample App', class: 'round', height: \"50px\")\n end", "def logo\r\n \tlogo = image_tag(\"logo.png\", :alt => \"mens fashion today\", :class => \"round\")\r\n end", "def logo\n image_tag(\"logo.png\", :alt => \"Sample App\", :class => \"round\")\n end", "def logo\n image_tag(\"logo.png\", :alt => \"Sample App\", :class => \"round\")\n end", "def logo_tag\n image_tag \"rails.png\", :alt => @page_title\n end", "def logo\n logo=image_tag(\"rails.png\" , :alt=>\"Sample app\" ,:class=>\"round\")\n end", "def logo\n logo = image_tag(\"background.png\", :alt => \"background\")\n end", "def logo\n\t\timage_tag(\"logo.png\", :alt => \"jobradar\", :class => \"round\")\n\tend", "def logo; end", "def logo; end", "def logo\n \"This is a cool logo !\"\n end", "def logo_url\n logo? ? h.image_tag(logo.thumb_medium, alt: 'Logo', width: 90) :\n h.content_tag(:span, initial, class: 'brand_img_holder', style: 'width:43px; height:43px;')\n end", "def logo\n\t\ts = image_tag('rails.png', :alt => \"Online Orders Application\")\n\t\treturn s\n\tend", "def home\n image_tag(\"home.png\", :alt => \"Home\")\n end", "def logo(path, params)\n l = image_tag(path, params) \n link_to l, path\n end", "def header_img\n image_tag('header-img-2.jpg', border: 0)\n end", "def logo=(_arg0); end", "def header\n image \"#{Rails.root}/app/assets/images/giftgardensmall.jpg\", \n width: 40, height: 40\n move_up 30\n text \"Activities Report\", size: 24, style: :bold, :align => :center\n end", "def icon\n image_tag( \"tags/#{ @name }.png\" , :height => 8 )\n end", "def tier_logo_tag(tier, options={}, html_options={})\n html_options = {:size => \"300x66\", :title => h(tier.name), :alt => h(tier.name)}.merge(html_options).symbolize_keys\n if path = tier_logo_path(tier, options)\n image_tag(path, html_options)\n end\n end", "def logo_url style = :original\n logo.url(style, timestamp: false)\n end", "def logo_link\n link_to(logo_img, view_context.root_path)\n end", "def image url, alt=url\n \"![#{alt}](#{url})\"\n end", "def user_logo(user)\n image_tag(user.avatar_url)\n end", "def image_tag(image)\n raw \"<img src=\\\"/images/\" + image + \"\\\"/>\"\n end", "def logo\n get_attribute(Yoti::Attribute::APPLICATION_LOGO)\n end", "def logo\n rand_num = Random.rand(76) + 1\n \"http://www.biz-logo.com/examples/#{ rand_num < 10 ? \"00\" : \"0\" }#{rand_num}.gif\"\n end", "def display_course_logo(course)\n content_tag(:span, class: ['image']) do\n image_tag(course.logo.medium.url || 'course_default_logo.svg')\n end\n end", "def goth_image_full_tag(goth)\n\t\timage = image_path \"goths/#{goth.name}.jpg\"\n\t\turl = \"#{root_url.chomp('/')}#{image}\"\n\t\timage_tag url, :alt => goth.name, :title => goth.name\n\tend", "def make_img_tag(x)\n\n\"<img src='\" + x +\"'/>\"\n\nend", "def header\n\t\tlogo_path = Rails.root.join('app','assets','images','longbourn_logo.png')\n\t\timage logo_path, :width => 70, :height => 45\n\t\tdraw_text \"Informe de Desempeño de Alumnos\", :at => [100,25], size:12\n\t\tdraw_text \"Longbourn Institute\", :at => [100,10], size:12\n\tend", "def logo\n return @logo\n end", "def image\n 'gh.png'\n end", "def interchange_logo\n q = []\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (default)]\"\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (large)]\"\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (medium)]\"\n q << \"[#{image_path(\"#{website.folder}/logo-sm.png\")}, (only screen and (max-width: 720px))]\"\n\n image_tag('', #\"#{website.folder}/logo.png\",\n class: \"no-resize no-resize-for-small\",\n alt: Setting.site_name(website),\n data: { interchange: q.join(\", \") })\n end", "def interchange_logo\n q = []\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (default)]\"\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (large)]\"\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (medium)]\"\n q << \"[#{image_path(\"#{website.folder}/logo-sm.png\")}, (only screen and (max-width: 720px))]\"\n\n image_tag('', #\"#{website.folder}/logo.png\",\n class: \"no-resize no-resize-for-small\",\n alt: Setting.site_name(website),\n data: { interchange: q.join(\", \") })\n end", "def application_logo(classes)\n if cookies[:layout] == 'application' || cookies[:layout].nil?\n image_tag(asset_pack_path('media/images/duszek-awesome.svg'), class:\"#{classes}\")\n else\n image_tag(asset_pack_path('media/images/duszki.png'), class:\"#{classes}\")\n end\n end", "def image(opts)\n \"#{opts[:alt] || opts[:title]}\"\n end", "def create_logo(text)\n tag = 'h1' if item.identifier == '/'\n tag ||= 'div'\n\n \"<\" + tag + \" id=\\\"logo\\\"><a href=\\\"/\\\">\" + text + \"</a></\" + tag + \">\"\n end", "def photo(image, alt_text = '')\n image_tag('image/todd_ramirez_' + image,\n alt: alt_text,\n title: alt_text)\n end", "def gravatar(email,gravatar_options={})\n\n # Set the img alt text.\n alt_text = 'Gravatar'\n\n # Sets the image sixe based on the gravatar_options.\n img_size = gravatar_options.include?(:size) ? gravatar_options[:size] : '80'\n\n \"<img src=\\\"#{gravatar_url(email, gravatar_options)}\\\" alt=\\\"#{alt_text}\\\" height=\\\"#{img_size}\\\" width=\\\"#{img_size}\\\" />\" \n\nend", "def casein_config_logo\n \t'/images/logo_ss.jpg'\n end", "def footer_gi_logo_link\n $tracer.trace(__method__)\n return ToolTag.new(nav.className(\"logo\"), __method__)\n end", "def as_img_tag()\n \"<img src='#{self.encode}' />\"\n end", "def ver_foto\n %Q(<img src=\"#{foto}\" alt=\"#{nombre}\" />)\n end", "def facebook_image_tag(name,options={})\n tag \"img\",:src=>\"http://#{ENV['FACEBOOKER_STATIC_HOST']}#{image_path(name)}\"\n end", "def get_logo\n Oneclick::Application.config.ui_logo\n end", "def medium_image_tag\n image_tag medium_image_path, alt: @picture.alt_text, class: 'medium-image', title: @picture.title\n end", "def pet_image_tag\n return '' if pet.image_id.to_s.empty?\n\n html.div class: 'pet' do\n h2 'Actual image'\n img src: \"#{UrlAws}#{pet.image_id}\"\n end\n end", "def sp_logo\n sp.logo || DEFAULT_LOGO\n end", "def image(options = {}, html_options = {})\n html_options[:src] = if options.is_a?(String) then options else self.url_for(options) end\n html_options[:alt] ||= File.basename(html_options[:src], '.*').split('.').first.capitalize\n\n if html_options[:size]\n html_options[:width], html_options[:height] = html_options[:size].split(\"x\")\n html_options.delete :size\n end\n\n tag(\"img\", html_options)\n end", "def logo=(value)\n @logo = value\n end", "def image_tag(source, options = {})\n options.symbolize_keys!\n\n options[:src] = path_to_image(source)\n options[:alt] ||= File.basename(options[:src], '.*').split('.').first.to_s.capitalize\n\n if size = options.delete(:size)\n options[:width], options[:height] = size.split(\"x\") if size =~ %r{^\\d+x\\d+$}\n end\n\n if mouseover = options.delete(:mouseover)\n options[:onmouseover] = \"this.src='#{image_path(mouseover)}'\"\n options[:onmouseout] = \"this.src='#{image_path(options[:src])}'\"\n end\n\n tag(\"img\", options)\n end", "def logo_path\n root_path\n end", "def logo_path\n root_path\n end", "def logo_path\n root_path\n end", "def getImg(width=64, height=64)\n if self.image\n self.image+\"?width=#{width}&height=#{height}\"\n else\n \"no_image.png\"\n end\n end", "def logo_link\n root_path\n end", "def user_image_tag(email, size = 1)\n if APP_CONFIG.enabled?(\"gravatar\")\n gravatar_image_tag(email)\n else\n render html: \"<i class=\\\"fa fa-user fa-#{size}x\\\"></i>\".html_safe\n end\n end", "def image; end", "def image_for(movie)\n if movie.image.exists?\n image_tag(movie.image.url,size: \"90x124\")\n else\n image_tag('placeholder.png')\n end\n end", "def profile_picture\n\t\timage_tag(\"ruby.svg.png\", alt: \"Profile Picture\")\n\tend", "def make_emoticon image, alt\n '<img src=\"' << escape_html(\"/emoticons/#{image}.png\") << '\" alt=\"' << escape_html(alt) << '\" title=\"' << escape_html(alt) << '\"/>'\n end", "def image\n \"icon.png\"\n end", "def spacer(width = 10)\n image_tag \"1x1.gif\", :width => width, :height => 1, :alt => nil\n end", "def image path, attrs = {}\n Tagz.tag :img, { :src => path }.merge(attrs)\n end", "def xf_image_tag (src, attrs = {})\n attrs = attrs.symbolize_keys()\n content = \"\"\n caption = attrs.delete(:caption)\n unless caption.nil?\n content += typeWithAttrs(\"caption\", caption, nil, xhtml2prefix)\n end\n width = attrs.delete(:width)\n unless width.nil?\n content += typeWithAttrs(\"param\", nil, {:name => \"mcs-aspect-ratio-width\", :value => width}, xhtml2prefix)\n end\n height = attrs.delete(:height)\n unless height.nil?\n content += typeWithAttrs(\"param\", nil, {:name => \"mcs-aspect-ratio-height\", :value => height}, xhtml2prefix)\n end\n attrs[:src] = src\n typeWithAttrs(\"object\", content, attrs, xhtml2prefix)\n end", "def g_home_logo(page_title)\n if page_title.empty?\n '<a href=\"#\"><img class=\"brand\" width=\"26\" src=\"/assets/botflip-logo.svg\"></a><a href=\"#\" class=\"brand\">Miniflip</a>'.html_safe\n # link_to \"MiniFeed\", \"#\", class: \"brand\"\n else\n '<a href=\"/\"><img class=\"brand\" width=\"26\" src=\"/assets/botflip-logo.svg\"></a><a href=\"/\" class=\"brand\">Miniflip</a>'.html_safe\n end\n end", "def get_logo_display\n\t\tif !logged_in?\n\t\t\treturn \"City Produce\"\n\t\tend\n\t\tif current_user.admin?\n\t\t\treturn \"Admin\"\n\t\tend\n\t\treturn \"Home\"\n\tend", "def header\n #This inserts an image in the pdf file and sets the size of the image\n #image \"#{Rails.root}/app/assets/images/header.png\", width: 530, height: 150\n end", "def logo_dimensions_string\n \"#{LOGO_WIDTH}x#{LOGO_HEIGHT}\"\n end", "def reg_shirt_image(reg, opts={})\n src = reg.shirt_asset_path()\n image_tag src, opts\n end", "def icon_tag(image, alt, opts={})\n image+= \".png\" unless image.match(/\\.[a-z]+$/)\n image_tag \"icons/#{image}\", { alt: alt, title: alt, size: \"16x16\" }.merge(opts)\n end", "def resize_image\n unless logo.nil?\n if logo.height != 100\n self.logo = logo.thumb('x100') # resize height and maintain aspect ratio\n end\n end\n end", "def site_image_tag(src, options = {})\n image_tag(site_image_path(src), options)\n end", "def icon aFileName, aAlt = nil, aTitle = nil\n aTitle ||= aAlt\n\n %{<img class=\"icon\" src=\"icons/#{aFileName}\" alt=\"#{aAlt}\" title=\"#{aTitle}\" />}\n end", "def professor_image\n image_tag(\"professor.jpg\", :size => \"50x50\", :border => \"0\", :alt => \"These fields can be edited by a faculty role\", :title => \"Faculty role\")\n end", "def image\n end", "def image\n end", "def logo\n rand_num = rand(1..13)\n \"https://pigment.github.io/fake-logos/logos/medium/color/#{rand_num}.png\"\n end", "def image alt_text, href\n \"!\" + link_to(alt_text, href)\n end", "def icon\n img :src => $imgHostURL + \"/\" + $iconImg\n end", "def version_image_tag(asset, version, opts = {})\n placeholder = opts.delete(:placeholder)\n if asset.nil?\n if placeholder\n content_tag(:div, 'No Image', :class => 'image-missing')\n end\n else\n opts[:class] = \"#{opts[:class]} #{asset.orientation}\".strip\n image_tag(version_image_url(asset, version), opts)\n end\n end", "def image\n lambda do |text|\n begin \n hash = parse_text(text)\n image = find_image(hash)\n src = get_image_src(hash, image)\n\n unless image.nil?\n engine = gen_haml('image.haml')\n engine.render(nil, {:src => src, :id => hash['id'], :class_name => hash['class'], :alt => hash['alt'], :title => hash['title'], :itemprop => hash['itemprop'], :height => hash['height'], :width => hash['width']})\n end\n rescue NoMethodError => e\n Rails.logger.error \"#{e} could not find image with the params: #{text}\"\n end\n end\n end", "def style_image_tag(name,args={})\r\n image_tag(\"styles/#{CONFIG[:default_style]}/#{name}\",args)\r\n end", "def image_tag(src, html_options = {})\n src = \"#{Compass.configuration.images_dir}/#{src}\" unless src =~ /^(https?:|\\/)/\n tag(:img, html_options.merge(:src=>src))\n end", "def show_image\n if @wine.picture.attached?\n image_tag(@wine.picture.service_url, alt: \"your_image\", height: \"250\", style: \"border: 1px solid #220F24\")\n end\n end", "def gravatar_tag email\n _hash = Digest::MD5.hexdigest email\n <<-EOHTML\n <a href='http://www.gravatar.com/#{_hash}'>\n <img src='http://www.gravatar.com/avatar/#{_hash}'\n class='avatar'\n title='Gravatar-Profile: #{email}'\n alt='User Avatar'\n />\n </a>\n EOHTML\n end", "def default_image\n end", "def static_image_tag image, options={}\n image_tag url_for(:controller => :images, :action => :show_static, :image => image)\n end", "def beer_logo_path\n self.logo_path.url(:medium)\n end", "def showtube_img_tag(vid, imwidth, imheight, html_options = {})\n image_tag(\"http://img.youtube.com/vi/#{vid}/0.jpg\", :size => \"#{imwidth}x#{imheight}\")\n end", "def og_image_tag(url)\n tag(:meta, :property => 'og:image', :content => url).html_safe if url\n end", "def image\n\n end", "def image\n end", "def image\n end", "def logo_url\n logo? ? logo.url : profile_img\n end", "def page_asset_image_tag(image_file_name)\n %{<img src=\"#{page_assets_link_base}#{image_file_name}\" />}\n end", "def link_to_powered_by_logo\n link_to(content_tag(:div, '', :class => \"poweredByLogo fl ml10\"), home_page_url, {:popup => true})\n end", "def image()\n\t\tActionController::Base.helpers.image_tag(\"holes/Hunter_H%02d\" % self.number + \".jpg\" \\\n\t\t\t, :alt => 'Hole ' % self.number \\\n\t\t\t, :class => 'holeImage'\n\t\t\t)\n\tend" ]
[ "0.9155077", "0.88573754", "0.8772004", "0.8696916", "0.8696916", "0.86860436", "0.86200833", "0.860193", "0.8522485", "0.7858701", "0.7858701", "0.7819328", "0.78030103", "0.7715543", "0.7645759", "0.7577226", "0.72125816", "0.71147", "0.707723", "0.7051588", "0.69802535", "0.6934495", "0.6868591", "0.6864173", "0.68354315", "0.683238", "0.67399746", "0.6689585", "0.6669423", "0.663802", "0.66032845", "0.65824556", "0.6555225", "0.6553131", "0.65494806", "0.65494806", "0.65358853", "0.652718", "0.65257573", "0.64941293", "0.64599276", "0.6459351", "0.6446827", "0.6427595", "0.6420047", "0.6406426", "0.64005876", "0.639117", "0.6378501", "0.63608515", "0.635547", "0.635298", "0.633261", "0.63259876", "0.63259876", "0.63259876", "0.631917", "0.6278584", "0.6257012", "0.6254406", "0.62486595", "0.62307614", "0.6221987", "0.6204515", "0.6191368", "0.61868244", "0.61788356", "0.61775637", "0.61652076", "0.61622137", "0.6160222", "0.6156519", "0.61510146", "0.61351484", "0.6134525", "0.6133215", "0.61292315", "0.61257505", "0.61257505", "0.6117956", "0.6109336", "0.61058897", "0.61035556", "0.6097119", "0.609268", "0.60675454", "0.6065904", "0.60561264", "0.60490805", "0.604772", "0.6047309", "0.6041016", "0.60345006", "0.60295385", "0.60274017", "0.60274017", "0.6022261", "0.6017758", "0.60127175", "0.6007022" ]
0.7531097
16
=begin This method adds the details of this comment to the log file. It will be called after a successful creation of the comment Inputs: none Output: none Author: Menisy =end
def add_to_log user_name = self.user.name || self.user.email.split('@')[0] Log.create!(loggingtype: 2,user_id_1: self.user.id ,user_id_2: nil,admin_id: nil,story_id: self.story.id ,interest_id: nil,message: (user_name+" commented on \"" + self.story.title + "\" with \"" + self.content + "\"").to_s ) Admin.push_notifications "/admins/index" ,"" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_comment(comment); end", "def log_create(target = self.target)\n return unless target&.respond_to?(:log)\n\n target.log(:log_comment_added, summary: summary, touch: true)\n end", "def add_comment comment\n \"\\n###### #{comment} ######\\n\" \n end", "def create\n\t\t\tsuper\n\t\t\tprintComments\n\t\tend", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def add_comment(comment)\n \"\\n+++++++++++++++++++++++++++++++++++++++++ #{comment} ++++++++++++++++++++++++++++++++++++++++++++++\\n\"\n end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def add_comment(comment)\n @comment += comment + \"\\n\"\n end", "def on_comment(comment)\n STDOUT << \"on_comment\" << \"\\n\" <<\n \" comment: \" << comment << \"\\n\"\n STDOUT.flush\n end", "def a_method_before_add(comment)\n puts \"================== Something before comment get added! ========================\"\n end", "def genFileComment(cls, bld)\r\n end", "def genFileComment(cls, bld)\r\n end", "def genFileComment(cls, bld)\r\n end", "def genFileComment(cls, bld)\r\n end", "def genFileComment(cls, bld)\r\n end", "def append_comment_to_other_info(other_info, str)\n if other_info.present?\n other_info += \"\\n\"\n else\n other_info = \"\"\n end\n other_info += \"MIGRATION_ISSUE: #{str}\"\n other_info\n end", "def comment comment\n end", "def add_comment\n return client.add_comment(repository, pr_id, report_urls.comment_body) unless comment\n\n client.update_comment(repository, comment[:id], report_urls.comment_body(comment[:body]))\n end", "def add_sql_diff_comment(comment = nil)\n sql_diff_text_log << '--'\n sql_diff_text_log << \" #{comment}\" if comment\n sql_diff_text_log << \"\\r\\n\"\n end", "def new_comment comment, line_no = nil\n c = RDoc::Comment.new comment, @top_level, :ruby\n c.line = line_no\n c.format = @markup\n c\n end", "def trigger_comment(comment) end", "def comment?; end", "def comment?; end", "def write_comment\n\t\t# determing whos who\n\t\t@user = current_user\n\t\t@commentee = User.find(params[:commentee_id])\n\n\t\t# if the comment is not blank\n\t\tif !(params[:description] == \"\")\n\t\t\t# create new comment for the commentee\n\t\t @comment = UserComment.new(:user_id => @user.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t :commentee_id => params[:commentee_id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t :description => params[:description] )\n\t\t @comment.save\n\t\tend\n\t\tredirect_to :action => 'profile', :username => @commentee.login\n\tend", "def _comment db, id, text\n rowid = db.sql_comments_insert id, text\n puts \"Comment #{rowid} created\"\n handle = db.db\n \n commcount = handle.get_first_value( \"select count(id) from comments where id = #{id};\" )\n commcount = commcount.to_i\n db.sql_update \"bugs\", id, \"comment_count\", commcount\n rowid = db.sql_logs_insert id, \"comment\", Cmdapp.truncate(text, 50)\n end", "def comment str\n self.add_comment(\"This is a paragraph comment for the paragraph\", \"OCELOT Commenter\");\n end", "def comment message\n @instructions << Comment.new(message)\n self\n end", "def write_comment(message)\n GitHub.add_comment repo_name, number, \":octocat: #{message}\"\n rescue Octokit::UnprocessableEntity => error\n raise CommentFailed, \"Unable to write the comment: '#{error.message}'\"\n end", "def save_comment(name)\n Jhead.call(\"-cs\", name.shellescape, @match, @pattern)\n end", "def comment=(*)\n # do nothing with comment\n end", "def log_update(target = self.target)\n return unless target&.respond_to?(:log)\n\n target.log(:log_comment_updated, summary: summary, touch: false)\n end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def log_description_created\n @description.parent.log(:log_description_created,\n user: @user.login, touch: true,\n name: @description.unique_partial_format_name)\n end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment name\n\t\tempty = \"//\\n\"\n\n\t\tret = ''\n\t\tret << empty << empty\n\t\tret << \"// #{name}\\n\"\n\t\tret << \"// This is an object created by COBGIN\\n\"\n\t\tret << empty << empty\n\t\tret << \"// by Mickey Barboi\\n\"\n\t\tret << empty << empty << \"\\n\\n\"\n\n\t\tret\n\tend", "def create\n # we only get here if this comment is being manually entered.\n @comment = Comment.new(comment_params)\n\n c_max = current_rulemaking.comments.maximum(:order_in_list)\n next_order_in_list = (c_max.nil? ? 0 : c_max) + 1\n @comment.order_in_list = next_order_in_list\n\n @comment.rulemaking = current_rulemaking\n @comment.manually_entered = true\n\n respond_to do |format|\n if @comment.save\n suggested_change_change_hash = save_suggested_changes\n save_change_log(current_user,{comment: @comment, suggested_change_changes: suggested_change_change_hash, action_type: 'create'})\n format.html { redirect_to edit_comment_path(@comment), notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n set_select_options\n format.html { render :new }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_comment(comment)\n @comment = comment\n end", "def comment_added(comment)\n @comment = comment\n @user = @comment.user\n @track = @comment.track\n @project = @track.project\n\n mail to: @user.email,\n bcc: \"pierre@sugaryourcoffee.de, #{@project.user.email}\",\n subject: \"[apptrack] New Comment in Project #{@project.title}\"\n end", "def call\n @comment.touch\n end", "def on_comment(msg)\n end", "def add_comment(text, file_data = nil, file_mime_type = 'text/plain',\n file_name = 'attachment.txt')\n add_page = @client.get @add_comment_url\n add_form = add_page.form_with :action => /addcomment/i\n \n add_form.field_with(:name => /newCommentRaw/i).value = text\n add_form.field_with(:name => /newComment/i).value = text\n add_form.checkbox_with(:name => /privateComment/i).checked = :checked\n if file_data\n upload = add_form.file_uploads.first\n upload.file_name = file_name\n upload.mime_type = file_mime_type\n upload.file_data = file_data\n end\n add_form.submit add_form.button_with(:name => /submit/i)\n self\n end", "def comment\n cyc.comment(self.to_sym)\n end", "def comment(str)\n @out.comment(str)\n end", "def update_comment_text(story_data, bug_task, build_number)\n txt = String.new(FIXED_COMMENT_PREFIX) # comment should always begin with this\n txt << \"Fixed in Git and deployed with build #{build_number}\"\n\n if (story_data.current_state != 'finished' && story_data.current_state != 'delivered' && story_data.current_state != 'accepted')\n txt << \"\\n\\nNOTE: this story is not in the expected status 'Finished'... please verify and update status if necessary\"\n end\n txt\n end", "def document\n comment_code\n super\n end", "def create\n if !current_user\n redirect_to login_path\n end\n @request = Request.find(params[:request_id])\n @comment = Comment.new(comment_params)\n current_user.comments << @comment\n @request.comments << @comment\n if @comment.body.length < 1 \n flash[:Error] = \"Comment length : 1-200 characters. Comment length: Cannot be empty.\"\n redirect_to new_comment_path(params[:request_id])\n end\n if @comment.save\n UserMailer.comment_notification(@comment, @request).deliver_now\n flash[:success] = \"Thanks for responding! The person who posted the request will be notified.\"\n redirect_to request_path(params[:request_id])\n else\n flash[:danger] = \"All fields must be filled in to post a comment.\"\n redirect_to new_comment_path(params[:request_id])\n end\n \n end", "def add_comment(post_num_input)\n puts \"Type in a username.\"\n username = gets.chomp\n puts \"Type your comment\"\n comment = gets.chomp\n BLOG[post_num_input].comments << Comment.new(username,comment)\n puts \"Thank you #{username}! Your comment has been added to \" +\n \"\\\"#{BLOG[post_num_input].title}\\\"!\"\n show_comments(post_num_input)\n end", "def create_log(content)\n @note.title = to_utf8(@name) + \" - \" + Time.now.strftime(\"%Y-%m-%d %H:%M:%S\")\n @note.tags = @tag.get\n @note.content = to_utf8(content)\n @note.create\n Logger.log_internal { \"Create note: #{@note.guid}\" }\n end", "def create_comments\n end", "def create_comments\n end", "def create_comments\n end", "def comment(comment_hash)\n time = Time.parse(comment_hash[:updated]).strftime('%b %d %H:%m')\n author = set_color(\" -- #{comment_hash[:author][:name]}\", :cyan)\n byline = \"#{author} | #{time}\\n\"\n\n [comment_hash[:body], byline].join(\"\\n\")\n end", "def <<(new_comment)\n @config.ffi_delegate.set_comment('%s', :string, new_comment)\n self\n end", "def add_backup_comment(comm)\n add_comment convert_backup_comment(comm)\n end", "def <<(comment)\n @comments << comment\n end", "def comment(text)\n@out << \"<!-- #{text} -->\"\nnil\nend", "def add_comment comment, location\n return unless document_self\n\n original = comment\n\n comment = case comment\n when RDoc::Comment then\n comment.normalize\n else\n normalize_comment comment\n end\n\n if location.parser == RDoc::Parser::C\n @comment_location.delete_if { |(_, l)| l == location }\n end\n\n @comment_location << [comment, location]\n\n self.comment = original\n end", "def comment _args\n \"comment _args;\" \n end", "def comment!(str)\n @comments_buf << str\n end", "def comment args #id, comment\n id = args.shift\n unless id\n id = ask(\"Issue Id? \", Integer)\n end\n db, row = validate_id id, true\n die \"No issue found for #{id}\" unless row\n if !args.empty?\n comment = args.join(\" \")\n else\n message \"Enter a comment (. to exit): \"\n comment = Cmdapp.get_lines\n end\n die \"Operation cancelled\" if comment.nil? or comment.empty?\n message \"Comment is: #{comment}.\"\n message \"Adding comment to #{id}: #{row['title']}\"\n _comment db, id, comment\n 0\n end", "def file_name\n \"create_comments\"\n end", "def log_activity\n #Activity.log_activity(self, self.commentable, 'commented', self.user_id)\n if self.user.facebook_omniauth\n Activity.create_log_for_each_friend(self, self.commentable, 'commented on' , self.user.facebook_omniauth.uid, self.user.display_name)\n end\n end", "def comment=(value)\n @comment = value\n end", "def comment=(value)\n @comment = value\n end", "def redmine_add_comment(m, params)\n begin\n \tcertificate = redmine_check_auth(m)\n\t\tif ! certificate\n\t\t\t# ne rien faire, l'utilisateur n'est pas connecté\n\t\telse\n\t\t\tresulted_task = redmine_check_task(m, params, certificate)\n\t\t\tif ! resulted_task.nil?\n\t\t\t\t# Best way to save text line\n\t\t\t\tmessageEntry = params[:message].to_s.strip\n\t\t\t\t# Ajout d'un commentaire\n\t\t\t\tresulted_task.notes = messageEntry\t\n\t\t\t\t# Save an issue\n\t\t\t\tif ! resulted_task.save\n\t\t\t\t\t# on indique à l'utilisateur\n\t\t\t\t\t@bot.say m.replyto, \"#{certificate[:username]}, #{@redmine_l_thetask} ##{resulted_task.id} #{@redmine_l_hasnotbeenupdated}\"\n\t\t\t\telse \n\t\t\t\t\t# on indique à l'utilisateur\n\t\t\t\t\t@bot.say m.replyto, \"#{certificate[:username]}, #{@redmine_l_thetask} ##{resulted_task.id} #{@redmine_l_hasbeenupdated} => #{@redmine_rapid_url}#{@redmine_issue_show_path}/#{resulted_task.id}\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tm.reply \"#{@redmine_l_thetask} ##{params[:task]} #{@redmine_l_doesnotexistsinredmine}\"\n\t\t\tend\n\t\tend\n rescue Exception => e\n m.reply e.message\n m.reply e.backtrace.inspect\n end\n end", "def add_comment(uid, comment_text)\n\n radlib = find_radlib_by_radlib_id(radlib_id)\n\n author = find_user_by_uid(radlib.author_uid)\n author.increment_comments_received\n\n comment_index = increase_atomic_count(@docs[:num_comments])\n timestamp = Time.now.getutc\n comment_key = radlib_fillin_id + \"::comment::\" + comment_index.to_s\n\n comment_doc = {\n :type => \"radlib_fillin_comment\",\n :author => uid,\n :text => comment_text,\n :timestamp => timestamp\n }\n\n create_document(comment_key, comment_doc)\n comment_index\n end", "def log(bad_or_good, request_env)\n\t\t\toutfile = (bad_or_good == 'good') ? '/tmp/comments-good' : '/tmp/comments-bad'\n\t\t\tFile.open(outfile, 'a') do |f|\n\t\t\t\tf.puts \"\\n\\n#{'=' * 80}\\n\"\n\t\t\t\trequest_env.each do |k,v|\n\t\t\t\t\tf.puts \"#{k}: #{v}\\n\"\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def log(person)\n @file << person.to_markdown\n @file << \"\\n\\n\"\n end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def comments; end" ]
[ "0.696004", "0.68861306", "0.6857673", "0.6472247", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.6439953", "0.64294577", "0.6383043", "0.6383043", "0.6383043", "0.6383043", "0.637435", "0.6305124", "0.62695265", "0.62614894", "0.62614894", "0.62614894", "0.62614894", "0.62614894", "0.6238827", "0.6203446", "0.6201939", "0.61595047", "0.6154065", "0.6121678", "0.6099559", "0.6099559", "0.6034686", "0.60243154", "0.6023654", "0.601525", "0.5997839", "0.59839195", "0.59678847", "0.5917223", "0.59124714", "0.59124714", "0.59124714", "0.59124714", "0.59124714", "0.5902237", "0.5893926", "0.5893926", "0.5893926", "0.5893926", "0.589242", "0.5859057", "0.5850192", "0.5849525", "0.5845334", "0.5821285", "0.5820434", "0.5820076", "0.58193874", "0.58072054", "0.5804872", "0.58034194", "0.5787475", "0.57783604", "0.57772154", "0.57772154", "0.57772154", "0.57722914", "0.57652545", "0.5749522", "0.57399535", "0.57257247", "0.5722192", "0.5711019", "0.570912", "0.57003886", "0.5699382", "0.569432", "0.5676833", "0.5676833", "0.56732064", "0.5672685", "0.5672441", "0.5665751", "0.5665663", "0.5665663", "0.5665663", "0.5665663", "0.5665663", "0.5665663" ]
0.61783576
37
=begin This method checks if a user thumbed up this comment before Inputs: user who we want to check if he upped or not. Output: boolean true or false Author: Menisy =end
def upped_by_user?(user) up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # get the up that a user gave to this comment before "if exists" !up.nil? # if up is nil then return false if not then return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def downed_by_user?(user)\n down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) # get the down that a user gave to this comment before \"if exists\"\n !down.nil? # if down is nil then return false if not then return true\n end", "def up_comment(user)\n upped_before = self.upped_by_user?(user)\n downed_before = self.downed_by_user?(user)\n if !upped_before && !downed_before then #if user never upped or downed the comment then up it\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif downed_before then\n self.comment_up_downs.find_by_user_id_and_action(user.id,2).destroy #if user disliked it, now make him like it!\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if comment.user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif upped_before\n old_up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # if upped before, then un-up\n old_up.add_to_log(self.user,2)\n old_up.destroy\n return true\n else\n return false\n end \n end", "def down_comment(user)\n upped_before = self.upped_by_user?(user)\n downed_before = self.downed_by_user?(user)\n if !upped_before && !downed_before then #if user never upped or downed the comment then up it\n down = CommentUpDown.new(:action => 2)\n down.comment = self\n down.user = user\n down.save\n down.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for disliking a comment \n if comment.user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n ###################################\n return true\n elsif upped_before then\n self.comment_up_downs.find_by_user_id_and_action(user.id,1).destroy #if user disliked it, now make him like it!\n down = CommentUpDown.new(:action => 2)\n down.comment = self\n down.user = user\n down.save\n down.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for disliking a comment \n if user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n ###################################\n return true\n elsif downed_before\n old_down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) #if downed before then un-down\n old_down.add_to_log(self.user,2)\n old_down.destroy\n return true\n else\n return false\n end\n end", "def has_upvote_from(user)\n votes.find_by(user_id: user.id).present?\n end", "def original_photo(photourl)\n if(current_user.upvotes.find_by(photourl: photourl) || current_user.downvotes.find_by(photourl: photourl)) \n return false\n end\n return true\nend", "def upvote?\n note.start_with?('+1') || note.start_with?(':+1:')\n end", "def upvoted?(post)\n voted_up_on? post\n end", "def goodcomments\n User.isliked(self)\n end", "def up_vote?\n\t\tvalue == 1\n\tend", "def upvote(current_user)\n if current_user && current_user.voted_up_on?(self)\n self.unliked_by current_user\n else\n self.liked_by current_user\n end\n end", "def want_up?\n @raw && !pid && @raw[3] == 'u'\n end", "def up_vote?\n value == 1\n end", "def user_voted?(naming, user)\n !lookup_naming(naming).users_vote(user).nil?\n end", "def upvotelnk(beer)\n if current_user && current_user.votes.where(:beer_id => beer.id, :up => true).present?\n \t\"you up-voted\"\n \t\telse\n \t\tlink_to 'click to up-vote', votes_path(:vote => {:beer_id => beer.id, :up => true}), :method => :post\n \t\tend\n\nend", "def upvote_for(user)\n return unless vote_weight_for_user(user) < 1\n vote_for(user, 1)\n end", "def update?\n\t\t@comment.user == @user\n\tend", "def quality_check\n if session[:comment_id] == nil\n return true\n else session[:comment_id].each do |comment_id|\n if Comment.find(comment_id).downvote >= 12\n return false\n end\n end\n end\n end", "def user_voted?(user)\n !!users_vote(user)\n end", "def is_human?(params, comment)\n if !logged_in?\n if params[:signup_check].nil? || params[:signup_check].length > 0\n comment.errors.add(:base, \"Are you really human??\")\n return false\n end\n end\n return true\n end", "def repostable_by_user?(user)\n user.is_a?(Admin) || ( user.parent_of?(offender) && pending_parent_action? )\n end", "def upcomment\n comm = Comment.find_by_id(params[:id])\n if !comm.nil?\n comm.vote(current_user, true)\n end\n end", "def voted_by?(user)\n !!vote_ups.find_by_user_id(user.id) if user\n end", "def is_the_user_the_owner(scrollz, user)\n if scrollz.user_id != user.id\n flash[:notice] = \"?\"\n redirect_to scrollz_path(@scrollz)\n end\n end", "def vote_up(user_ip)\n if user_already_voted?(user_ip)\n false\n else\n if self.votes.create(:user_ip => user_ip)\n true\n else\n false\n end\n end\n end", "def already_voted_by_user?(the_user)\n post_vote_array(the_user).present?\n end", "def upvote!(u)\n raise ArgumentError, \"must supply User\" unless u and u.is_a?(User)\n\n return true if self.has_voted?(u.id)\n\n self.upvoters << u.id\n\n GT::Framer.dupe_frame!(self, u.id, u.upvoted_roll_id)\n\n update_score\n\n # send email notification in a non-blocking manor\n ShelbyGT_EM.next_tick { GT::NotificationManager.check_and_send_upvote_notification(u, self) }\n\n self.save\n end", "def bacon_upvote?(topic)\n\ttopic == \"bacon\"\nend", "def taken_to_showcase?(of_user)\r\n if of_user.collection?\r\n of_user.featured_album.album_contents.map(&:body_project_id).include?(self.body_project_id)\r\n else\r\n ContentImportDetails.count(:include => :content, :conditions =>\r\n ['original_content_id = ? and new_owner_id = ? and contents.id is not null', original_content_id,\r\n of_user.id]) > 0\r\n end\r\n end", "def auto_approve?\n return user.auto_approve_comment?\n end", "def voted_on?(user)\n return !self.ratings.find_by_user_id(user.id).nil?\n end", "def upvote_and_update(user)\n self.liked_by user\n self.save #trigger set_hotness!\n end", "def upvote\n if current_user.voted_for? @pin\n @pin.unliked_by current_user\n else\n @pin.liked_by current_user\n end\n\n redirect_to :back\n end", "def already_liked?\n Vote.where(author_id: current_user.id, comment_id:\n params[:comment_id]).exists?\n end", "def upvote(user)\n unless self.voters.any? {|id| id.to_s == user.uid.to_s}\n self.voters << user.uid\n self.votes += 1\n self.relevance = calculate_relevance unless new_record?\n self.save\n end\n end", "def user_has_voted(post)\n if (current_user)\n if (post.voted_by?(current_user))\n 1\n else\n 0\n end\n else\n 2\n end\nend", "def has_liked_userpost(feed_item)\n @like = Like.where(user_id: current_user.id, userpost_id: feed_item.id).first\n !@like.nil?\n end", "def liked?(user_id)\n !StoryLike.where(story_id: self.id, user_id: user_id).empty?\n end", "def is_liked user\n \tLike.find_by(user_id: user_id, post_id: id)\n end", "def correct_user\n check_owner_of(@micropost)\n end", "def already_commented_by_user?(the_user)\n !self.comments.where([\"user_id = ?\", the_user.id]).empty?\n end", "def owner_voted?(naming)\n !lookup_naming(naming).users_vote(user).nil?\n end", "def post_review?(next_review, user)\n\n (next_review && \n !self.review_locked? && \n next_review.designer_id == user.id &&\n next_review.review_type_id == next_review.design.phase_id)\n\n end", "def needs_followup?\n followup_note_count && followup_note_count > 0\n end", "def has_downvoted_for(user_id, post_id)\n\t\trelationship = Vote.find_by(user_id: user_id, post_id: post_id, vote_type: \"downvote\")\n \treturn true if relationship\n\tend", "def replied_conv? usr\n if @conv.posts.count > 1 && @conv.posts.last.user_id != usr.id\n @conv.posts.each do |post|\n return true if post.user_id == usr.id\n end\n end\n false\n end", "def up_voted?(voter)\n RedisVoteable.redis.sismember prefixed(\"#{class_key(voter)}:#{UP_VOTES}\"), class_key(self).to_s\n end", "def verify_user_for_changes!\n\n unless @item.editable_by_user?(auth_user)\n status_error = @item.errors[:status].present? ? @item.errors[:status].join(' ') : nil\n flash[:error] = status_error || \"You do not have permission to the item.\"\n redirect_back(items_path) && return\n\n else\n if ItemPhoto.over_the_limit?(@item)\n flash[:notice] = \"The images over the limit will be discarded.\"\n end\n end\n\n end", "def food_upvote?(topic)\n\ttopic == \"food\"\nend", "def up_voted?(voteable)\n RedisVoteable.redis.sismember prefixed(\"#{class_key(voteable)}:#{UP_VOTERS}\"), class_key(self).to_s\n end", "def can_user_buy_photos?(user)\n return true if who_can_buy == WHO_EVERYONE\n return true if who_can_buy == WHO_OWNER && user && admin?(user.id)\n return true if who_can_buy == WHO_VIEWERS && user && can_view_or_not_private?(user.id)\n\n return false\n end", "def mayView? ( other_user )\n if ( (not other_user.valid?) or ( other_user.is_a?(User) == false ) )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"basic check failed\"\n # d other_user.type\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return false\n end\n user = getUser()\n if ( other_user == user )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"same user as owner\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return true\n end\n if ( ( self.public_policy == Dfile::PP_MAYVIEW ) or ( self.public_policy == Dfile::PP_MAYEDIT ) )\n return true\n end\n if self.special_users\n special = self.special_users[other_user.id.to_s]\n if special\n if ( ( special == Dfile::PP_MAYVIEW ) or ( special == Dfile::PP_MAYEDIT ) )\n return true\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has special permission but not right one\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has no special permission\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n \n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"no special permissions\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n return false\n end", "def up?\n @last_status == :up\n end", "def preview_only?(user)\n !listed && !author?(user)\n end", "def watch_comment_status_by_user_id(user_id)\n action = watch_comment_by_user_actions.where(\"user_type = 'User' and user_id = ?\", user_id).take\n return action.action_option == \"ignore\" ? \"ignore\" : \"watch\" if action\n\n repo_action = repository.watch_by_user_actions.where(\"user_type = 'User' and user_id = ?\", user_id).take\n return \"watch\" if repo_action\n \"unwatch\"\n end", "def self_signup?\n user_id == author_id\n end", "def deal_status(user, actual_targets)\n return true # TODO\n end", "def editable_by?(user)\n if self.status == :private\n self.user == user || self.featurings.map(&:user).include?(user)\n elsif status == :temporary\n true # XXX FIXME SECURITY HOLE RIGHT HERE: ANY USER CAN MODIFY TEMP SONGS FIXME\n elsif status == :public\n false\n end\n end", "def downvote?\n note.start_with?('-1') || note.start_with?(':-1:')\n end", "def already_welcomed?(user)\n notification = Notification.welcomed_by(self.id, user.id)\n !notification.empty?\n end", "def can_be_seen_by(user, no_new_submission)\n return true if user.admin?\n return false if user.rating < 200\n if self.virtualtest_id == 0 # Not in a virtualtest: prerequisites should be completed\n return false if no_new_submission and self.submissions.where(\"user_id = ? AND status != ?\", user.id, Submission.statuses[:draft]).count == 0\n self.chapters.each do |c|\n return false if !user.chap_solved?(c)\n end\n else # In a virtualtest: the user should have finished the test\n return false if user.test_status(self.virtualtest) != \"finished\"\n end\n return true\n end", "def user_may_view_item?\n @pcp_item.pcp_step.released? || @pcp_item.pcp_step.in_commenting_group?\n end", "def user_is_track_owner?(track)\n return false if current_user.nil?\n return true if current_user.has_role?('admin')\n current_user.is_track_owner?(track)\n end", "def update?\n return true if user.present? && user == article.user\n end", "def comments?\n !!user && user.admin?\n end", "def update_review_status(status, user)\n \n if status && status.id != self.review_status_id &&\n (self.review_status.name == 'Review On-Hold' ||\n self.review_status.name == 'In Review')\n\n self.record_update('Review Status', \n self.review_status.name, \n status.name,\n user)\n\n if self.review_status.name == 'Review On-Hold'\n self.remove_from_hold(status.id)\n elsif self.review_status.name == 'In Review'\n self.place_on_hold\n end\n self.save\n \n true\n else\n false\n end \n \n end", "def liked_by_user?\n\t\tLike.where(user_id: current_user.id, post_id:\n\t \tparams[:post_id]).exists?\n\tend", "def takendown?\n author_linked_account_id && Takedown.linked_account_id_has_takedown?(author_linked_account_id)\n end", "def checked_out_by?(user) # user.has_tool?\n user_id == user.id if user\n end", "def hasReviewed(u, e)\n return Event.find_by(id: e).reviews.find_by(user_id: u) != nil\n end", "def completed?\n user.likes_count >= self.class.config.likes_needed_for_completion\n end", "def eventunscrape?\n @user.is_admin?\n end", "def upvote(e, params)\n @messages.vote(user_hash(@message), 1) or @irc.msg(e.nick, \"SORRY YOU CAN'T VOTE ON THIS MESSAGE AGAIN\")\nend", "def favorited?(user, coffeeshop)\n coffeeshop.users.each do |coffeeshop_user|\n return true if coffeeshop_user == user\n end\n return false\n end", "def upvote\n\t\tif vote_once\n\t\t\t@vote = @post.votes.create(user_id: current_user.id)\n\t\telse\n\t\t\t@vote = false\n\t\tend\n\t\tbyebug\n\t\trespond_to do |format|\n\t\t\tformat.js\n\t\tend\n\tend", "def upvote\n @comment = Comment.find_by(id: params[:id])\n # raise 'hell'\n\n # the following line to be uncommented when we go live to allow for 1 vote per user\n # Vote.find_or_create_by(upvote: 1, post: @post, user: @current_user)\n Vote.find_or_create_by(upvote: 1, comment: @comment, user: @current_user)\n check_score()\n respond_to do |format|\n # # if the response format is html, redirect as usual\n format.html { redirect_to root_path }\n # # if the response format is javascript, do something else...\n format.js { }\n end\n end", "def likable?\n if current_user\n !dog_has_owner? || dog_owner.id != current_user.id ? true : false\n else\n false\n end\n end", "def user_dugg?\n assert_not_nil @rdigg.stories.user_dugg?(\"7987660\", \"kevinrose\")\n end", "def downvote_and_update(user)\n self.disliked_by user\n self.save\n end", "def update_release_review_poster(release_reviewer, user)\n\n if self.review_type.name == \"Release\" &&\n self.review_status.name != \"Review Completed\" &&\n release_reviewer && self.designer_id != release_reviewer.id\n\n self.record_update('Release Poster', \n self.designer.name, \n release_reviewer.name,\n user)\n\n self.designer_id = release_reviewer.id\n self.save\n \n true\n else\n false\n end\n\n end", "def vote_up!(user)\n vote_ups.create(:user => user) unless voted_by?(user)\n end", "def correct_user; redirect_to root_url, flash: {success: \"Permission denied!\"} unless current_user? load_micropost.user end", "def update_status conv, user, fld\n if conv.update_attribute(fld.to_sym, 'removed')\n conv.remove_posts(user)\n true\n else\n false\n end\n end", "def down_vote?\n\t\tvalue == -1\n\tend", "def can_see_comment?(comment); comment.user.admin?; end", "def peer_auditor_checked?\n !(self.auditor_result == 'None' || self.auditor_result == 'Comment')\n end", "def canCommentPage(session)\n\n #CuppaUser user = GlobalSettings.getUser(session);\n #return (user != null && user.userIsAdmin());\n end", "def can_vote\n if owner_user?\n redirect_back_or root_url \n flash[:info] = \"You are the owner.\"\n end\n end", "def can_vote\n if owner_user?\n redirect_back_or root_url \n flash[:info] = \"You are the owner.\"\n end\n end", "def manually_added?\n if credit_note_items.size == 1\n return true if credit_note_items.first.source_type == 'User'\n end\n false\n end", "def liked_by?(user)\n likes.find_by_user_id(user.id).present?\n end", "def i_am_owner_or_admin(user_id)\n \tuser_to_check = User.find(user_id)\n \tif user_to_check\n \t\tif user_to_check.is_admin\n \t\t\treturn true\n \t\telse\n\t \t\tif self.from_user_id == user_to_check.id\n\t \t\t\treturn true\n\t \t\telse\n\t \t\t\treturn false\n\t \t\tend\n \t\tend\n\n \tend\n\n end", "def bump?\n # No bumping for subcomments\n return false if parent.present?\n # No bumping for posts older than 2 weeks\n return false if post.created_at < 14.days.ago\n # Only bump for 25% of comments on Kitsu-group posts\n return rand <= 0.25 if Group.kitsu && post.target_group_id == Group.kitsu.id\n # Otherwise yeah, bump away my dude\n true\n end", "def user_is_not_owner\n unless @likeable_obj.present? && @likeable_obj.user_id != current_user.id\n redirect_to @likeable_obj, notice: \"You cannot like your own dog... How sad...\"\n end\n end", "def undroppable?(user)\n self.status == 'washed' and self.dropper_id == user.id\n # Order.where(:status => 'washed', :dropper_id => user.id).where.not(:picker_id => nil) or !self.picked?\n end", "def has_been_acquired_by_user?(user)\n current_user_profile = Profile.find_by(user_id: user.id)\n addition = Addition.find_by(profile_id: current_user_profile, story_id: self.id)\n addition != nil\n end", "def liked_by? user\n not likes.reject { |like| like.created_by != user }.blank?\n end", "def unappliable?\n !order_item.order.user || !referrer\n end", "def applies_to?(user); false end", "def update_userpic!(should_this_be)\n if !should_this_be && user.profile.userpic == self\n self.clear_userpic!\n elsif should_this_be && user.profile.userpic != self\n self.make_userpic!\n end\n end", "def update?\n user_is_owner_or_admin?\n end" ]
[ "0.7199514", "0.707595", "0.653329", "0.6292011", "0.6243375", "0.6200053", "0.61881196", "0.6110206", "0.6005291", "0.5989424", "0.5957557", "0.59369016", "0.59129316", "0.59000254", "0.58777636", "0.5843153", "0.58414036", "0.58069694", "0.58015496", "0.57767844", "0.57515675", "0.5751099", "0.5742021", "0.5723526", "0.5718983", "0.56985164", "0.5660931", "0.56447124", "0.5626703", "0.56093127", "0.559693", "0.5568631", "0.5568417", "0.5548273", "0.5539564", "0.5525889", "0.5521059", "0.5519944", "0.5508476", "0.5486505", "0.54797107", "0.5474122", "0.547264", "0.54694283", "0.545702", "0.54504794", "0.54491925", "0.5442296", "0.543944", "0.5438098", "0.54251856", "0.54036045", "0.5401961", "0.5394446", "0.5384591", "0.5377441", "0.5351964", "0.5351518", "0.5344696", "0.53425026", "0.53392464", "0.5335331", "0.5326297", "0.53261983", "0.53238255", "0.5322545", "0.53194255", "0.53142035", "0.53050584", "0.52955663", "0.5283607", "0.52787334", "0.52770305", "0.52764815", "0.5264363", "0.52628624", "0.5260737", "0.5256965", "0.5237931", "0.5235944", "0.52353585", "0.52185136", "0.5218171", "0.5217679", "0.5210327", "0.5210181", "0.5202913", "0.5202913", "0.5201927", "0.5201372", "0.5198948", "0.51984125", "0.51906157", "0.5188031", "0.51822054", "0.51773137", "0.5177232", "0.51716286", "0.51685476", "0.5160813" ]
0.7711889
0
=begin This method checks if a user thumbed down this comment before Inputs: user who we want to check if he upped or not. Output: boolean true or false Author: Menisy =end
def downed_by_user?(user) down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) # get the down that a user gave to this comment before "if exists" !down.nil? # if down is nil then return false if not then return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upped_by_user?(user)\n up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # get the up that a user gave to this comment before \"if exists\"\n !up.nil? # if up is nil then return false if not then return true\n end", "def up_comment(user)\n upped_before = self.upped_by_user?(user)\n downed_before = self.downed_by_user?(user)\n if !upped_before && !downed_before then #if user never upped or downed the comment then up it\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif downed_before then\n self.comment_up_downs.find_by_user_id_and_action(user.id,2).destroy #if user disliked it, now make him like it!\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if comment.user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif upped_before\n old_up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # if upped before, then un-up\n old_up.add_to_log(self.user,2)\n old_up.destroy\n return true\n else\n return false\n end \n end", "def down_comment(user)\n upped_before = self.upped_by_user?(user)\n downed_before = self.downed_by_user?(user)\n if !upped_before && !downed_before then #if user never upped or downed the comment then up it\n down = CommentUpDown.new(:action => 2)\n down.comment = self\n down.user = user\n down.save\n down.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for disliking a comment \n if comment.user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n ###################################\n return true\n elsif upped_before then\n self.comment_up_downs.find_by_user_id_and_action(user.id,1).destroy #if user disliked it, now make him like it!\n down = CommentUpDown.new(:action => 2)\n down.comment = self\n down.user = user\n down.save\n down.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for disliking a comment \n if user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n ###################################\n return true\n elsif downed_before\n old_down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) #if downed before then un-down\n old_down.add_to_log(self.user,2)\n old_down.destroy\n return true\n else\n return false\n end\n end", "def original_photo(photourl)\n if(current_user.upvotes.find_by(photourl: photourl) || current_user.downvotes.find_by(photourl: photourl)) \n return false\n end\n return true\nend", "def quality_check\n if session[:comment_id] == nil\n return true\n else session[:comment_id].each do |comment_id|\n if Comment.find(comment_id).downvote >= 12\n return false\n end\n end\n end\n end", "def goodcomments\n User.isliked(self)\n end", "def upvote?\n note.start_with?('+1') || note.start_with?(':+1:')\n end", "def has_downvoted_for(user_id, post_id)\n\t\trelationship = Vote.find_by(user_id: user_id, post_id: post_id, vote_type: \"downvote\")\n \treturn true if relationship\n\tend", "def has_upvote_from(user)\n votes.find_by(user_id: user.id).present?\n end", "def upvoted?(post)\n voted_up_on? post\n end", "def downvote?\n note.start_with?('-1') || note.start_with?(':-1:')\n end", "def up_vote?\n\t\tvalue == 1\n\tend", "def up_vote?\n value == 1\n end", "def repostable_by_user?(user)\n user.is_a?(Admin) || ( user.parent_of?(offender) && pending_parent_action? )\n end", "def update?\n\t\t@comment.user == @user\n\tend", "def user_voted?(naming, user)\n !lookup_naming(naming).users_vote(user).nil?\n end", "def is_the_user_the_owner(scrollz, user)\n if scrollz.user_id != user.id\n flash[:notice] = \"?\"\n redirect_to scrollz_path(@scrollz)\n end\n end", "def user_voted?(user)\n !!users_vote(user)\n end", "def want_up?\n @raw && !pid && @raw[3] == 'u'\n end", "def upvotelnk(beer)\n if current_user && current_user.votes.where(:beer_id => beer.id, :up => true).present?\n \t\"you up-voted\"\n \t\telse\n \t\tlink_to 'click to up-vote', votes_path(:vote => {:beer_id => beer.id, :up => true}), :method => :post\n \t\tend\n\nend", "def upcomment\n comm = Comment.find_by_id(params[:id])\n if !comm.nil?\n comm.vote(current_user, true)\n end\n end", "def down_vote?\n\t\tvalue == -1\n\tend", "def comments?\n !!user && user.admin?\n end", "def is_human?(params, comment)\n if !logged_in?\n if params[:signup_check].nil? || params[:signup_check].length > 0\n comment.errors.add(:base, \"Are you really human??\")\n return false\n end\n end\n return true\n end", "def can_see_comment?(comment); comment.user.admin?; end", "def voted_on?(user)\n return !self.ratings.find_by_user_id(user.id).nil?\n end", "def auto_approve?\n return user.auto_approve_comment?\n end", "def watch_comment_status_by_user_id(user_id)\n action = watch_comment_by_user_actions.where(\"user_type = 'User' and user_id = ?\", user_id).take\n return action.action_option == \"ignore\" ? \"ignore\" : \"watch\" if action\n\n repo_action = repository.watch_by_user_actions.where(\"user_type = 'User' and user_id = ?\", user_id).take\n return \"watch\" if repo_action\n \"unwatch\"\n end", "def voted_by?(user)\n !!vote_ups.find_by_user_id(user.id) if user\n end", "def already_commented_by_user?(the_user)\n !self.comments.where([\"user_id = ?\", the_user.id]).empty?\n end", "def taken_to_showcase?(of_user)\r\n if of_user.collection?\r\n of_user.featured_album.album_contents.map(&:body_project_id).include?(self.body_project_id)\r\n else\r\n ContentImportDetails.count(:include => :content, :conditions =>\r\n ['original_content_id = ? and new_owner_id = ? and contents.id is not null', original_content_id,\r\n of_user.id]) > 0\r\n end\r\n end", "def bacon_upvote?(topic)\n\ttopic == \"bacon\"\nend", "def liked?(user_id)\n !StoryLike.where(story_id: self.id, user_id: user_id).empty?\n end", "def upvote(current_user)\n if current_user && current_user.voted_up_on?(self)\n self.unliked_by current_user\n else\n self.liked_by current_user\n end\n end", "def already_liked?\n Vote.where(author_id: current_user.id, comment_id:\n params[:comment_id]).exists?\n end", "def is_liked user\n \tLike.find_by(user_id: user_id, post_id: id)\n end", "def user_dugg?\n assert_not_nil @rdigg.stories.user_dugg?(\"7987660\", \"kevinrose\")\n end", "def canCommentPage(session)\n\n #CuppaUser user = GlobalSettings.getUser(session);\n #return (user != null && user.userIsAdmin());\n end", "def post_review?(next_review, user)\n\n (next_review && \n !self.review_locked? && \n next_review.designer_id == user.id &&\n next_review.review_type_id == next_review.design.phase_id)\n\n end", "def preview_only?(user)\n !listed && !author?(user)\n end", "def already_voted_by_user?(the_user)\n post_vote_array(the_user).present?\n end", "def user_may_view_item?\n @pcp_item.pcp_step.released? || @pcp_item.pcp_step.in_commenting_group?\n end", "def comment_required?(designer_result, auditor_result)\n\n # Checking the check for the check type is overkill.\n check = Check.find(self.check_id)\n case \n when designer_result == 'No'\n check.yes_no?\n when designer_result == 'Waived'\n check.designer_only? || check.designer_auditor?\n when auditor_result == 'Waived' || auditor_result == 'Comment'\n check.designer_auditor?\n end\n\n end", "def takendown?\n author_linked_account_id && Takedown.linked_account_id_has_takedown?(author_linked_account_id)\n end", "def mayView? ( other_user )\n if ( (not other_user.valid?) or ( other_user.is_a?(User) == false ) )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"basic check failed\"\n # d other_user.type\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return false\n end\n user = getUser()\n if ( other_user == user )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"same user as owner\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return true\n end\n if ( ( self.public_policy == Dfile::PP_MAYVIEW ) or ( self.public_policy == Dfile::PP_MAYEDIT ) )\n return true\n end\n if self.special_users\n special = self.special_users[other_user.id.to_s]\n if special\n if ( ( special == Dfile::PP_MAYVIEW ) or ( special == Dfile::PP_MAYEDIT ) )\n return true\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has special permission but not right one\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has no special permission\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n \n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"no special permissions\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n return false\n end", "def peer_auditor_checked?\n !(self.auditor_result == 'None' || self.auditor_result == 'Comment')\n end", "def replied_conv? usr\n if @conv.posts.count > 1 && @conv.posts.last.user_id != usr.id\n @conv.posts.each do |post|\n return true if post.user_id == usr.id\n end\n end\n false\n end", "def upvote_for(user)\n return unless vote_weight_for_user(user) < 1\n vote_for(user, 1)\n end", "def downcomment\n comm = Comment.find_by_id(params[:id])\n if !comm.nil?\n comm.vote(current_user, false)\n end\n end", "def needs_followup?\n followup_note_count && followup_note_count > 0\n end", "def thumbnailable?\n false\n end", "def likable?\n if current_user\n !dog_has_owner? || dog_owner.id != current_user.id ? true : false\n else\n false\n end\n end", "def food_upvote?(topic)\n\ttopic == \"food\"\nend", "def user_has_voted(post)\n if (current_user)\n if (post.voted_by?(current_user))\n 1\n else\n 0\n end\n else\n 2\n end\nend", "def owner_voted?(naming)\n !lookup_naming(naming).users_vote(user).nil?\n end", "def downvote(current_user)\n if current_user && current_user.voted_down_on?(self)\n self.undisliked_by current_user\n else\n self.downvote_by current_user\n end\n end", "def downvote_and_update(user)\n self.disliked_by user\n self.save\n end", "def can_user_buy_photos?(user)\n return true if who_can_buy == WHO_EVERYONE\n return true if who_can_buy == WHO_OWNER && user && admin?(user.id)\n return true if who_can_buy == WHO_VIEWERS && user && can_view_or_not_private?(user.id)\n\n return false\n end", "def deal_status(user, actual_targets)\n return true # TODO\n end", "def hasReviewed(u, e)\n return Event.find_by(id: e).reviews.find_by(user_id: u) != nil\n end", "def eventunscrape?\n @user.is_admin?\n end", "def verify_user_for_changes!\n\n unless @item.editable_by_user?(auth_user)\n status_error = @item.errors[:status].present? ? @item.errors[:status].join(' ') : nil\n flash[:error] = status_error || \"You do not have permission to the item.\"\n redirect_back(items_path) && return\n\n else\n if ItemPhoto.over_the_limit?(@item)\n flash[:notice] = \"The images over the limit will be discarded.\"\n end\n end\n\n end", "def comment_liking?(comment)\n comment_liking_comments.include?(comment)\n end", "def vote_up(user_ip)\n if user_already_voted?(user_ip)\n false\n else\n if self.votes.create(:user_ip => user_ip)\n true\n else\n false\n end\n end\n end", "def unappliable?\n !order_item.order.user || !referrer\n end", "def has_liked_userpost(feed_item)\n @like = Like.where(user_id: current_user.id, userpost_id: feed_item.id).first\n !@like.nil?\n end", "def editable_by?(user)\n if self.status == :private\n self.user == user || self.featurings.map(&:user).include?(user)\n elsif status == :temporary\n true # XXX FIXME SECURITY HOLE RIGHT HERE: ANY USER CAN MODIFY TEMP SONGS FIXME\n elsif status == :public\n false\n end\n end", "def show_extra_links?\n user.is_gold?\n end", "def check_down; end", "def user_comment?(user_id)\n @current_user.id == user_id\n end", "def up?\n direction == UP\n end", "def commenting_allowed?\n return false if owner.commenting_banned == true\n return true if owner.commenting_allowed\n\n if owner.supporter?\n set commenting_allowed: true\n save_changes validate: false\n return true\n else\n return false if owner.commenting_too_much?\n end\n\n if (account_sites_events_dataset.exclude(site_change_id: nil).count >= COMMENTING_ALLOWED_UPDATED_COUNT || (created_at < Date.new(2014, 12, 25).to_time && changed_count >= COMMENTING_ALLOWED_UPDATED_COUNT )) &&\n created_at < Time.now - 604800\n owner.set commenting_allowed: true\n owner.save_changes validate: false\n return true\n end\n\n false\n end", "def under?\r\n return false if $game_player.screen_x < self.x + @under[0] - @cw / 2\r\n return false if $game_player.screen_y < self.y + @under[1] - @ch\r\n return false if $game_player.screen_x > self.x + @under[2] - @cw / 2\r\n return false if $game_player.screen_y > self.y + @under[3] - @ch + 16\r\n return true\r\n end", "def up?\n @last_status == :up\n end", "def test_upDownToggle\n [@window, @sprite, @bitmap].each{|container|\n uc = UCNumericUpDown.new(container, Rect.new(0, 96, 100, 24), 27, \"%d%%\", -125, 225, 7)\n @uc_upDownsToggle.push(uc)\n }\n upDownToggle()\n return true\n end", "def undroppable?(user)\n self.status == 'washed' and self.dropper_id == user.id\n # Order.where(:status => 'washed', :dropper_id => user.id).where.not(:picker_id => nil) or !self.picked?\n end", "def comments_admin?\n admin?\n end", "def favorited?(user, coffeeshop)\n coffeeshop.users.each do |coffeeshop_user|\n return true if coffeeshop_user == user\n end\n return false\n end", "def eligible_for_referrer_reward?(user)\n user.sent_referrals.size % SENT_REFERRALS_TARGET == 0\n end", "def liked_by_user?\n\t\tLike.where(user_id: current_user.id, post_id:\n\t \tparams[:post_id]).exists?\n\tend", "def up_voted?(voteable)\n RedisVoteable.redis.sismember prefixed(\"#{class_key(voteable)}:#{UP_VOTERS}\"), class_key(self).to_s\n end", "def want_down?\n pid && @raw[3] == 'd'\n end", "def i_am_owner_or_admin(user_id)\n \tuser_to_check = User.find(user_id)\n \tif user_to_check\n \t\tif user_to_check.is_admin\n \t\t\treturn true\n \t\telse\n\t \t\tif self.from_user_id == user_to_check.id\n\t \t\t\treturn true\n\t \t\telse\n\t \t\t\treturn false\n\t \t\tend\n \t\tend\n\n \tend\n\n end", "def correct_user\n check_owner_of(@micropost)\n end", "def completed?\n user.likes_count >= self.class.config.likes_needed_for_completion\n end", "def upvote_and_update(user)\n self.liked_by user\n self.save #trigger set_hotness!\n end", "def toggle_follow\n #user.toggle_follow!(celebrity) process 22, comment out this one\n #current_user.toggle_follow!(:user_id) process 44, comment out this one\n current_user.toggle_follow!(@post.user) #to get user object of the poster who post something 4\n redirect_to :back #66\n end", "def update_release_review_poster(release_reviewer, user)\n\n if self.review_type.name == \"Release\" &&\n self.review_status.name != \"Review Completed\" &&\n release_reviewer && self.designer_id != release_reviewer.id\n\n self.record_update('Release Poster', \n self.designer.name, \n release_reviewer.name,\n user)\n\n self.designer_id = release_reviewer.id\n self.save\n \n true\n else\n false\n end\n\n end", "def checked_out_by?(user) # user.has_tool?\n user_id == user.id if user\n end", "def update_review_status(status, user)\n \n if status && status.id != self.review_status_id &&\n (self.review_status.name == 'Review On-Hold' ||\n self.review_status.name == 'In Review')\n\n self.record_update('Review Status', \n self.review_status.name, \n status.name,\n user)\n\n if self.review_status.name == 'Review On-Hold'\n self.remove_from_hold(status.id)\n elsif self.review_status.name == 'In Review'\n self.place_on_hold\n end\n self.save\n \n true\n else\n false\n end \n \n end", "def can_be_seen_by(user, no_new_submission)\n return true if user.admin?\n return false if user.rating < 200\n if self.virtualtest_id == 0 # Not in a virtualtest: prerequisites should be completed\n return false if no_new_submission and self.submissions.where(\"user_id = ? AND status != ?\", user.id, Submission.statuses[:draft]).count == 0\n self.chapters.each do |c|\n return false if !user.chap_solved?(c)\n end\n else # In a virtualtest: the user should have finished the test\n return false if user.test_status(self.virtualtest) != \"finished\"\n end\n return true\n end", "def already_welcomed?(user)\n notification = Notification.welcomed_by(self.id, user.id)\n !notification.empty?\n end", "def user_is_track_owner?(track)\n return false if current_user.nil?\n return true if current_user.has_role?('admin')\n current_user.is_track_owner?(track)\n end", "def rated?\n liked_by_count > 0 || disliked_by_count > 0\n end", "def liked_by?(user)\n likes.find_by_user_id(user.id).present?\n end", "def update?\n return true if user.present? && user == article.user\n end", "def bump?\n # No bumping for subcomments\n return false if parent.present?\n # No bumping for posts older than 2 weeks\n return false if post.created_at < 14.days.ago\n # Only bump for 25% of comments on Kitsu-group posts\n return rand <= 0.25 if Group.kitsu && post.target_group_id == Group.kitsu.id\n # Otherwise yeah, bump away my dude\n true\n end", "def pen_up?\n !@pen_is_down\n end", "def is_bookmarked user\n Bookmark.find_by(user_id: user_id, post_id: id)\n end", "def bookmarked?(user_id)\n !Bookmark.where(story_id: self.id, user_id: user_id).empty?\n end" ]
[ "0.7538691", "0.69439965", "0.6871517", "0.62694585", "0.61994", "0.61727524", "0.5876259", "0.58750856", "0.5789535", "0.57670224", "0.5731327", "0.5716213", "0.5642832", "0.56402373", "0.5636984", "0.5636606", "0.5629734", "0.5592459", "0.5584061", "0.55372924", "0.5511598", "0.5489253", "0.5487202", "0.5473579", "0.5471235", "0.5465477", "0.5462991", "0.54611546", "0.5446301", "0.5432631", "0.54104924", "0.54104465", "0.5404732", "0.5402432", "0.5401855", "0.53966165", "0.53964925", "0.53955543", "0.5367315", "0.53524226", "0.5331442", "0.532557", "0.5309873", "0.5306589", "0.53039443", "0.530199", "0.5299675", "0.52933455", "0.5285809", "0.52822286", "0.52776664", "0.5272167", "0.5261915", "0.52566576", "0.5252999", "0.5252021", "0.52454334", "0.52415013", "0.5228211", "0.52103233", "0.5210115", "0.52036", "0.5202549", "0.52019304", "0.520056", "0.519617", "0.51956797", "0.5191585", "0.51882845", "0.5179186", "0.5175438", "0.51698637", "0.5152178", "0.51447093", "0.5138842", "0.5138666", "0.51337504", "0.5127877", "0.5117942", "0.5110585", "0.510967", "0.51083696", "0.510663", "0.5104332", "0.5100816", "0.5098554", "0.50964767", "0.50916463", "0.5090648", "0.50849825", "0.50798035", "0.5079132", "0.50789523", "0.5077418", "0.507291", "0.5070838", "0.50644064", "0.5063827", "0.50634897", "0.50619566" ]
0.7611069
0
=begin Returns number of ups for a comment Inputs: none Output: int number of ups Author: Menisy =end
def get_num_ups ups = self.comment_up_downs.find_all_by_action(1).size end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_comment_score(c)\n upcount = (c['up'] ? c['up'].length : 0)\n downcount = (c['down'] ? c['down'].length : 0)\n upcount-downcount\nend", "def get_num_downs\n downs = self.comment_up_downs.find_all_by_action(2).size\n end", "def increment_num_comments\n\n end", "def compute_comment_score(c)\n upcount = (c['up'] ? c['up'].length : 0)\n downcount = (c['down'] ? c['down'].length : 0)\n upcount-downcount\n end", "def comment_count\n comments.length\n end", "def number_of_commenting_users\n temp = describing_comments.collect{|comment| comment.submitter_id}.uniq.length\n ((temp >= @@low_amount_of_commenters)?(temp.to_s):(\"פחות מ-#{@@low_amount_of_commenters}\"))\n end", "def comment_count number\n pluralizing_count number, 'comment'\n end", "def number_comments \n self.comments.count\n end", "def number_of_comments\n\t \tcomments.count\n\t end", "def metadata_comment_count(structure)\n \"#{structure.comments.count} avis\"\n end", "def num_developers(lines) \n devs = []\n lines.each { |line|\n words = line.split(' ')\n if words[0] == \"Author:\"\n author = words[words.length - 1]\n devs << author\n end\n }\n devs.uniq.length\nend", "def num_developers(lines)\n\n #initialize counter at zero and an empty list\n numDevs = 0\n emails = []\n\n lines.each{ |line|\n if line.start_with?(\"Author: \")\n \n #email is always the last string in the line\n email = line.split(\" \")[3]\n\n #increment numDevs only if its a novel developer email\n if not emails.include?(email)\n numDevs += 1\n emails << email\n end\n end\n }\n\n #emails.each{|e| puts(e) }\n\n return numDevs\n\nend", "def comments_count\n @comments_count ||= self.comments.count || 0\n end", "def numbered_comments(post_num_input)\n puts ''\n BLOG[post_num_input].comments.each do |x|\n puts \"[#{BLOG[post_num_input].comments.index(x) + 1}] #{x.username} - #{x.comment}\"\n end\n puts ''\n end", "def count_comments!\n self.update_attribute(:num_comments, comments.viewable.size)\n end", "def comments_count\n self[:comments_count] || 0\n end", "def comments_count\n self[:comments_count] || 0\n end", "def num_comments\n self.comments.count\n end", "def comments_word_count\n self.turker_comments.present? ? self.turker_comments.split(/\\s/).length : 0\n end", "def count_of_comment\n Comment.number_of_comment(self)\n end", "def comments_count\n self.comments.count\n end", "def CommentCount\n return Comment.where(:user_id => id).count\n end", "def review_comment_count\n self.reviews.map { |review| review.comments.count }.inject(:+)\n end", "def num_pr_comments(pr)\n q = <<-QUERY\n select count(*) as comment_count\n from pull_request_comments prc\n where prc.pull_request_id = ?\n and prc.created_at < (\n select max(created_at)\n from pull_request_history\n where action = 'closed' and pull_request_id = ?)\n QUERY\n db.fetch(q, pr[:id], pr[:id]).first[:comment_count]\n end", "def numComments(actionIdeaID) \n \treturn ActionIdeaComment.where(actionIdeaID =self.action_idea_id).count()\n end", "def review_comment_downvote_count\n number_of_downvotes = 0\n self.reviews.each do |review|\n votes = Vote.where(votable_type: \"Review\", votable_id: review.id, value: -1).count || 0\n number_of_downvotes += votes\n end\n number_of_downvotes\n end", "def counting\n puts \"hard to do right\"\n end", "def liked_comments_count\n # Creating comments\n comment_ids = \"SELECT id FROM comments WHERE user_id = :user_id\"\n # Except for self like\n CommentLike.where(\"comment_id IN (#{comment_ids}) AND user_id <> :user_id\", user_id: id).count\n end", "def num_commit_comments(pr)\n q = <<-QUERY\n select count(*) as commit_comment_count\n from pull_request_commits prc, commit_comments cc\n where prc.commit_id = cc.commit_id\n and prc.pull_request_id = ?\n QUERY\n db.fetch(q, pr[:id]).first[:commit_comment_count]\n end", "def uncommented_kassi_event_count\n query1 = \"\n SELECT COUNT(ke.id) - (SELECT COUNT(*) FROM person_comments WHERE author_id = '#{id}')\n FROM kassi_events AS ke, kassi_event_participations AS kep\n WHERE kep.person_id = '#{id}'\n AND kep.kassi_event_id = ke.id\n \"\n KassiEvent.count_by_sql(query1)\n end", "def num_cookmarks\n user_pointers.count\n end", "def popularity\n views*1 + comments.size*1\n end", "def up_comment(user)\n upped_before = self.upped_by_user?(user)\n downed_before = self.downed_by_user?(user)\n if !upped_before && !downed_before then #if user never upped or downed the comment then up it\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif downed_before then\n self.comment_up_downs.find_by_user_id_and_action(user.id,2).destroy #if user disliked it, now make him like it!\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if comment.user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif upped_before\n old_up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # if upped before, then un-up\n old_up.add_to_log(self.user,2)\n old_up.destroy\n return true\n else\n return false\n end \n end", "def author_count\n revisions = Marginalia.revisions(params[:id])\n authors = []\n revisions.collect {|rev| authors << rev['user']}\n authors.uniq!\n render :text => authors.length\n end", "def real_comment_count(photo_data)\n # Don't know what the maximum Instagram will give us is, let's pretend it's\n # 20.\n return photo_data.comments['count'] if photo_data.comments['count'] > 20\n\n # This is getting copy-pasta...\n params = {client_id: AppConfig.instagram.client_id}\n # If photo has a user with creds, make the request as them\n params[:access_token] = self.user.access_token if self.user and self.user.access_token\n\n begin\n response = Star::Requester.get \"media/#{self.uid}/comments\", params\n if response.success? and response.body.data\n return response.body.data\n .select{|comment| comment.from.id != photo_data.user.id}\n .uniq_by{|c| c.from.id}.length\n else\n raise \"/media/{id}/comments was not a success: #{response.body.inspect}\"\n end\n rescue Faraday::Error::ResourceNotFound, Faraday::Error::ClientError\n return photo_data.comments['count']\n end\n end", "def comment_length\n\t120\nend", "def review_comment_vote_count\n number_of_votes = 0\n self.reviews.each do |review|\n review.comments.each do |comment|\n number_of_votes += comment.votes.count\n end\n end\n number_of_votes\n end", "def hottest_comment\n unless comments.empty?\n comments.map{|c| [c,c.votes.count]}.sort{|x,y| y[1] <=> x[1]}.first[0]\n end\nend", "def num_comments(pr_id)\n q = <<-QUERY\n select count(*) as comment_count\n from pull_request_comments prc\n where prc.pull_request_id = ?\n and prc.created_at < (\n select max(created_at)\n from pull_request_history\n where action = 'closed' and pull_request_id = ?)\n QUERY\n if_empty(db.fetch(q, pr_id, pr_id).all, :comment_count)\n end", "def parse_comment_body(comment_body)\n net_pluses = comment_body.scan(PLUS_ONE_COMMENT).count\n net_pluses = net_pluses - comment_body.scan(NEG_ONE_COMMENT).count\n\n if net_pluses > 0\n net_pluses = 1\n elsif net_pluses < 0\n net_pluses = -1\n end\n\n return net_pluses\n end", "def user_count; end", "def increment_comments_count\n return unless commented_on_card?\n commentable.update(comments_count: commentable.comments_count + 1)\n end", "def upvote_count\n self.get_upvotes.size\n end", "def count(commit, author, file, lines_ins_del)\n churn = 0\n unless lines_ins_del.empty?\n lines_ins_del.each do |d, i|\n @deletions += d\n @insertions += i\n churn += d + i\n end\n end\n churn\n end", "def upvotes_size\n\t\treviews.where(satisfied: true).size\n\tend", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def num_issue_comments(pr)\n q = <<-QUERY\n select count(*) as issue_comment_count\n from pull_requests pr, issue_comments ic, issues i\n where ic.issue_id=i.id\n and i.issue_id=pr.pullreq_id\n and pr.base_repo_id = i.repo_id\n and pr.id = ?\n and ic.created_at < (\n select max(created_at)\n from pull_request_history\n where action = 'closed' and pull_request_id = ?)\n QUERY\n db.fetch(q, pr[:id], pr[:id]).first[:issue_comment_count]\n end", "def followers_count_in_words(kase)\n case kase.kind\n when :idea then (\"%{people} like this idea\" % {:people => \"%d person\" / kase.followers_count})\n when :question then (\"%{people} have this question\" % {:people => \"%d person\" / kase.followers_count})\n when :question then (\"%{people} have this problem\" % {:people => \"%d person\" / kase.followers_count})\n when :praise then (\"%{people} gave same praise\" % {:people => \"%d person\" / kase.followers_count})\n end\n end", "def num_developers(lines)\n\temails = []\n\tlines.each{|line|\n\t\tif line.include? \"Author:\"\n\t\t\twords = line.split(\" \")\n\t\t\twords.each{|word|\n\t\t\t\tif word.include?('@')\n\t\t\t\t\temails += [word] if !emails.include? (word)\n\t\t\t\tend\n\t\t\t}\n\t\tend\n\t}\n\treturn emails.length\n\t\t\t\nend", "def length\n count(:up)\n end", "def num_commits(lines)\n num = 0 \n lines.each { |line|\n words = line.split\n if words[0] == \"commit\" then num+= 1 end\n }\n num\nend", "def comment_lines(arr)\n output = 0\n begin\n i = 0\n while i < arr.length\n if arr[i] == \"#\\n\"\n output += 1\n else\n j = 0\n temp_holder = arr[i]\n while j < temp_holder.length\n if temp_holder[j] == \"#\"\n output += 1\n break\n elsif temp_holder[j] != \" \"\n break\n end\n j += 1\n end\n end\n i += 1\n end\n rescue NameError\n p \"No variable with this name\"\n rescue TypeError\n p \"String was not converted into integer\"\n rescue IndexError\n p \"Index was not inside the paramaters\"\n ensure\n return output\n end\nend", "def upcomment\n comm = Comment.find_by_id(params[:id])\n if !comm.nil?\n comm.vote(current_user, true)\n end\n end", "def comment_count_in_words(object)\n content_tag(:span, (I18n.t(\"{{count}} comment\", :count => object.comments_count)).titleize)\n end", "def total_up_votes\r\n self.song_up_votes.size\r\n end", "def comments_range; end", "def comments_range; end", "def count; end", "def count; end", "def count; end", "def hash_tag_comments(pr)\n ccs = commit_comments(pr)\n prcs = pr_comments(pr)\n ics = issue_comments(pr)\n (ccs + prcs + ics).reduce(0) do |acc, ic|\n unless ic[:body].nil?\n acc + ic[:body].gsub(/`.*?`/, '').\\\n scan(/#([0-9]+)/).size\n else\n acc\n end\n end\n end", "def comment_points\n self.comments.map { |comment| comment.vote_count }.inject(:+)\n end", "def my_counter_function()\n puts(\"Text:\");\n text = gets().chop().downcase; # \"Hallo\"\n puts (\"Buchstabe:\") ;\n letter = gets()[0 ,1].downcase; #wir speichern nur den ersten Buchstaben\n count = count_occurrences(text,letter);\n puts(\"Der Buchstabe '\" + letter + \"' kommt \" + count.to_s() + \" mal vor.\");\nend", "def first_author_publications_cnt()\n self.investigator_abstracts.first_author_abstracts.length\n end", "def downvotes\n notes.select(&:downvote?).size\n end", "def comments_sum\n published_comments_count + draft_comments_count\n end", "def num_commits(lines)\n i = 0\n\tlines.each{|line| \n\t\tif line.include? \"commit\"\n\t\t\ti += 1\n\t\tend\n\t}\n\treturn i\nend", "def upvote_count\n self.up_retweet_count\n end", "def count(summary='', product=\"\", component=\"\")\n url = \"#{@url}/buglist.cgi?product=#{product}&component=#{component}&short_desc=#{CGI.escape(summary)}&short_desc_type=allwordssubstr\"\n @log.debug url\n page = @agent.get(url)\n if page.search(\".//td[@id='error_msg']\").empty?\n @log.debug \"Authenticated successfully\"\n @log.debug page.search(\"//span[@class='bz_result_count']\")[0].content\n count = page.search(\"//table[@class='bz_buglist']/tr\").length\n count -= 1 if count > 0\n return count\n else\n @log.error page.search(\".//td[@id='error_msg']\")[0].content.strip\n end\n return 0\n end", "def test_read_by\n chapter = Chapter.find(17)\n user = User.find(3)\n num_unread = Pcomment.count_by_sql([\"select count(p.id) from pcomments pc, paragraphs p where p.chapter_id = ? and pc.id not in (select prb.pcomment_id from pcomments_read_by prb where prb.user_id = ?) and pc.paragraph_id = p.id\", chapter.id, user.id])\n num_comments = chapter.num_comments\n assert num_unread == (num_comments - 1), \"Should have #{num_comments - 1} unread comments, got #{num_unread} instead\"\n end", "def joke_count # {{{\n\n @log.message :debug, \"Entering count function\"\n\n jokes = Joke.all\n sources = Hash.new\n\n sources[ \"Total\" ] = jokes.length\n sources[ \"Manually Entered\" ] = 0\n\n jokes.each do |j|\n source = j.source\n\n if( source == nil )\n sources[ \"Manually Entered\" ] += 1\n else\n sources[ source ] = 0 if sources[ source ].nil?\n sources[ source ] += 1\n end\n end\n\n sources\n end", "def number\n before.count + 1\n end", "def increment_comment_count\n self.comments_count += 1\n self.save\n end", "def update_comment_cache_counters\n update_attributes!(\n comment_count: comments.length,\n participants_count: watchers_count || ([self]+comments).map { |obj| obj[:author_linked_account_id] || obj[:author_name] }.uniq.length,\n )\n update_thumbs_up_count\n end", "def noun_count\n 20\nend", "def increment_board_comments_counter\n Board.increment_counter(:comments_count, self.post.board.id)\n end", "def total_guess_count()\r\n\t\t# TODO: fill in method body\r\n\t\treturn -1\r\n\tend", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def score\n\t\tupvotes.count\n\tend", "def num_commits(lines)\n numCommits = 0\n lines.each{ |line| numCommits += 1 if line.start_with?(\"commit \") }\n return numCommits\nend", "def get_count\n user_page = Habr::open_page(Habr::Links.userpage(@userslug))\n # get text with favs count\n user_page.css(\".left .count\").first.text.to_i\n end", "def get_count(input)\n input.count('aeiou')\nend", "def count_reviews_of\n @count_reviews_of ||= Review.of(editor).posted_within(self).count\n end", "def count\n @count ||= 0\n @count += 1\n end", "def show_comments(post_num_input)\n puts ''\n puts '----COMMENTS----'\n BLOG[post_num_input].comments.each do |x|\n puts x.username\n puts x.comment\n puts ''\n end\n puts ''\n end", "def num_files_owned_by_user(in_user_name)\n command_string = 'find '+@install_root+' -user '+in_user_name+' | wc -l'\n inspec.bash(command_string).stdout.split(\"\\n\")[0].strip.to_i\n end", "def up_votes\n # we find the up votes for a post by passing value: 1 to where. This fetches a collection of votes with a value of 1. \n # We then call count on the collection to get a total of all up votes.\n votes.where(value: 1).count\n end", "def reviews_count\n\t\treviews.size\n\tend", "def decrement_comments_count\n return unless commented_on_card?\n commentable.update(comments_count: commentable.comments_count - 1)\n end", "def count_item\n count = 0\n @g_net.each do |followers|\n count += 1 unless !followers or followers.empty?\n end\n count\n end", "def cached_comment_count\n Rails.cache.fetch [self, \"comment_count\"] do\n comments.size\n end\n end" ]
[ "0.6960234", "0.69509375", "0.6933406", "0.6806268", "0.66469365", "0.6492806", "0.640031", "0.62952965", "0.62896365", "0.62858915", "0.619988", "0.616674", "0.6156696", "0.6102019", "0.61011696", "0.60990554", "0.60990554", "0.60471517", "0.5991153", "0.5976966", "0.59160787", "0.5876469", "0.5873608", "0.57936734", "0.5765383", "0.57560134", "0.5735352", "0.5730892", "0.5707201", "0.5704653", "0.5701198", "0.5680317", "0.5673444", "0.5667168", "0.5656138", "0.5650562", "0.5637344", "0.56151843", "0.5603579", "0.5575795", "0.55559087", "0.55137765", "0.551377", "0.55127305", "0.55120575", "0.54867476", "0.54867476", "0.54867476", "0.54867476", "0.54867476", "0.5481188", "0.54738736", "0.545999", "0.54572344", "0.5445614", "0.54216075", "0.5410376", "0.5390072", "0.5383345", "0.538095", "0.538095", "0.5378446", "0.5378446", "0.5378446", "0.5376131", "0.53701776", "0.5368145", "0.53525513", "0.53489643", "0.5339712", "0.53370845", "0.5325913", "0.53171366", "0.53154814", "0.53151685", "0.5311104", "0.53102434", "0.53048855", "0.5303148", "0.5302668", "0.5300219", "0.52864367", "0.52864367", "0.52864367", "0.52864367", "0.52864367", "0.52864367", "0.5276517", "0.52706075", "0.52602196", "0.5231915", "0.5231696", "0.52307576", "0.52296686", "0.52295184", "0.5222705", "0.52189296", "0.52171725", "0.5213131", "0.5209302" ]
0.77432495
0
=begin Returns number of downs for a comment Inputs: none Output: int number of downs Author: Menisy =end
def get_num_downs downs = self.comment_up_downs.find_all_by_action(2).size end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_ups\n ups = self.comment_up_downs.find_all_by_action(1).size\n end", "def compute_comment_score(c)\n upcount = (c['up'] ? c['up'].length : 0)\n downcount = (c['down'] ? c['down'].length : 0)\n upcount-downcount\nend", "def compute_comment_score(c)\n upcount = (c['up'] ? c['up'].length : 0)\n downcount = (c['down'] ? c['down'].length : 0)\n upcount-downcount\n end", "def increment_num_comments\n\n end", "def review_comment_downvote_count\n number_of_downvotes = 0\n self.reviews.each do |review|\n votes = Vote.where(votable_type: \"Review\", votable_id: review.id, value: -1).count || 0\n number_of_downvotes += votes\n end\n number_of_downvotes\n end", "def comment_count\n comments.length\n end", "def comment_count number\n pluralizing_count number, 'comment'\n end", "def count_down(num)\n p num;\n count_down(num - 1)\n end", "def number_of_comments\n\t \tcomments.count\n\t end", "def number_comments \n self.comments.count\n end", "def count_down(start)\n\t puts start\n\t if start > 0\n\t count_down(start - 1)\n\t end\n\tend", "def comments_count\n self[:comments_count] || 0\n end", "def comments_count\n self[:comments_count] || 0\n end", "def count_down(num) \n if num == 0\n p \"Houston, we have lift-off!\"\n return;\n end\n\n p num\n count_down(num - 1)\n end", "def down_comment(user)\n upped_before = self.upped_by_user?(user)\n downed_before = self.downed_by_user?(user)\n if !upped_before && !downed_before then #if user never upped or downed the comment then up it\n down = CommentUpDown.new(:action => 2)\n down.comment = self\n down.user = user\n down.save\n down.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for disliking a comment \n if comment.user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n ###################################\n return true\n elsif upped_before then\n self.comment_up_downs.find_by_user_id_and_action(user.id,1).destroy #if user disliked it, now make him like it!\n down = CommentUpDown.new(:action => 2)\n down.comment = self\n down.user = user\n down.save\n down.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for disliking a comment \n if user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n ###################################\n return true\n elsif downed_before\n old_down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) #if downed before then un-down\n old_down.add_to_log(self.user,2)\n old_down.destroy\n return true\n else\n return false\n end\n end", "def comments_count\n @comments_count ||= self.comments.count || 0\n end", "def downvotes\n notes.select(&:downvote?).size\n end", "def count_down(number)\n\tif number <= 0\n\t\tputs number\n\telse \n\t\tputs number\n\t\tnumber -= 1\n\t\tcount_down(number)\n\tend\nend", "def comment_length\n\t120\nend", "def count_of_comment\n Comment.number_of_comment(self)\n end", "def count_comments!\n self.update_attribute(:num_comments, comments.viewable.size)\n end", "def numbered_comments(post_num_input)\n puts ''\n BLOG[post_num_input].comments.each do |x|\n puts \"[#{BLOG[post_num_input].comments.index(x) + 1}] #{x.username} - #{x.comment}\"\n end\n puts ''\n end", "def decrement_comments_count\n return unless commented_on_card?\n commentable.update(comments_count: commentable.comments_count - 1)\n end", "def num_comments\n self.comments.count\n end", "def metadata_comment_count(structure)\n \"#{structure.comments.count} avis\"\n end", "def numComments(actionIdeaID) \n \treturn ActionIdeaComment.where(actionIdeaID =self.action_idea_id).count()\n end", "def down num=1\n # $log.debug \"inside down\"\n num.times do \n if @prow >= get_content().length-1\n #Ncurses.beep\n @message = \"No more rows\"\n return -1\n end\n if @winrow < @scrollatrow # 20\n @winrow += 1 # move cursor down\n else\n @toprow += 1 # scroll down a row\n end\n @prow += 1 # incr pad row\n end\n end", "def count_down(start)\n puts start\n if start > 0\n count_down(start -1)\n end\nend", "def comments_count\n self.comments.count\n end", "def decrement_comment_count \n return if self.post_activity.blank? or self.post_activity.parent.blank? or self.post_activity.parent.direct_activity_object.blank?\n \n self.post_activity.parent.direct_activity_object.decrement!(:comment_count) \n end", "def num_comments(pr_id)\n q = <<-QUERY\n select count(*) as comment_count\n from pull_request_comments prc\n where prc.pull_request_id = ?\n and prc.created_at < (\n select max(created_at)\n from pull_request_history\n where action = 'closed' and pull_request_id = ?)\n QUERY\n if_empty(db.fetch(q, pr_id, pr_id).all, :comment_count)\n end", "def count_down(num)\n\n if num >=0\n puts num\n count_down(num-=1)\n else\n puts \"Complete!\"\n end\n\n\nend", "def count_down(x, y)\n if y - 1 < 0\n return 0\n end\n return $canvas[x][y - 1] == 1 ? 1 : 0\nend", "def count_down(num) \n if num == 0\n p \"Houston, we have lift-off!\"\n return;\n end\n\n p num\n count_down(num - 1)\nend", "def comments_range; end", "def comments_range; end", "def num_pr_comments(pr)\n q = <<-QUERY\n select count(*) as comment_count\n from pull_request_comments prc\n where prc.pull_request_id = ?\n and prc.created_at < (\n select max(created_at)\n from pull_request_history\n where action = 'closed' and pull_request_id = ?)\n QUERY\n db.fetch(q, pr[:id], pr[:id]).first[:comment_count]\n end", "def duns_number; end", "def count_down\n top_card = $deck.first\n top_card = 53 if ['A', 'B'].include? top_card\n chosen_number = $deck[top_card]\n return '' if ['A', 'B'].include? chosen_number\n\n (chosen_number + (chosen_number > 26 ? 38 : 64)).chr\nend", "def comments_word_count\n self.turker_comments.present? ? self.turker_comments.split(/\\s/).length : 0\n end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def uncommented_kassi_event_count\n query1 = \"\n SELECT COUNT(ke.id) - (SELECT COUNT(*) FROM person_comments WHERE author_id = '#{id}')\n FROM kassi_events AS ke, kassi_event_participations AS kep\n WHERE kep.person_id = '#{id}'\n AND kep.kassi_event_id = ke.id\n \"\n KassiEvent.count_by_sql(query1)\n end", "def counting\n puts \"hard to do right\"\n end", "def downcomment\n comm = Comment.find_by_id(params[:id])\n if !comm.nil?\n comm.vote(current_user, false)\n end\n end", "def number_closed(file)\n numClosed = 0;\n line = file.gets\n if line == nil then return end\n # read additional lines\n while line = file.gets do\n # begins with \"path\", must be path specification\n if line[0...4] != \"path\" \n if (!(line.include? \"u\") && !(line.include? \"d\") &&\n !(line.include? \"l\") && !(line.include? \"r\"))\n numClosed += 1;\n end\n end\n end\n puts \"#{numClosed}\"\nend", "def parse_comment_body(comment_body)\n net_pluses = comment_body.scan(PLUS_ONE_COMMENT).count\n net_pluses = net_pluses - comment_body.scan(NEG_ONE_COMMENT).count\n\n if net_pluses > 0\n net_pluses = 1\n elsif net_pluses < 0\n net_pluses = -1\n end\n\n return net_pluses\n end", "def increment_comments_count\n return unless commented_on_card?\n commentable.update(comments_count: commentable.comments_count + 1)\n end", "def count_down(val)\n if val < 0\n puts 'All done!'\n else\n puts val\n val -= 1\n count_down(val)\n end\nend", "def up_comment(user)\n upped_before = self.upped_by_user?(user)\n downed_before = self.downed_by_user?(user)\n if !upped_before && !downed_before then #if user never upped or downed the comment then up it\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif downed_before then\n self.comment_up_downs.find_by_user_id_and_action(user.id,2).destroy #if user disliked it, now make him like it!\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if comment.user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif upped_before\n old_up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # if upped before, then un-up\n old_up.add_to_log(self.user,2)\n old_up.destroy\n return true\n else\n return false\n end \n end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comment_threshold\n 40\n end", "def CommentCount\n return Comment.where(:user_id => id).count\n end", "def num_commit_comments(pr)\n q = <<-QUERY\n select count(*) as commit_comment_count\n from pull_request_commits prc, commit_comments cc\n where prc.commit_id = cc.commit_id\n and prc.pull_request_id = ?\n QUERY\n db.fetch(q, pr[:id]).first[:commit_comment_count]\n end", "def cached_comment_count\n Rails.cache.fetch [self, \"comment_count\"] do\n comments.size\n end\n end", "def review_comment_count\n self.reviews.map { |review| review.comments.count }.inject(:+)\n end", "def comment_lines(arr)\n output = 0\n begin\n i = 0\n while i < arr.length\n if arr[i] == \"#\\n\"\n output += 1\n else\n j = 0\n temp_holder = arr[i]\n while j < temp_holder.length\n if temp_holder[j] == \"#\"\n output += 1\n break\n elsif temp_holder[j] != \" \"\n break\n end\n j += 1\n end\n end\n i += 1\n end\n rescue NameError\n p \"No variable with this name\"\n rescue TypeError\n p \"String was not converted into integer\"\n rescue IndexError\n p \"Index was not inside the paramaters\"\n ensure\n return output\n end\nend", "def num_issue_comments(pr)\n q = <<-QUERY\n select count(*) as issue_comment_count\n from pull_requests pr, issue_comments ic, issues i\n where ic.issue_id=i.id\n and i.issue_id=pr.pullreq_id\n and pr.base_repo_id = i.repo_id\n and pr.id = ?\n and ic.created_at < (\n select max(created_at)\n from pull_request_history\n where action = 'closed' and pull_request_id = ?)\n QUERY\n db.fetch(q, pr[:id], pr[:id]).first[:issue_comment_count]\n end", "def increment_board_comments_counter\n Board.increment_counter(:comments_count, self.post.board.id)\n end", "def downvotes_size\n\t\treviews.where(satisfied: false).size\n\tend", "def number\n before.count + 1\n end", "def half_page_down() [\"moveDown:\"] * 6 * @number_prefix end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def down_votes_count(voting_field = \"votes\")\n eval(voting_field).try(:[], 'down_count') || 0\n end", "def downvotes_count\n topic_votes.where(value: -1).sum(:value) * -1\n end", "def hottest_comment\n unless comments.empty?\n comments.map{|c| [c,c.votes.count]}.sort{|x,y| y[1] <=> x[1]}.first[0]\n end\nend", "def increment_comment_count\n self.comments_count += 1\n self.save\n end", "def count_up(x, y)\n if y + 1 >= $height\n return 0\n end\n return $canvas[x][y + 1] == 1 ? 1 : 0\nend", "def downvote(link_or_comment)\n vote link_or_comment, -1\n end", "def comment_points\n self.comments.map { |comment| comment.vote_count }.inject(:+)\n end", "def comments_range=(_arg0); end", "def review_comment_vote_count\n number_of_votes = 0\n self.reviews.each do |review|\n review.comments.each do |comment|\n number_of_votes += comment.votes.count\n end\n end\n number_of_votes\n end", "def show_comments(post_num_input)\n puts ''\n puts '----COMMENTS----'\n BLOG[post_num_input].comments.each do |x|\n puts x.username\n puts x.comment\n puts ''\n end\n puts ''\n end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end" ]
[ "0.7143779", "0.70730305", "0.7051696", "0.68160594", "0.6667954", "0.6358727", "0.62098014", "0.6004241", "0.59985244", "0.5978681", "0.59504306", "0.59256", "0.59256", "0.5914564", "0.58918214", "0.5891177", "0.5890678", "0.58732986", "0.58191663", "0.5803583", "0.57873106", "0.5774959", "0.5767532", "0.5764918", "0.5753471", "0.57523644", "0.57219255", "0.5694779", "0.56676877", "0.56576514", "0.56406075", "0.5629019", "0.56206745", "0.5603393", "0.5596814", "0.5596814", "0.5596367", "0.5556565", "0.55240864", "0.5508746", "0.54468936", "0.54468936", "0.54468936", "0.54468936", "0.54468936", "0.54468936", "0.54251355", "0.5416553", "0.5404197", "0.5376062", "0.5368596", "0.53491825", "0.53384274", "0.5337291", "0.532898", "0.532898", "0.532898", "0.532898", "0.532898", "0.532841", "0.5322384", "0.53197795", "0.531559", "0.5313462", "0.53036165", "0.5284324", "0.52788436", "0.52767867", "0.5246504", "0.522727", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5226648", "0.5213859", "0.52133715", "0.519977", "0.5192961", "0.5192923", "0.5184001", "0.51745355", "0.51672894", "0.5152231", "0.5121753", "0.5121528", "0.5121528", "0.5121528" ]
0.78357047
0
=begin Ups a comment. Input: user who is upping the comment. Output: boolean indicating success or failure Author: Menisy =end
def up_comment(user) upped_before = self.upped_by_user?(user) downed_before = self.downed_by_user?(user) if !upped_before && !downed_before then #if user never upped or downed the comment then up it up = CommentUpDown.new(:action => 1) up.comment = self up.user = user up.save up.add_to_log(self.user) #Author: Omar #adding the notification to the database for liking a comment if user != self.user UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true) self.user.notifications = self.user.notifications.to_i + 1 self.user.save end ############################# return true elsif downed_before then self.comment_up_downs.find_by_user_id_and_action(user.id,2).destroy #if user disliked it, now make him like it! up = CommentUpDown.new(:action => 1) up.comment = self up.user = user up.save up.add_to_log(self.user) #Author: Omar #adding the notification to the database for liking a comment if comment.user != self.user UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true) self.user.notifications = self.user.notifications.to_i + 1 self.user.save end ############################# return true elsif upped_before old_up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # if upped before, then un-up old_up.add_to_log(self.user,2) old_up.destroy return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upped_by_user?(user)\n up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # get the up that a user gave to this comment before \"if exists\"\n !up.nil? # if up is nil then return false if not then return true\n end", "def upcomment\n comm = Comment.find_by_id(params[:id])\n if !comm.nil?\n comm.vote(current_user, true)\n end\n end", "def comment?; end", "def comment?; end", "def update?\n\t\t@comment.user == @user\n\tend", "def test04_FlagNoteComment\n\t\tcommentNotePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_success.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPS04T04: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def allow_comment?(user) \n # for now, we allow everyone\n return true \n end", "def already_commented_by_user?(the_user)\n !self.comments.where([\"user_id = ?\", the_user.id]).empty?\n end", "def comment_finished?\n\t\t\n\tend", "def downed_by_user?(user)\n down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) # get the down that a user gave to this comment before \"if exists\"\n !down.nil? # if down is nil then return false if not then return true\n end", "def auto_approve?\n return user.auto_approve_comment?\n end", "def test05_FlagArticleComment\n\t\tcommentArticlePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_success.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPS04T05: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def allows_comment?(a_person=nil)\n self.alive?\n end", "def down_comment(user)\n upped_before = self.upped_by_user?(user)\n downed_before = self.downed_by_user?(user)\n if !upped_before && !downed_before then #if user never upped or downed the comment then up it\n down = CommentUpDown.new(:action => 2)\n down.comment = self\n down.user = user\n down.save\n down.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for disliking a comment \n if comment.user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n ###################################\n return true\n elsif upped_before then\n self.comment_up_downs.find_by_user_id_and_action(user.id,1).destroy #if user disliked it, now make him like it!\n down = CommentUpDown.new(:action => 2)\n down.comment = self\n down.user = user\n down.save\n down.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for disliking a comment \n if user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n ###################################\n return true\n elsif downed_before\n old_down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) #if downed before then un-down\n old_down.add_to_log(self.user,2)\n old_down.destroy\n return true\n else\n return false\n end\n end", "def write_comment\n\t\t# determing whos who\n\t\t@user = current_user\n\t\t@commentee = User.find(params[:commentee_id])\n\n\t\t# if the comment is not blank\n\t\tif !(params[:description] == \"\")\n\t\t\t# create new comment for the commentee\n\t\t @comment = UserComment.new(:user_id => @user.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t :commentee_id => params[:commentee_id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t :description => params[:description] )\n\t\t @comment.save\n\t\tend\n\t\tredirect_to :action => 'profile', :username => @commentee.login\n\tend", "def user_input\n print \"Say your thang\"\n user_comment = get.chomp.downcase\nend", "def new_comment(rep, c_u, content)\n @current_user = c_u\n @content = content\n @rep = rep\n mail to: rep.user.email, subject: \"Ripetizione per '#{rep.course.name}'\"\n end", "def comment_moderation(user_id, comment_id, url_title, response)\n @user = User.find(user_id)\n @utitle = url_title\n @comment = Comment.find(comment_id)\n\n mail :to => recipient(@user.email), :subject => \"25c Testimonial Notification for #{@utitle}\"\n end", "def user_comment?(user_id)\n @current_user.id == user_id\n end", "def trigger_comment(comment) end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def is_human?(params, comment)\n if !logged_in?\n if params[:signup_check].nil? || params[:signup_check].length > 0\n comment.errors.add(:base, \"Are you really human??\")\n return false\n end\n end\n return true\n end", "def add_comment\n if current_user.id.to_s == params[:user_id].to_s\n comment = Comment.new(:user_id => params[:user_id], :post_id => params[:post_id],\\\n :content => params[:content], :upvotes => 0, :downvotes => 0, :rank => 0)\n comment.save!\n end\n end", "def comment comment\n end", "def test03_flag_repost_event_TC_24323\n\t\trepostEventPop\n\t\tsleep 2\n\t\trepost\n\t\tcommentFlag\n\t\tsleep 2\n\t\t\n\t\tbegin\n\t\tassert $browser.text.include?(\"Comment\")\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"R8_T3: FAILED! User unable to flag post.\"\n\t\tend\n\tend", "def new_unmoderated_comment(user_id, comment_id, url_title)\n @user = User.find(user_id)\n @utitle = url_title\n @comment = Comment.find(comment_id)\n\n mail :to => recipient(@user.email), :subject => \"New 25c Testimonial Note for #{@utitle}\"\n end", "def test02_flag_repost_article_TC_24323\n\t\trepostArticlePop\n\t\tsleep 2\n\t\trepost\n\t\tcommentFlag\n\t\tsleep 2\n\t\t\n\t\tbegin\n\t\tassert $browser.text.include?(\"Comment\")\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"R8_T2: FAILED! User unable to flag post.\"\n\t\tend\n\tend", "def update_comment(post_num_input)\n puts \"WARNING: This will erase your entire previous comment text.\"\n puts \"Would you still like to update it? 'y' or 'n'\"\n input = gets.chomp\n if input == \"n\"\n puts ''\n puts \"Comment unchanged\"\n puts ''\n elsif input == \"y\"\n numbered_comments(post_num_input)\n puts \"Which comment would you like to update? (Type the corresponding number)\"\n comment_choice = gets.chomp.to_i\n array_number = comment_choice - 1\n puts \"Type in your username.\"\n username = gets.chomp.downcase\n puts \"Go ahead a write an updated comment.\"\n updated_comment = gets.chomp\n BLOG[post_num_input].comments[array_number].username = username\n BLOG[post_num_input].comments[array_number].comment = updated_comment\n puts \"Your comment has been updated!\"\n show_comments(post_num_input)\n else\n puts \"\\n\" + ERROR_MESSAGE\n puts ''\n end\n end", "def test05_post_open_news_FlagNoteComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentFlag\n\t\tsleep 1\n\t\tassert $comment_flag_success.exists?\n\tend", "def verify_comment(line) \n end", "def comment_affirmative?(comment)\n !!(comment =~ /(^lgtm$)|(^:\\+1:\\s+$)|(^:ok:\\s+$)|(^looks\\s+good(?:\\s+to\\s+me)?$)|(^:shipit:\\s+$)|(^:rocket:\\s+$)|(^:100:\\s+$)/i)\n end", "def update\n @comment = Comment.find(params[:id])\n\n properly_owned = (current_user == @comment.user)\n\n flash[:error] = \"Must be author of a comment to update it.\" unless properly_owned\n\n respond_to do |format|\n if properly_owned and @comment.update_attributes(params[:comment])\n flash[:notice] = 'Comment was successfully updated.'\n format.html { redirect_to(@comment) }\n format.xml { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end", "def checkData(iUserID, iComment)\n # Nothing to test\n end", "def add_comment(comment); end", "def test_02_comment_on_post_as_guest\n end", "def rude_comment\n @res.write GO_AWAY_COMMENT\n end", "def comment args #id, comment\n id = args.shift\n unless id\n id = ask(\"Issue Id? \", Integer)\n end\n db, row = validate_id id, true\n die \"No issue found for #{id}\" unless row\n if !args.empty?\n comment = args.join(\" \")\n else\n message \"Enter a comment (. to exit): \"\n comment = Cmdapp.get_lines\n end\n die \"Operation cancelled\" if comment.nil? or comment.empty?\n message \"Comment is: #{comment}.\"\n message \"Adding comment to #{id}: #{row['title']}\"\n _comment db, id, comment\n 0\n end", "def test_ID_25863_comment_on_review()\n login_as_user1\n read_all_updates\n share_review(\"outside-in\")\n logout_common\n login_as_user2\n leave_comment_on_share_review_group(\"outside-in\")\n logout_common\n login_as_user1\n verify_updates\n end", "def test02_FlagEventComment_TC_24319\n\t\tcommentEventPop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_success.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPS05T02: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def prevent_commenting?\n prevent_commenting_until? && prevent_commenting_until > Time.current\n end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment_line?(line_source); end", "def comment_line?(line_source); end", "def comment_vote_up\n comment = Comment.find(params[:id])\n\n if(!valid_request? comment, :back, false)\n return\n end\n\n v = VotesComment.new(:comment_id => comment.id, :user_id => current_user.id)\n\n respond_to do |format|\n if v.save\n format.html { redirect_to :back, notice: 'Vote Up successful' }\n format.json { render json: :back, status: :created, location: v }\n else\n format.html { render action: \"vote up\" }\n format.json { render json: v.errors, status: :unprocessable_entity }\n end\n end\n end", "def associate_comment_with_user_at_sign_in_up\n if session[:comment_tracking_number].present?\n comment = Comment.where(\n :user_id => nil,\n :comment_tracking_number => session[:comment_tracking_number]\n ).first\n else\n comment = Comment.where(\n :user_id => nil,\n :submission_key => session[:submission_key]\n ).first\n end\n\n if comment\n comment.user_id = current_user.id\n comment.secret = session[:comment_secret]\n comment.comment_publication_notification = session[:comment_publication_notification]\n\n comment.build_subscription(current_user, request)\n\n comment.save :validate => false\n\n if comment.user_id\n CommentMailer.comment_copy(\n User.new(\"id\" => current_user.id, \"email\" => current_user.email),\n comment\n ).deliver_now\n end\n end\n\n redirect_location = comments_path\n\n if comment.nil?\n if session[:comment_tracking_number].present?\n comment = Comment.where(\n :comment_tracking_number => session[:comment_tracking_number]\n ).first\n else\n comment = Comment.where(\n :submission_key => session[:submission_key]\n ).first\n end\n\n if comment.blank? || (comment.user_id.blank? || comment.subscription.blank?)\n Honeybadger.notify(\n error_class: \"UnexpectedSessionCommentData\",\n error_message: \"Unknown data stored in session\",\n context: {\n comment_tracking_number: session[:comment_tracking_number],\n comment_secret: session[:comment_secret],\n comment_publication_notification: session[:comment_publication_notification],\n submission_key: session[:submission_key],\n followup_document_notification: session[:followup_document_notification],\n }\n )\n end\n message = {}\n elsif session[:followup_document_notification] == '1' && !current_user.confirmed?\n message = {:warning => \"Successfully added your comment on '#{comment.document.title}' to your account, but you will not receive notification about followup documents until you have confirmed your email address. #{view_context.link_to 'Resend confirmation email', resend_confirmation_path}.\"}\n else\n message = {:notice => \"Successfully added your comment on '#{comment.document.title}' to your account.\"}\n end\n\n # clean up\n unless comment.nil?\n session[:comment_tracking_number] = nil\n session[:comment_secret] = nil\n session[:comment_publication_notification] = nil\n session[:submission_key] = nil\n session[:followup_document_notification] = nil\n end\n\n return message, redirect_location\n end", "def test05_post_closed_news_FlagNoteComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentFlag\n\t\tsleep 1\n\t\tassert $comment_flag_success.exists?\n\tend", "def add_comment(post_num_input)\n puts \"Type in a username.\"\n username = gets.chomp\n puts \"Type your comment\"\n comment = gets.chomp\n BLOG[post_num_input].comments << Comment.new(username,comment)\n puts \"Thank you #{username}! Your comment has been added to \" +\n \"\\\"#{BLOG[post_num_input].title}\\\"!\"\n show_comments(post_num_input)\n end", "def test03_CancelFlagNoteComment_TC_24319\n\t\tcommentNotePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentCancelFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_link.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPS05T03: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def on_comment(comment)\n STDOUT << \"on_comment\" << \"\\n\" <<\n \" comment: \" << comment << \"\\n\"\n STDOUT.flush\n end", "def add_comment\n data = request.subset(:post_id, :username, :comment)\n comment = Comment.new\n\n # If the user is logged in the user_id field should be set instead of the\n # username field.\n if logged_in?\n data.delete('username')\n data['user_id'] = user.id\n end\n\n begin\n comment.update(data)\n flash[:success] = 'The comment has been added'\n rescue => e\n Ramaze::Log.error(e)\n\n flash[:form_errors] = comment.errors\n flash[:error] = 'The comment could not be added'\n end\n\n redirect_referrer\n end", "def comment_added(comment)\n @place = comment.place # pulling from db\n @place_owner = @place.user # pulling specific owner of comment from db\n # Would be mail(to: @place_owner.email, ...) if owner of comment to receive msg\n mail(to: 'webdev.throwaway@gmail.com',\n subject: \"A comment was added to #{@place.name}\")\n end", "def comment_begins?\n\t\t\n\tend", "def test_ID_25863_comment_on_review()\n login $user_1_email, $master_password\n read_all_updates\n \n $browser.goto(\"http://flatiron.#{$environment}.patch.com/listings/yelp\")\n $share_review_text_field.when_present().click\n $post_compose_review.when_present().set (\"Automated review text #{random}\")\n $group_post_button.when_present().click\n\n logout_common\n login $user_1_email, $master_password\n $browser.goto(\"http://flatiron.#{$environment}.i.patch.com/listings/yelp\")\n $comment_icon.click\n sleep 3\n $leave_comment_textfield.set \"Automated comment text #{random}\"\n $group_post_comment.click\n logout_common\n login $user_1_email, $master_password\n verify_updates\n end", "def comment_owner\n unless current_user.id == @comment.user.id\n flash[:notice] = \"You don't have access to that!\"\n redirect_to @post\n end\n \n end", "def create\n # If user signed in, link comment to user\n if user_signed_in? \n params[:comment][:user_id] = current_user.id\n else\n if @conf.anonymous_comment == false\n redirect_to request.referer, notice: t('You must be logged in to comment')\n return \n end\n # Add http if not present (for anonymous)\n if !params[:comment][:anonymous_url].match /^http:\\/\\//i\n params[:comment][:anonymous_url].insert(0, \"http://\")\n end\n end\n \n # Persist flash variable\n flash[:old_back] = flash[:old_back]\n\n params[:comment][:content] = params[:comment][:content].gsub(/\\n/, '<br>')\n \n @comment = Comment.new(params[:comment])\n \n if USER_REPUTATION == true and @conf.anonymous_comment == false\n article = Article.find(params[:comment][:article_id], :include => 'user')\n if current_user.id != article.user.id\n user = article.user\n user.reputation += REPUTATION_COMMENT\n user.save\n end\n end\n \n respond_to do |format|\n if @comment.save\n format.html { redirect_to request.referer, notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def can_see_comment?(comment); comment.user.admin?; end", "def update\n @comment = Comment.find(params[:id])\n @comment_indent = params[:indent].to_i\n @page = @comment.page\n\n if @comment.user != current_user\n render(:text => \"You can't edit other people's comments\")\n return false\n end\n\n if !@comment.update_attributes(params[:comment])\n render(:text => \"You can't edit other people's comments\")\n return false\n end\n end", "def test02_CommentOnBoardHomepage\n\t\t@msg = \"Homepage Boards Comment #{random}\"\n\t\tlogin $user_1_email, $master_password\n\n\t\twait_for_ajax\n sleep 3\n $comment_hp_board_comment.click #click Comment for Featured article\n sleep 3\n $comment_textfield.set @msg\n sleep 3\n $comment_submit.click\n sleep 3\n assert $browser.text.include?(@msg)\n\tend", "def comment\n\t Hookup.where(:user_id => params[:user_id], :challenge_id => params[:challenge_id]).update_attribute(:u,:c)\n end", "def test_ID_25866_comment_on_post_you_wrote()\n login_as_user1\n post_to_any_group(\"Sports\",\"Basketball\")\n logout_common\n login_as_user2\n leave_a_comment_on_any_group(\"Sports\",\"Basketball\")\n logout_common\n login_as_user1\n verify_updates()\n end", "def comments?\n !!user && user.admin?\n end", "def add_comment\n @issue.comment @user_message.empty? ? @message : @user_message\n end", "def update_comment\n get_comment\n @pcp_item = @pcp_comment.pcp_item\n @pcp_subject = @pcp_item.pcp_subject\n @pcp_step = @pcp_subject.current_step\n if @pcp_step.status_closed?\n render_bad_logic t( 'pcp_items.msg.subj_closed')\n return\n end\n if user_has_permission?( :to_update ) then\n respond_to do |format|\n if @pcp_comment.update( pcp_comment_params )\n format.html { redirect_to @pcp_comment.pcp_item, notice: t( 'pcp_comments.msg.edit_ok' )}\n else\n format.html { render :edit_comment }\n end\n end\n else\n render_no_permission\n end\n end", "def watch_comment_status_by_user_id(user_id)\n action = watch_comment_by_user_actions.where(\"user_type = 'User' and user_id = ?\", user_id).take\n return action.action_option == \"ignore\" ? \"ignore\" : \"watch\" if action\n\n repo_action = repository.watch_by_user_actions.where(\"user_type = 'User' and user_id = ?\", user_id).take\n return \"watch\" if repo_action\n \"unwatch\"\n end", "def allow_comments?\n case @comments\n when :guess\n @prompt && !@prompt.empty? && !end_chars.include?('#')\n else\n @comments\n end\n end", "def autocorrect_preceding_comments(corrector, comment); end", "def create\n signup = FindSignup.by_id params[:signup_id].to_i\n\n if signup\n CommentOnSignup.new(current_user, signup).run(params[:comment][:comment])\n redirect_to raid_path(signup.raid)\n else\n redirect_to root_path\n end\n end", "def notifies_commenter? # ...of direct responses to this comment\n wants_notifications?\n end", "def validate_update(comment)\n true\n end", "def update\n user = cookies[\"user_id\"]\n comment = Comment.find_by(\"id\" => params[\"id\"])\n comment.update(\"summary\" => params[\"summary\"], \"project_id\" => params[\"project_id\"], \"user_id\" => user)\n redirect_to \"/projects\", :notice => \"Comment Updated\"\n end", "def comment_fun(y_or_n, post_num_input)\n if y_or_n == 'y'\n puts \"\\nWould you like to...\"\n puts \"[1] add a comment\"\n puts \"[2] delete a comment\"\n puts \"[3] update a comment\"\n choice = gets.chomp\n case choice\n when \"1\"\n add_comment(post_num_input)\n when \"2\"\n delete_comment(post_num_input)\n when \"3\"\n update_comment(post_num_input)\n else\n puts ERROR_MESSAGE\n end\n elsif y_or_n == 'n'\n puts \"\\n nothing changed\"\n puts ''\n else\n puts ERROR_MESSAGE\n end\n end", "def correct_user\n \t\t@comment = Comment.find(params[:post_id])\n \t\tredirect_to request.referrer || root_url unless current_user?(@comment.user)\n \tend", "def check(params={})\n call 'comment-check', params\n end", "def correct_user\n comment = Comment.find(params[:id])\n message = 'You may only edit your own comments.'\n unless current_user?(comment.user)\n redirect_to(context_url(context), alert: message)\n end\n end", "def insert_comment(news_id,user_id,comment_id,parent_id,body)\n news = get_news_by_id(news_id)\n return false if !news\n if comment_id == -1\n if parent_id.to_i != -1\n p = Comments.fetch(news_id,parent_id)\n return false if !p\n end\n comment = {\"score\" => 0,\n \"body\" => body,\n \"parent_id\" => parent_id,\n \"user_id\" => user_id,\n \"ctime\" => Time.now.to_i,\n \"up\" => [user_id.to_i] };\n comment_id = Comments.insert(news_id,comment)\n return false if !comment_id\n $r.hincrby(\"news:#{news_id}\",\"comments\",1);\n $r.zadd(\"user.comments:#{user_id}\",\n Time.now.to_i,\n news_id.to_s+\"-\"+comment_id.to_s);\n if p and $r.exists(\"user:#{p['user_id']}\")\n $r.hincrby(\"user:#{p['user_id']}\",\"replies\",1)\n end\n return {\n \"news_id\" => news_id,\n \"comment_id\" => comment_id,\n \"op\" => \"insert\"\n }\n end\n\n # If we reached this point the next step is either to update or\n # delete the comment. So we make sure the user_id of the request\n # matches the user_id of the comment.\n # We also make sure the user is in time for an edit operation.\n c = Comments.fetch(news_id,comment_id)\n return false if !c or c['user_id'].to_i != user_id.to_i\n return false if !(c['ctime'].to_i > (Time.now.to_i - CommentEditTime))\n\n if body.length == 0\n return false if !Comments.del_comment(news_id,comment_id)\n $r.hincrby(\"news:#{news_id}\",\"comments\",-1);\n return {\n \"news_id\" => news_id,\n \"comment_id\" => comment_id,\n \"op\" => \"delete\"\n }\n else\n update = {\"body\" => body}\n update = {\"del\" => 0} if c['del'].to_i == 1\n return false if !Comments.edit(news_id,comment_id,update)\n return {\n \"news_id\" => news_id,\n \"comment_id\" => comment_id,\n \"op\" => \"update\"\n }\n end\nend", "def accept_comments?\n !locked?\n end", "def upvote?\n note.start_with?('+1') || note.start_with?(':+1:')\n end", "def reply_bang\n user_bang = UserBang.find_by(id: params[:id])\n raise Bang::Error::InvalidUserBang\\\n if !user_bang.present?\\\n || user_bang.user_id != current_user.id\\\n || user_bang.has_replied?\n\n user_bang.status = UserBang.status_from_string(params[:status])\n if user_bang.accept?\n create_conversation [user_bang.user_id, user_bang.from_user_id], :user_bang\n end\n user_bang.save!\n @user_bang = user_bang\n end", "def test05_post_closed_board_FlagNoteComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_closed_note)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentFlag\n\t\tsleep 1\n\t\t\n\t\tassert $comment_flag_success.exists?\n\tend", "def comment=(_arg0); end", "def comment=(_arg0); end" ]
[ "0.64954954", "0.61798835", "0.61450386", "0.61450386", "0.6125262", "0.5901997", "0.59014744", "0.5804496", "0.5791708", "0.5778875", "0.57758504", "0.57027066", "0.56988496", "0.5698222", "0.56838405", "0.56787574", "0.56494707", "0.56389534", "0.56368935", "0.5634246", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56104577", "0.56080973", "0.5599343", "0.55986136", "0.55975187", "0.5587044", "0.5586487", "0.5584624", "0.5575355", "0.5569266", "0.5552585", "0.55515885", "0.55214626", "0.55025107", "0.54630136", "0.5460067", "0.5459776", "0.5452559", "0.54465413", "0.5439656", "0.54371345", "0.54371345", "0.54371345", "0.54371345", "0.5433949", "0.5433949", "0.54328656", "0.54243183", "0.5416856", "0.540099", "0.5395361", "0.538747", "0.5384526", "0.5352861", "0.53487515", "0.53446823", "0.53401566", "0.53327626", "0.53316057", "0.5324592", "0.5321789", "0.5314497", "0.53106284", "0.5306416", "0.5296185", "0.5295894", "0.5293985", "0.52935433", "0.52900326", "0.5288763", "0.5284679", "0.5277604", "0.5273591", "0.5273494", "0.52511096", "0.52473205", "0.52449405", "0.52422905", "0.523347", "0.52317536", "0.52153695", "0.52146256", "0.5213626", "0.5213626" ]
0.63475513
1
=begin Downs a comment. Input: user who is downing the comment. Output: boolean indicating success or failure Author: Menisy =end
def down_comment(user) upped_before = self.upped_by_user?(user) downed_before = self.downed_by_user?(user) if !upped_before && !downed_before then #if user never upped or downed the comment then up it down = CommentUpDown.new(:action => 2) down.comment = self down.user = user down.save down.add_to_log(self.user) #Author: Omar #adding the notification to the database for disliking a comment if comment.user != self.user UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true) self.user.notifications = self.user.notifications.to_i + 1 self.user.save end ################################### return true elsif upped_before then self.comment_up_downs.find_by_user_id_and_action(user.id,1).destroy #if user disliked it, now make him like it! down = CommentUpDown.new(:action => 2) down.comment = self down.user = user down.save down.add_to_log(self.user) #Author: Omar #adding the notification to the database for disliking a comment if user != self.user UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:6 , new:true) self.user.notifications = self.user.notifications.to_i + 1 self.user.save end ################################### return true elsif downed_before old_down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) #if downed before then un-down old_down.add_to_log(self.user,2) old_down.destroy return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def downed_by_user?(user)\n down = self.comment_up_downs.find_by_user_id_and_action(user.id,2) # get the down that a user gave to this comment before \"if exists\"\n !down.nil? # if down is nil then return false if not then return true\n end", "def downcomment\n comm = Comment.find_by_id(params[:id])\n if !comm.nil?\n comm.vote(current_user, false)\n end\n end", "def up_comment(user)\n upped_before = self.upped_by_user?(user)\n downed_before = self.downed_by_user?(user)\n if !upped_before && !downed_before then #if user never upped or downed the comment then up it\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif downed_before then\n self.comment_up_downs.find_by_user_id_and_action(user.id,2).destroy #if user disliked it, now make him like it!\n up = CommentUpDown.new(:action => 1)\n up.comment = self\n up.user = user\n up.save\n up.add_to_log(self.user)\n #Author: Omar\n #adding the notification to the database for liking a comment \n if comment.user != self.user\n UserNotification.create(owner:self.user_id , user:user.id, story:self.story_id , comment:self.id , notify_type:5 , new:true)\n self.user.notifications = self.user.notifications.to_i + 1\n self.user.save\n end\n #############################\n return true\n elsif upped_before\n old_up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # if upped before, then un-up\n old_up.add_to_log(self.user,2)\n old_up.destroy\n return true\n else\n return false\n end \n end", "def upped_by_user?(user)\n up = self.comment_up_downs.find_by_user_id_and_action(user.id,1) # get the up that a user gave to this comment before \"if exists\"\n !up.nil? # if up is nil then return false if not then return true\n end", "def step_down\n @member = Member.find_by(band_id: params[:id], user_id: params[:user_id])\n @member.update!(is_admin: false)\n\n flash[:success] = \"You have stepped down as an admin.\"\n\n redirect_to band_url(params[:id])\n end", "def want_down?\n pid && @raw[3] == 'd'\n end", "def check_down; end", "def downvote\n @comment = Comment.find_by(id: params[:id])\n # Vote.find_or_create_by(downvote: 1, post: @post, user: @current_user)\n Vote.find_or_create_by(downvote: 1, comment: @comment, user: @current_user)\n check_score()\n make_request()\n end", "def downvote(link_or_comment)\n vote link_or_comment, -1\n end", "def down?\n !!@down_at\n end", "def down?\n !(up?)\n end", "def down?\n !(up?)\n end", "def double_down()\r\n if(@curplayer.nummoves > 0)\r\n return false\r\n end\r\n if(@curplayer.money - @curplayer.curBet >= 0)\r\n money = @curplayer.curBet\r\n @curplayer.curBet += money\r\n @curplayer.money -= money\r\n hit()\r\n return true\r\n else\r\n return false\r\n end\r\n end", "def downvote?\n note.start_with?('-1') || note.start_with?(':-1:')\n end", "def is_deletable?(user)\n user.is_admin? || (self.comments.blank? && self.user_discussions.first.user.id == user.id)\n end", "def down?(type, name)\n check(type, name, :down)\n end", "def test05_post_closed_board_FlagNoteComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_closed_note)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentFlag\n\t\tsleep 1\n\t\t\n\t\tassert $comment_flag_success.exists?\n\tend", "def test02_post_closed_board_CancelDeleteNoteOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_closed_note)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t\n\t\tassert $comment_delete_link.exists?\n\tend", "def down?\n @last_status == :down\n end", "def down?\n direction == DOWN\n end", "def down\n help = [\n '',\n \"Use: #{me} down\",\n '',\n \"Stops and removes docker containers created with 'up'\",\n ]\n\n if ARGV[1] == '--help'\n show help\n exit succeeded\n end\n\n unless ARGV[1].nil?\n STDERR.puts \"FAILED: unknown argument [#{ARGV[1]}]\"\n exit failed\n end\n # cyber-dojo.sh does actual [down]\nend", "def user_decline(user_id, comment = nil)\n trade_lines.each { |x| x.user_from_accepted = false }\n trade_lines.each { |x| x.save }\n if comment\n note = trade_notes.build\n note.comment = comment\n note.user_id = user_id\n note.note_type = \"cancel\"\n note.save\n end\n end", "def test05_post_closed_news_FlagNoteComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentFlag\n\t\tsleep 1\n\t\tassert $comment_flag_success.exists?\n\tend", "def comment?; end", "def comment?; end", "def upcomment\n comm = Comment.find_by_id(params[:id])\n if !comm.nil?\n comm.vote(current_user, true)\n end\n end", "def test02_post_closed_news_CancelDeleteNoteOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_note)\n\t\t\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t\n\t\tassert $comment_delete_link.exists?\n\tend", "def downvote\n\t\t@comment = Comment.find(params[:id])\n\t\t@comment.downvote_by current_user\n\t\t\n\t\trespond_to do |format|\n\t format.html { redirect_back(fallback_location: root_path) }\n\t format.js\n\t end\n\tend", "def prevent_commenting?\n prevent_commenting_until? && prevent_commenting_until > Time.current\n end", "def test03_post_closed_board_CancelDeleteArticleOneComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_closed_article)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t\n\t\tassert $comment_delete_link.exists?\n\tend", "def down\n help = [\n '',\n \"Use: #{me} down\",\n '',\n \"Stops and removes docker containers created with 'up'\",\n ]\n if ['help','--help'].include? ARGV[1]\n show help\n exit failed\n end\n # TODO: check for unknown args\n # cyber-dojo.sh does actual [down]\nend", "def test03_post_open_board_CloseFlagArticleDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_article)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\tsleep 1\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend", "def test02_post_open_board_CloseFlagNoteDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\tsleep 1\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend", "def unsubscribe_from_comments user\n subscription = find_or_build_comment_subscription user\n subscription.subscribed = false\n subscription.save!\n end", "def test02_post_closed_blog_CancelFlagArticleComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_post_closed_article)\n\t\t\n\t\tsleep 4\n\t\tcommentCancelFlag\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend", "def test03_post_closed_news_CloseFlagArticleDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_article)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\tsleep 1\n\t\t \n\t\tassert $comment_flag_link.exists?\n\tend", "def double_down(players_cards, deck)\n double_down_value = []\n players_cards.each {|x, y| double_down_value.push(y)}\n if double_down_value[0] == double_down_value[1]\n puts 'Yo have matching cards. Do you want to double down? Yes or No?'\n double_down_reply = gets.chomp\n while double_down_reply.downcase != 'no'\n if double_down_reply.downcase == 'yes'\n players_cards = double_down_value[0]\n players_cards_two = double_down_value[1]\n players_cards.push (the_draw(deck))\n players_cards_two.push (the_draw(deck))\n elsif double_down_reply.downcase == 'no'\n exit\n else\n puts 'You didn\\'t enter Yes or No to the question, do you want to double down? Please respond with Yes or No'\n double_down_reply = gets.chomp\n end\n end\n end\n end", "def test02_post_closed_news_CloseFlagNoteDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend", "def delete_comment user\n edit_comment user, nil\n end", "def bury\n @comment = Comment.find(params[:id])\n \n respond_to do |format|\n if @comment.vote(false, current_user)\n flash[:notice] = 'You have downvoted this comment.'\n format.html { redirect_to(@story) }\n format.xml { render :xml => @story, :status => :created, :location => @story }\n else\n format.html { render :action => \"index\" }\n format.xml { render :xml => @story.errors, :status => :unprocessable_entity }\n end\n end\n end", "def down!\n @data[:state] = :down\n save!\n end", "def test03_post_closed_news_CancelDeleteArticleOneComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_article)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t \n\t\tassert $comment_delete_link.exists?\n\tend", "def quality_check\n if session[:comment_id] == nil\n return true\n else session[:comment_id].each do |comment_id|\n if Comment.find(comment_id).downvote >= 12\n return false\n end\n end\n end\n end", "def downvote_for(user)\n return unless vote_weight_for_user(user) > -1\n vote_for(user, -1)\n end", "def test02_post_open_news_CancelDeleteNoteOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_note)\n\t\t\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t\n\t\tassert $comment_delete_link.exists?\n\tend", "def downvote(current_user)\n if current_user && current_user.voted_down_on?(self)\n self.undisliked_by current_user\n else\n self.downvote_by current_user\n end\n end", "def dislike\n @comment.disliked_by current_user\n end", "def cdeop(m, nick)\n nick = User(nick)\n if is_chanadmin?(m.channel, m.user) && is_botpowerful?(m.channel)\n m.channel.deop(m.channel, nick)\n elsif !is_chanadmin?(m.channel, m.user)\n m.reply NOTADMIN, true\n elsif !is_botpowerful?(m.channel)\n m.reply NOTOPBOT, true\n end\n end", "def test05_post_closed_board_NoteTwoComments_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\tsleep 2\n\t\t$browser.goto($patch_boards_post_closed_note)\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend", "def test03_CancelFlagNoteComment_TC_24319\n\t\tcommentNotePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentCancelFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_link.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPS05T03: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def down(&block)\n @down_block = block\n end", "def check_down=(_arg0); end", "def test02_post_closed_board_ArticleOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\tsleep 2\n\t\t$browser.goto($patch_boards_post_closed_note)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend", "def down(&block)\n if block_given?\n define_down_runner(&block)\n else\n @down_runner || NullRunner.new(self, :up)\n end\n end", "def test04_CancelFlagArticleComment_TC_24319\n\t\tcommentArticlePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentCancelFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_link.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPS05T04: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def double_down(hand, decks)\r\n if !hand.is_two_cards\r\n puts \"Cannot double_down!\"\r\n return false\r\n end\r\n hand.add_card(decks)\r\n hand = Hand.new(hand.get_cards, false, true)\r\n return true\r\n end", "def comment_finished?\n\t\t\n\tend", "def test02_CloseFlagNoteDialog\n\t\tcommentNotePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentCloseFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_link.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPST02: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def test03_post_open_news_CancelDeleteArticleOneComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_article)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t \n\t\tassert $comment_delete_link.exists?\n\tend", "def update_comment(post_num_input)\n puts \"WARNING: This will erase your entire previous comment text.\"\n puts \"Would you still like to update it? 'y' or 'n'\"\n input = gets.chomp\n if input == \"n\"\n puts ''\n puts \"Comment unchanged\"\n puts ''\n elsif input == \"y\"\n numbered_comments(post_num_input)\n puts \"Which comment would you like to update? (Type the corresponding number)\"\n comment_choice = gets.chomp.to_i\n array_number = comment_choice - 1\n puts \"Type in your username.\"\n username = gets.chomp.downcase\n puts \"Go ahead a write an updated comment.\"\n updated_comment = gets.chomp\n BLOG[post_num_input].comments[array_number].username = username\n BLOG[post_num_input].comments[array_number].comment = updated_comment\n puts \"Your comment has been updated!\"\n show_comments(post_num_input)\n else\n puts \"\\n\" + ERROR_MESSAGE\n puts ''\n end\n end", "def test05_post_closed_news_NoteTwoComments_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_note)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend", "def has_downvoted_for(user_id, post_id)\n\t\trelationship = Vote.find_by(user_id: user_id, post_id: post_id, vote_type: \"downvote\")\n \treturn true if relationship\n\tend", "def mark_down\n post = Post.find(params[:id])\n post.down = true\n post.save\n \n redirect_to :action => \"home\"\n end", "def downvote(m, nick)\n user = User(nick)\n m.reply \"Nice try, #{nick}. ಠ_ಠ\" and return if user == m.user\n\n karma = @bot.redis.decr(\"#{m.channel}:#{nick.downcase}:karma\")\n m.reply \"#{nick} #{DOWNVOTE_MESSAGES.sample} Karma: #{karma}.\"\n end", "def leave_comment(comment, story, options = {})\n options[:user] ||= \"doesnt_matter\"\n steps %Q{\n Given I am logged in as \"#{options[:user]}\"\n And I am on the story page for \"#{story}\"\n And I fill in the following:\n | comment | #{comment} |\n And I press \"submit\"\n And I logout\n }\n # @comment = Comment.last\n # if ! options[:created_at].blank?\n # @comment.created_at = Time.parse(options[:created_at]).gmtime\n # @comment.save\n # end\n # \n {:comment => comment, :story => story, :user => options[:user]}\nend", "def test03_post_closed_board_MediaOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\tsleep 2\n\t\t$browser.goto($patch_boards_post_closed_note)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend", "def test05_post_open_news_FlagNoteComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentFlag\n\t\tsleep 1\n\t\tassert $comment_flag_success.exists?\n\tend", "def correct_user_for_deleting_comment\n\t @comment = Comment.find(params[:id])\n\t @user = @comment.user\n\t redirect_to(login_url) unless current_user?(@user)\n\t end", "def test02_post_closed_blog_CloseFlagNoteDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_post_closed_note)\n\t\t\n\t\tcommentPopSubmit \"Blog Note Comment for close flag #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend", "def test04_FlagNoteComment\n\t\tcommentNotePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_success.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPS04T04: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def comment_fun(y_or_n, post_num_input)\n if y_or_n == 'y'\n puts \"\\nWould you like to...\"\n puts \"[1] add a comment\"\n puts \"[2] delete a comment\"\n puts \"[3] update a comment\"\n choice = gets.chomp\n case choice\n when \"1\"\n add_comment(post_num_input)\n when \"2\"\n delete_comment(post_num_input)\n when \"3\"\n update_comment(post_num_input)\n else\n puts ERROR_MESSAGE\n end\n elsif y_or_n == 'n'\n puts \"\\n nothing changed\"\n puts ''\n else\n puts ERROR_MESSAGE\n end\n end", "def down\n cursor.down\n\n refresh\n end", "def test_08_AddNewCard_deletecomment_removefan()\n\t\t\n\t\tputs \"---------------------- START OF SCENARIO 8 ----------------------\"\n\t\tsearchOrg($org_name)\n\t\tdonateUsingAddCreditCard($donation_amount, $street, $state, $city, $pin_code,\n\t\t\t\t\t\t $amexcard_number, $amex_seccode, \"label=Weekly\")\n\t\tdeleteComments(\"Delete this comment\")\n\t\tremoveFan($fr_name)\n\t\tputs \"---------------------- END OF SCENARIO 8 --------------------------\"\n\tend", "def test04_post_closed_news_ArticleTwoComments\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_article)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend", "def test05_FlagArticleComment\n\t\tcommentArticlePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_success.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPS04T05: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def test03_CloseFlagArticleDialog\n\t\tcommentArticlePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentCloseFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_link.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPST03: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend", "def downvote\n @voteable = @commentable_collection.find(params[:id])\n current_user.vote_against(@voteable)\n current_user.add_points(1)\n @voteable.update_vote_score\n respond_to do |format|\n format.js\n end\n end", "def downvote\n @question.downvote_from current_user\n #si votas negativo automaticamente el usuario logueaado tiene un punto negativo -1\n @question.user.puntaje-=2\n @question.user.save\n\n current_user.puntaje-=1\n current_user.save\n redirect_to @question, notice: 'Gracias por puntuar'\n end", "def test02_pre_open_blog_CancelFlagArticleComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_article_to_edit)\n\t\t\n\t\tsleep 4\n\t\tcommentCancelFlag\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def test02_post_closed_news_ArticleOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_article)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend", "def continue_browsing\n puts \"Would you like to keep learning more about COVID-19 spread?\".green\n user_input = gets.strip.downcase\n\n until user_input == \"yes\" || user_input == \"no\"\n puts \"I didn't understand that command.\".red\n puts \"Please enter YES or NO\".green\n user_input = gets.strip.downcase\n end\n\n user_input == \"yes\" ? program_run : sign_off\n end", "def test04_post_closed_board_CancelDeleteMediaOneComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_closed_note)\n\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t\n\t\tassert $comment_delete_link.exists?\n\tend", "def reopen!(comment, is_private = false)\n @client.update_bug(id, status: 'REOPENED', comment: { body: comment.to_s, is_private: is_private.to_b })\n end" ]
[ "0.72441554", "0.7017349", "0.6250808", "0.6222246", "0.58906364", "0.5852679", "0.5828789", "0.5695721", "0.5638064", "0.5624087", "0.55421865", "0.55421865", "0.55078185", "0.5454527", "0.54468954", "0.5445814", "0.5431789", "0.54209906", "0.5407877", "0.5404402", "0.5402702", "0.53930575", "0.5388849", "0.5355541", "0.5355541", "0.5343294", "0.5329848", "0.53226584", "0.5295036", "0.526583", "0.52604175", "0.5255334", "0.5250758", "0.5238174", "0.5230685", "0.5229888", "0.5212867", "0.5212412", "0.5211027", "0.52103335", "0.520856", "0.5206367", "0.5187496", "0.5182074", "0.5172963", "0.5170422", "0.51599175", "0.51193726", "0.511185", "0.5105387", "0.5102509", "0.5087116", "0.5061263", "0.5060904", "0.5045505", "0.50415796", "0.5040098", "0.50396776", "0.5023882", "0.50224537", "0.5020484", "0.5016946", "0.5016713", "0.5015352", "0.50149655", "0.50043243", "0.49970523", "0.49796256", "0.4963934", "0.49490973", "0.4948991", "0.49449104", "0.4941228", "0.49407947", "0.492905", "0.4921224", "0.49181947", "0.4906792", "0.49011198", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48911875", "0.48850638", "0.4877537", "0.48736727", "0.48719007" ]
0.7527961
0
=begin Description: This story is mainly used in the notification system to summarize the content of the comment to fit within a certain length input: char_num:Int which is the number of chars it will be summarized to output: String > The summarized String Author: Kiro =end
def summarize_content (char_num) if self.content.length <= char_num return self.content else return self.content[0..(char_num-1)] + "..." end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comment_length\n\t120\nend", "def description_complexity(pr)\n pull_req = pull_req_entry(pr[:id])\n (pull_req['title'] + ' ' + pull_req['body']).gsub(/[\\n\\r]\\s+/, ' ').split(/\\s+/).size\n end", "def description_from_string(str)\n len = 12\n return str unless str.length > len\n \"#{str[0..len - 1]}...\" # Is this length correct?\n end", "def text_summary\n summary = self.text\n summary = summary[(summary.index(\" \") + 1)...summary.length] if self.text[0...1] == \"@\"\n summary = (summary.length > 30 ? \"#{summary[0..30]}...\" : summary[0..30])\n summary\n end", "def snippet(text, wordcount, omission)\n return '' if text.blank?\n text.split[0..(wordcount-1)].join(\" \") + (text.split.size > wordcount ? \" \" + omission : \"\")\n end", "def full_info number \n\t\tshort_text = description.split(\"<br>\")[0][0..59]\n\t\tshort_text = short_text + \"...\" if short_text.length == 60\n\t\t\"#{number}. #{short_text}\"\n\tend", "def card_description(bug_id)\n descr = <<TXT\nBugzilla: #{bz_markdown_link(bug_id)}\n\n---\n## Review\n- Pull Request: *URL here*\nTXT\n\n # just to avoid the trailing blank errors in the heredoc\n descr + \"- \"\nend", "def content_summary(max)\n if self.content.length >= max\n self.content.slice(0..max) + \"...\"\n else\n self.content\n end\n end", "def paragraph_by_chars(number: T.unsafe(nil), supplemental: T.unsafe(nil)); end", "def text_summary\n summary = attribute_get(:text)\n summary = summary[(summary.index(\" \") + 1)...summary.length] if summary[0...1] == \"@\"\n summary = (summary.length > 30 ? \"#{summary[0..30]}...\" : summary[0..30])\n summary\n end", "def truncate_paragraph(long_str, num_characters, truncated_indicator=\"...\")\n if long_str.length <= num_characters\n return long_str\n else \n return long_str.split(//).first(num_characters).join + \" \" + (truncated_indicator) \n end\n \n\nend", "def snippet\n snippet = text.split(\"\\r\\n\\r\\n\")[0]\n snippet = snippet[0, 500] + ' **[. . .]**' if snippet.length > 550\n snippet\n end", "def general_info\n return <<HERE\n Manuscript Title: #{self.title}<br />\n Manuscript Type: #{self.manuscript_type.name}<br />\n Main Subject Category: #{self.article_section.article_section_name}<br />\n Manuscript Counts<br />\n Pages: #{self.num_pages}<br />\n References: #{self.num_refs}<br />\n Tables: #{self.num_tables}<br />\n Figures: #{self.num_figures}<br />\n Supplemental Materials: #{self.num_suppl_mtrls}<br />\n Co-Authors: #{self.coauthors.count}<br />\nHERE\n end", "def size_article(string)\n sentences = []\n iterator = 1\n num_times = string.size / 103\n sentence_chars = string.chars\n num_times.times do\n if iterator == 1\n sentence = sentence_chars.shift(95).join(\"\") + \"\\n\"\n sentences << sentence\n else\n sentence = sentence_chars.shift(103).join(\"\") + \"\\n\"\n sentences << sentence\n end\n iterator += 1\n end\n sentences\n end", "def summary(content)\n content[0, content.index('<!-- more -->') || content.length]\nend", "def short(str)\n limit = 140\n str = str.gsub(/(\\n|\\r)/, \"\")\n return str if str.size <= limit\n str.strip[0...(limit-3)]\n .concat(\"...\")\n end", "def truncate_paragraph(long_str, num_characters, truncated_indicator=\"...\")\n\n if long_str.length > num_characters\n return long_str[0...num_characters] + \" \" + truncated_indicator\n else \n return long_str\n end\n\nend", "def summary\n self.content.gsub(/\\r?\\n\\r?\\n(.*)/m, '') # break after the first paragraph\n end", "def summary\n\t\tsummary = \"\"\n\t\tget = @text.split(/ /)\n\t\tget.each_index do |word|\n\t\t\tsummary << get[word] << \" \" if word < 10\n\t\tend\n\t\tsummary.strip\n\tend", "def get_comment(n, algebraic_structure)\n ret = <<EOS\n/**\n* Combine #{n} #{algebraic_structure}s into a product #{algebraic_structure}\n*/\nEOS\n ret.strip\nend", "def truncate_paragraph(long_str, num_characters, truncated_indicator=\"...\")\nend", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def output_characters\n if @number <= self.class.total_included_characters\n convert_paragraphs_to_characters(self.class.included_paragraphs_joined)\n else\n repeat = (@number / self.class.total_included_words.to_f).ceil\n convert_paragraphs_to_characters((PARAGRAPHS * repeat).join(\"\\n\\n\"))\n end\n end", "def html_summarize_by_chars(text, length = 270, omission = '...')\n return '' if text.blank?\n truncate_on_word(strip_tags(text), length, omission)\n end", "def content_based_description\n first_long_paragraph = parsed_search('//p[string-length() >= 120]').first\n first_long_paragraph ? first_long_paragraph.text : ''\n end", "def string_length(num)\n if num == 0\n puts \"You have to give me something to work with, here.\"\n elsif num <= 10\n puts \"You're not much with words, are you?\"\n elsif num <= 20\n puts \"You've got a lot to say.\"\n else\n puts \"Sounds like you had quite a day!\"\n end\n end", "def metadata_comment_count(structure)\n \"#{structure.comments.count} avis\"\n end", "def paragraph_by_chars(characters: 256, supplemental: false)\n paragraph = paragraph(sentence_count: 3, supplemental: supplemental)\n\n paragraph += \" #{paragraph(sentence_count: 3, supplemental: supplemental)}\" while paragraph.length < characters\n\n \"#{paragraph[0...characters - 1]}.\"\n end", "def short_notes; RubyPants.new(Scrub.sanitize_and_strip(notes).truncate(SHORT_LENGTH, separator: /\\s/)).to_html.html_safe; end", "def snippet(text, max)\n result = ''\n count = 0\n # TODO figure out support for pre that contains code blocks..\n return [result, count] if is_blank?(text)\n text.split.each do |word|\n return [result.strip!, count] if count >= max\n result << \"#{word} \"\n count += 1\n end\n [result.strip!, count]\n end", "def announce(announcement)\n puts \"\\n#{'=' * 76}\\n#{announcement}\\n#{'-' * 76}\"\nend", "def one_line_description(opts={}) ; attributes['comments'] ; end", "def shortened_tweet_truncator(tweet_string)\n if tweet_string.length > 140\n tweet_string[0..136] + \"...\"\n else\n tweet_string\n end\nend", "def test_char_limit\n assert_equal(\"The note is over the character limit!\", Notes.add_note(\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce a mi et tellus convallis venenatis sit amet a dolor. In nec tincidunt magna, sed fringilla dolor. Nunc id felis consectetur, laoreet magna sit amet, efficitur sem. \"))\n end", "def update_comment_text(story_data, bug_task, build_number)\n txt = String.new(FIXED_COMMENT_PREFIX) # comment should always begin with this\n txt << \"Fixed in Git and deployed with build #{build_number}\"\n\n if (story_data.current_state != 'finished' && story_data.current_state != 'delivered' && story_data.current_state != 'accepted')\n txt << \"\\n\\nNOTE: this story is not in the expected status 'Finished'... please verify and update status if necessary\"\n end\n txt\n end", "def indefinite_long_description\n return \"something\"\n end", "def descr_short\n descr = self[:descr].to_s.gsub(\"\\n\", \" \").gsub(/\\s{2,}/, \" \")\n descr = Knj::Strings.shorten(descr, 20)\n #descr = \"[#{_(\"no description\")}]\" if descr.to_s.strip.length <= 0\n return descr\n end", "def hrule( length=75, char=\"-\" )\n\t\treturn (char * length ) + \"\\n\"\n\tend", "def pr_description\n danger_file.warn('Please provide a summary in the Pull Request description') if danger_file.github.pr_body.length < 3 && danger_file.git.lines_of_code > 10\n end", "def short_description\n description = \"\"\n paragraphs = body.split(\"\\n\")\n paragraphs.each do |p|\n description << p << \"\\n\"\n break if description.size > SHORT_DESCRIPTION_SIZE\n end\n @@renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML,\n :autolink => true, :space_after_headers => true)\n @@renderer.render(description).html_safe\n end", "def summary\n content = self.content\n sentences = content.split(\".\")\n \"#{sentences[0..1].join(\".\")}...\"\n end", "def commentString\n if(comments.length <= 0)\n return 'No hay comentarios'\n else\n return ''\n end\n end", "def content_summary(**args)\n length = args[:length] ? args[:length] : 50\n # If we can find first paragraph\n reg = Regexp.new(/(^<p>[^<]*<\\/p>)/)\n if !self.content.match(reg).nil?\n return self.content.match(reg).captures[0].gsub(/<[a-z]{1,}[^>]*>|<\\/[a-z]>/,'').truncate(length)\n end\n # Else, strip HTML and truncate\n return self.content.gsub(/<[a-z]{1,}[^>]*>|<\\/[a-z]>/, '').truncate(length)\n end", "def long_word_count(text)\n \nend", "def list_title(n=40)\n st = subject[0..n].to_s\n st += \"...\" unless subject.length <= n\n st\n end", "def html_summarize(text, length = 30, omission = '...')\n return '' if text.blank?\n snippet(strip_tags(text), length, omission)\n end", "def paragraph_by_chars(characters: T.unsafe(nil), supplemental: T.unsafe(nil)); end", "def comment_describing(line_number)\n self.class.comment_describing(raw, line_number)\n end", "def comment_describing(line_number)\n self.class.comment_describing(raw, line_number)\n end", "def story(story_content)\n story_content = story_content.strip.split(/[ \\t]*\\n+[ \\t]*/).map {|line| \" #{line}\\n\" }.join \n #metadata[:example_group][:description] << \"\\n\"+story_content+\"\\n\"\n metadata[:example_group][:full_description] << \"\\n\"+story_content+\"\\n\"\n end", "def truncate_paragraph(long_str, num, trunc_symb=\"...\")\n if long_str.length > num\n b = long_str.chars.to_a\n b[0..num-1].join + \" \" + trunc_symb\n else \n long_str\n end\nend", "def description_length\n description&.scan(/\\w+/)\n end", "def description\n initial_comment.try(:text) || \"\"\n end", "def description_lines\n string = @challenge.description\n lines = 0\n string.each_line('|') { |i|\n lines += 1\n }\n return lines+1\n end", "def data520\n max_length = 1879\n @thesis.abstract&.each_line do |line|\n # skip any blank lines. Mostly if multiple linebreaks were added to the text.\n next if line.strip.empty?\n\n # if the line length is valid for 520, add it\n if line.length < max_length\n @record.append(MARC::DataField.new(\n '520', '3', ' ',\n ['a', line.encode(options: :xml).strip]\n ))\n # split lines that remain too long into valid size strings\n else\n part = line.chars.to_a.each_slice(max_length).map(&:join)\n part.each do |part_line|\n @record.append(MARC::DataField.new(\n '520', '3', ' ',\n ['a', part_line.encode(options: :xml).strip]\n ))\n end\n end\n end\n end", "def desc_char_limit\n 300\n end", "def preview(text, length=400)\n text.split(/\\s/).inject(\"\") do |out, chunk|\n if (out.size + 1 + chunk.size) <= length\n out + \" \" + chunk\n else\n return out + \" ...\"\n end\n end\n end", "def shorten_description(description,text_length)\n description.length>text_length ? description.slice(0,text_length)+\"...\" : description\n end", "def summarize(length = 100, elipsis = true)\n return truncate(length)\n end", "def number_of_chars\n text.to_s.number_of_chars\n end", "def get_description(n)\n description = Nokogiri::HTML(super(n)).text\n if description.include?(\"IF YOU GO\")\n description = description.split(\"IF YOU GO\")[0]\n description = description.split(\" \")[3..-1].join(\" \") # remove \"by 'author name'\"\n description.slice!(\"[ Subscribe to the comments on this story ] \")\n description\n else\n nil\n end\n end", "def summarise\n headerless = self.body.gsub(/\\<h\\d.*?\\>.*?\\<\\/h\\d\\>/m, '')\n summary = ActionView::Base.full_sanitizer.sanitize(headerless).strip.match(/^(.+?)[\\.\\r\\n]/m)&.captures&.first || self.title\n\n return \"#{ summary }.\"\n end", "def comment str\n self.add_comment(\"This is a paragraph comment for the paragraph\", \"OCELOT Commenter\");\n end", "def build_comment string_data\n if is_multiline string_data\n build_multiline_comment string_data\n else\n build_singleline_comment string_data\n end\n end", "def shortened_tweet_truncator(tweet_one)\n if tweet_one.length > 140\n tweet_one[0..139] \n else\n tweet_one\n end\nend", "def comment_display_limit\r\n return 10\r\n end", "def preview\n self.content.split(' ')[0...5].join(' ') + '...'\n end", "def render_summary\n summary = nil\n max_chars = (self.display_configuration.try {|h| h[\"summary_max_chars\"]}) || 280\n\n\n\n if self.snippets.length > 0 && !(self.display_configuration.try {|h| h[\"prefer_abstract_as_summary\"]} && self.abstract)\n summary = self.snippets.first\n self.snippets.slice(1, self.snippets.length).each do |snippet|\n summary += ' '.html_safe + snippet if (summary.length + snippet.length) <= max_chars\n end\n else\n summary = _h.bento_truncate( self.abstract, :length => max_chars )\n end\n\n summary\n end", "def shortened_tweet_truncator(tweet)\n shortened_tweet = selective_tweet_shortener(tweet)\n if tweet.length < 140 \n tweet\n elsif\n shortened_tweet.length > 140 \n shortened_tweet[0...140-3] + \"...\" \n else\n shortened_tweet\nend\nend", "def homework(title, topic, date, thesis_statement, pronoun)\n\tparagraph = \"#{title}/n The #{topic} was an interesting topic. It happened in #{date}. \n\tI feel that #{topic} was a very important part of #{date} because \n\t#{pronoun}. #{thesis_statement}. This is what made #{topic} really \n\tinteresting part of #{date} and an important part of history.\"\n\treturn paragraph\nend", "def generate_unique_comment\n \"This is a comment for product and is for #{Time.now.to_i}\"\n end", "def hash_tag_description(pr)\n pull_req = pull_req_entry(pr)\n unless pull_req[:body].nil?\n pull_req[:body].\\\n gsub(/`.*?`/, '').\\\n scan(/#([0-9]+)/).size\n else\n 0\n end\n end", "def shortened_tweet_truncator(tweet)\n selective_tweet_shortener(tweet)\n if tweet.length >= 140\n tweet[0...137].concat(\"...\") #(...) is 3 characters!\n else\n tweet if tweet.length < 140\n end\nend", "def increment_num_comments\n\n end", "def summary\n if first_line =~ /^#/\n first_line.sub(/^#*/, '').strip\n else\n ''\n end\n end", "def shortened_tweet_truncator(tweet)\n\n if tweet.length <= 140\n tweet\n else\n word_substituter(tweet)[0..136] + \"...\"\n end\nend", "def metadata_comment_title(structure)\n \"#{(structure.highlighted_comment || structure.comments.last).title} (#{structure.comments_count} avis)\"\n end", "def char_word_counter(sentence)\n words_array = sentence.split(' ')\n how_many_words = words_array.length\n how_many_chars = sentence.gsub(/\\s+/, \"\").length\n\n \"This sentence has #{how_many_words} words & #{how_many_chars} characters\"\nend", "def char_description(character)\n\thtml = open(\"https://awoiaf.westeros.org/index.php/#{character}\")\n\tdoc = Nokogiri::HTML(html)\n\tif doc.css(\"div.hatnote:first-child\").empty? #|| doc.css(\".mw-parser-output .hatnote:nth-child(2)\").empty?\n\t\tdescription = doc.css(\".mw-parser-output > p:nth-child(2)\").text.gsub!(/[^A-Za-z ,.]/,'')\n\telse \n\t\tdescription = doc.css(\".mw-parser-output > p:nth-child(3)\").text.gsub!(/[^A-Za-z ,.]/,'')\n\tend\n\n\tif character == \"Walder_Frey\"\n\t\tdescription = doc.css(\".mw-parser-output > p:nth-child(3)\").text.gsub!(/[^A-Za-z ,.]/,'')\n\tend\n\n\tif character == \"Viserys_Targaryen\"\n\t\tdescription = doc.css(\".mw-parser-output > p:nth-child(3)\").text.gsub!(/[^A-Za-z ,.]/,'')\n\tend\n\n\tif character == \"Tywin_Lannister\"\n\t\tdescription = doc.css(\".mw-parser-output > p:nth-child(2)\").text.gsub!(/[^A-Za-z ,.]/,'')\n\tend\n\tdescription\nend", "def to_s\n \"\\s\\s#{@title}\\n#{'#' * (@title.size + 4)}\\n\\n#{@exam}\"\n end", "def description\n markup @comment\n end", "def shortened_tweet_truncator(tweet)\n shortened_tweet = selective_tweet_shortener(tweet)\n tweet_w_ellipses = \"\"\n char_array = []\n\n if shortened_tweet.length > 140\n shortened_tweet = shortened_tweet[0..136] + \"...\"\n else\n return shortened_tweet\n end\nend", "def title\n description.truncate(30, :separator =>' ')\n end", "def description; @text; end", "def long_word_count(text)\n #\n # your code goes here\n #\n counter = 0\n text.split.each do |word|\n counter += 1 if word.length > 7\n end\n\n counter\nend", "def sectionComment(sectionName)\r\n txt = sectionName.strip\r\n bar = \"\"\r\n # 6: 5 misc chars (// ) plus 1\r\n width = (@maxWidth - 6 - txt.length) / 2\r\n width.times do\r\n bar += \"+\"\r\n end\r\n\r\n header = <<EOF\r\n\r\n\r\n\r\n\r\n// #{bar} #{txt} #{bar}\r\n\r\nEOF\r\n\r\n header\r\n\r\n end", "def shortened_tweet_truncator(tweet)\n if word_substituter(tweet).length > 140\n word_substituter(tweet)[0..136] + '...'\n else\n tweet\n end\nend", "def show_word_length\n @word_lth = @str.length.to_i\n p \"-\" * @word_lth\n end", "def shortened_tweet_truncator(tweet) \n if word_substitutor(tweet).length > 140 \n word_substitutor(tweet)[0...137] + \"...\"\n else \n tweet\n end \nend", "def print_heading(content)\n puts \"=\" * content.length\n puts \"#{content}\"\n puts \"=\" * content.length\nend", "def snippet(sentence, desired_word_count = 3)\n sentence.sub(/\\A(?<first_x_words>(\\w+ ){#{desired_word_count}})(?<the_rest>.*)/, '\\k<first_x_words>...')\nend", "def help; summarize(\"#{banner}\".sub(/\\n?\\z/, \"\\n\")) end", "def summary\n description.lines.first.thru { |line|\n if line\n line.split( '. ', 2 ).first\n else\n ''\n end\n }\n end", "def comments_text\n return self.comments.inject(\"\") do |string, comment| \n string + \n (string.empty? ? \"\" : \"\\n\") +\n comment.email +\n \": \" +\n comment.message\n end\n end", "def getPostDescription article\n\t\treturn article.gsub(/<[^>]*>/,'').gsub(/&nbsp;/,' ').slice(0,60)+'...'\n\tend", "def truncated_content\n\t\tid.to_s+\" - \"+content.truncate(50,{omission: '...'})\n end", "def shortened_tweet_truncator(tweet)\n short = word_substituter(tweet)\n if short.length > 140\n short[0..139]\n else\n short\n end\nend" ]
[ "0.70011026", "0.6411546", "0.63406503", "0.6306612", "0.61043483", "0.607377", "0.6041252", "0.6026639", "0.60241747", "0.60133034", "0.5949859", "0.59486544", "0.59285885", "0.5905003", "0.590407", "0.5899543", "0.5890872", "0.5882059", "0.5857261", "0.58479726", "0.58358", "0.57866466", "0.57866466", "0.57866466", "0.57866466", "0.57482845", "0.57387227", "0.57118464", "0.57087094", "0.570176", "0.56858265", "0.56851035", "0.56774527", "0.56740105", "0.56737727", "0.56664705", "0.5637739", "0.5594692", "0.5593832", "0.5591734", "0.55893576", "0.5588858", "0.55885977", "0.5582741", "0.5577124", "0.5565988", "0.55638075", "0.5561539", "0.5553849", "0.5552905", "0.5547521", "0.5547521", "0.5544959", "0.5543878", "0.5543532", "0.5542884", "0.5531964", "0.5529247", "0.55264425", "0.55192083", "0.55178356", "0.55169594", "0.5516196", "0.5514179", "0.550752", "0.55005085", "0.54981804", "0.54941183", "0.5490206", "0.54817337", "0.54811263", "0.5474835", "0.54586387", "0.5442095", "0.5441818", "0.54337734", "0.54319054", "0.5429631", "0.5419927", "0.54118234", "0.5409873", "0.540945", "0.5408585", "0.5408101", "0.54057723", "0.5402705", "0.5400684", "0.5398813", "0.5398214", "0.5389733", "0.53885186", "0.5387894", "0.53813547", "0.5376842", "0.5376795", "0.5370625", "0.53655237", "0.53590673", "0.53405994", "0.53399664" ]
0.77979815
0
This is the stub for a systemwide error handler. we will funnel system messages through this API. Global messages defined in the config file.
def initialize(id) @error_code = id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleError(msg)\n # For right now, throw an exception\n raise \"Error in obtaining information from LIMS. \" +\n \"Error from LIMS : \" + msg\n end", "def initialize_error_handlers\n #When an error occurrs, write nothing to stdout. We'll handle the errors ourselves\n Cspice_wrapper.errprt_c('SET', 0, 'NONE')\n\n #When an error happens, return from the erroring function, but do not abort the whole process\n Cspice_wrapper.erract_c('SET', 0, 'RETURN')\n end", "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 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 err(message, title=nil)\n Sinatra::Messages.error(\"#{get_env}#{message}\", title)\n end", "def handleError(msg)\n obj = ErrorMessage.new()\n obj.msgDetail = msg\n obj.msgBrief = \"Error in BCL to Fastq conversion for flowcell : \" +\n @fcName.to_s\n obj.workingDir = Dir.pwd\n ErrorHandler.handleError(obj)\n exit -1\n end", "def error_handler()\n @error_handler\n end", "def handleError(msg)\n obj = ErrorMessage.new()\n obj.msgDetail = \"LIMS upload error. Error message : \" + msg.to_s\n obj.msgBrief = \"LIMS upload error for : \" + @fcBarcode.to_s\n obj.fcBarcode = @fcBarcode.to_s\n obj.workingDir = Dir.pwd\n ErrorHandler.handleError(obj)\n exit -1\n end", "def stub_log_error\n ExceptionHandling.stub_handler = self\n end", "def default_errors!\n configure :production do\n error ::Exception do\n boom = env['sinatra.error']\n logger.error [\"#{boom.class} - #{boom.message}:\", *boom.backtrace].join(\"\\n \")\n response.status = 500\n content_type 'text/html'\n '<h1>Internal Server Error</h1>'\n end\n end\n end", "def handle_generic_error ex\n log_exception(ex)\n errors _(\"An unexpected error has occurred, details have been logged.\")\n redirect_back\n end", "def error_handler_deep_fallback(meth, error = nil)\n Log.error { \"#{meth} FAILED: #{error.inspect}\" } if error\n self.status = :internal_server_error\n render welcome_path\n end", "def errorhandling\n end", "def handle_thrift_exceptions_with_missing_message\n begin\n yield\n rescue Exception => err\n if !err.message\n if err.respond_to?(\"message=\")\n err.message = err.what || ''\n else\n def err.message\n self.what || ''\n end\n end\n end\n\n raise err\n end\n end", "def setup_error_handling(rack_env)\n end", "def receive_with_error_handling(name,options={})\n message = receive(name,options)\n status = message['status']\n case status\n when 'success'\n message\n when 'error'\n raise_error_for_message(message)\n else\n $stderr.puts message.inspect\n raise RZ::Error,\"message status #{status.inspect} is unkown\"\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 server_error\n\n end", "def print_error_message text, aconfig={}, &block\n _print_message :error, text, aconfig, &block\nend", "def error_handler\n @error_handler || DEFAULT_ERROR_HANDLER\n end", "def on_error(msg)\n end", "def error(event, msg, code=500, trace = [])\n title = case code\n when 400\n \"Bad Request (400)\"\n when 401\n \"Unauthorized Request\"\n when 403\n \"Access Restricted\"\n when 404\n \"Page Not Found\"\n when 405\n \"HTTP Method Not Allowed\"\n else\n \"An Error Has Occured\"\n end\n @content = render('error', {title: title, message: msg, error_code: code, trace: trace})\n warnlog 'Error handler called with \"' << msg << '\", code ' << code.to_s << ' (trace: ' << trace.to_s << ')'\n end", "def error(x, status:200, type:\"request\", title:\"An error occurred\", message:\"\", args: [])\n x.res.status = status\n if App[:app_error][type.to_sym]\n App[:app_error][type.to_sym][:get][x, title, message, *args]\n else\n x << \"ERROR: #{title} - #{message}\"\n end\n end", "def print_error(error={})\n if !@error_handler.nil?\n @error_handler.call(error)\n else\n puts \"Service returned an error.\"\n puts \"Type: #{error['Type']}\" if error['Type']\n puts \"Code: #{error['Code']}\" if error['Code']\n puts \"Details: #{error['Details']}\" if error['Details']\n puts \"Message: #{error['Message']}\" if error['Message']\n end\n end", "def handle_error_response(response)\n # Some errors come back under the `message` key while others are nested\n # under `error`\n error_message = response.body.dig('message') || response.body.dig('error', 'message')\n Rails.logger.error(\"SOLIDUS DRIP | #{error_message}\")\n end", "def error_handler\n flash[:notice] = \"Something went wrong here...\"\n end", "def sfdc_error(exception)\n case exception.code\n when \"INVALID_SESSION_ID\"\n if current_user\n Rails.logger.fatal \"[FATAL] Handling Invalid SFDC Session for #{current_user.username}. Token last refreshed at #{current_user.last_access_token_refresh_at}. Should token be expired: #{Time.now.utc > 45.minutes.since(current_user.last_access_token_refresh_at.getutc)}\"\n current_user.handle_invalid_session_id\n redirect_to '/whoops'\n end\n else\n Rails.logger.fatal \"[FATAL] SFDCError but no handler found for #{exception.code}: #{exception.message}. URL: #{exception.url}\"\n redirect_to '/bad'\n end\n end", "def hsdq_error(message, context); placeholder; end", "def push_error_message(msg)\n push_message(:error, msg)\n end", "def push_error_message(msg)\n push_message(:error, msg)\n end", "def standard_error(error)\n #When we rescue an error, we prevent our program from doing what\n #it normally would do - crashing, such as logging the details\n #and the backtrace. it's important to always log this information\n #when rescuing a general type\n\n #Use the logger.error method with an error's message to\n #log the error details again\n logger.error error.full_message\n\n render(\n status: 500,\n json:{\n status:500,\n errors:[{\n type: error.class.to_s,\n message: error.message\n }]\n }\n )\n end", "def error message; write ERROR, message, caller[0] unless level > @level end", "def config_error(path, error); end", "def error!(text, **message)\n\t\t\t\t\tmessage[:errno] ||= -1\n\t\t\t\t\t\n\t\t\t\t\tsend(status: text, **message)\n\t\t\t\tend", "def handle_generic_error(exception)\n end", "def log_error(msg, res, ex)\n Puppet.err(\"%s for %s: Error %s:%s \" % [msg, res, ex.class, ex.message] )\n Puppet.err(\"Fault error message: %s\" % ex.fault.errMsg.to_s) if ex.is_a?(RbVmomi::Fault)\n end", "def setup_logging_stubs(_error = nil, _code = nil, _message = nil)\n _undefined\n end", "def error(message)\n print(1, message)\n end", "def error_handler\n begin\n yield\n rescue => exception\n options = Rails.env.development? ? {:backtrace => exception.backtrace, :class => exception.class.to_s} : {}\n render_error(exception.message, options)\n end\n end", "def internal_server_error(exception = nil)\n error_rendering exception, __callee__\n end", "def __raise_transport_error(response)\n error = ERRORS[response.status] || ServerError\n raise error.new \"[#{response.status}] #{response.body}\"\n end", "def write_fatal_error message\n puts \"Error: #{message}. See spritemaster -h for usage\"\n exit\n end", "def report_error(message, hsh = {})\n hsh[:message] = message\n @report.error(hsh)\n end", "def errors_handling(err_code)\n\n\t\terr_code = err_code.to_i + 32000\n\n\t\t# PJL File System Errors (32xxx)\n\t\tfs_errors = {\n\t\t\t'32000' => 'General error',\n\t\t\t'32001' => 'Volume not available',\n\t\t\t'32002' => 'Disk full',\n\t\t\t'32003' => 'File not found',\n\t\t\t'32004' => 'No free file descriptors',\n\t\t\t'32005' => 'Invalid number of bytes',\n\t\t\t'32006' => 'File already exists',\n\t\t\t'32007' => 'Illegal name',\n\t\t\t'32008' => 'Can\\'t delete root',\n\t\t\t'32009' => 'File operation attempted on a directory',\n\t\t\t'32010' => 'Directory operation attempted on a file',\n\t\t\t'32011' => 'Not same volume',\n\t\t\t'32012' => 'Read only',\n\t\t\t'32013' => 'Directory full',\n\t\t\t'32014' => 'Directory not empty',\n\t\t\t'32015' => 'Bad disk',\n\t\t\t'32016' => 'No label',\n\t\t\t'32017' => 'Invalid parameter',\n\t\t\t'32018' => 'No contiguous space',\n\t\t\t'32019' => 'Can\\'t change root',\n\t\t\t'32020' => 'File Descriptor obsolete',\n\t\t\t'32021' => 'Deleted',\n\t\t\t'32022' => 'No block device',\n\t\t\t'32023' => 'Bad seek',\n\t\t\t'32024' => 'Internal error',\n\t\t\t'32025' => 'Write only',\n\t\t\t'32026' => 'Write protected',\n\t\t\t'32027' => 'No filename',\n\t\t\t'32051' => 'End of directory',\n\t\t\t'32052' => 'No file system',\n\t\t\t'32053' => 'No memory',\n\t\t\t'32054' => 'Vol name out of range',\n\t\t\t'32055' => 'Bad FS',\n\t\t\t'32056' => 'Hardware failure'\n\t\t}\n\n\t\tif (fs_errors.has_key?(err_code.to_s))\n\t\t\treturn fs_errors[err_code.to_s]\n\t\telse\n\t\t\treturn 'Bad command or error'\n\t\tend\n\tend", "def errors_handling(err_code)\n\n\t\terr_code = err_code.to_i + 32000\n\n\t\t# PJL File System Errors (32xxx)\n\t\tfs_errors = {\n\t\t\t'32000' => 'General error',\n\t\t\t'32001' => 'Volume not available',\n\t\t\t'32002' => 'Disk full',\n\t\t\t'32003' => 'File not found',\n\t\t\t'32004' => 'No free file descriptors',\n\t\t\t'32005' => 'Invalid number of bytes',\n\t\t\t'32006' => 'File already exists',\n\t\t\t'32007' => 'Illegal name',\n\t\t\t'32008' => 'Can\\'t delete root',\n\t\t\t'32009' => 'File operation attempted on a directory',\n\t\t\t'32010' => 'Directory operation attempted on a file',\n\t\t\t'32011' => 'Not same volume',\n\t\t\t'32012' => 'Read only',\n\t\t\t'32013' => 'Directory full',\n\t\t\t'32014' => 'Directory not empty',\n\t\t\t'32015' => 'Bad disk',\n\t\t\t'32016' => 'No label',\n\t\t\t'32017' => 'Invalid parameter',\n\t\t\t'32018' => 'No contiguous space',\n\t\t\t'32019' => 'Can\\'t change root',\n\t\t\t'32020' => 'File Descriptor obsolete',\n\t\t\t'32021' => 'Deleted',\n\t\t\t'32022' => 'No block device',\n\t\t\t'32023' => 'Bad seek',\n\t\t\t'32024' => 'Internal error',\n\t\t\t'32025' => 'Write only',\n\t\t\t'32026' => 'Write protected',\n\t\t\t'32027' => 'No filename',\n\t\t\t'32051' => 'End of directory',\n\t\t\t'32052' => 'No file system',\n\t\t\t'32053' => 'No memory',\n\t\t\t'32054' => 'Vol name out of range',\n\t\t\t'32055' => 'Bad FS',\n\t\t\t'32056' => 'Hardware failure'\n\t\t}\n\n\t\tif (fs_errors.has_key?(err_code.to_s))\n\t\t\treturn fs_errors[err_code.to_s]\n\t\telse\n\t\t\treturn 'Bad command or error'\n\t\tend\n\tend", "def error(msg) $stderr.puts(\"Error: #{msg}\") end", "def error(msg); @logger.error(msg); end", "def notify_on_error(proc_name = nil, message = nil, &block)\n begin\n yield\n rescue => exception\n options = {}\n options.merge! :proc_name => proc_name unless proc_name.nil?\n options.merge! :error_messages => message unless message.nil?\n handle_exception(exception, options)\n end\n\n return nil\n end", "def error(msg)\n $ibm_cloud_log.error(format_message(msg))\n end", "def server_errors; end", "def catch_errors\n yield\n rescue TingYun::Support::Exception::UnKnownServerException => e\n handle_force_restart(e)\n retry\n rescue TingYun::Support::Exception::ServerConnectionException => e\n handle_delay_restart(e, 60)\n retry\n rescue => e\n handle_delay_restart(e, 60)\n retry\n end", "def errmsg(message); end", "def unknown_error(error, req = T.unsafe(nil), text = T.unsafe(nil)); end", "def handle_errors(interactor)\n interactor.call\n rescue Errors::Base => e\n context.fail!(resource: e, status: e.status)\n end", "def error(message)\n raw \"ERROR :#{message}\\r\\n\"\n end", "def error(message)\n @module_manager.bot.log s prefix + \"\\e[31m\" + message + \"\\e[0m\"\n end", "def handle_error(msg)\n @logger.error(msg)\n raise msg\n end", "def handle_candlepin_server_error ex\n log_exception(ex)\n errors _(\"An error has occurred in the Entitlement Server.\")\n redirect_back\n end", "def error_message(msg)\n STDERR.puts msg\n end", "def _handle_error(e)\n res = @_response\n res.send(:initialize)\n res.status = 500\n res = _roda_handle_route{handle_error(e)}\n begin\n _roda_after(res)\n rescue => e2\n if errors = env['rack.errors']\n errors.puts \"Error in after hook processing of error handler: #{e2.class}: #{e2.message}\"\n e2.backtrace.each{|line| errors.puts(line)}\n end\n end\n res\n end", "def operational_error(message = [{\n 'error_source' => 'Asq',\n 'error_text' => 'Something went wrong.'\n }].to_json)\n self.status = 'operational_error'\n store_results(message)\n log('error', JSON.parse(message)[0]['error_text'])\n finish_refresh\n end", "def log_error(msg)\n print_error(msg)\n\n elog(msg, 'hwbridge', error: $!)\n end", "def handle_msg msg\n throw Exception(\"handle_msg must be implemented\")\n end", "def error_messages=(_arg0); end", "def error_catcher\n yield\n rescue Errors::ApiError => e\n logger.info e.backtrace.first(5).join(\"\\n\")\n render json: e.error_hash, status: e.status_code\n end", "def handle_error(error)\n # Can be overridden\n render plain: error.inspect, status: 500\n end", "def error(message)\n write_message message, 'error'\n end", "def errmsg(message)\n print(\"*** #{message}\\n\")\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 raise_api_error_msg(res)\n \"HTTP status code: #{res.status}, \" \\\n \"Error message: #{res.body['message']}, \" \\\n \"Reference: #{res.body['reference']}\"\n end", "def error(m)\n log_handler.error msg(m)\n end", "def error(msg) log(ERROR, \"ERROR \" << format(msg) << \", \" << caller[0][caller[0].rindex(\"/\").nil? ? 0 : caller[0].rindex(\"/\") + 1 .. -1]); end", "def handle_exception(exception, options = {})\n request = options[:request]\n render_errors = options[:render_errors] || false\n proc_name = options[:proc_name] || config[:app_name]\n error_messages = options[:error_messages] || ['']\n\n error_messages = [error_messages] unless error_messages.is_a?(Array)\n\n if exception.respond_to?(:backtrace)\n backtrace = exception.backtrace\n else\n backtrace = caller\n end\n\n # extract the relevant request data and also filter out any params\n # that should NOT be logged/emailed (passwords etc.)\n request_data = request_data_from_request(request) unless request.nil?\n\n supplementary_info = nil\n\n unless config[:call_for_supplementary_info].nil?\n supplementary_info = config[:call_for_supplementary_info].call(request)\n supplementary_info = [supplementary_info] unless supplementary_info.is_a?(Array)\n end\n\n unless supplementary_info.blank?\n error_messages << \"Supplementary info:\"\n error_messages += supplementary_info\n end\n\n if exception.nil?\n exception_classname = nil\n status_code = nil\n log_error error_messages.inspect\n log_error backtrace\n log_error \"Request params were:\"\n log_error request_data.to_yaml\n error_string = error_messages.shift\n else\n status_code =\n Wrangler::ExceptionHandler.status_code_for_exception(exception)\n\n log_exception(exception, request_data, status_code, error_messages)\n\n if exception.is_a?(Class)\n exception_classname = exception.name\n else\n exception_classname = exception.class.name\n end\n\n if exception.respond_to?(:message)\n error_string = exception.message\n else\n error_string = exception.to_s\n end\n end\n\n if send_notification?(exception, request, status_code)\n if notify_with_delayed_job?\n # don't pass in request as it contains not-easily-serializable stuff\n log_error \"Wrangler sending email notification asynchronously\"\n Wrangler::ExceptionNotifier.send_later(:deliver_exception_notification,\n exception_classname,\n error_string,\n error_messages,\n proc_name,\n backtrace,\n supplementary_info,\n status_code,\n request_data)\n else\n log_error \"Wrangler sending email notification synchronously\"\n Wrangler::ExceptionNotifier.deliver_exception_notification(exception_classname,\n error_string,\n error_messages,\n proc_name,\n backtrace,\n supplementary_info,\n status_code,\n request_data,\n request)\n end\n end\n\n if render_errors\n render_error_template(exception, status_code)\n end\n\n rescue Exception => unhandled_exception\n # if it looks like a temporary error interacting with SMTP, then enqueue\n # the error using delayed job if possible\n # (testing by name this way in case the exception isn't loaded into\n # environment, which would cause a NameError and be counterproductive...)\n if unhandled_exception.class.name == 'Net::SMTPAuthenticationError' &&\n Wrangler::ExceptionNotifier.respond_to?(:send_later)\n\n log_error \"Wrangler failed to send error notification: #{unhandled_exception.class.name}:\"\n log_error \" #{unhandled_exception.to_s}\"\n\n # note: this is specific to an old-ish version of delayed job...should\n # make wrangler compatible with the old and the new...\n log_error \"Wrangler attempting to send via delayed job\"\n Wrangler::ExceptionNotifier.send_later(:deliver_exception_notification,\n exception_classname,\n error_string,\n error_messages,\n proc_name,\n backtrace,\n supplementary_info,\n status_code,\n request_data)\n else\n log_error \"/!\\\\ FAILSAFE /!\\\\ Wrangler encountered an unhandled exception \" +\n \"while trying to handle an error. The arguments it received \" +\n \"were:\"\n log_error \" exception: #{exception.inspect}\"\n log_error \" options: #{options.inspect}\"\n log_error \"The unhandled error encountered was #{unhandled_exception.class.name}:\"\n log_error \" #{unhandled_exception.to_s}\"\n end\n end", "def before_server_error(exception); end", "def error_handler(exception)\n puts exception\n end", "def error(handler)\n puts '! Error occurred' if handler.bot.debug\n end", "def extact_error_message(body)\n error_response = JSON.parse(body)\n error_response[\"errorMessage\"][0][\"error\"][0][\"message\"][0] rescue \"Unexpected error occured!\"\n end", "def handleError(errorMessage)\n obj = ErrorMessage.new()\n obj.msgDetail = errorMessage.to_s\n obj.msgBrief = \"Error while merging sample \" + @sampleName.to_s\n obj.workingDir = Dir.pwd\n\n # hostName = EnvironmentInfo.getHostName()\n\n=begin\n if hostName != nil && !hostName.eql?(\"\")\n obj.hostName = hostName.to_s\n end\n=end\n\n puts \"CAME HERE\"\n #ErrorHandler.handleError(obj)\n exit\n end", "def send_error(e, res)\n res.code = 500\n res['Content-Type'] = 'application/json'\n body = { code: -1, error: \"#{e.class}: #{e.message}\" }\n body[:backtrace] = e.backtrace\n res.body = @shell.data(body).json(@shell.indent)\n @shell.logger.warn(Impl.format_error(e))\n\tend", "def render_error(options)\n error = options[:message] || env['sinatra.error'].message\n status = options[:status] || 400\n \n halt status, { 'Content-type' => 'application/json; charset=utf-8' }, error \n end", "def default_error req, endpoint, error\n msg = \"= #{error.class}:\\n<b>#{error.message}</b>\\n\\n\"\n msg << error.backtrace\n\n response HTTP_INTERNAL_ERROR, api_html(msg)\n end", "def general_error_redirection(caller,error)\n flash[:danger] = t(:general_error) #Set the error message to the user\n Rails.logger.debug \"*[ERROR] @ #{caller}=> #{error}.\" #Log the error\n Rails.logger.debug \"#{error.backtrace}\"\n redirect_to error_general_error_path #Redirect the user to the generic error page\n end", "def failure_wrap(message)\n begin\n payload = unpack(message)\n yield payload\n rescue => e\n error \"Unexpected error encountered processing custom resource - #{e.class}: #{e.message}\"\n debug \"#{e.class}: #{e}\\n#{e.backtrace.join(\"\\n\")}\"\n cfn_resource = payload.get(:data, :cfn_resource)\n cfn_response = build_response(cfn_resource)\n cfn_response['Status'] = 'FAILED'\n cfn_response['Reason'] = \"Unexpected error encountered [#{e.message}]\"\n respond_to_stack(cfn_response, cfn_resource[:response_url])\n message.confirm!\n end\n end", "def on_error(error); @parent.on_error(@env, error); end", "def redsys_error\n logger.debug \"==== REDSYS#ERROR ==== order##{params[:order_id]} params# #{params.inspect}\"\n notify_acknowledge = acknowledgeSignature(redsys_credentials(payment_method))\n if notify_acknowledge\n @order ||= Spree::Order.find_by_number!(params[:order_id])\n @order.update_attribute(:payment_state, 'failed')\n flash[:alert] = Spree.t(:spree_gateway_error_flash_for_checkout)\n end\n redirect_to order_path(@order)\n end", "def send_error(e, res)\n res.status = 500\n res['Content-Type'] = 'application/json'\n body = { code: -1, error: \"#{e.class}: #{e.message}\" }\n body[:backtrace] = e.backtrace\n res.body = @shell.data(body).json(@shell.indent)\n @shell.logger.warn(Impl.format_error(e))\n\tend", "def handle_error(error_messages, options = {})\n options.merge! :error_messages => error_messages\n handle_exception(nil, options)\n end", "def server_error?; end", "def custom_error_message\n message = component.dig('errors', schema_key, 'any')\n\n message % error_message_hash if message.present?\n end", "def handle_error(e)\n handler = error_handler()\n if handler.nil?\n puts \"** [#{full_name()}] #{e.class}: #{e.message}\"\n e.backtrace.each { |line| puts \" #{line}\" }\n else\n handler.receive(nil, Box.new([e, full_name()]))\n end\n end", "def error\n asl_log(@aslclient, @aslmsg, ASL_LEVEL_ERR, message)\n end", "def fail_with_message(error, message)\n Helper.log.error(\"#{error.class}: #{error.message}\")\n sys_abort(message)\n end", "def sms_error_class(&block)#:nodoc\n if yield\n SmsOnRails::FatalSmsError\n else\n SmsOnRails::SmsError\n end\n end", "def error_namespace; \"vagrant.errors\"; end", "def write_error_info\n end", "def error(message, code = 1)\n puts \"custodian: #{message}\"\n exit code\n end", "def on_error(err)\n Rails.logger.error \"SseResponder: #{err.to_s}\"\n end", "def handle_error(msg)\n @errors[msg] = true\nend", "def error_message; end", "def gateway_error\n message\n end", "def magic_error(code_or_msg = nil, code_or_msg2 = nil,\n code: nil, msg: nil, generic: false, halt: true)\n [code_or_msg2, code_or_msg].each do |v|\n if v.is_a? Array\n msg = v\n elsif v.is_a? String\n msg = [v]\n elsif v.is_a? Integer\n code = v\n end\n end\n\n locals = Hash.new.tap do |h|\n unless code.nil?\n h[:code] = code unless generic\n h[:message] = DEFAULT_ERROR_MESSAGES[code]\n end\n h[:message] = msg unless msg.nil?\n h[:generic] = generic\n end\n\n if (code.nil? || generic)\n status 200\n else\n status code\n end\n\n page = render(:error, locals: locals).randomly { |p| switch_themes p }\n halt && !code.nil? ? halt(code, page) : page\n end" ]
[ "0.66247505", "0.64327425", "0.6383515", "0.6360325", "0.63536876", "0.63095057", "0.62860376", "0.62854975", "0.62813836", "0.62360775", "0.60945886", "0.60638654", "0.6059355", "0.6037437", "0.60135615", "0.5963554", "0.5958585", "0.5950381", "0.5943309", "0.59183043", "0.5901211", "0.58757377", "0.58669096", "0.58573765", "0.5853773", "0.58535856", "0.5835774", "0.5833082", "0.5830457", "0.5830457", "0.5830253", "0.5791261", "0.57835835", "0.5775631", "0.57749295", "0.5774806", "0.576686", "0.57653844", "0.57630527", "0.5759369", "0.5755291", "0.5749756", "0.5741126", "0.5736427", "0.5736427", "0.57256514", "0.5724925", "0.5721209", "0.5715312", "0.57015693", "0.5701442", "0.5683529", "0.5673614", "0.5668746", "0.566832", "0.56680596", "0.5667266", "0.5667037", "0.5665925", "0.5664973", "0.5663889", "0.5651718", "0.5647918", "0.5642329", "0.56410885", "0.56391174", "0.5639014", "0.5638582", "0.5628058", "0.56270516", "0.56251866", "0.5623101", "0.56193024", "0.5617783", "0.56062585", "0.56059045", "0.5605762", "0.5605556", "0.5604188", "0.5603013", "0.5602045", "0.56019455", "0.5598656", "0.5596927", "0.5596117", "0.55952597", "0.55930996", "0.5579544", "0.5579469", "0.55763674", "0.5575419", "0.55711436", "0.5569058", "0.55660784", "0.55643845", "0.5559871", "0.5559459", "0.55576164", "0.5553078", "0.555301", "0.55516565" ]
0.0
-1
Reply and previous tweet
def reply? !!in_reply_to_status_id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_reply_to_user\n previous_tweet.try(:author).try(:screen_name) || params[:in_reply_to_user]\n end", "def get_in_reply_to(t)\n if t\n id = t.in_reply_to_status_id\n if id\n if r = $tweets[id]\n get_in_reply_to(r)\n elsif $buff[id]\n get_in_reply_to(r)\n else\n begin\n limit_status = Twitter.rate_limit_status\n if limit_status.remaining_hits < 10\n puts \"reset time: #{limit_status.reset_time}\"\n $abort_flug = true\n end\n puts \"のこり #{limit_status.remaining_hits} APIs\"\n\n r = Twitter.status(id)\n $buff[r.id] = r\n pp r\n puts\n get_in_reply_to(r)\n rescue => e\n p e\n end\n end\n end\n end\nend", "def process_tweet(tweet)\n log_info { \"New Tweet: #{tweet.uri}\" }\n\n if tweet.retweeted_status.present?\n text =\n \"Retweeted from <a href=\\\"https://twitter.com/#{tweet.retweeted_status.user.screen_name}\\\">@#{tweet.retweeted_status.user.screen_name}</a>:\\n\" +\n convert_all_entities(tweet.retweeted_status)\n\n send_media_of tweet.retweeted_status, retweeted: true\n\n elsif tweet.quoted_status?\n text =\n convert_all_entities(tweet) + \"\\n\\n\" +\n \"Retweeted from <a href=\\\"https://twitter.com/#{tweet.quoted_status.user.screen_name}\\\">@#{tweet.quoted_status.user.screen_name}</a>:\\n\" +\n convert_all_entities(tweet.quoted_status)\n\n send_media_of tweet.quoted_status, retweeted: true\n\n else\n text = convert_all_entities(tweet)\n\n send_media_of tweet\n\n end\n\n text = text + \"\\n\\n<a href=\\\"#{tweet.uri}\\\">Reply</a>\"\n\n @bot.telegram.api.send_message(\n chat_id: @config.twitter.target_channel,\n text: text,\n parse_mode: 'HTML',\n disable_web_page_preview: true\n )\n\n end", "def on_mention(tweet)\n txt = tweet.text.split[1..-1].join(' ')\n response = MODEL.make_response(txt, 100)\n reply(tweet, response)\n end", "def crosspost toot\n content = Decoder.decode(toot.content\n .gsub(/(<\\/p><p>|<br\\s*\\/?>)/, \"\\n\")\n .gsub(/<(\"[^\"]*\"|'[^']*'|[^'\">])*>/, '')\n .gsub('*', '*'))\n \n # replaces any mention in the post with the account's URL\n unless toot.mentions.size.zero?\n toot.mentions.each do |ment|\n content.gsub!(\"@#{ment.acct.split('@').first}\", ment.url)\n end\n end\n \n return if not @filter.nil? and content =~ @filter\n return if content.empty? and toot.media_attachments.size.zero?\n\n parent_toot = @masto_rest.status(toot.in_reply_to_id) unless toot.in_reply_to_id.nil?\n\n old_cw = parent_toot.spoiler_text unless parent_toot.nil?\n cw = toot.spoiler_text unless toot.spoiler_text.empty? or toot.spoiler_text == old_cw\n \n content = \"cw: #{cw}\\n\\n#{content}\" unless cw.nil?\n \n uploaded_media = false\n \n @retries = 0\n thread_ids = []\n while not content.empty? or\n (not toot.media_attachments.size.zero? and not uploaded_media)\n trimmed, content = trim_post(content)\n trimmed += \"…\" unless content.empty?\n tweet = nil\n reply_id = thread_ids.last || @ids[toot.in_reply_to_id]\n \n puts \"attempting to tweet \" + trimmed.length.to_s + \" chars\"\n\n while @retries < MaxRetries and tweet.nil?\n begin\n if toot.media_attachments.size.zero? or uploaded_media\n tweet = @twitter.update(trimmed,\n in_reply_to_status_id: reply_id)\n else\n media = download_media(toot).collect do |file|\n file.end_with?('.mp4') ?\n File.open(file, 'r') :\n file\n end\n tweet = @twitter.update_with_media(trimmed,\n media,\n in_reply_to_status_id: reply_id)\n\n uploaded_media = true\n end\n rescue Twitter::Error::UnprocessableEntity,\n Twitter::Error::RequestEntityTooLarge,\n Twitter::Error::BadRequest => err\n # if we're at the last try to upload media\n # we see if we have room to add the link to the\n # media, otherwise we tack the links onto the end\n # of 'content' so it'll get threaded onto the op\n # if we're not on the last try we just add 1 and\n # print the error out like normal\n if @retries + 1 >= MaxRetries\n toot.media_attachments.each do |media|\n if trimmed.length + media.url.length <= MaxTweetLength\n trimmed << \" #{media.url}\"\n else\n content << media.url\n end\n end\n \n # this skips trying to upload the media anymore\n uploaded_media = true\n else\n @retries += 1\n pp err\n end\n rescue Twitter::Error => err\n @retries += 1\n pp err\n rescue StandardError => err\n pp err\n ensure\n # make sure we clean up any downloaded files\n unless media.nil? or media.empty?\n media.each do |file|\n file.close if File.basename(file).end_with? '.mp4'\n File.delete(file)\n end\n end\n end\n end\n \n break if @retries >= MaxRetries or tweet.nil?\n\n thread_ids << tweet.id\n @ids[toot.id] = tweet.id \n cull_old_ids\n save_ids\n end\n end", "def retweet\n @tweet.retweet(current_user)\n redirect_to_back_or_default_url\n end", "def tweet account\n if @in_reply_to_status_id then\n account.client.statuses.update! :status => @status, :in_reply_to_status_id=>@in_reply_to_status_id\n else\n account.client.statuses.update! :status => @status\n end\n end", "def on_mention(tweet)\n\n #this is a bot we know\n if @botinfo.key?(tweet.user.screen_name)\n bot = @botinfo[tweet.user.screen_name]\n if bot.should_reply_to()\n #reply to the bot\n bot.replies_left -= 1\n sleep(rand(5..30))\n do_reply(tweet)\n else\n log \"not replying to bot\"\n end\n\t \n else\n # Become more inclined to pester a user when they talk to us\n userinfo(tweet.user.screen_name).pesters_left += 1\n delay do\n do_reply(tweet)\n end\n end\n end", "def on_mention(twt)\n Random.new_seed\n\n # We load our bot here.\n bot = ai('drbmitchellphd')\n\n # The replying dataset.\n bot.learn_from_dataset 'corpuses/doctor_tweet_corpus.txt'\n\n # Delay typing to act like a human is thinking what to say.\n # Produce a mistake rate between 0.1 and 1.\n sleep Masqueraide::NLP.typing_delay(twt.text)\n\n # Check if the text is unintelligible before responding to the patient.\n if Masqueraide::NLP.unintelligible? twt.text\n rand = Random.new.rand 0.1..1\n unsure_response = []\n # Choose a random unsure sentence from the markov chain.\n if rand > 0.5\n unsure_sentences = []\n while unsure_sentences.length != 10\n sentence = bot.reply(twt.text, 140)\n if sentiment.classify_with_score(sentence)[0].to_sym == :unsure\n unsure_sentences << sentence\n end\n end\n else\n # Or use a predefined corpus.\n # Read the DM corpus and produce an unsure response.\n unsure_response = DR_UNSURE['data'].select\n end\n unsure_response = unsure_response.sample\n sleep Masqueraide::NLP.typing_delay(unsure_response) + (Random.new.rand 1..15)\n reply(twt, unsure_response)\n return\n end\n\n # TODO: sentiment on public tweets.\n\n # We must identify between :question and :conversation tweets.\n # Continue the conversation publicly, but once offered to DM privately, don't talk to the person for (Time.now + 8 hours)\n # The doctor is busy.\n\n real_reply = bot.reply(twt.text, 140)\n\n # Delay based on how long it takes to type the message. and add 1 to 30.\n # Dr. Brian Mitchell does not need to reply instantly.\n sleep Masqueraide::NLP.typing_delay(real_reply) + (Random.new.rand 1..30)\n reply(twt, brian_reply)\n end", "def call\n client = @request[:twitter_client]\n\n mentions = TwitterMention.where('replied IS NOT TRUE').order(twitter_id: :desc).limit(REPLY_LIMIT).each do |mention|\n chat_response = Interactors::QueryBot.new(input: strip_mentions(mention.text)).call()\n full_text = \"#{chat_response.outputs.join(' ')}\"\n mention.update_attributes!(replied: true)\n Interactors::SendTweets.new({twitter_client: client, text: full_text, \n screen_names: [mention.screen_name], in_reply_to_status_id: mention.twitter_id}).call()\n end\n end", "def check_if_reply_and_not_already_read(tweet)\n\n puts tweet.text\n if tweet.text.match(/^@partyprinter.*/) && tweet.user.id != 1678701920 && Tweet.exists?(tweet.id.to_i) == nil\n puts \"new\"\n return true\n end\n\n end", "def on_timeline(tweet)\n #don't reply to retweets\n return if tweet.retweeted_status?\n #check if bot can \"pester\" this user\n return unless can_pester?(tweet.user.screen_name)\n\n #see if bot finds the tweet interesting (based off top 100 / top 20 model words)\n tokens = Ebooks::NLP.tokenize(tweet.text)\n interesting = tokens.find { |t| top100.include?(t.downcase) }\n very_interesting = tokens.find_all { |t| top20.include?(t.downcase) }.length > 2\n\n #do various actions depending on how interesting the tweet is\n delay do\n if very_interesting\n favorite(tweet) if rand < 0.5\n retweet(tweet) if rand < 0.1\n if rand < 0.05 #0.01\n userinfo(tweet.user.screen_name).pesters_left -= 1\n reply(tweet, make_response_wrapper(tweet))\n end\n elsif interesting\n favorite(tweet) if rand < 0.05\n if rand < 0.01 #0.001\n userinfo(tweet.user.screen_name).pesters_left -= 1\n reply(tweet, make_response_wrapper(tweet))\n end\n end\n end\n end", "def update_replies\n # https://api.slack.com/methods/conversations.replies\n # scopes: channels:history, groups:history, im:history, mpim:history\n replies = slack_client.conversations_replies(channel: channel_id, ts: slack_ts, inclusive: true, limit: 1)\n message = replies['messages'].first\n self.starter ||= User.find_or_create_by(slack_id: message['user'], team: team)\n self.latest_reply_ts = message['latest_reply']\n self.reply_count = message['reply_count']\n self.reply_users = message['reply_users'].map do |reply_user|\n user = User.find_or_create_by(slack_id: reply_user, team: team)\n user.id\n end.join(', ')\n self.reply_users_count = message['reply_users_count']\n save\n rescue Slack::Web::Api::Errors::MissingScope => _e\n false\n end", "def get_reply_to\n @reply_to\n end", "def getUserToReply\n followers = self::get_followers\n followers[:result][rand(followers[:result].length)]\n end", "def send_vote_reply vote\n tweeter = Tweeter.default\n reply_text = reply_message.gsub('#ANSWER#', \"#{vote.answer_abbr}\").gsub('#POLLNAME#', name )\n status = \"@#{vote.voter_name} #{reply_text} #{fq_url} #{poll_tag}\"\n tweeter.status_update( status, vote.tweet_id )\n logger.info(\"REPLY SENT\")\n end", "def tweet\n return \"chirp chirp\"\n end", "def reset_since_id_reply\n config[:since_id_reply] = 0\n result = client.mentions_timeline.max_by(&:id)\n update_since_id_reply(result)\n end", "def retweet?(message)\n message.index('RT @') || message.index(%{ \"@}) || message.index(\" \\u201c@\") #detect retweets\n end", "def reply\n message_body = params[\"Body\"]\n from_number = params[\"From\"]\n @recent_msg = Message.where(number: from_number).last # Get the name of this user if possible\n\n # Some random schmoe not in our db is trying to text me.\n if @recent_msg.blank?\n head 200, \"content_type\" => 'text/html'\n return\n end\n\n user = @recent_msg.user\n\n # Store reply in db and send back a simple text.\n @message = Message.new(user: user, number: from_number, text: message_body, action: 'REPLY')\n if @message.save\n boot_twilio\n sms = @client.messages.create(\n from: Rails.application.secrets.twilio_number,\n to: from_number,\n body: \"Hello from the other side! Your number is #{from_number}.\"\n )\n end\n head 200, \"content_type\" => 'text/html'\n end", "def get_reply\n @reply\n end", "def reply\n end", "def set_reply\n @post = Post.find(params[:post_id])\n @comment = @post.comments.find(params[:comment_id])\n @reply = @comment.replies.find(params[:id])\n end", "def on_tweet(tweet)\n # only interested in retweets\n return unless tweet[:retweeted_status]\n\n orig_id = tweet[:retweeted_status][:id]\n tweet[:timestamp_ms] = tweet[:timestamp_ms].to_i\n # only maintain the most recent RT received\n @rts[orig_id] = tweet\n end", "def reply_to\n @reply_to\n end", "def create\r\n @tweet = Tweet.new(tweet_params)\r\n @tweet.poster_id = current_user.id\r\n @tweet.user = current_user\r\n @tweet.is_retweet = false\r\n\r\n # if @tweet.is_reply\r\n # Tweet.find(@tweet.reply_id).replies << @tweet\r\n # end\r\n\r\n respond_to do |format|\r\n if @tweet.save\r\n format.html { redirect_to root_path}\r\n format.js { render 'create' }\r\n else\r\n @tweet_stream = []\r\n format.html { render action: 'new' }\r\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n\r\n # if @tweet.is_reply\r\n # Conversation.create(@tweet_id)\r\n\r\n # Notification.new(user_id: Tweet.find(reply_id).user_id, img_url: User.find(Tweet.find(reply_id).user_id).img_url, content: @tweet.content, message: \"#{User.find(@tweet.user_id).full_name} retweeted your tweet!\"\r\n # end\r\n\r\n end", "def tweet(message, lat = nil, long = nil, reply_id = nil)\n #\nend", "def tweet(message, lat = nil, long = nil, reply_id = nil)\n #\nend", "def send_tweets\n\n\t\ttweets = TweetQueue.all\n\n\t\ttweets.each do |tweet|\n\n\t\t\ttext \t\t\t= tweet.text\n\n\t\t\ttweet_source \t= {:id => tweet.source}\n\n\t\t\tnew_tweet = reply(text, tweet_source)\n\n\t\t\tunless new_tweet.is_unique?\n\t\t\t\trandom_suffix = random_chars(2)\n\t\t\t\tnew_tweet = reply(text + random_suffix, tweet_source)\n\t\t\t\tdebug \"Duplicate tweet id detected; adding random emoji\"\n\t\t\tend\n\n\t\t\tstore_id_of new_tweet\n\n\t\t\ttweet.destroy\n\t\t\tdebug \"Outgoing Tweet: #{new_tweet.text}\"\n\n\t\tend # tweets.each\n\n\tend", "def increment_both_no_reply_count\n return true if seen_second_both_no_reply?\n if seen_first_both_no_reply\n self.seen_second_both_no_reply = true\n else\n self.seen_first_both_no_reply = true\n end\n end", "def tweet\r\n\treturn \"tweet tweet tweet\"\r\n\tend", "def reply\n is_reputable_to do\n @post = Post.find(params[:id])\n @topic = @post.topic\n @topicable = @topic.topicable\n #\n render_reply_form\n end \n end", "def replyToChatter(origin,reply)\n Debug.log \"Reply to chatter #{reply} (#{origin})\"\n f=Databasedotcom::Chatter::FeedItem.find(@client,origin);\n f.comment(reply)\n end", "def poll_timeline\n opts = @last_id ? { :since_id => @last_id } : {}\n tl = @twitter.friends_timeline( opts )\n if tl.any?\n if @last_id.nil?\n @last_id = tl[ 0 ].id.to_i\n else\n tl.reverse!\n tl.reverse_each do |tweet|\n say_tweet tweet\n end\n end\n end\n rescue Exception => e\n $stderr.puts \"Twitter exception: #{e.message}\"\n # $stderr.puts e.backtrace.join( \"\\t\\n\" )\n end", "def cancel_reply\n render :text => ''\n end", "def _on_reply(wi)\n Ruote.participant_send(self, :on_reply, 'workitem' => wi)\n end", "def replying_to\n return nil unless self.reply?\n user = self.text[0...self.text.index(\" \")]\n return nil unless user[0...1] == \"@\"\n user\n end", "def replying_to\n return nil unless self.reply?\n user = self.text[0...self.text.index(\" \")]\n return nil unless user[0...1] == \"@\"\n user\n end", "def reply_bang\n user_bang = UserBang.find_by(id: params[:id])\n raise Bang::Error::InvalidUserBang\\\n if !user_bang.present?\\\n || user_bang.user_id != current_user.id\\\n || user_bang.has_replied?\n\n user_bang.status = UserBang.status_from_string(params[:status])\n if user_bang.accept?\n create_conversation [user_bang.user_id, user_bang.from_user_id], :user_bang\n end\n user_bang.save!\n @user_bang = user_bang\n end", "def retweeted?\n retweeted_ids = h.current_user.retweeted_replies.pluck(:id)\n retweeted_ids.include?(self.id)\n end", "def increment_doer_no_reply_count\n return true if seen_second_doer_no_reply?\n if seen_first_doer_no_reply\n self.seen_second_doer_no_reply = true\n else\n self.seen_first_doer_no_reply = true\n end\n end", "def on_timeline(tweet)\n end", "def reply_to_line(reply_text)\n return nil if reply_text.nil?\n\n #Get reply token\n reply_token = params['events'][0]['replyToken'] \n \n #Set reply message\n message = {\n type: 'text',\n text: reply_text\n }\n\n #Send message\n line.reply_message(reply_token, message)\n end", "def do_new_reply\n @feeditem_id = params['feeditem_id']\n @challenge_id = params['challenge_id']\n @reply_text = params['reply_text']\n ChallengeFeeds.post_comment(dbdc_client, @feeditem_id, @reply_text)\n redirect_to :id => @challenge_id, :action => 'show'\n end", "def prev_follow\n end", "def reply_text\n root['ReplyText']\n end", "def reply_to\n (@reply_to || self.from)\n end", "def tweet\n return \"Arrrr matey\"\n end", "def reply(ev, text, opts={})\n opts = opts.clone\n\n if ev.is_a? Twitter::DirectMessage\n log \"Sending DM to @#{ev[:sender][:screen_name]}: #{text}\"\n @twitter.direct_message_create(ev[:sender][:screen_name], text, opts)\n elsif ev.is_a? Twitter::Tweet\n log \"Replying to @#{ev[:user][:screen_name]} with: #{text}\"\n @twitter.update(text, in_reply_to_status_id: ev[:id])\n else\n raise Exception(\"Don't know how to reply to a #{ev.class}\")\n end\n end", "def tweet(text)\n @followers.each do |follower|\n follower.receive_tweet(@name, text)\n end\n end", "def update\n @reply = current_user.replies.find(params[:id])\n if (@reply.update_attributes(params[:reply]))\n event = Event.find(@reply.event.id)\n BabysitMailer.deliver_reply(event, @reply)\n redirect_to user_url(current_user)\n else\n render :action => :edit\n end\n end", "def retweet(query_parameters = {})\n start('statuses/retweet', query_parameters)\n end", "def markov_getreply(input='')\n if !@hal.nil?\n reply = @hal.getResponse(input)\n\n # We don't want to save every single time someone says something, so this is a hack.\n if (Time.now.sec % 2) == 0\n @hal.save\n end\n return reply\n end\n end", "def prepare_all_reply_links(all_links, target)\n all_reply_links = Array.new\n all_links.each do |link|\n begin\n open(link) do |f|\n hash_data = {}\n hash_data[:link] = link\n data = f.read\n # get the body\n body_match = (/<span class=\"entry-content\">(.*?)<\\/span>.*<span class=\"published\">(.*?)<\\/span>/).match(data) unless data == nil\n hash_data[:body] = body_match[1].strip unless body_match == nil\n hash_data[:body] = \"N/A\" if body_match == nil\n # the body (as it is a reply) has @username, need to replace with good url\n hash_data[:body] = hash_data[:body].gsub(/@<a href=\\\"\\//, \"@<a href=\\\"http://twitter.com/\")\n hash_data[:time] = Time.parse(body_match[2]) unless body_match == nil \n hash_data[:time] = Time.now if body_match == nil \n # get authors name (not necessary /status/, but may be /statuses/, so .*?)\n name_match = (/twitter.com\\/(.*?)\\/.*?\\/(.*)/).match(link.downcase) \n hash_data[:name] = name_match[1].strip unless name_match == nil\n hash_data[:name] = \"unknown\" if name_match == nil \n hash_data[:sid] = name_match[2].strip unless name_match == nil\n hash_data[:sid] = \"0\" if name_match == nil \n # now actually check if this is a reply\n search_string = \"<a href=\\\"\" + target[:link] + \"\\\">in reply to \" + target[:name] + \"</a>\"\n we_have_reply = data.downcase.index(search_string.downcase) unless data == nil\n all_reply_links.push hash_data unless we_have_reply == nil\n \tend\n rescue\n # ignore here\n end\n end \n all_reply_links \nend", "def new_replies\n last_comment_view.nil? ? replies : replies.find(:all, :conditions => [\"thing_comments.created_at > ?\", last_comment_view])\n end", "def tweet(args = {})\n options = {\n num_hashtags: [0, rand(-5..4)].max,\n num_mentions: [0, rand(-7..2)].max,\n reply: (rand(1..10) == 1),\n body_length: rand(20..140)\n }.merge(args)\n\n my_reply = options[:reply] ? \"#{mention} \" : ''\n my_mentions = (options[:num_mentions]).positive? ? \"#{mentions(options[:num_mentions])} \" : ''\n my_tags = tags(options[:num_hashtags])\n\n remaining = [\n options[:body_length],\n 140 - (my_reply.size + my_mentions.size + my_tags.size)\n ].min\n\n \"#{my_reply}#{body(remaining)}#{my_mentions}#{my_tags}\"\n end", "def increment_both_no_reply_count!\n increment_both_no_reply_count\n save\n end", "def tweet!\n TWITTER.update(\"#{title.truncate(75)} - #{tweet_users}\\n\\nhttp://beta.briefideas.org/ideas/#{sha}\")\n self.update_columns(:tweeted => true)\n end", "def tweet(message)\n @followers.each { |follower| follower.update(self, message)}\n end", "def post_to_twitter\n tweet = event_post_to_twitter(current_user.events.find(params[:id]))\n if tweet\n tweet_url = \"https://twitter.com/#{current_user.twitter_username}/status/#{tweet.id}\"\n redirect_to request.referer,\n :flash => { :success => \"Your event has been twitted,\n <br><i class='fa fa-twitter'></i> \n <a href='#{tweet_url}' rel='nofollow' target='_blank'>#{tweet_url}</a>\" }\n else\n redirect_to request.referer, :flash => { :error => \"Ooops. something wrong\" }\n end\n end", "def unfollow\n @twitter = Twitter::Client.new(\n :oauth_token => @bot.tw_token,\n :oauth_token_secret => @bot.tw_secret\n )\n\n @tweet = Tweet.find(params[:tweet])\n\n @twitter.unfollow(@tweet.tw_usuario)\n @tweet.estado = 4\n @tweet.save\n\n mensaje = \"Dejo de seguir a \" + @tweet.tw_usuario\n redirect_to(bot_tweets_path(@bot), notice: mensaje)\n end", "def reply_to\n return @reply_to\n end", "def unfollow\n\t\t@twitter = Twitter::Client.new(\n\t\t\t:oauth_token => @bot.tw_token,\n\t\t\t:oauth_token_secret => @bot.tw_secret\n\t\t)\n\n\t\t@tweet = Tweet.find(params[:tweet])\n\n\t\t@twitter.unfollow(@tweet.tw_usuario)\n\t\t@tweet.estado = 4\n\t\t@tweet.save\n\n\t\tmensaje = \"Dejo de seguir a \" + @tweet.tw_usuario\n\t\tredirect_to(bot_tweets_path(@bot), notice: mensaje)\n\tend", "def set_thread_for_replies\n self.thread = self.commentable.thread if self.reply_comment?\n end", "def reply\n @reply\n end", "def execute(msg, tweet)\n return if Variables::Constants::IGNORED_USERS.include?(msg.user.nick)\n # 134 because it has to fit \"[IRC] \"\n if tweet.length > 1 && tweet.length < 134\n twitter = LittleHelper.init_twitter\n twitter.update(\"[IRC] #{tweet}\")\n msg.reply('Successfully tweeted!'.freeze)\n else\n msg.reply('That tweet is either too long or too short.'.freeze)\n end\n end", "def replymsg\n @dirreply_msg = HDirmessageReply.select(\"m_users.user_name,h_dirmessage_replies.dirmsg_id,h_dirmessage_replies.dirthread_msg,h_dirmessage_replies.created_at\")\n .joins(\"join m_users on m_users.user_id=h_dirmessage_replies.reply_user_id\")\n .where(\"h_dirmessage_replies.dirmsg_id=?\", params[:clickid]).order(\"h_dirmessage_replies.created_at ASC\")\n #TChunreadMessage.joins(\"join t_channel_messages on t_channel_messages.chmsg_id=t_chunread_messages.chmsg_id\")\n #.where(\"chuser_id=? and t_channel_messages.channel_id =? \", session[:user_id], session[:clickchannel_id]).update_all(is_read: 0)\n main\n end", "def set_reply\n @reply = Replie.find(params[:id])\n end", "def retweeted_to_me(options={})\n perform_get(\"statuses/retweeted_to_me.#{Twitter.format}\", options)\n end", "def set_reply\n @reply = Reply.find(params[:id] || params[:reply_id])\n end", "def reply(event)\n msg = event.message['text']\n mk_reply(msg)\nend", "def micropost_notification(poster, follower, micropost)\n @greeting = \"Hi\"\n @follower = follower\n @micropost = micropost\n @poster = poster\n\n mail to: follower.email, subject: \"New Tweet!\"\n \n end", "def in_reply_to\n headers['In-Reply-To']\n end", "def tweet\n\t\treturn \"Polly want's a cracker.\"\n\tend", "def execute(msg, tweet)\n # 134 because it has to fit \"[IRC] \"\n if tweet.length > 1 && tweet.length < 134\n LittleHelper::TWEETER.update(\"[IRC] #{tweet}\")\n msg.reply('Successfully tweeted!'.freeze)\n else\n msg.reply('That tweet is either too long or too short.'.freeze)\n end\n end", "def reply\n @title = \"Reply\"\n @user=User.find(params[:id])\n @micropost=Micropost.new\n respond_to do |format|\n format.html\n format.json { render json: @micropost }\n end\n\n end", "def retweet(id)\n # one thread per retweet, \n # cause it's much, much faster\n Thread.new do \n LOG.info \"retweet status ##{id}\"\n @handler.post(\"/statuses/retweet/#{id}.json\", nil)\n end\n end", "def replies\n Post.where(\"topic_id = ?\", self.id).order(\"created_at asc\")\n #Post.find_all_by_topic_id(self.id).order(\"created_at desc\")\n end", "def tweet_reviewed_by_influencer(tweet)\n @tweet = tweet\n\n set_attachments\n\n mail(to: tweet.campaign.advertiser.user.email, subject: \"Notificaciones @ Social Target - Uno de tus tweets fue revisado/modificado por una empresa\")\n end", "def reply\n if acknowledged?\n replies.first\n else\n nil\n end\n end", "def post_tweet(message)\n Tweet.new(message, self) # I am myself\n end", "def tweet\n\t\treturn \"AHHP! Pretty bird!\"\n\tend", "def follow\n @twitter = Twitter::Client.new(\n :oauth_token => @bot.tw_token,\n :oauth_token_secret => @bot.tw_secret\n )\n\n @tweet = Tweet.find(params[:tweet])\n\n @twitter.follow(@tweet.tw_usuario)\n @tweet.estado = 1\n @tweet.save\n\n mensaje = \"Se sigue a \" + @tweet.tw_usuario\n redirect_to(bot_tweets_path(@bot), notice: mensaje)\n end", "def update\n @reply = Reply.find(params[:id])\n\n respond_to do |format|\n if @reply.update_attributes(params[:reply ])\n flash[:notice] = 'Reply was successfully updated.'\n if @blog\n format.html { redirect_to([@blog, @reply ]) } \n else\n format.html { redirect_to(@reply ) } \n end\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reply.errors, :status => :unprocessable_entity }\n end\n end\n end", "def tweet(t)\n @t = t\n @followers.each do |observer|\n observer.read(self)\n end \n end", "def update(sender, message)\n puts \"#{self.name} received a tweet from #{sender.name}: #{message}\"\n end", "def receive_replies(connection); end", "def update\n @reply = @topic.replies.find(params[:id])\n\n respond_to do |format|\n if @reply.update_attributes(params[:reply])\n flash[:notice] = '回复已成功更新。'\n format.html { redirect_to(@topic) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reply.errors, :status => :unprocessable_entity }\n end\n end\n end", "def perform(reply, user)\n\t\t@user = user\n\t\t@reply = reply\n\t\t@comment = Comment.where(id: @reply.comment_id).joins(\"JOIN things ON things.id = comments.thing_id\").select(:user_id, :thing_type, :id, :comment, :thing_id).first\n\t\tunless @comment.user_id == @user.id\n\t\t\t@reply_email = ReplyEmail.where(comment_id: @comment.id, user_id: @user.id, recipient_id: @comment.user_id).first\n\t\t\tunless @reply_email.present?\n\t\t\t\t@recipient = User.joins(\"JOIN email_preferences ON email_preferences.user_id = users.id\").select(:id, :email, :name, :token_1, :token_2, :comment_replies, :email_validated).where(id: @comment.user_id).first\n\t\t\t\t(@comment.comment.length > 40) ? (@comment_val = @comment.comment[0,40] + \"...\") : (@comment_val = @comment.comment)\n\t\t\t\tif @comment.thing_type == 0 #thing_type == 0 means it's for the leaderboard\n\t\t\t\t\t@action = send_notification(\"/leaderboard\")\n\t\t\t\telsif @comment.thing_type == 1 #thing_type == 1 means it's for a user's post\n\t\t\t\t\t@post = Post.find_by_thing_id(@comment.thing_id)\n\t\t\t\t\t@action = send_notification(\"/posts/#{@post.id}\")\n\t\t\t\telsif @comment.thing_type == 2 #thing_type == 2 means it's for a workout\n\t\t\t\t\t@workout = Workout.find_by_thing_id(@comment.thing_id)\n\t\t\t\t\t@action = send_notification(\"/workouts/#{@workout.id}\")\n\t\t\t\telsif @comment.thing_type == 3 #thing_type == 3 means it's for a contest\n\t\t\t\t\t@contest = Contest.find_by_thing_id(@comment.thing_id)\n\t\t\t\t\t@action = send_notification(\"/contests/#{@contest.id}\")\n\t\t\t\tend\n\t\t\t\tReplyEmail.create(comment_id: @comment.id, user_id: @user.id, recipient_id: @comment.user_id)\n\t\t\tend\n\t\tend\n\tend", "def update\n @reply = Replly.find(params[:id])\n\n if @reply.update_attributes(reply_params)\n redirect_to(list_path(@reply.list_id), notice: '回帖更新成功.')\n else\n render action: 'edit'\n end\n end", "def tweet\n\treturn \"Tweet Tweet Twitter\"\nend", "def update\n @reply = Reply.find(params[:id])\n @post = @reply.post\n @reply.user_id = current_user.id\n\n respond_to do |format|\n if @reply.update_attributes(params[:reply])\n format.html { redirect_to @post , notice: 'Reply added' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end", "def follow\n\t\t@twitter = Twitter::Client.new(\n\t\t\t:oauth_token => @bot.tw_token,\n\t\t\t:oauth_token_secret => @bot.tw_secret\n\t\t)\n\n\t\t@tweet = Tweet.find(params[:tweet])\n\n\t\t@twitter.follow(@tweet.tw_usuario)\n\t\t@tweet.estado = 1\n\t\t@tweet.save\n\n\t\tmensaje = \"Se sigue a \" + @tweet.tw_usuario\n\t\tredirect_to(bot_tweets_path(@bot), notice: mensaje)\n\tend", "def reply()\n db = SQLite3::Database.new('db/db.db')\n authorid = db.execute(\"SELECT UserId FROM users WHERE Username=(?)\", session[:user])\n if authorid != nil\n db.execute(\"INSERT INTO replies(Text, AuthorId, ParentId) VALUES(?, ?, ?)\", params[\"reply\"], authorid, params[\"threadId\"])\n else\n redirect('/')\n end\n redirect('/')\nend", "def tweet_reviewed_by_advertiser(tweet)\n @tweet = tweet\n\n set_attachments\n\n mail(to: tweet.influencer.user.email, subject: \"Notificaciones @ Social Target - Uno de tus tweets fue revisado/modificado por una celebridad\")\n end", "def can_reply_to?(topic) false end", "def reply(message)\n return @mouth.reply(message)\n end", "def reply\n @page = Page.find(params[:page])\n @parent_id = params[:parent]\n @comment_indent = params[:indent]\n @comment = Comment.new(:emailupdates => true)\n end", "def reply?\n !self.in_reply_to.nil?\n end", "def reply?\n !self.in_reply_to.nil?\n end" ]
[ "0.6814464", "0.67171884", "0.6710001", "0.6454624", "0.64500445", "0.63366455", "0.6322527", "0.62949777", "0.62840176", "0.6261413", "0.6234904", "0.61191595", "0.6086721", "0.6065399", "0.6041803", "0.6021239", "0.60071474", "0.5991872", "0.5983279", "0.5967489", "0.59651446", "0.5954073", "0.5948671", "0.594224", "0.59355956", "0.5923785", "0.58841467", "0.58841467", "0.58695537", "0.58692825", "0.5851001", "0.58479536", "0.58400786", "0.5836091", "0.58251244", "0.5824746", "0.58179945", "0.58179945", "0.58007234", "0.5793461", "0.5784795", "0.5767314", "0.5766086", "0.57634985", "0.57589597", "0.575291", "0.5750568", "0.5748818", "0.57404107", "0.57376605", "0.5732859", "0.57293606", "0.57215893", "0.57206833", "0.5719274", "0.57156146", "0.570266", "0.5698723", "0.5686595", "0.56783056", "0.5677841", "0.5674947", "0.5652736", "0.56369996", "0.56369305", "0.5634887", "0.56347275", "0.5631584", "0.560966", "0.5597952", "0.5590402", "0.558546", "0.5584898", "0.55831426", "0.5574171", "0.5568921", "0.55593246", "0.55592376", "0.5546695", "0.55420524", "0.55405086", "0.5534282", "0.55302453", "0.55260986", "0.5524647", "0.5524336", "0.5517752", "0.55174845", "0.55120766", "0.5510478", "0.550141", "0.5499976", "0.5498379", "0.5495712", "0.5494086", "0.54929215", "0.5484572", "0.54838145", "0.5473824", "0.5473824" ]
0.57269347
52
Field assigments Assigns the tweet's fields from a Twitter status object Returns the tweet record without saving it and persisting the changes to the database
def assign_fields(status) self.text = expand_urls(status.text, status.urls) self.in_reply_to_user_id = status.in_reply_to_user_id self.in_reply_to_status_id = status.in_reply_to_status_id self.source = status.source self.lang = status.lang self.retweet_count = status.retweet_count self.favorite_count = status.favorite_count self.created_at = status.created_at self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_database(t, i)\n created_at = DateTime.strptime(t['created_at'], '%a %b %d %H:%M:%S %z %Y')\n # get rid of annoying Asian characters\n location = t['user']['location']#.gsub(/[^\\p{Latin}\\/ \\-,]/, '')\n\n begin\n # if the object contains latitude and longitude and retweeted status\n if t['coordinates'] != nil and t['retweeted_status'] != nil\n status = Status.create(:id => t['id_str'], :text => t['text'],\n :created_at => created_at,\n :longitude => t['coordinates']['coordinates'][0],\n :latitude => t['coordinates']['coordinates'][1],\n :favorite_count => t['favorite_count'],\n :retweet_count => t['retweet_count'],\n :original_status_id => t['retweeted_status']['id_str'],\n :user_id => t['user']['id_str'],\n :user_followers_count => t['user']['followers_count'],\n :user_friends_count => t['user']['friends_count'],\n :user_location => location,\n :user_screen_name => t['user']['screen_name'])\n elsif t['coordinates'] == nil and t['retweeted_status'] != nil\n # else if no longitude and latitude but does have retweeted status\n status = Status.create(:id => t['id_str'], :text => t['text'],\n :created_at => created_at,\n :favorite_count => t['favorite_count'],\n :retweet_count => t['retweet_count'],\n :original_status_id => t['retweeted_status']['id_str'],\n :user_id => t['user']['id_str'],\n :user_followers_count => t['user']['followers_count'],\n :user_friends_count => t['user']['friends_count'],\n :user_location => location,\n :user_screen_name => t['user']['screen_name'])\n # else if the object contains latitude and longitude but not retweeted status\n elsif t['coordinates'] != nil and t['retweeted_status'] == nil\n status = Status.create(:id => t['id_str'], :text => t['text'],\n :created_at => created_at,\n :longitude => t['coordinates']['coordinates'][0],\n :latitude => t['coordinates']['coordinates'][1],\n :favorite_count => t['favorite_count'],\n :retweet_count => t['retweet_count'],\n :user_id => t['user']['id_str'],\n :user_followers_count => t['user']['followers_count'],\n :user_friends_count => t['user']['friends_count'],\n :user_location => location,\n :user_screen_name => t['user']['screen_name'])\n elsif t['coordinates'] == nil and t['retweeted_status'] == nil\n # else if no longitude, no latitude, and no retweeted status\n status = Status.create(:id => t['id_str'], :text => t['text'],\n :created_at => created_at,\n :favorite_count => t['favorite_count'],\n :retweet_count => t['retweet_count'],\n :user_id => t['user']['id_str'],\n :user_followers_count => t['user']['followers_count'],\n :user_friends_count => t['user']['friends_count'],\n :user_location => location,\n :user_screen_name => t['user']['screen_name'])\n end \n rescue StandardError => e\n # if the new row doesn't get created in the database, print out\n # some helpful info so we can look to see what's going on\n if e.class.to_s == 'ActiveRecord::RecordNotUnique'\n return 1\n else\n puts i.to_s\n puts $!\n return 0\n end\n end\n\n # add URLs, if there are any. I set the urls table to hold 1024\n # characters, so limit the url characters to that many\n if t[\"entities\"].keys.include? \"urls\"\n t[\"entities\"][\"urls\"].each do |url|\n status.urls.create(:url => url['expanded_url'][0..1023])\n end\n end\n\n return 0\nend", "def assign_fields(user)\n self.screen_name = user.screen_name\n self.name = user.name\n description_urls = user.attrs[:entities].try(:fetch, :description).try(:fetch, :urls, nil)\n self.description = description_urls ? expand_urls(user.description, description_urls) : user.description\n self.location = user.location\n self.profile_image_url = user.profile_image_url_https\n url_urls = user.attrs[:entities].try(:fetch, :url, nil).try(:fetch, :urls, nil)\n self.url = url_urls ? expand_urls(user.url, url_urls) : user.url\n self.followers_count = user.followers_count\n self.statuses_count = user.statuses_count\n self.friends_count = user.friends_count\n self.joined_twitter_at = user.created_at\n self.lang = user.lang\n self.time_zone = user.time_zone\n self.verified = user.verified\n self.following = user.following\n self\n end", "def postTweet(status)\n\t\t\t@client.update(status)\n\t\tend", "def fix_raw_tweet!\n return unless raw_tweet\n raw_tweet['id'] = ModelCommon.zeropad_id( raw_tweet['id'])\n raw_tweet['created_at'] = ModelCommon.flatten_date(raw_tweet['created_at'])\n raw_tweet['favorited'] = ModelCommon.unbooleanize(raw_tweet['favorited'])\n raw_tweet['truncated'] = ModelCommon.unbooleanize(raw_tweet['truncated'])\n raw_tweet['twitter_user_id'] = ModelCommon.zeropad_id( raw_tweet['twitter_user_id'] )\n raw_tweet['in_reply_to_user_id'] = ModelCommon.zeropad_id( raw_tweet['in_reply_to_user_id']) unless raw_tweet['in_reply_to_user_id'].blank? || (raw_tweet['in_reply_to_user_id'].to_i == 0)\n raw_tweet['in_reply_to_status_id'] = ModelCommon.zeropad_id( raw_tweet['in_reply_to_status_id']) unless raw_tweet['in_reply_to_status_id'].blank? || (raw_tweet['in_reply_to_status_id'].to_i == 0)\n Wukong.encode_components raw_tweet, 'text', 'in_reply_to_screen_name'\n end", "def save_tweet(tweet, user)\n RawTweet.create(tweet_id: tweet.id) do |t|\n t.full_text = tweet.full_text\n t.uri = tweet.uri\n t.tweet_posted_at = tweet.created_at\n t.username = user.screen_name\n t.place = place(tweet)\n end\n end", "def add_retweet(status)\n\t@tweet_db[status.retweeted_status.id] ||= {\n\t\t:original => status.retweeted_status,\n\t\t:retweets => {}\n\t}\n\t@tweet_db[status.retweeted_status.id][:retweets][status.id] = status\nend", "def tweet_params\n params.require(:tweet).permit(:status, :message, :location, :user_id)\n end", "def post_tweet(tweet, user)\n self.user_id = user\n self.external_id = tweet.id\n self.body = tweet.text\n\n self.longitude = tweet.place.bounding_box.coordinates[0][0][0]\n self.latitude = tweet.place.bounding_box.coordinates[0][0][1]\n self.active = true\n self.external_link = tweet.url\n\n self.created_at = tweet.created_at || DateTime.now\n self.provider = \"twitter\"\n self.kind = \"tweet\"\n\n self.log = tweet.to_hash\n if tweet.media.present?\n self.image = tweet.media[0].media_url\n end\n\n if (self.valid?)\n self.save!\n else\n # raise self.errors.inspect\n end\n end", "def transmogrify\n\t\tassign_value_of_changed_status\n\t\tupdate_attributes(last_sent: DateTime.now)\n\n\tend", "def fetch_details_from_twitter\n\t\t# twitter_object = Twitter::Client.new(\n\t\t# \t:oauth_token => self.token,\n\t\t# \t:oauth_token_secret => self.secret\n\t\t# \t)\n\t\t# twitter_data = Twitter.user(self.uid.to_i)\n\t\t# self.username = twitter_data.username\n\t\t# self.save\n\t\t# self.user.username = twitter_data.username if self.user.username.blank?\n\t\t# self.user.image = twitter_data.profile_image_url if self.user.image.blank?\n\t\t# self.user.location = twitter_data.location if self.user.location.blank?\n\t\t# self.user.save(:validate => false)\n\t\tself.user.has_twitter = true\n\t\tself.user.save\n\tend", "def parse_retweeted_status(rs)\n if rs.nil?\n nil\n else\n rs = { \n :created_at => rs.created_at,\n :id => rs.id,\n :text => rs.text,\n :source => rs.source, \n :truncated => rs[\"truncated\"],\n :in_reply_to_status_id => rs[\"in_reply_to_status_id\"],\n :in_reply_to_user_id => rs[\"in_reply_to_user_id\"],\n :in_reply_to_screen_name => rs[\"in_reply_to_screen_name\"],\n :user_id => rs[\"user\"][\"id\"] \n }\n rs\n end\n end", "def status\n Twitter::Status.new(@status.merge(:user => self.to_hash.delete(:status))) if @status\n end", "def create_from_status! (status)\n # Create a document only if geocords are available\n # TODO: relook this logic later, other options available\n if status['geo'] && status['geo']['type'] == 'Point'\n create! do |t|\n t.status_id = status['id_str']\n t.text = status['text']\n t.user_handle = status['user']['screen_name']\n t.user_avatar_url = status['user']['profile_image_url']\n t.location = status['geo']['coordinates'] # returns [-77.423456, 42.989259]\n t.place_name = status['place']['full_name'] if status['place']\n t.time = Time.parse(status['created_at']) # returns \"Wed Mar 28 21:28:55 +0000 2012\"\n end\n end\n end", "def tweet_params\n @tweet_parms = params.require(:tweet).permit(:tweet)\n @tweet_parms[:user] = auth_user\n @tweet_parms\n end", "def status_tweets\n logger.debug { \"#{__method__} is called twitter_user_id=#{id}\" }\n tweets = []\n tweets = InMemory::StatusTweet.find_by(uid) if InMemory.enabled? && InMemory.cache_alive?(created_at)\n tweets = Efs::StatusTweet.where(uid: uid) if tweets.blank? && Efs::Tweet.cache_alive?(created_at)\n tweets = ::S3::StatusTweet.where(uid: uid) if tweets.blank?\n tweets.map { |tweet| ::TwitterDB::Status.new(uid: uid, screen_name: screen_name, raw_attrs_text: tweet.raw_attrs_text) }\n end", "def persistance_data\n attributes.slice(\n :title,\n :description,\n :assignee_id,\n :status\n )\n end", "def tweet­_params\n params.require(:tweet­).permit(:status, :zombie_id)\n end", "def update_all_account_data\n tw_user = twitter_connection.user\n\n self.followers_count = tw_user.followers_count\n self.following_count = tw_user.friends_count\n self.tweets_count = tw_user.tweets_count\n self.avatar_url = \"#{tw_user.profile_image_url.scheme}://#{tw_user.profile_image_url.host}#{tw_user.profile_image_url.path.gsub('normal', '400x400')}\"\n self.username = \"@#{twitter_connection.user.screen_name}\"\n self.url = \"#{tw_user.url.scheme}://#{tw_user.url.host}#{tw_user.url.path}\"\n self.save\n self.fetch_latest_tweets(self.tweets.count > 0 ? self.tweets.maximum(:twitter_id) : nil) if tw_user.tweets_count > self.tweets.count\n end", "def retweeted_status\n @retweeted_status ||= self.class.fetch_or_new(@attrs[:retweeted_status])\n end", "def tweet_params\n params.require(:tweet).permit(:tweet)\n end", "def to_usmf status\n\n\t\tusmf = USMF.new\n\t\tuser = User.new\n\n\t\tstatus = JSON.parse(status)\n\t\tif status.has_key? 'Error'\n\t\t\tlogger.error(\"tweet malformed\")\n\t\t\traise \"status malformed\"\n\t\tend\n\n\t\t#Retrieving a status from Twitter\n\t\tusmf.service = \"Twitter\"\n\t\tusmf.id = status[\"id_str\"]\n\t\t\n\n\t\tx = status[\"coordinates\"]\n\t\tunless x==nil\n\t\t\tusmf.geo = x[\"coordinates\"]\n\t\tend\n\t\t\n\t\tusmf.application = status[\"source\"]\n\t\t\n\n\t\tx = status[\"place\"]\n\t\tunless x == nil\n\t\t\tusmf.location = x[\"full_name\"] + \" , \" + x[\"country\"]\n\t\tend\n\n\t\tusmf.date = status[\"created_at\"]\n\t\tusmf.text = status[\"text\"]\n\t\tusmf.description = status[\"in_reply_to_status_id_str\"]\n\t\tusmf.likes = status[\"retweet_count\"]\n\n\t\t#Retrieving user\n\t\tx = status[\"user\"]\n\t\tunless x == nil\n\t\t\tuser.name = x[\"screen_name\"]\n\t\t\tuser.real_name = x[\"name\"]\n\t\t\tuser.id = x[\"id_str\"]\n\t\t\tuser.language = x[\"lang\"]\n\n\t\t\tunless x[\"time_zone\"] == nil and x[\"utc_offset\"] == nil\n\t\t\t\tuser.utc = x[\"time_zone\"].to_s + \" + \" + x[\"utc_offset\"].to_s\n\t\t\tend\n\n\t\t\tuser.description = x[\"description\"]\n\t\t\tuser.avatar = x[\"profile_image_url_https\"]\n\t\t\tuser.location = x[\"location\"]\n\t\t\tuser.subscribers = x[\"followers_count\"]\n\t\t\tuser.subscriptions = x[\"friends_count\"]\n\t\t\tuser.postings = x[\"statuses_count\"]\n\t\t\tuser.profile = \"https://twitter.com/#!/#{user.name}\"\n\t\t\tuser.website = x[\"url\"]\n\n\t\t\tusmf.user = user\n\t\t\tusmf.source = \"https://twitter.com/#{usmf.user.name}/status/#{usmf.id}\"\n\t\tend\n\t\t\n\n\t\tusmf.to_users = []\n\t\tusmf.links = []\n\n\t\t#Retrieving entities\n\n\t\tentities = status[\"entities\"]\n\t\tunless entities == nil\n\t\t\n\t\t#Retrieving URLs\n\n\t\t\tx = entities[\"urls\"]\n\t\t\tunless x == nil\n\t\t\t\tx.each do |item|\n\t\t\t\t\tl = Link.new\n\t\t\t\t\tl.href = item[\"url\"]\n\t\t\t\t\t\n\t\t\t\t\tusmf.links << l\n\t\t\t\tend\n\t\t\tend\n\n\t\t#Retrieving all media content\n\n\t\t\tx = entities[\"media\"]\n\t\t\tunless x == nil\n\t\t\t\tx.each do |item|\n\t\t\t\t\tl = Link.new\n\t\t\t\t\tl.title = item[\"type\"]\n\t\t\t\t\tl.thumbnail = item[\"media_url\"]\n\t\t\t\t\tl.href = item[\"url\"]\n\t\t\t\t\t\n\t\t\t\t\tusmf.links << l\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t#Retrieving hashtags\n\n\t\t\tx = entities[\"hashtags\"]\n\t\t\tunless x == nil\n\n\t\t\t\tusmf.keywords = \"\"\n\t\t\t\tx.each do |h| \n\n\t\t\t\t\tusmf.keywords += h[\"text\"] + \", \"\n\n\t\t\t\tend\n\n\t\t\tend\n\n\t\t\t#Retrieving mentions\n\n\t\t\tx = entities[\"user_mentions\"]\n\t\t\tunless x == nil\n\t\t\t\tx.each do |item|\n\t\t\t\t\ttu = ToUser.new\n\n\t\t\t\t\ttu.name = item[\"screen_name\"]\n\t\t\t\t\ttu.id = item[\"id_str\"]\n\n\t\t\t\t\tif item[\"id_str\"] == status[\"in_reply_to_user_id_str\"]\n\t\t\t\t\t\ttu.service = \"reply\"\n\t\t\t\t\telse\n\t\t\t\t\t\ttu.service = \"mention\"\n\t\t\t\t\tend\n\t\t\t\t\tunless status[\"in_reply_to_status_id_str\"] == nil\n\t\t\t\t\t\ttu.title = status[\"in_reply_to_status_id_str\"]\n\t\t\t\t\t\ttu.href = \"https://twitter.com/#{tu.name}/status/#{tu.title}\"\n\t\t\t\t\tend\n\n\t\t\t\t\tusmf.to_users << tu\n\t\t\t\tend\n\t\t\tend\n\n\t\tend\n\n\t\tusmf\n\n\tend", "def update_fields(fields)\n attributes[:action_id] = fields['id']\n attributes[:text] = fields['data']['text']\n attributes[:date] = Time.iso8601(fields['date'])\n attributes[:member_creator_id] = fields['idMemberCreator']\n self\n end", "def create_statuses\n end", "def create_statuses\n end", "def fixed_values\n if self.entry.present?\n self.published = self.entry.published\n self.entry_created_at = self.entry.created_at\n end\n end", "def tweet_params\n params.require(:tweet).permit(:content, :active)\n end", "def update_status(status)\n self.status = status\n self.save! validate: false\n end", "def import_profile_from_twitter\n self.profile.first_name = @credentials['name']\n self.profile.website = @credentials['url']\n self.profile.federated_profile_image_url = @credentials['profile_image_url']\n self.profile.save\n end", "def save_tweet(params)\n @tweet=self.tweets.new(params)\n @tweet.save\n schedule_tweet(@tweet)\n end", "def assign_twitter_account_info(auth)\n user = auth.extra.raw_info\n self.twitter_id = user.id\n self.name = user.name\n self.screen_name = user.screen_name\n self.location = user.location\n self.description = user.description\n self.url = user.url\n self.profile_image_url = user.profile_image_url_https\n self\n end", "def set_flds\n self.status = 'active' if status.blank?\n self.status = 'scheduled' if has_appt? && !is_completed?\n self.status = 'completed' if is_completed?\n end", "def set_status\n\t \t#establecer status en BD\n\t \tself.status = \"created\"\n\t \tself.save #para que se guarde\n\t end", "def update_fields(fields)\n attributes[:action_id] = fields['id'] || attributes[:action_id]\n attributes[:text] = fields['data']['text'] || attributes[:text]\n attributes[:date] = Time.iso8601(fields['date']) if fields.has_key?('date')\n attributes[:member_creator_id] = fields['idMemberCreator'] || attributes[:member_creator_id]\n self\n end", "def retweeted_status\n @retweeted_status ||= self.class.new(@attrs['retweeted_status']) unless @attrs['retweeted_status'].nil?\n end", "def prepare\n model.tap do |p|\n p.identifier = set_identifiers\n p.meta = set_meta\n p.text = set_text\n p.status = COMPLETED_STATUS\n p.authored = set_date\n p.author = set_author\n p.subject = set_subject\n p.questionnaire = set_questionnaire\n p.group = set_group\n end\n end", "def tweet_params\n params.require(:tweet).permit(:body, :title, :footnote)\n end", "def create\n\n #player = Player.all.sample\n #game = Game.all.sample\n #tr = TweetRecord.new\n #tr.user_screen_name=\"rebeccag_dev\"\n #tr.user_twitter_id=1234567890123\n #tr.status_text=\"@c2sb #g#{game.id}p#{player.id}sFGM\"\n #Rails.logger.info \"Sending tweet #{tr.inspect}\"\n #TweetCollector.add_tweet(tr)\n ##StatisticsCollector.add_tweet(68,\"#g17p#{player.id}sFGM\")\n #Rails.logger.info \"Submitted tweet for player #{player.id} - #{player.name}\"\n #Rails.logger.info(\"Tweet log #{StatisticsCollector.get_tweet_log.last.inspect}\")\n #has_error = false\n\n\n @user_reported_statistic = UserReportedStatistic.new()\n stat_params=params[:user_reported_statistic]\n @tweet = params[:tweet]\n user_id = stat_params[:user]\n tr = TweetRecord.new\n tr.status_text=@tweet\n tr.user_id= user_id\n TweetCollector.add_tweet(tr)\n @user_reported_statistic = UserReportedStatistic.new\n\n if tr.has_error?\n @statistic_types = StatisticType.all\n @games = Game.all\n @teams = Team.all\n @players = Player.all\n @users = User.all\n tr.error_msgs.each do | x|\n @user_reported_statistic.errors.add(:tweet,x)\n end\n end\n logger.info(\"logger update_stat\")\n\n respond_to do |format|\n if tr.has_error?\n format.html { render action: \"new\" }\n format.json { render json: @user_reported_statistic.errors, status: :unprocessable_entity }\n else\n format.html { redirect_to user_reported_statistics_url, notice: 'User reported statistic was successfully created.' }\n format.json { render json: @user_reported_statistic, status: :created, location: @user_reported_statistic }\n end\n\n end\n end", "def set_attributes\n # (needed) set title\n if @data['title'] then\n @title = @data['title']\n else\n raise \"This post (#{@id}) miss a title\"\n end\n # (needed) set author\n if @data['author'] then\n @author_name = @data['author']\n elsif @infos[:author_name]\n @author_name = @infos[:author_name]\n else\n @author_name = 'unknown'\n end\n if @data['email'] then\n @author_email = @data['email']\n else\n @author_email = @infos[:author_email]\n end\n # (needed) set published, if found nowhere, use filename date\n if @data['published'] then\n @published = Time.at(@data['published'])\n elsif @infos[:published]\n @published = @infos[:published]\n else\n @published = Time.mktime(@year, @month, @day)\n end\n # (optional) set last modification date\n @last_modified = @infos[:last_modified] if @infos[:last_modified]\n # (optional) set last modification author name\n @last_author_name = @infos[:last_author_name] if @infos[:last_author_name]\n # (optional) set last modification author email\n @last_author_email = @infos[:last_author_email] if @infos[:last_author_email]\n end", "def tweet_params\n params.require(:tweet).permit(:username, :tweetbody)\n end", "def controller_issues_edit_before_save(context={ })\n\n issue = context[:issue]\n time_entry = context[:time_entry]\n\n if issue && time_entry\n # insere os dados no atributo auxiliar\n issue.ayty_before_time_entry = time_entry\n end\n\n end", "def set_tweet­\n @tweet­ = Tweet­.find(params[:id])\n end", "def update_tweet(id)\n RawTweet.update(id, is_processed: true)\n end", "def before_save\n self.status = 'submitted' if status.blank?\n end", "def manage_assign_attributes_with_params _params\n\t\t\tassign_attributes _params.permit([:status, :note])\n\t\tend", "def detect_tweet_type\n begin\n coordinates = MultiJson.load(self.coordinates)\n rescue ArgumentError\n coordinates = nil\n end\n entities = MultiJson.load(self.entities)\n self.with_coordinate = true if coordinates && !coordinates.empty?\n self.with_image = true if entities['media'] && !entities['media'].empty?\n self.with_url = true if entities['urls'] && !entities['urls'].empty?\n self.with_mention = true if entities['user_mentions'] && !entities['user_mentions'].empty?\n self.with_hashtag = true if entities['hashtags'] && !entities['hashtags'].empty?\n self.save if self.changed?\n return self\n end", "def queue\n raise StringTooBigError if status.length > MAX_STATUS_LENGTH\n api_url = 'http://twitter.com/statuses/update.json'\n url = URI.parse(api_url)\n req = Net::HTTP::Post.new(url.path)\n req.basic_auth(@@username, @@password)\n req.set_form_data({ 'status'=> status }, ';')\n res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }.body\n @id = JSON.parse(res)[\"id\"]\n @created_at = JSON.parse(res)[\"created_at\"]\n self\n end", "def tweet!\n TWITTER.update(\"#{title.truncate(75)} - #{tweet_users}\\n\\nhttp://beta.briefideas.org/ideas/#{sha}\")\n self.update_columns(:tweeted => true)\n end", "def tweet_params\n defaults = { user_id: current_user.id }\n params.require(:tweet).permit(:title, :content, :status, :user_id).reverse_merge(defaults)\n end", "def editing_complete status=nil\n self.edit_mode = false\n self.status = status.to_s if status\n self.save\n end", "def update( obj )\n timer.measure { \n tweet = obj\n }\n log_stats\n end", "def extract_and_set_fields\n @type = raw_event['type']\n @is_public = raw_event['public']\n @payload = raw_event['payload']\n @id = raw_event['id']\n # https://github.com/igrigorik/gharchive.org/blob/c9ae11426e5bcc30fe15617d009dfc602697ecde/bigquery/schema.js#L17-L38\n @repo = parse_repo\n\n # https://github.com/igrigorik/gharchive.org/blob/c9ae11426e5bcc30fe15617d009dfc602697ecde/bigquery/schema.js#L39-L70\n @actor = parse_actor\n\n # https://github.com/igrigorik/gharchive.org/blob/c9ae11426e5bcc30fe15617d009dfc602697ecde/bigquery/schema.js#L71-L102\n @org = parse_org\n\n @created_at = parse_created_at\n end", "def tweet_params\n params.require(:tweet).permit(:company_id, :text, :username, :useful, :bayesfilter)\n end", "def get_and_update_attributes!(_task)\n # raise \"You need to implement 'get_and_update_attributes!' method for class #{self.class}\"\n end", "def get_and_update_attributes!(_task)\n # raise \"You need to implement 'get_and_update_attributes!' method for class #{self.class}\"\n end", "def get_and_update_attributes!(_task)\n # raise \"You need to implement 'get_and_update_attributes!' method for class #{self.class}\"\n end", "def tweett_params\n params.require(:tweett).permit(:tweett)\n end", "def update!(**args)\n @entity_unique_id = args[:entity_unique_id] if args.key?(:entity_unique_id)\n @sentiment = args[:sentiment] if args.key?(:sentiment)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @entity_unique_id = args[:entity_unique_id] if args.key?(:entity_unique_id)\n @sentiment = args[:sentiment] if args.key?(:sentiment)\n @type = args[:type] if args.key?(:type)\n end", "def tweet_params\nparams.require(:tweet).permit(:text, :user_id)\nend", "def create\n @status = current_user.statuses.new(status_params)\n\n if current_user.state_facebook? && @status.content?\n current_user.facebook(current_user).put_wall_post(@status.content)\n end\n\n if current_user.state_twitter? && @status.content?\n current_user.twitter(current_user).update(@status.content)\n end\n \n respond_to do |format|\n if @status.save\n format.html { redirect_to statuses_url, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @status }\n else\n format.html { redirect_to statuses_url }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "def tweet_params\n params.require(:tweet).permit(:author, :content,:title,:url, :created_at, :user_id)\n end", "def tweet_params\n params.require(:tweet).permit(:contents, :id_user, :tweet_id)\n end", "def find_tweets(current_user)\n @screen_name = current_user.authentications[2].to_s\n @another_tweet = self.twitter.user_timeline(@screen_name)\n @tweet = Tweets.new\n @another_tweet.each do |t|\n @tweet.screenname = t.screen_name\n @tweet.text = t.text\n @tweet.created_at = t.created_at\n end\n @tweet.save\n end", "def tweet(message, options = {}) # options = {} is the hash argument\n status = Status.new\n status.lat = options[:lat] # each item in [] that starts with : are reference keys from hash\n status.long = options[:long]\n status.body = options[:body]\n status.reply_id = options[:reply_id]\n status.post\nend", "def load_task_field_values\n return if @task_fields\n\n @task_fields = {}\n @task_field_values = {} \n @task_field_values_changed = Set.new\n self.prototype.task_fields.each do |tf|\n @task_fields[tf.name] = tf\n end\n self.task_field_values.includes(:task_field).each do |task_field_value|\n @task_field_values[task_field_value.task_field.name] = task_field_value\n end\n end", "def set_tweet\n \t\t@tweet = Tweet.find(params[:id])\n \tend", "def tweet_params\r\n params.require(:tweet).permit(:content, :twauthor, :user_id)\r\n end", "def tweet_params\n params.require(:tweet).permit(:content, :user_id, :tweet_id)\n end", "def tweet account\n if @in_reply_to_status_id then\n account.client.statuses.update! :status => @status, :in_reply_to_status_id=>@in_reply_to_status_id\n else\n account.client.statuses.update! :status => @status\n end\n end", "def initialize(attrs)\n @completed = attrs[:completed] || attrs[\"Completed\"] || nil\n @demo = attrs[:demo] || attrs[\"Demo\"] || nil\n @scheduled_time = attrs[:scheduled_time] || attrs[\"ScheduledTime\"] || nil\n @status_code = attrs[:status_code] || attrs[\"StatusCode\"] || nil\n @status_text = attrs[:status_text] || attrs[\"StatusText\"] || nil\n @text_id = attrs[:text_id] || attrs[\"TextID\"] || nil\n @received_date = attrs[:received_date] || attrs[\"ReceivedDate\"] || nil\n @responded = attrs[:responded] || attrs[\"Responded\"] || nil\n end", "def lent_out\n\tupdate_attributes(status: 'Lent Out')\nend", "def assign_attributes_for_update!(hash, update_time)\n hash[:type] = model_class.name if supports_sti? && hash[:type].nil?\n hash[:updated_on] = update_time if supports_column?(:updated_on)\n hash[:updated_at] = update_time if supports_column?(:updated_at)\n end", "def assign_attributes_for_update!(hash, update_time)\n hash[:type] = model_class.name if supports_sti? && hash[:type].nil?\n hash[:updated_on] = update_time if supports_column?(:updated_on)\n hash[:updated_at] = update_time if supports_column?(:updated_at)\n end", "def ingest_human_review_field(obj)\n f = HumanReviewField.new\n f.human_review_id = self.id\n f.object_sha2 = obj.object_sha2\n f.object_uid = obj.object_uid\n f.object_type = obj.object_type\n f.object_field = obj.object_field\n f.object_field_original = obj.object_field_original\n f.save || (return false)\n\n return true\n end", "def prepare_for_update(updated_by_id, status)\n self.version += 1\n self.updated_by = updated_by_id\n self.donation_status = status\n self.updated_at = Time.now\n end", "def save_values\n self.first_name = @first_name_field.text.strip.chomp\n self.last_name = @last_name_field.text.strip.chomp\n self.email = @email_field.text.strip.chomp\n self.github = @github_field.text.strip.chomp\n self.twitter = @twitter_field.text.strip.chomp\n self.fun_fact = @fun_fact_field.text.strip.chomp\n\n # TODO: 2. Finish the implementation to set the other fields. DONE\n end", "def create\n @tracker = Tracker.new()\n @tracker.period = params[:period]\n @tracker.user_id = current_user.id\n @user = User.find(current_user.id)\n\n respond_to do |format|\n if @tracker.save\n \n @fields = [Field.new(), Field.new(), Field.new()]\n\n @lastfields = Field.all.order(\"id desc\").limit(3).reverse\n\n if not @lastfields.any? \n @fields[0].title = \"Progress\" \n @fields[1].title = \"Plan\"\n @fields[2].title = \"Problems\"\n else\n @fields[0].title = @lastfields[0].title \n @fields[1].title = @lastfields[1].title\n @fields[2].title = @lastfields[2].title\n end\n\n @fields.each do |f|\n f.tracker_id = @tracker.id\n f.save\n\n @entries = [Entry.new(), Entry.new(), Entry.new()]\n @entries.each do |e|\n e.field_id = f.id\n e.task = \"Click here to edit goal\"\n e.save\n\n end\n\n \n end\n\n format.html { redirect_to @user, notice: 'Tracker was successfully created.' }\n format.json { render :show, status: :created, location: @tracker }\n else\n format.html { render :new }\n format.json { render json: @tracker.errors, status: :unprocessable_entity }\n end\n end\n end", "def on_tweet(tweet)\n # only interested in retweets\n return unless tweet[:retweeted_status]\n\n orig_id = tweet[:retweeted_status][:id]\n tweet[:timestamp_ms] = tweet[:timestamp_ms].to_i\n # only maintain the most recent RT received\n @rts[orig_id] = tweet\n end", "def getTweet(tweet,rt)\n\tflds=[]\n\n\trt_original_tweetID=nil\n\tif tweet[\"retweeted_status\"]\n\t\trt_original_tweetID=tweet[\"retweeted_status\"][\"id\"]\n\tend\n\n\ttweetID=tweet[\"id\"]\n\tflds << tweetID\n\tflds << tweet[\"user\"][\"id\"]\n\tif tweet[\"created_at\"]\n\t\tflds << tweet[\"created_at\"]\n\t\tdt=DateTime.parse(tweet[\"created_at\"])\n\t\tflds << dt.strftime(\"%Y%m%d\")\n\t\tflds << dt.strftime(\"%H%M%S\")\n\telse\n\t\tflds << nil\n\t\tflds << nil\n\t\tflds << nil\n\tend\n\tflds << rt\n\tflds << rt_original_tweetID\n\tif $orgText\n\t\tflds << tweet[\"text\"]\n\telse\n\t\tif tweet[\"text\"]\n\t\t\tflds << tweet[\"text\"].gsub(\"\\r\",\"\").gsub(\"\\n\",\"\")\n\t\telse\n\t\t\tflds << nil\n\t\tend\n\tend\n\tif tweet[\"source\"]\n\t\tflds << tweet[\"source\"].gsub(/<a.*?>/,\"\").gsub(/<\\/a.*?>/,\"\")\n\telse\n\t\tflds << nil\n\tend\n\tflds << tweet[\"truncated\"]\n\tflds << tweet[\"in_reply_to_status_id\"]\n\tflds << tweet[\"in_reply_to_user_id\"]\n\tflds << tweet[\"in_reply_to_screen_name\"]\n\tdat=tweet[\"coordinates\"]\n\tif dat\n\t\tflds << dat[0]\n\t\tflds << dat[1]\n\telse\n\t\tflds << nil\n\t\tflds << nil\n\tend\n\tflds << tweet[\"contributors\"]\n\n\t#dat=tweet[\"current_user_retweet\"]\n\t#if dat\n\t#\tflds << dat[\"id\"]\n\t#else\n\t#\tflds << nil\n\t#end\n\n\tflds << tweet[\"avorite_count\"]\n\tflds << tweet[\"favorited\"]\n\tflds << tweet[\"filter_level\"]\n\tflds << tweet[\"lang\"]\n#place\tPlaces\n\tflds << tweet[\"possibly_sensitive\"]\n#scopes\tObject\n\tflds << tweet[\"retweet_count\"]\n\tflds << tweet[\"retweeted\"]\n#\tflds << tweet[\"withheld_copyright\"]\n#withheld_in_countries\tArray of String\n#\tflds << tweet[\"withheld_scope\"]\n\n\n\treturn tweetID,flds\nend", "def save\n # 1. What am I saving?\n # 2. input => username, message\n\n # if i saved\n # update OI don't want to do thjis!!!\n # else\n\n sql = <<-SQL\n INSERT INTO tweets (username, message)\n VALUES (?, ?);\n SQL\n\n # SQL Injection, parameterize\n\n DB[:conn].execute(sql, self.username, self.message)\n @id = DB[:conn].execute(\"SELECT * FROM tweets\").last[\"id\"]\n end", "def status\n @way.status = request.raw_post\n @way.save!\n render :text => @way.status\n end", "def import\n\t\t\t\tkeywords = [\"kind:status\", \"src:twitter\"].map do |keyword|\n\t\t\t\t\tKeyword.find_or_create_by_name(keyword)\n\t\t\t\tend\n\n\t\t\t\tlast_import = LastImport.first({\n\t\t\t\t\t\t:conditions => { :service_name => \"Twitter\" }})\n\t\t\t\tlast_updated = last_import ? last_import.timestamp : nil\n\n\t\t\t\tentries = []\n\t\t\t\tputs \" * parsing statuses\"\n\n\t\t\t\t# `ARGV[0]` gives us the name of the rake task that invokes this, so we\n\t\t\t\t# have to use `ARGV[1]` instead\n\t\t\t\tdata = File.open(ARGV[1], \"r\").read\n\t\t\t\titems = Crack::JSON.parse(data)\n\t\t\t\tunless items.empty?\n\t\t\t\t\titems.each do |item|\n\t\t\t\t\t\tentry = Entry.first({ :conditions => {\n\t\t\t\t\t\t\t\t:bookmark_url => \"https://twitter.com/#{@user_name}/status/#{item[\"id\"]}\" }})\n\n\t\t\t\t\t\tunless entry\n\t\t\t\t\t\t\tprint \".\"\n\t\t\t\t\t\t\tentry = generate_entry(item)\n\t\t\t\t\t\t\tentry.keywords = keywords\n\t\t\t\t\t\t\tentries << entry\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tputs\n\n\t\t\t\tputs \" * found #{entries.length} new statuses\"\n\t\t\t\t# We read newest-to-oldest, but it makes more sense to write to the\n\t\t\t\t# database oldest-to-newest.\n\t\t\t\tentries.reverse_each { |entry| entry.save }\n\n\t\t\t\tif last_import\n\t\t\t\t\tlast_import.update_attributes({ :timestamp => Time.now })\n\t\t\t\telse\n\t\t\t\t\tLastImport.create({ :service_name => \"Twitter\",\n\t\t\t\t\t\t\t:timestamp => Time.now })\n\t\t\t\tend\n\t\t\tend", "def prepare_for_update(updated_by_id, status)\n self.version += 1\n self.updated_by = updated_by_id\n self.donation_status = status\n self.updated_at = Date.current\n end", "def tweet_params\n params.require(:tweet).permit(:body)\n end", "def tweet_params\n params.require(:tweet).permit(:body)\n end", "def tweet_params\n params.require(:tweet).permit(:body)\n end", "def update!(**args)\n @new_otr_status = args[:new_otr_status] if args.key?(:new_otr_status)\n @new_otr_toggle = args[:new_otr_toggle] if args.key?(:new_otr_toggle)\n @old_otr_status = args[:old_otr_status] if args.key?(:old_otr_status)\n @old_otr_toggle = args[:old_otr_toggle] if args.key?(:old_otr_toggle)\n end", "def create\n @tweet = Tweet.new(tweet_params)\n if @tweet.username == nil\n # This is for the current user posting tweets\n @tweet.username = current_user.name\n @tweet.user_id = current_user.id\n # Updates to Twitter\n current_user.twitter.update(@tweet.tweetbody)\n else \n # Incoming tweets from the daemon script\n @tweet.save\n end\n respond_with(@tweet)\n end", "def create(attrs, user = @@default_user)\n attrs = { project_token: @project_token }.merge(attrs)\n @attributes = send_request('statuses', :post) do |req|\n req.body = {\n status_object: attrs.slice(:name),\n token: attrs[:project_token],\n auth_token: user.auth_token\n }\n end\n end", "def update!(**args)\n @field_display_name = args[:field_display_name] if args.key?(:field_display_name)\n @field_id = args[:field_id] if args.key?(:field_id)\n @field_type = args[:field_type] if args.key?(:field_type)\n @formatted_type = args[:formatted_type] if args.key?(:formatted_type)\n @metadata = args[:metadata] if args.key?(:metadata)\n @multi_valued = args[:multi_valued] if args.key?(:multi_valued)\n @schema_display_name = args[:schema_display_name] if args.key?(:schema_display_name)\n @schema_id = args[:schema_id] if args.key?(:schema_id)\n @type = args[:type] if args.key?(:type)\n @value = args[:value] if args.key?(:value)\n end", "def update!(**args)\n @status = args[:status] if args.key?(:status)\n @text_completeness_probability = args[:text_completeness_probability] if args.key?(:text_completeness_probability)\n end", "def update!(**args)\n @birthday_status = args[:birthday_status] if args.key?(:birthday_status)\n @family_status = args[:family_status] if args.key?(:family_status)\n @hidden_keys = args[:hidden_keys] if args.key?(:hidden_keys)\n @hide_type = args[:hide_type] if args.key?(:hide_type)\n end", "def update!(**args)\n @date_time_values = args[:date_time_values] if args.key?(:date_time_values)\n @enum_values = args[:enum_values] if args.key?(:enum_values)\n @float_values = args[:float_values] if args.key?(:float_values)\n @integer_values = args[:integer_values] if args.key?(:integer_values)\n @map_property = args[:map_property] if args.key?(:map_property)\n @name = args[:name] if args.key?(:name)\n @property_values = args[:property_values] if args.key?(:property_values)\n @text_values = args[:text_values] if args.key?(:text_values)\n @timestamp_values = args[:timestamp_values] if args.key?(:timestamp_values)\n end", "def tweet_params\n params.require(:tweet).permit(:content,:tweet)\n end", "def record_tweet(tweet_name, time)\n \n end", "def update!(**args)\n @status = args[:status] if args.key?(:status)\n @update_time = args[:update_time] if args.key?(:update_time)\n end", "def update!(**args)\n @corrected_key_text = args[:corrected_key_text] if args.key?(:corrected_key_text)\n @corrected_value_text = args[:corrected_value_text] if args.key?(:corrected_value_text)\n @field_name = args[:field_name] if args.key?(:field_name)\n @field_value = args[:field_value] if args.key?(:field_value)\n @name_detected_languages = args[:name_detected_languages] if args.key?(:name_detected_languages)\n @provenance = args[:provenance] if args.key?(:provenance)\n @value_detected_languages = args[:value_detected_languages] if args.key?(:value_detected_languages)\n @value_type = args[:value_type] if args.key?(:value_type)\n end", "def set_derived_fields\n self.credit_for_mil_training = to_yes_string(vet2)\n self.vet_poc = to_yes_string(vet3)\n self.student_vet_grp_ipeds = to_yes_string(vet4)\n self.soc_member = to_yes_string(vet5)\n self.calendar = to_calendar(calsys)\n self.online_all = to_true_string(distnced)\n\n true\n end", "def update\n @tweet.update(tweet_params)\n respond_with(@tweet)\n end" ]
[ "0.5984665", "0.57777435", "0.5751553", "0.56884736", "0.55796427", "0.55776656", "0.55295026", "0.5526155", "0.5499975", "0.5488875", "0.54535866", "0.5430363", "0.5409972", "0.53913707", "0.5380252", "0.5376062", "0.5368158", "0.5348213", "0.5313817", "0.5303217", "0.53012973", "0.5295502", "0.5286821", "0.5286821", "0.52731234", "0.52711636", "0.5269431", "0.52546924", "0.52491343", "0.5246869", "0.52383476", "0.52367765", "0.52346545", "0.5205765", "0.520007", "0.51661015", "0.51515174", "0.5127475", "0.5121123", "0.5111157", "0.51109576", "0.5110823", "0.5106851", "0.5096973", "0.50940883", "0.5092296", "0.50854856", "0.5085444", "0.5083267", "0.50825465", "0.5080149", "0.50685436", "0.5066246", "0.5066246", "0.5066246", "0.50653315", "0.5058848", "0.5058848", "0.5057829", "0.50511205", "0.5050766", "0.50505733", "0.5045733", "0.50442994", "0.50409555", "0.50389576", "0.5031076", "0.5028731", "0.5028416", "0.50250375", "0.5021509", "0.5020059", "0.5020059", "0.5016123", "0.5008461", "0.50083494", "0.50028956", "0.49945045", "0.49926922", "0.49768794", "0.49762478", "0.49707112", "0.49704504", "0.49657393", "0.49657393", "0.49657393", "0.49606565", "0.4957896", "0.49542892", "0.49513975", "0.49475008", "0.49405676", "0.49388233", "0.49366495", "0.49363217", "0.4936304", "0.49324235", "0.49280208", "0.49270102" ]
0.68355423
1
Assigns a certain workflow state given a symbol or string Knows about a whitelist of valid states
def assign_state(state) state &&= state.try(:to_sym) raise "Unknown state: #{ state }" unless Tweet.available_states.include?(state) case state when :conversation then self.state ||= state # do not override existing states with :conversation state else self.state = state end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_state(s)\n case s.to_sym\n when :pending\n register if passive?\n when :active\n activate if pending? || deleted?\n unsuspend if suspended?\n when :suspended\n suspend if passive? || pending? || active?\n when :deleted\n delete if passive? || pending? || active? || suspended?\n end\n end", "def WorkflowState(input, workflow, &block) # rubocop:disable Naming/MethodName\n result = case input\n when Sipity::WorkflowState\n input\n when Symbol, String\n WorkflowState.find_by(workflow_id: workflow.id, name: input)\n end\n\n handle_conversion(input, result, :to_sipity_workflow_state, &block)\n end", "def change_state(contestant_symbol, contestant_move)\n\t\t@current_state[contestant_move] = contestant_symbol\n\tend", "def state(state, &block)\n @states[state.to_sym] = State.new(&block)\n end", "def impose_state(s) # :args: state\n @_hegemon_state = s\n nil end", "def test_state_names_2\n simple_dfa = Automaton.new(false) do |fa|\n fa.add_state(:initial => true)\n end\n assert_raise ArgumentError do\n simple_dfa.get_state('') # non-existing state\n end\n end", "def symbol! sym\ninitialize\ns0 = new_state\ns1 = new_state\nset_start(s0)\nset_final(s1, true)\nadd_transition(s0, s1, sym)\nif sym != \"\" && @alphabet.include?(\"#{sym}\") == false\n@alphabet.push(\"#{sym}\")\nend\nend", "def set_state\n @state = State.friendly.find(params[:id])\n end", "def state=(s)\n @flows.each_value do |f|\n f.state = s\n end\n end", "def transition(symbol, to)\n @subject.transitions[@state][symbol] = to\n end", "def set_state(s)\n @state = s\n send(s)\n rescue => e\n handle_error(e)\n end", "def state(name, options = {})\n options[:allow] = [options[:allow]] unless options[:allow].kind_of? Array\n states[name] = options\n end", "def request_state(s, *flags) # :args: state, *flags\n return true if @_hegemon_state==s\n return false unless @_hegemon_states[@_hegemon_state].transitions[s]\n @_hegemon_states[@_hegemon_state].transitions[s].try(*flags)\n end", "def assign_state(state)\n @state = state\n end", "def add_state(v)\nunless has_state?(v)\n@state[v] = true\n@transition[v] = {}\nend\nend", "def to_state(x)\n states = {\n 'AL' => 'Alabama',\n 'AK' => 'Alaska',\n 'AS' => 'America Samoa',\n 'AZ' => 'Arizona',\n 'AR' => 'Arkansas',\n 'CA' => 'California',\n 'CO' => 'Colorado',\n 'CT' => 'Connecticut',\n 'DE' => 'Delaware',\n 'DC' => 'District of Columbia',\n 'FM' => 'Micronesia1',\n 'FL' => 'Florida',\n 'GA' => 'Georgia',\n 'GU' => 'Guam',\n 'HI' => 'Hawaii',\n 'ID' => 'Idaho',\n 'IL' => 'Illinois',\n 'IN' => 'Indiana',\n 'IA' => 'Iowa',\n 'KS' => 'Kansas',\n 'KY' => 'Kentucky',\n 'LA' => 'Louisiana',\n 'ME' => 'Maine',\n 'MH' => 'Islands1',\n 'MD' => 'Maryland',\n 'MA' => 'Massachusetts',\n 'MI' => 'Michigan',\n 'MN' => 'Minnesota',\n 'MS' => 'Mississippi',\n 'MO' => 'Missouri',\n 'MT' => 'Montana',\n 'NE' => 'Nebraska',\n 'NV' => 'Nevada',\n 'NH' => 'New Hampshire',\n 'NJ' => 'New Jersey',\n 'NM' => 'New Mexico',\n 'NY' => 'New York',\n 'NC' => 'North Carolina',\n 'ND' => 'North Dakota',\n 'OH' => 'Ohio',\n 'OK' => 'Oklahoma',\n 'OR' => 'Oregon',\n 'PW' => 'Palau',\n 'PA' => 'Pennsylvania',\n 'PR' => 'Puerto Rico',\n 'RI' => 'Rhode Island',\n 'SC' => 'South Carolina',\n 'SD' => 'South Dakota',\n 'TN' => 'Tennessee',\n 'TX' => 'Texas',\n 'UT' => 'Utah',\n 'VT' => 'Vermont',\n 'VI' => 'Virgin Island',\n 'VA' => 'Virginia',\n 'WA' => 'Washington',\n 'WV' => 'West Virginia',\n 'WI' => 'Wisconsin',\n 'WY' => 'Wyoming'\n }\n return states[x]\n end", "def change_state(position,symbol)\t\n @@hash_tictactoe[position]=symbol\nend", "def state=(s)\n @state = s\n end", "def state=(s)\n @tasks.each_value do |task|\n task.state = s\n end\n end", "def set_game_state s=''\n @state = s\n end", "def state=(s)\n raise ArgumentError, 'The state of TurnOnTasks is always \\'ON\\'' unless s.casecmp('ON').zero?\n super\n end", "def set_intern_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end", "def start(state)\n parse_names\n if @starting_state\n raise ArgumentError, \"this state machine already has a starting \"\\\n \"state, use #depends_on to run more than one task at startup\"\n end\n @starting_state = validate_task(state)\n end", "def set_state(new_state)\n Torrent::STATES.each_with_index do |allowed_state, index|\n if allowed_state == new_state\n self.state = index\n end\n end\n end", "def state(name, &block)\n raise ArgumentError, \"The state name must respond to `to_sym`\" unless name.respond_to?(:to_sym)\n name = name.to_sym\n state_configuration(name).instance_eval &block\n \n raise \"You must provide a start state for #{name}\" unless state_configuration(name).start_state\n\n define_method(name) { state_container name }\n end", "def step!(next_state)\n @state = case @state\n when :a\n next_state == :b ? :b : :a\n when :b\n [:a, :c].include?(next_state) ? next_state : :b\n when :c\n :d\n else\n :a\n end\n end", "def add_state(s)\n @states << s\n self\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def validate_state(state = {}); end", "def validate_state(state = {}); end", "def test_state_names_1\n s0,s1,s2 = nil,nil,nil\n simple_dfa = Automaton.new(false) do |fa|\n s0 = fa.add_state(:initial => true, :name => 'A')\n s1 = fa.add_state(:accepting => true, :name => 'B')\n s2 = fa.add_state(:name => 'C')\n fa.connect(s0, s1, 'a')\n fa.connect(s1, s1, 'b')\n fa.connect(s1, s2, 'c')\n end\n assert_raise ArgumentError do\n simple_dfa.get_state(56) # wrong type\n end\n assert_raise ArgumentError do\n simple_dfa.get_state('T') # non-existing name\n end\n\n assert_raise ArgumentError do\n simple_dfa.get_state('') # non-existing state\n end\n\n assert_raise ArgumentError do\n simple_dfa.get_state(nil) # nil name\n end\n assert_equal s0,simple_dfa.get_state('A')\n assert_equal s1,simple_dfa.get_state('B')\n assert_equal s2,simple_dfa.get_state('C')\n end", "def set_states_assign\n @states_assign = StatesAssign.find(params[:id])\n end", "def update_state(*args)\n if transition_choice?\n found_trans = machine.select_transition(name, *args)\n machine.state = found_trans.to_states.first\n else\n transitions = machine.transitions[name]\n machine.state = transitions[machine.state] || transitions[ANY_STATE] || name\n end\n end", "def symbol! sym\n initialize\n s0 = new_state\n s1 = new_state\n set_start(s0)\n set_final(s1, true)\n add_transition(s0, s1, sym)\n if (sym != \"\") && (!@alphabet.include? sym)\n @alphabet.push sym\n end\n end", "def test_add_state\n Automaton.new(false) do |fa|\n s0 = fa.add_state\n assert_equal(1, fa.state_count)\n assert_equal(false, s0.initial?)\n assert_equal(false, s0.accepting?)\n\n s1 = fa.add_state(:initial => true)\n assert_equal(2, fa.state_count)\n assert_equal(true, s1.initial?)\n assert_equal(false, s1.accepting?)\n\n s2 = fa.add_state(:initial => true, :accepting => true)\n assert_equal(3, fa.state_count)\n assert_equal(true, s2.initial?)\n assert_equal(true, s2.accepting?)\n\n s3 = fa.add_state(:myownkey => \"blambeau\")\n assert_equal(4, fa.state_count)\n assert_equal(false, s3.initial?)\n assert_equal(false, s3.accepting?)\n assert_equal(\"blambeau\", s3[:myownkey])\n\n assert_equal(0, fa.edge_count)\n end\n end", "def define_state_predicate; end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state(index, state)\n @states[index] = state\n end", "def symbol! sym\n initialize\n s0 = new_state\n s1 = new_state\n set_start(s0)\n set_final(s1, true)\n add_transition(s0, s1, sym)\n end", "def symbol! sym\n initialize\n s0 = new_state\n s1 = new_state\n set_start(s0)\n set_final(s1, true)\n add_transition(s0, s1, sym)\n end", "def set_machine_state(machine, pool, state, timeout = @timeout)\n handle_action_exceptions(__method__) do\n cmd_line = [\"setmachinestate '#{machine}' '#{pool}' '#{state}'\"]\n cmd_line << \"-timeout #{timeout}\"\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' '), timeout))\n end\n end", "def save_state(state)\n states.add(state)\n end", "def set_state\n @state = State.find(params[:id])\n end", "def execState\n findNextState\n current_state = @state_list[@state][@transition]\n\n @transition = eval \"#{@state}\"\n @history.push @state\n\n @finished = @state == :finish\n end", "def add(name, state)\n\tif(@states[name] != nil)\n\t raise StateMachine::Error, \"state '#{name}' exists\"\n\tend\n\t@states[name] = state\n\treturn self\n end", "def transit_state(signal)\n permitted_transitions = transitions[signal.to_sym]\n unless permitted_transitions.nil?\n next_state = permitted_transitions[state]\n\n # if current state is not explicitly permitted, is any state (referred by '*') permitted?\n next_state = permitted_transitions['*'] unless next_state\n self.state = next_state\n end\n !!next_state\n end", "def create_state\n State.create(state:'TX')\n end", "def _lex_to_state_actions; end", "def _lex_to_state_actions; end", "def _lex_to_state_actions; end", "def _lex_to_state_actions; end", "def state=(input)\n self.audited_state = input.try(:to_sym)\n end", "def _lex_to_state_actions=(_arg0); end", "def _lex_to_state_actions=(_arg0); end", "def _lex_to_state_actions=(_arg0); end", "def _lex_to_state_actions=(_arg0); end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def go_state (index)\n @state = @states[index]\n end", "def state(name)\n @state.push(name)\n end", "def state=(state)\n if state.nil?\n fail ArgumentError, 'state cannot be nil'\n end\n\n if state.to_s.length > 2\n fail ArgumentError, 'invalid value for \"state\", the character length must be smaller than or equal to 2.'\n end\n\n pattern = Regexp.new(/^[A-Z]{2}$/)\n if state !~ pattern\n fail ArgumentError, \"invalid value for \\\"state\\\", must conform to the pattern #{pattern}.\"\n end\n\n @state = state\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def state_match\n states = %w(mn ak hi id mt wy ut nm tx ks \n ok nb sd nd ia ar la ms ab wi\n tn ky in oh pn wv md va nc sc\n ga de nj ct ri ma vt nh ma il\n ca co az nv fl mi ny or wa mo)\n eval states.map {|x| \"stri('#{x}')\"}.join(' | ')\n end", "def state_params\n params.require(:state).permit(:name, :abbreviation)\n end", "def state(*args)\n result = self.info(\"--state\", *args).collect{ |str| str.scan(REGEX_STATE) }\n result.flatten!.compact!\n\n result.first.strip.downcase.to_sym\n end", "def set_layer7_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end", "def set_state(state)\n self.state = state\n self.save\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def set_action_state\n @action_state = ActionState.find(params[:id])\n end", "def find_state_by_name(name)\n find_task_by_name(\"#{name}_state\")\n end", "def fix_state!(row)\n return unless row['STATE']\n possible_state = final_state = row['STATE'].strip.upcase\n map = {\n /ANDHRAPRADESH/ => 'ANDHRA PRADESH',\n /ANDAMAN/ => 'ANDAMAN AND NICOBAR ISLANDS',\n /BANGALORE/ => 'KARNATAKA',\n /BARDEZ/ => 'GOA',\n /BHUSAWAL/ => 'MAHARASHTRA',\n /BTM/ => 'KARNATAKA',\n /BULDHANA/ => 'MAHARASHTRA',\n /BUNDI/ => 'RAJASTHAN',\n /RAJAS/ => 'RAJASTHAN',\n /KARANATAKA/ => 'KARNATAKA',\n /CARMELARAM/ => 'KARNATAKA',\n # Chandigarh is not a state, but the branches there are ambigous b/w Haryana and Punjab\n # /CHANDIGARH/ => 'PUNJAB',\n /CHEMBUR/ => 'PUNJAB',\n /CHENNAI/ => 'TAMIL NADU',\n /CHHATIS/ => 'CHHATTISGARH',\n # Double H, Single T\n /CHHATISHGARH/ => 'CHHATTISGARH',\n # Single H, Double T\n /CHATTISGARH/ => 'CHHATTISGARH',\n /DADRA/ => 'DADRA AND NAGAR HAVELI AND DAMAN AND DIU',\n /DAHEGAM/ => 'GUJARAT',\n /DAHEJ/ => 'GUJARAT',\n /DELHI/ => 'DELHI',\n /DINDORI/ => 'MADHYA PRADESH',\n /MADHYAPRADESH/ => 'MADHYA PRADESH',\n # Do not use DAMAN as that clashes with ANDAMAN\n /DIU/ => 'DADRA AND NAGAR HAVELI AND DAMAN AND DIU',\n # Do an exact match for Daman instead\n 'DAMAN' => 'DADRA AND NAGAR HAVELI AND DAMAN AND DIU',\n /GOA/ => 'GOA',\n /HIMANCHAL/ => 'HIMACHAL PRADESH',\n /HIMACHAL/ => 'HIMACHAL PRADESH',\n /HYDERABAD/ => 'ANDHRA PRADESH',\n /IDAR/ => 'ANDHRA PRADESH',\n /INDORE/ => 'MADHYA PRADESH',\n /JAMMU/ => 'JAMMU AND KASHMIR',\n /MADURAI/ => 'TAMIL NADU',\n /MALEGAON/ => 'MAHARASHTRA',\n /MUMBAI/ => 'MAHARASHTRA',\n /NASHIK/ => 'MAHARASHTRA',\n /NASIK/ => 'MAHARASHTRA',\n /PONDICHERRY/ => 'PUDUCHERRY',\n /SAMBRA/ => 'KARNATAKA',\n /SANTACRUZ/ => 'MAHARASHTRA',\n /TAMIL/ => 'TAMIL NADU',\n /UTTARA/ => 'UTTARAKHAND',\n /UTTARPRADESH/ => 'UTTAR PRADESH',\n /UTTRAKHAND/ => 'UTTARAKHAND',\n /WEST/ => 'WEST BENGAL',\n /CHURU/ => 'RAJASTHAN',\n /AHMEDABAD/ => 'GUJARAT',\n /GUJRAT/ => 'GUJARAT',\n /HARKHAND/ => 'JHARKHAND',\n /JHAGRAKHAND/ => 'JHARKHAND',\n /ORISSA/ => 'ODISHA',\n /PUNE/ => 'MAHARASHTRA',\n /TELENGANA/ => 'TELANGANA',\n /PANJAB/ => 'PUNJAB',\n /MEGHALAY/ => 'MEGHALAYA',\n # Only if the branch is specifically marked as a UT branch\n # Otherwise, it could be Haryana or Punjab\n /CHANDIGARH UT/ => 'CHANDIGARH'\n }\n\n if possible_state.size == 2\n final_state = {\n \"AP\" => \"ANDHRA PRADESH\",\n \"KA\" => \"KARNATAKA\",\n \"TN\" => \"TELANGANA\",\n \"MH\" => \"MAHARASHTRA\",\n \"CG\" => \"CHHATTISGARH\",\n \"ML\" => \"MEGHALAYA\",\n \"MP\" => \"MADHYA PRADESH\"\n }[possible_state]\n else\n map.each_pair do |r, state|\n if r.is_a? Regexp and r.match? possible_state\n final_state = state\n elsif r == possible_state\n final_state = state\n end\n end\n end\n\n if final_state != row['STATE']\n log \"#{row['IFSC']}: Setting State=(#{final_state}) instead of (#{row['STATE']})\"\n row['STATE'] = final_state\n end\nend", "def set_task_state\n @task_state = TaskState.find(params[:id])\n end", "def set_state(new_state)\n failure_message = \"Failed to set pending_op #{self._id.to_s} state to #{new_state.to_s} for domain #{self.domain.namespace}\"\n updated_op = update_with_retries(5, failure_message) do |current_domain, current_op, op_index|\n Domain.where({ \"_id\" => current_domain._id, \"pending_ops.#{op_index}._id\" => current_op._id }).update({\"$set\" => { \"pending_ops.#{op_index}.state\" => new_state }})\n end\n\n # set the state in the object in mongoid memory for access by the caller\n self.state = updated_op.state\n end", "def get_state(name)\n name = name.to_sym\n (@states.detect { |st| st.name == name }).value\n end", "def set_state(key, val)\n @state[key] = val\n self\n end", "def initial_state=(new_initial_state); end", "def state_sym\n return self.state.to_s.gsub(/_state$/, '').to_sym\n end", "def set_chain_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end", "def update_state(state, active)\n if !active.nil?\n @states.each do |s, v|\n v[1] = active if s == state\n classify_state v\n end\n end\n end" ]
[ "0.6481978", "0.64131534", "0.63184446", "0.62278825", "0.60918456", "0.604355", "0.6011745", "0.59891486", "0.59716976", "0.59408146", "0.5933534", "0.5921859", "0.5919237", "0.5900503", "0.58076984", "0.57849354", "0.5759678", "0.5756897", "0.5755993", "0.57469743", "0.5724746", "0.57149756", "0.57082945", "0.5664804", "0.56643206", "0.56583905", "0.5658052", "0.5652233", "0.5652233", "0.5652233", "0.5652233", "0.5652233", "0.5652233", "0.5652233", "0.5652233", "0.56254196", "0.56254196", "0.5613253", "0.5601707", "0.55878806", "0.5581311", "0.5580413", "0.55653775", "0.5549501", "0.5549501", "0.5549376", "0.553734", "0.553734", "0.55286443", "0.55258524", "0.55158234", "0.55113137", "0.55029386", "0.5489159", "0.5482927", "0.5475786", "0.5475786", "0.5475786", "0.5475786", "0.5461235", "0.5452557", "0.5452557", "0.5452557", "0.5452557", "0.543668", "0.543668", "0.54340917", "0.54222006", "0.5418334", "0.5383395", "0.5383395", "0.5383395", "0.5383395", "0.5383395", "0.5383395", "0.5383395", "0.5368459", "0.5364589", "0.5342649", "0.53374594", "0.53348714", "0.5330306", "0.5330306", "0.5330306", "0.5330306", "0.5330306", "0.5330306", "0.5330306", "0.53165835", "0.5316299", "0.5313643", "0.5309269", "0.529555", "0.52855957", "0.5284752", "0.5282488", "0.5276673", "0.5273849", "0.52725726", "0.5270167" ]
0.658227
0
Only logged in users can gain access to all the actions
def create @user = User.find(params[:user_id]) @resourcethread = @user.resource_threads.find(params[:resource_thread_id]) @resourcethread.increment!(:resource_count) @resource = @resourcethread.resources.create(resource_params) @resource.update_attribute(:trust, 100) @resource.update_attribute(:user, @current_user) redirect_to user_resource_thread_path(@user, @resourcethread) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_access_control_all\n @user = User.find(params[:user_id])\n\n unless !@user.admin? && current_user.admin? || current_user?(@user)\n response_access_denied\n end\n\n rescue\n response_access_denied\n end", "def check_access_control_all\n @user = User.find(params[:user_id])\n\n response_access_denied unless current_user.has_role?(:admin) || current_user.id == @user.id\n rescue\n response_access_denied\n end", "def user_actions(user)\n can_act_as_logged_in_user(user) unless Revs::Application.config.restricted_beta # also have logged in privileges if we are not in beta\n end", "def access action\n\t\tif current_user\n \treturn true\n else\n \treturn false\n end\n\n\tend", "def index\n\n #Make sure only logged in admins can manipulate users\n\n if @loggedinuser && @loggedinuser.authorizationlevel >= 4\n else \n redirect_to '/'\n end\n end", "def restrict_access\n head :unauthorized and return false unless current_user\n end", "def allow_access\n !@current_user.nil?\n end", "def admin_actions(user)\n can_act_as_logged_in_user(user)\n can_view_any_profile\n can_view_any_gallery\n can_edit_saved_queries\n can_curate\n can_update_metadata\n can_administer\n end", "def restrict_access\t\n\t\tif current_user.owner == false\n\t\t\tredirect_to user_path(current_user), notice: \"You can't view this page, contact your box owner\"\n\t\tend\t\n\tend", "def help\r\n\r\n @user_actions = Access.where(:table_sid => \"users\", :action_sid => [\"index\", \"list\", \"new\", \"create\", \"show\", \"edit\", \"update\", \"destroy\", \"search\", \"download\", \"feed\", \"help\", \"login\", \"logout\", \"home\", \"access_graph\", \"field_access_graph\", \"change_password\"]).includes([:user_accesses, :profile_accesses]).reject{|a| @current_user.can_run?(a) }\r\n render(:layout => !request.xhr?)\r\n end", "def users_only\n deny_access(\"Necesitas crear una cuenta para entrar a esta sección\") unless signed_in?\n end", "def index\n \t@users = User.accessible_by(current_ability)\n \tauthorize! :read, User\n end", "def user_access\n @bot = current_user.admin? ? Bot.find(params[:id]) : current_user.bots.find(params[:id])\n\n check_user_access(@bot.account.user_id)\n\n rescue\n flash_access_denied\n end", "def curator_actions(user)\n can_act_as_logged_in_user(user)\n can_curate\n can_update_metadata\n end", "def index\n # @users = User.all\n # authorize @users \n @users = policy_scope(User)\n authorize @users\n end", "def access_control\n \n end", "def index\n @users = User.all\n authorize @users\n end", "def index\n @users = User.all\n authorize User\n end", "def authorize\n if !session[:user_id]\n redirect_to root_path\n end\n if session[:user_id]\n if User.find_by(id: session[:user_id]).access != \"admin\"\n redirect_to root_path\n end\n end\n end", "def check_accessible\n if current_user\n myaction=Action.find_controller_action(params[:controller], params[:action])\n raise \"Page not found\" unless !myaction || myaction.accessible(current_user) || Group.find(2).has_user(current_user) # this is a nasty hack to stop errors because there are links to actions accessible only by users. Need to sort out access management!!\n end\n end", "def action_allowed?\n current_user_has_ta_privileges?\n end", "def action_allowed?\n current_user_has_ta_privileges?\n end", "def needs_authenticate_user?\n except_actions = %w[index show]\n !except_actions.include?(action_name)\n end", "def check_can_access\n res = false\n read_actions = [ \"index\", \"list\", \"edit\" ]\n new_actions = [ \"new\", \"create\" ]\n edit_actions = [ \"edit\", \"update\", \"destroy\", \"update_logo\" ]\n\n res ||= (action_name == \"show_logo\")\n res ||= current_user.admin?\n\n if current_user.option_externalclients?\n res ||= (current_user.read_clients? and read_actions.include?(action_name))\n res ||= (current_user.edit_clients? and edit_actions.include?(action_name))\n res ||= (current_user.create_clients? and new_actions.include?(action_name))\n end\n\n if !res\n flash[\"notice\"] = _(\"Access denied\")\n redirect_from_last\n end\n end", "def users_only\n deny_access(\"You must be signed in to access this page.\") unless signed_in?\n end", "def authorized?(user, action)\n\t\ttrue\n\tend", "def needs_authenticate_user?\n except_actions = %w[index show print]\n !except_actions.include?(action_name)\n end", "def ensure_user\n current_user? || deny_access('You must be logged in to perform this action.')\n end", "def action_allowed?\n current_user_has_student_privileges?\n end", "def authorize_user\n # simple authorization: kick out anonymous users from backend actions\n=begin\n if !current_user\n redirect_back_or_default(home_page) and return if action_name =~ /index|edit|update|destroy/\n \n # skip checking permission if user is an admin\n elsif !current_user.has_role?('Admin')\n unless current_user.has_permission?(controller_name, action_name, params)\n flash[:warning] = 'Access Denied'\n redirect_back_or_default(home_page) and return\n end\n end\n=end\n end", "def check_user_access\n check_access_and_redirect(@request)\n end", "def permission_required \n render_403 unless admin? || @user == current_user\n end", "def authorize\n unless User.find_by(id: session[:user_id])\n redirect_to tasks_index_path, notice: \"Please log in\"\n end\n end", "def index\n @user = User.find(params[:user_id])\n @conditions = @user.conditions\n\n if current_user.id == @user.id\n\t\t\trender action: :index\n\t\telse\n\t\t\trender file: 'public/denied'\n\t\tend\n end", "def user_access\n @account = current_user.admin? ? Account.find(params[:id]) : current_user.accounts.find(params[:id])\n\n check_user_access(@account.user_id)\n\n rescue\n flash_access_denied\n end", "def authorise_action\n if !logged_in? or (@annotation.source != current_user)\n # TODO: return either a 401 or 403 depending on authentication\n respond_to do |format|\n flash[:error] = 'You are not allowed to perform this action.'\n format.html { redirect_to :back }\n format.xml { head :forbidden }\n end\n return false\n end\n return true\n end", "def authorise_action\n if !logged_in? or (@annotation.source != current_user)\n # TODO: return either a 401 or 403 depending on authentication\n respond_to do |format|\n flash[:error] = 'You are not allowed to perform this action.'\n format.html { redirect_to :back }\n format.xml { head :forbidden }\n end\n return false\n end\n return true\n end", "def check_permission\n redirect_to dashboard_path, notice: 'You are not authorised to perform this action.' unless current_user&.admin?\n end", "def authorized?\n %w(new create plans canceled thanks).include?(self.action_name) || \n ((self.action_name == 'dashboard') && current_user) ||\n admin?\n end", "def authorized?\n %w(new create plans canceled thanks).include?(self.action_name) || \n ((self.action_name == 'dashboard') && current_user) ||\n admin?\n end", "def authorized?\n\n return false unless current_user\n\n %w{ show index }.include?(action_name) || current_user.is_admin?\n end", "def user_access_control\n bot = Bot.find(params[:id])\n\n if current_user.admin?\n @bot = User.find(bot.account.user_id).admin? ? current_user.bots.find(params[:id]) : bot\n else\n @bot = current_user.bots.find(params[:id])\n end\n\n rescue\n response_access_denied\n end", "def allow_access\n !current_cas_user.nil?\n end", "def index\n redirect_to(:action => 'login') #unless logged_in? || User.count > 0\n end", "def authorize_author\n redirect_to '/login' unless self.user_access > 1 || current_user.access == 3\n end", "def user_access_control_account_all\n @account = Account.find(params[:account_id])\n user = @account.user\n\n unless !user.admin? && current_user.admin? || current_user?(user)\n response_access_denied\n end\n\n rescue\n response_access_denied\n end", "def allow_access_by_any_user\n @attributes[:allow_access_by_any_user]\n end", "def authorize_access\n # byebug\n redirect_to root_path, alert: \"Access Denied\" unless can? :modify, Post\n end", "def block_access\n if current_user.present?\n redirect_to users_path\n end\n end", "def authorize_admin\n redirect_to :login unless current_user.permission.manage_app ||\n current_user.permission.manage_attrs ||\n current_user.permission.manage_achievement_categories ||\n current_user.permission.manage_talent_trees ||\n current_user.permission.manage_talents ||\n current_user.permission.manage_quests ||\n current_user.permission.manage_skills ||\n current_user.permission.manage_achievements ||\n current_user.permission.manage_items ||\n current_user.permission.manage_titles\n end", "def has_access?( action )\n unless @sir_log.permitted_to_access?( current_user.id )\n render_no_access\n return false\n end\n return true if [ 'index', 'new', 'create', 'show_stats' ].include?( action_name )\n unless current_user.permission_to_access( feature_identifier, action, @sir_item.group_id )\n render_no_permission \n return false \n end\n return true\n end", "def validate_access\n if @user_logged_in != @answer.user\n render status: :forbidden\n end\n end", "def show\n # authorize Admin\n end", "def authorize_user\n if @user.id != current_user.id\n redirect_to \"/\", notice: 'You are not allowed the given operation' and return\n end\n end", "def index\n\t\tbegin\n\t\t\tif(session[:user][\"admin\"])\n\t\t\t\t@users = User.where.not(id: 1)\n\t\t\telse\n\t\t\t\traise \"No_ACCESS\"\n\t\t\tend\n\t\trescue\n\t\t\trender \"error\"\n\t\telse\n\t\tend\n\tend", "def action_allowed?(action_name, user)\n return false\n end", "def beta_actions(user)\n can_act_as_logged_in_user(user)\n end", "def restrict_users\n \t\tif user_signed_in?\n \t\t\tif current_user.has_role? :client\n \t\t\t\tif current_user.profile.agreed == nil\n \t\t\t\t\tredirect_to edit_profile_path(current_user.profile)\n \t\t\t\tend\n \t\t\tend\n\n \t\tend\n\n \tend", "def restrict_access\n redirect_to root_path if is_superuser_or_admin? == false\n end", "def run_filters\n set_user\n authorize\n end", "def authorize_admin\r\n unless session[:user_id] and\r\n User.find(session[:user_id]).level == 2\r\n session[:original_uri] = request.request_uri\r\n flash[:notice] = Resource.get(\"access_denied\")\r\n redirect_to(:controller => \"welcome\", :action => \"signin\")\r\n end\r\n end", "def authorized\n\t unless admin?\n\t redirect_to root_path\n\t end\n end", "def index\n # authorize! :index, @user, :message => 'Not authorized as an administrator.'\n @users = User.all\n end", "def listings\n authorize! :read, @user\n end", "def has_access?( action )\n unless( action_name == :show && @sir_item.sir_log.permitted_to_access?( current_user.id )) ||\n @sir_item.sir_log.permitted_to_update?( current_user.id )\n render_no_access \n return false\n end\n g = [ :new, :create ].include?( action_name ) ? @sir_item.resp_next_entry : @sir_entry.resp_this_entry\n unless current_user.permission_to_access( feature_identifier, action, g.id )\n render_no_permission \n return false\n end\n true\n end", "def index\n @activites = Activite.all\n authorize @activites\n end", "def user_permissions\n if user_signed_in? && (current_user.is_logistics? || current_user.is_clerical? || current_user.is_vendor? || current_user.is_customer?)\n authorize! :edit, Element\n end\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def check_user_before_action\n @blog = Blog.find(params[:id])\n if (current_user != @blog.user) and (@blog.global == false)\n redirect_to({ action: \"index\" }, notice: \"You don't have sufficient permissions\")\n\n end\n end", "def index\n @sessions = Session.all\n authorize @sessions\n end", "def index\n redirect_to(:action => 'login') and return unless logged_in?\n \n @user = current_user\n end", "def action_allowed?\n if %w[edit update list_submissions].include? params[:action]\n current_user_has_admin_privileges? || current_user_teaching_staff_of_assignment?(params[:id])\n else\n current_user_has_ta_privileges?\n end\n end", "def index\n @admins = Admin.order(:email)\n authorize @admins\n end", "def allowedusers_only\n \n\t\tallowed_users=[VendorPortal::Application.config.operationadmin.to_s,VendorPortal::Application.config.operationuser.to_s,VendorPortal::Application.config.vendor.to_s]\n\t\n if !current_user.userrole.in?(allowed_users)\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end", "def allowedusers_only\n \n\t\tallowed_users=[VendorPortal::Application.config.operationadmin.to_s,VendorPortal::Application.config.operationuser.to_s,VendorPortal::Application.config.vendor.to_s]\n\t\n if !current_user.userrole.in?(allowed_users)\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end", "def allowedusers_only\n \n\t\tallowed_users=[VendorPortal::Application.config.operationadmin.to_s,VendorPortal::Application.config.operationuser.to_s,VendorPortal::Application.config.vendor.to_s]\n\t\n if !current_user.userrole.in?(allowed_users)\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end", "def allowedusers_only\n \n\t\tallowed_users=[VendorPortal::Application.config.operationadmin.to_s,VendorPortal::Application.config.operationuser.to_s,VendorPortal::Application.config.vendor.to_s]\n\t\n if !current_user.userrole.in?(allowed_users)\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end", "def assert_user_cant_access(user, actions, params = {})\r\n assert_user_access_check(false, user, actions, params)\r\n end", "def show\n \tauthorize! :read, @user\n end", "def show\n enforce_view_permission(@user)\n \n end", "def permit_user\n if (!current_user.lunches_admin?) \n flash[:alert] = 'You not allowed to see all orders.'\n respond_to do |format| \n format.html {redirect_to(root_url)}\n end\n end\n end", "def access_robot\n raise 'unauthorised' if current_user != @robot.user \n end", "def index\n @users = User.select{ |_| can? :read, _ }\n end", "def access_required_member\n\tlogger.debug session.to_yaml\n\t\tredirect_to '/access_denied.html' and return unless session[\"user_#{current_user.id}\"][:access_level] >= Role.access_level('Member')\n\tend", "def show\n authorize User\n end", "def show\n authorize User\n end", "def user_action_on_resource_authorized\n end", "def check_access_control\n @bot = Bot.find(params[:id])\n\n response_access_denied unless current_user.has_role?(:admin) || current_user.id == @bot.account.user_id\n rescue\n response_access_denied\n end", "def admin_actions\n unless @current_admin.is_super_admin\n flash[:error]=\"You are not authorized to navigate to this page \"\n redirect_to admin_index_path\n return\n end\n end", "def allow_to\n # owner of story can do anything? editing?\n super :owner, :all => true\n # approved users can create new stories\n super :user, :only => [:show, :index, :search, :new, :create]\n # everybody can list and watch\n super :all, :only => [:show, :index, :search]\n end", "def index\n @users = User.where(:activate => true)\n authorize! :update, @users\n end", "def authorize_access\n redirect_to admin_sites_url unless @site || current_user.admin?\n end", "def show\n @user = current_user\n authorize @user\n end", "def require_authorization!\n unless current_user == @event.user\n render json: {}, status: :forbidden\n end\n end", "def authorize_unauthenticated_user\n target_action = params[:controller] + '#' + params[:action]\n unless User::DEFAULT_PERMISSIONS.include?(target_action)\n head :unauthorized and return\n end\n end", "def index\n if can?(:>=, \"5\")\n else\n redirect_to main_app.unauthorized_url\n end\n end", "def show\n authorize Session\n end", "def view_authorized(current_user)\n return self.goal.public? || self.edit_authorized(current_user)\n end", "def restrict_access\n unless logged_in?\n flash[:error] = \"You have to login to access this page.\"\n redirect_to login_url\n end\n end" ]
[ "0.7802231", "0.76084745", "0.7595346", "0.75416934", "0.73721224", "0.73371416", "0.7319035", "0.7294776", "0.72890043", "0.71676904", "0.7158603", "0.7142669", "0.7099145", "0.7090903", "0.70887", "0.70840037", "0.7039707", "0.70393634", "0.7026379", "0.70149964", "0.7014527", "0.7014527", "0.7011348", "0.700762", "0.7005884", "0.69935477", "0.6992147", "0.699133", "0.698757", "0.69831663", "0.69804794", "0.6945984", "0.69401747", "0.69165087", "0.68965226", "0.6885383", "0.6885383", "0.68789047", "0.6862664", "0.6862664", "0.6859256", "0.68561006", "0.682497", "0.67954427", "0.67950624", "0.67942035", "0.6792769", "0.678705", "0.6780236", "0.67774343", "0.6773541", "0.67713463", "0.67670435", "0.6762771", "0.6758039", "0.67572343", "0.6755954", "0.67502844", "0.67435896", "0.67405415", "0.6739107", "0.6736436", "0.67316", "0.6728409", "0.67268187", "0.67212516", "0.67099434", "0.67098397", "0.67098397", "0.67098397", "0.6706793", "0.66947263", "0.6693969", "0.6689393", "0.66866225", "0.6682129", "0.6682129", "0.6682129", "0.6682129", "0.66817266", "0.66765916", "0.66731334", "0.66693974", "0.66672367", "0.6653316", "0.6649784", "0.66465855", "0.66465855", "0.6646243", "0.6645885", "0.66450167", "0.6642006", "0.6639024", "0.66348004", "0.6633972", "0.66336775", "0.6624393", "0.6618831", "0.66134834", "0.6606217", "0.660414" ]
0.0
-1
Confirms a loggedin user.
def logged_in_user unless logged_in? store_location flash[:danger] = "Please log in." redirect_to user_login_url end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correct_user\n @user = User.find(params[:id])\n if !current_user?(@user)\n message = \"currently logged in as #{current_user.name}. Not you? \"\n message += \"#{view_context.link_to('Log out.', log_out)}\".html_safe\n flash[:warning] = message\n redirect_to(root_url)\n end\n end", "def confirm_logged_in\n \tunless session[:user_id]\n \t\tflash[:notice] = \"Please Log in.\"\n \t\tredirect_to(login_path)\n \tend\n end", "def correct_user\n\t\t\tauthenticate_user!\n\t\t\tunless @user == current_user || current_user.admin?\n\t\t\t\tredirect_to (root_path)\n\t\t\t\tflash[:alert]\n\t\t\tend\n\t\tend", "def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end", "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere else in the app\n flash['notice'] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n end", "def correct_user\n @user = User.find(params[:id])\n unless @user == current_user\n flash[:danger] = 'You are not authorized to do that.'\n redirect_to(root_url)\n end\n end", "def correct_user\n @user = User.find(params[:id])\n if @user != current_user\n flash[:alert] = \"Action not authorized\"\n redirect_to(root_url)\n end\n end", "def correct_user\n unless helpers.current_user?(@user)\n flash[:danger] = \"You don't have permission to do that\"\n redirect_to root_path\n end\n end", "def confirm_logged_in\n unless session[:user_id]\n redirect_to login_path, alert: \"Please log in\"\n end\n end", "def confirm_user_logged_in\n unless logged_in?\n store_url # So that user is sent to the same URL after they log in\n flash[:danger] = \"Please log in.\"\n redirect_to root_url\n end\n end", "def confirm_logged_in\n unless session[:user_id] != nil\n redirect_to root_path\n end\n end", "def correct_user\n @user = User.find(params[:user_id])\n redirect_to('/unauthorized') unless current_user?(@user)\n end", "def confirm\n if current_visitor && current_visitor.has_role?('admin', 'manager')\n user = User.find(params[:id]) unless params[:id].blank?\n if !params[:id].blank? && user && user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n # assume this type of user just activated someone from somewhere else in the app\n flash[:notice] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n else\n flash[:notice] = \"Please login as an administrator.\"\n redirect_to(root_path)\n end\n end", "def correct_user\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tredirect_to(root_url) unless @user == current_user\n\t\tend", "def correct_user\n @user = User.find(params[:id])\n if current_user != @user\n flash[:danger] = \"You don't have permission for that\"\n redirect_to(root_url) unless current_user?(@user)\n end\n end", "def appctrl_confirm_user\n redirect_to( signin_path() ) unless @current_user\n end", "def correct_user\n @user = User.find(params[:id])\n if !current_user?(@user)\n flash[:danger] = \"Sorry, you're aren't allowed to access that.\"\n redirect_to(\"/#flash\") \n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to root_path, alert: \"You do not have access to that page\" unless current_user == @user\n end", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to root_path unless @user == current_user\n\tend", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n flash[:danger] = \"Admin Access Only.\"\n end", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tif current_user != @user\n\t\t\t\tredirect_back(fallback_location: root_path)\n\t\t\tend\n\t\tend", "def user_stray\n if !logged_in? || @user == nil\n flash[:alert] = \"You have been logged out of your session. Please log back in to continue.\"\n redirect \"/\"\n elsif @user.id != current_user.id\n flash[:alert] = \"You do not have permission to view or edit other users' content.\"\n redirect \"/\"\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n user = User.find(params[:id])\n unless current_user?(user) \n flash[:danger] = \"Uncorrect user.\"\n redirect_to(root_url) \n end\n end", "def switch\n authorize!(:manage, :all)\n user = User.find_by(login: params[:login].upcase)\n if user\n session[:original_user_id] = session[:user_id]\n session[:user_id] = user.id\n redirect_to root_url, notice: \"Sie sind nun der Nutzer mit dem Login #{user.login}.\"\n else\n redirect_to root_url, notice: \"Der Nutzer existiert nicht im System.\"\n end\n end", "def correct_user\n set_user\n unless current_user?(@user)\n flash[:danger] = 'This action is not permitted for this account since you are not the owner'\n redirect_to overview_user_path(current_user)\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def confirm_user\n if session[:user_id]\n return true\n else\n flash[:notice] = \"please login\"\n redirect_to(:controller => 'manage', :action => 'login')\n return false\n end\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash[:danger] = \"Yikes. Sorry, but it doesn't look you have permission to do that 😬\"\n redirect_back(fallback_location: root_url)\n end\n end", "def correct_user\n\t @user = User.find(params[:id])\n\t unless current_user?(@user)\n\t flash[:danger] = \"You don't have rights\"\n\t\t\tredirect_back_or(root_url)\n\t end\n\tend", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user === current_user\n end", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tredirect_to(root_path) unless current_user?(@user)\n\t\tend", "def confirm_logged_in\n unless session[:username]\n redirect_to authenticate_login_path\n else\n true\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to root_path unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash[:danger] = \n \"You do not have permission to access #{@user.name}'s account.\"\n redirect_to(root_url)\n end\n end", "def correct_user\n @course = Course.find(params[:id])\n @user = @course.users\n unless current_user == @user\n redirect_to(root_url) \n flash[:danger] = \"You are not the authorised user\"\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user # sauf si\n end", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_path) unless current_user?(@user)\n\tend", "def correct_user\n\t\tunless current_user == @univers.user\n\t\t\tflash[:danger] = \"You have no power there\"\n\t\t\tredirect_to universes_path\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user) #checks if current_user == @user\n #current_user? defined in session helper\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n \n redirect_to(login_path) unless current_user?(@user)\n end", "def confirm_logged_in\n unless session[:user_id]\n flash[:notice] = \"Please log in.\"\n redirect_to root_path\n return false # halts the before_action\n else\n return true\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(user_root_path,:notice => 'You cannot access this page') unless current_user == @user\n end", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def logged_in_user\n unless !current_user.nil?\n flash[:danger] = \"Please log in.\"\n redirect_to root_path\n end\n end", "def correct_user\n @user = User.find(params[:id])\n\n if @user != current_user\n redirect_to(root_path)\n else\n # nothing to do\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @question = Question.find(params[:id])\n redirect_to(root_url) unless current_user == @question.user\n end", "def confirm_matching\n @user = User.find(params[:id])\n redirect_to root_path unless current_user? @user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless (current_user.id == @user.id)\n end", "def correct_user\n @user = User.find(params[:id])\n # current_user?() is a sessions_helper method. The user of the params hash has\n # to match the current user or will be redirected to root\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n\t\t@user = User.find(params[ :id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def logged_in_user\n unless logged_in?\n flash[:danger] = \"Please log in.\"\n redirect_to root_path\n end\n end", "def confirm_logged_in\r\n unless session[:username]\r\n redirect_to authenticate_index_path\r\n else\r\n true\r\n end\r\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user) # current_user is method in sessions_helper.rb\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end" ]
[ "0.70087826", "0.6982988", "0.6919373", "0.688131", "0.6845446", "0.68326277", "0.67944413", "0.67929715", "0.6642435", "0.6624581", "0.66114175", "0.66022736", "0.6589018", "0.65539706", "0.65349805", "0.65303934", "0.6512816", "0.650312", "0.64878744", "0.6487622", "0.6480418", "0.6479267", "0.64705276", "0.64680994", "0.64656436", "0.6457351", "0.64541256", "0.64485556", "0.64485556", "0.64485556", "0.64485556", "0.64485556", "0.64485556", "0.64485556", "0.64485556", "0.64485556", "0.6445996", "0.6437721", "0.64289176", "0.64260334", "0.6424799", "0.6417934", "0.64177954", "0.64163303", "0.6410097", "0.6401843", "0.63820904", "0.63622755", "0.63595843", "0.6355515", "0.635374", "0.6351282", "0.6350864", "0.63502026", "0.63502026", "0.63502026", "0.6347271", "0.63426447", "0.6342538", "0.6342538", "0.6342538", "0.6342538", "0.6342538", "0.6342538", "0.6342538", "0.6342538", "0.63400817", "0.63345385", "0.63329995", "0.6331134", "0.6330873", "0.632984", "0.6325074", "0.63200074", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605", "0.63152605" ]
0.0
-1
Confirms the correct user.
def correct_user redirect_to(root_url) unless current_user?(@user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correct_user\n msg = \"You do not have permission to update another user's information\"\n require_correct_user(@user, msg)\n end", "def correct_user\n\t\t\tauthenticate_user!\n\t\t\tunless @user == current_user || current_user.admin?\n\t\t\t\tredirect_to (root_path)\n\t\t\t\tflash[:alert]\n\t\t\tend\n\t\tend", "def correct_user\n unless helpers.current_user?(@user)\n flash[:danger] = \"You don't have permission to do that\"\n redirect_to root_path\n end\n end", "def correct_user\n set_user\n unless current_user?(@user)\n flash[:danger] = 'This action is not permitted for this account since you are not the owner'\n redirect_to overview_user_path(current_user)\n end\n end", "def correct_user\n @user = User.find(params[:id])\n unless @user == current_user\n flash[:danger] = 'You are not authorized to do that.'\n redirect_to(root_url)\n end\n end", "def correct_user\n user = User.find(params[:id])\n unless current_user?(user) \n flash[:danger] = \"Uncorrect user.\"\n redirect_to(root_url) \n end\n end", "def correct_user\n\t\tunless current_user == @univers.user\n\t\t\tflash[:danger] = \"You have no power there\"\n\t\t\tredirect_to universes_path\n end\n end", "def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end", "def correct_user\n @user = User.find(params[:id])\n if current_user != @user\n flash[:danger] = \"You don't have permission for that\"\n redirect_to(root_url) unless current_user?(@user)\n end\n end", "def correct_user\n @question = Question.find(params[:id])\n redirect_to(root_url) unless current_user == @question.user\n end", "def correct_user\n @user = User.find(params[:id])\n if @user != current_user\n flash[:alert] = \"Action not authorized\"\n redirect_to(root_url)\n end\n end", "def correct_user\n @user = User.find(params[:user_id])\n redirect_to('/unauthorized') unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user_help?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n if !current_user?(@user)\n message = \"currently logged in as #{current_user.name}. Not you? \"\n message += \"#{view_context.link_to('Log out.', log_out)}\".html_safe\n flash[:warning] = message\n redirect_to(root_url)\n end\n end", "def correct_user\n if !is_correct_user\n redirect_to incorrect_user_path_for\n end\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash[:danger] = \n \"You do not have permission to access #{@user.name}'s account.\"\n redirect_to(root_url)\n end\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash[:danger] = \"Please don't mess with others' profiles!\"\n # redirect_to root_url\n redirect_to @user\n end\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash[:danger] = \"Yikes. Sorry, but it doesn't look you have permission to do that 😬\"\n redirect_back(fallback_location: root_url)\n end\n end", "def correct_user\n\t @user = User.find(params[:id])\n\t unless current_user?(@user)\n\t flash[:danger] = \"You don't have rights\"\n\t\t\tredirect_back_or(root_url)\n\t end\n\tend", "def correct_user\n unless @user == current_user\n redirect_to user_notes_path(current_user)\n end\n end", "def correct_user\n redirect_to(root_url) unless @user == current_user\n end", "def confirm_with_user\n confirmed = Helper::Util.confirm \"Is this OK? \", true\n return if confirmed\n\n loop do\n Helper::Util.clear\n\n print_identification\n\n say \"<%= color('The following options may be adjusted before continuing.', BOLD) %>\"\n choice = choose do |menu|\n self.class.available_options.reject(&:skip_confirmation).each do |option|\n value = send option.confirm_symbol\n menu.choice \"#{option.label}: #{option.display_value(value)}\"\n end\n\n menu.choice \"Accept and continue\"\n menu.choice \"Quit\"\n menu.readline = true\n menu.prompt = \"What would you like to do?\"\n end\n\n Helper::Util.clear\n\n print_identification\n\n if (option = self.class.available_options.find { |o| choice =~ /^#{Regexp.quote(o.label)}/ })\n loop do\n break if prompt_for_option(option)\n say \"Invalid value for option.\\n\\n\"\n end\n elsif choice =~ /^Accept/\n log\n return\n else\n exit(0)\n end\n end\n end", "def correct_user\n @user = User.find(params[:id])\n if !current_user?(@user)\n flash[:danger] = \"Sorry, you're aren't allowed to access that.\"\n redirect_to(\"/#flash\") \n end\n end", "def correct_user(user)\n user == current_user\n end", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tif current_user != @user\n\t\t\t\tredirect_back(fallback_location: root_path)\n\t\t\tend\n\t\tend", "def correct_user\n @user = HoacUser.find(params[:id])\n redirect_to(edit_hoac_user_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to root_path, alert: \"You do not have access to that page\" unless current_user == @user\n end", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tredirect_to(root_url) unless @user == current_user\n\t\tend", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to root_path unless @user == current_user\n\tend", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tredirect_to(root_path) unless current_user?(@user)\n\t\tend", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user === current_user\n end", "def correct_user\n user_id = params[:user_id] || params[:id] || session[:user_id]\n @user = User.find_by(id: user_id)\n unless @user.nil?\n unless current_user?(@user) || current_user.administrator?\n flash[:danger] = \"Only the account owner or an adminstrator to do that.\"\n redirect_to(root_path)\n end\n else\n nonexistent_user_error\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n flash[:danger] = \"Admin Access Only.\"\n end", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_path) unless current_user?(@user)\n\tend", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user # sauf si\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to root_path unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:user_id])\n unless current_user?(@user)\n flash[:danger] = \"You don't have permission for that action.\"\n redirect_to(root_url)\n end\n end", "def correct_user\n @course = Course.find(params[:id])\n @user = @course.users\n unless current_user == @user\n redirect_to(root_url) \n flash[:danger] = \"You are not the authorised user\"\n end\n end", "def correct_user\n @user = User.find(params[:id])\n logger.debug \"***correct_user - Detected User - #{@user.name}\"\n redirect_to(root_url) unless current_user?(@user) || admin_user\n end", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def confirm_matching\n @user = User.find(params[:id])\n redirect_to root_path unless current_user? @user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(user_root_path,:notice => 'You cannot access this page') unless current_user == @user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to root_url, notice: \"You do not have permission to view or edit this information because it isn't yours.\" unless current_user?(@user)\n end", "def correct_user\n \n redirect_to(login_path) unless current_user?(@user)\n end" ]
[ "0.7474259", "0.73411936", "0.7317917", "0.7183303", "0.7174887", "0.7049758", "0.70130193", "0.7012358", "0.7006517", "0.7006201", "0.7003461", "0.69663024", "0.69136065", "0.6911695", "0.690295", "0.6892608", "0.68439376", "0.6842948", "0.68397075", "0.683463", "0.6826711", "0.6825813", "0.6811448", "0.680094", "0.67988366", "0.6793706", "0.67789406", "0.67666626", "0.67421", "0.6740984", "0.6740906", "0.6736732", "0.6736732", "0.6736732", "0.6736732", "0.6736732", "0.6736732", "0.6736732", "0.6736732", "0.6736732", "0.6732851", "0.67279315", "0.6725006", "0.6723821", "0.67211986", "0.67211986", "0.67211986", "0.67211986", "0.67211986", "0.67211986", "0.67211986", "0.67211986", "0.6720861", "0.6715527", "0.6711952", "0.6684064", "0.66769403", "0.66658443", "0.6663128", "0.6663128", "0.6663128", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.6658565", "0.66540176", "0.6653203", "0.664873", "0.66435707" ]
0.66520107
98
Confirms an admin user.
def admin_user redirect_to(root_url) unless current_user.is_admin? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_admin\n \tunless session[:admin]\n \t\tflash[:notice] = \"You are not an admin.\"\n \t\tredirect_to(user_path( :id => session[:user_id]))\n \tend\n end", "def admin_user\n\t\t\tflash_text = \"Administrative privilege required to perform this action.\"\n\t\t\tflash[:danger] = flash_text unless current_user.admin?\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend", "def admin_user\n if user_signed_in? && current_user.adminrole?\n flash.now[:success] = \"Admin Access Granted\"\n else\n redirect_to root_path\n end\n end", "def admin_user\n if(!current_user.admin?)\n flash[:danger] = \"Access Denied. Admin required\"\n redirect_to root_url\n end\n end", "def admin_user\n unless current_user.is_admin?\n flash[:danger] = \"Keine Berechtigung.\"\n redirect_to(root_url)\n end\n end", "def admin_user\n unless current_user.is_admin?\n flash[:danger] = \"Keine Berechtigung.\"\n redirect_to(root_url)\n end\n end", "def admin_user\n redirect_to(root_url) and flash[:danger] = \"Only admins can do that!\" unless current_user.admin?\n\n end", "def admin_user\n unless this_is_admin?(current_user)\n flash[:danger] = \"You don't have the rights for this action.\"\n redirect_to(root_url)\n end\n end", "def admin_user\n unless this_is_admin?(current_user)\n flash[:danger] = \"You don't have the rights for this action.\"\n redirect_to(root_url)\n end\n end", "def admin\n unless current_user.admin?\n flash[:danger] = \"Sorry, you must be an admin to do that.\"\n redirect_to user_path(current_user)\n end\n end", "def confirm_admin\n @confirm_admin = true if session[:role_name] == 'Administrator'\n end", "def confirm_admin\n redirect_to root_path unless current_user.admin?\n end", "def admin_user\n unless current_user.admin?\n flash[:danger] = \"You do not have the permission to do that.\"\n redirect_to home_path\n end\n end", "def admin_user\n\t unless current_user.admin?\n flash[:danger] = \"Log in as Admin.\"\n redirect_to(root_url)\n\t end \n\t end", "def admin_user\n unless current_user && current_user.admin?\n store_location\n flash[:danger] = \"Please log in as admin.\"\n redirect_to users_url\n end\n end", "def be_admin\n if current_user.switch_to(\"admin\")\n flash[:notice] = \"You have now an 'admin' role\"\n else\n flash[:error] = \"You are not authorized to have a 'admin' role\"\n end\n redirect_to( request.env[\"HTTP_REFERER\"])\n end", "def admin_user\n\t\tunless admin? \n\t\t\tflash[:danger] = \"Only administrators have access to this page\"\n\t\t\tredirect_back_or(root_url) \n\t\tend\n\tend", "def admin_user!\n unless signed_in? and current_user.admin?\n\t flash[:notice]=\"Por favor inicie sesión como administrador\".encode('UTF-8')\n\t redirect_back(fallback_location: root_path) \n end\n end", "def admin_user\n unless @is_admin\n flash[:danger] = \"Must be admin to modify recipes\"\n redirect_to(recipes_url) \n end\n end", "def admin_user \n if (!current_user.lunches_admin?) \n flash[:alert] = 'You not allowed to edit menu.'\n \n redirect_to(root_url)\n end\n end", "def admin_user\n redirect_to(root_path) unless current_user.try(:admin?) || current_user?(@user)\n end", "def verify_admin\n if !current_user.present? || current_user.email != I18n.t('general.admin_email')\n redirect_to concerts_path\n flash[:notice] = I18n.t('general.log_as_admin')\n end\n end", "def admin_user\n redirect_to(root_path) unless (current_user != nil && current_user.admin == true)\n end", "def admin_user\n unless @is_admin\n flash[:danger] = \"Must be admin to modify recipes\"\n redirect_to(recipes_url) \n end\n end", "def admin_user\n redirect_to root_url, notice: \"You do not have permission to view or edit this information.\" unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless !current_user?(@user) && current_user.admin?\n end", "def admin_user\n \n unless current_user.admin?\n \tflash[:danger] = \"Please log in with the correct user name.\"\n \tredirect_to(root_url)\n end\n end", "def admin_user\n unless current_user && current_user.admin?\n redirect_to login_url, notice: \"admin can only do this action.\" \n end\n end", "def admin_user\n redirect_to(root_path) unless is_admin?\n end", "def correct_user\n\t\t\tauthenticate_user!\n\t\t\tunless @user == current_user || current_user.admin?\n\t\t\t\tredirect_to (root_path)\n\t\t\t\tflash[:alert]\n\t\t\tend\n\t\tend", "def admin\n unless current_user.admin?\n redirect_to root_url\n flash[:danger] = \"You have no access here\"\n end\n end", "def admin_user\n if logged_in?\n redirect_to(root_url) unless current_user.admin?\n else\n flash[:danger] = \"You reached an invalid url and have been redirected to the home page.\"\n redirect_to(root_url)\n end\n end", "def admin_user\n @user = current_user\n redirect_to @user unless @user.admin?\n end", "def admin_user\n if (!current_user || current_user.username != 'admin')\n redirect_to(root_url)\n end\n end", "def check_admin\n redirect_to root_path, alert: \"You do not have admin privileges.\" unless current_user.admin\n end", "def check_admin\n redirect_to root_path, alert: \"You do not have admin privileges.\" unless current_user.admin\n end", "def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend", "def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend", "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin? #NB il metodo \"admin?\" è stato aggiunto direttamente da Rails quando alla creazione ha visto che admin è un booleano\n\tend", "def admin_user\n #redirect_to(root_url) unless\n current_user.admin?\n end", "def admin_user\n #redirect_to(root_url) unless\n current_user.admin?\n end", "def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t end", "def correct_user\n @userAdmin = UserAdmin.find(params[:id])\n unless current_user?(@userAdmin)\n flash[:danger] = \"You don't have the rights for this page/action.\"\n redirect_to(root_url)\n end\n end", "def admin_user\n redirect_to(root_url) unless user_signed_in? && current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless user_signed_in? && current_user.admin?\n end", "def admin_user\n redirect_to(root_path) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_path) unless current_user.admin?\n end", "def admin\n\t\tauthenticate_user!\n\t if current_user.admin\n\t\t return\n\t else\n\t\t redirect_to root_url\n\t end\n\tend", "def check_admin_user\n unless current_user && current_user.privilege_admin?\n flash[:danger] = \"You do not have permission to perform this operation\"\n redirect_to root_path\n end\n end", "def verify_admin_of_user\n redirect_to admins_path,\n flash: { alert: I18n.t(\"administrator.flash.unauthorized\") } unless current_user.admin_of?(@user, \"can_manage_users\")\n end", "def admin_user\n unless admin_user?\n redirect_to login_url\n end\n end", "def check_admin_status\n if current_user.nil? || !current_user.admin?\n flash[:alert] = \"Access denied. Please login as an admin user\"\n redirect_to root_url\n end\n end", "def check_admin_status\n if current_user.nil? || !current_user.admin?\n flash[:alert] = \"Access denied. Please login as an admin user\"\n redirect_to root_url\n end\n end", "def admin_user\n redirect_to(admin_admins_path) unless current_user.admin?\n end", "def admin_user\n redirect_to(current_user) unless current_user.admin?\n end", "def admin!\n redirect_to root_path, alert: \"Not authorized\" and return unless is_admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin? # se current_user.admin for falso redireciona para pagina principal\n end", "def authenticate_admin\n\t\tauthenticate_user!\n\t\tunless current_user.approved == 1\n\t\t\tsign_out\n\t\t\tflash[:error] = \"User is not admin! Try again using another username!\"\n\t\t\tredirect_to new_user_session_path\n\t\t\t# redirect_to new_user_session_path\n\t\tend\n\tend", "def correct_admin\n @admin_admin = Admin::Admin.find(params[:id])\n redirect_to(admin_admins_path) unless current_user?(@admin_admin)\n end", "def admin_user\n unless logged_in? && current_user.admin?\n redirect_to root_url\n end\n end", "def req_admin\n unless curr_user.admin\n flash[:danger] = \"You must be admin to go there!\"\n redirect_to root_url\n end\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end" ]
[ "0.79044944", "0.767215", "0.76483077", "0.76210374", "0.7605678", "0.7605678", "0.75945777", "0.7588445", "0.7588445", "0.7503662", "0.74675834", "0.7451482", "0.7424005", "0.7411313", "0.74107665", "0.7402138", "0.73993605", "0.7358812", "0.7329228", "0.73179626", "0.7312765", "0.72796166", "0.7269636", "0.7246544", "0.72386354", "0.7231975", "0.72179013", "0.7173976", "0.71720684", "0.7166012", "0.71593285", "0.71537924", "0.7137113", "0.7124807", "0.71221524", "0.71221524", "0.7120586", "0.7120586", "0.7120474", "0.7118341", "0.7118341", "0.7118329", "0.7113378", "0.710956", "0.710956", "0.71021533", "0.71021533", "0.7098989", "0.709487", "0.7092022", "0.7076285", "0.7067073", "0.7067073", "0.7066295", "0.70532054", "0.7049086", "0.7041013", "0.703546", "0.70188206", "0.701779", "0.70146185", "0.70101637", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686", "0.70089686" ]
0.70904475
53
Use callbacks to share common setup or constraints between actions.
def set_user @user = User.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 user_params params.require(:user).permit(:username, :name, :year_of_birth, :email, :password, :city_of_birth) 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
in seconds since epoc
def getpdf # source info page: https://github.com/usgpo/link-service #Query: bill number, bill type, congress, bill version OR most recent #Parameters: #collection: Required - Value is bills. #billtype: Required - Values are hr, s, hjres, sjres, hconres, sconres, hres, sres. #billversion: Optional - If bill version is not provided, the most recent version of a bill is returned. Values are as, cps, fph, lth, ppv, rds, rhv, # rhuc, ash, eah, fps, lts, pap, rev, rih, sc, eas, hdh, nat, pwah, reah, ris, ath, eh, hds, oph, rah, res, rsv, ats, eph, ihv, ops, ras, renr, rth, # cdh, enr, iph, pav, rch, rfh, rts, cds, esv, ips, pch, rcs, rfs, s_p, cph, fah, isv, pcs, rdh, rft, sas, mostrecent. <----- #billnum: Required - This is the numerical bill number. Sample value is 1027. #congress: Required - This is the numerical Congress number. Sample value is 112. #link-type: Optional - This is the format of the returned document. Default is pdf. Other values are xml, html, mods, premis, contentdetail. #Examples: #https://api.fdsys.gov/link?collection=bills&billtype=hr&billversion=ih&billnum=1&congress=112 #https://api.fdsys.gov/link?collection=bills&billtype=hconres&billnum=17&congress=112&link-type=xml # the above api accepts mostrecent as an argument, which is why I will be using it (that way I dont have to infer version through status, which would # be overhead). # replace tempfile location by a location in a folder under meritmoot. After returning the file to the user # check the last checked time. If its been a bit (like 2 hours), go through and delete all files that havent been # accessed in, like, a day. # I have noticed that some pdfs dont load on meritmoot.com. I am gueeesssssssing this is due to timeout. This is probably extendable in javascript. # extend it to 15 seconds. #capture crap logWatch("GetBillPdf") { |log| require 'net/http' require 'time' billType = params['billtype'] billNum = params['billnum'] billCongress = params['congress'] billVersion = 'mostrecent' billVersion = params['billversion'] if not params['billversion'].nil? theFile = nil prefix = "moot-pdf" theFileName = "#{prefix}-#{billCongress}-#{billType}-#{billNum}-#{billVersion}.pdf" #figure out if we allready have it files = Dir.entries("/tmp") files.select!{ |name| name == theFileName } p "files: #{files}" if files.length == 1 theFile = "/tmp/" + theFileName theFile = File.open(theFile) createTime = theFile.ctime billUpdateTime = Mmbill.find_by(bill_id: "#{billType}#{billNum}-#{billCongress}".downcase) if billUpdateTime == nil logWatch("pdfs_related_Mmbill_not_found"){ p("#{billType}#{billNum}-#{billCongress} - #{theFileName}") } billUpdateTime = Time.new(1990) #something a long time ago else billUpdateTime = Time.parse(billUpdateTime.bulk['history']['active_at']) end #outdated? if createTime > billUpdateTime #No just pass it back send_file(theFile, filename: theFileName, type: 'application/pdf', disposition: 'inline') else #Yes it is outdated. delete it theFile.close File.delete("/tmp/" + theFileName) theFile = nil end end if theFile == nil theFile = File.open("/tmp/" + theFileName, "w", :encoding => 'ascii-8bit') #https://api.fdsys.gov/link?collection=bills&billtype=sres&billversion=mostrecent&billnum=14&congress=116 Net::HTTP.get_response(URI.parse("https://api.fdsys.gov/link?collection=bills&billtype=#{billType}&billversion=#{billVersion}&billnum=#{billNum}&congress=#{billCongress}")) do |r| p "code: #{r.code}" ApiController.passingAround(r, theFile) end send_file(theFile, filename: theFileName, type: 'application/pdf', disposition: 'inline') theFile.close() end #bit of cleanup. #delete old ones files = Dir.entries("/tmp") #select ones we handle, and that are three days since last accesssed files.select!{|name| name[prefix] != nil and File.atime("/tmp/" + name) < Time.now - ( 3 * 24 * 60 * 60 ) } for rejectFile in files #rejectFile.close File.delete("/tmp/#{rejectFile}") end } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seconds\n _nudge[2]\n end", "def tv_sec() end", "def seconds\n (Time.now - @start_time).to_i\n end", "def seconds\n ((@died_at - @time) / 1000).to_i\n end", "def seconds\n @time\n end", "def sec\n return @t_sec\n end", "def time_sec; Time.now.sec; end", "def in_seconds\n @seconds\n end", "def seconds() self end", "def seconds\n\t\t@seconds\n\tend", "def nanoseconds; end", "def nsec\n 0\n end", "def tv_sec\n return @tv_sec\n end", "def nowSeconds; Time.now.utc.to_i end", "def time_remaining\n\n end", "def time_remaining\n end", "def secs\n self / 3600.0\n end", "def seconds\n (duration + 0.4999).to_i\n end", "def seconds_since(time)\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - time).round(2)\nend", "def seconds_until\n (start_time - Time.now).to_i\n end", "def seconds_until\n (start_time - Time.now).to_i\n end", "def total_time; end", "def seconds_until_end_of_day\n end_of_day.to_f - to_f\n end", "def total_seconds\n (ends_at - Time.current).round\n end", "def seconds_remaining\n ends_at ? (ends_at - started_at).round : 0\n end", "def seconds_since_seen\n Time.now - (last_seen || Time.at(0))\n end", "def calc_play_seconds\n @time_days.to_i * 86400 + @time_hours.to_i * 3600 + @time_minutes.to_i * 60\n end", "def elapsed_time\n (Time.now.to_f - @start_time) * 1000\n end", "def seconds_to(some_ebay_time)\n some_ebay_time - time\n end", "def to_seconds; @val end", "def duration_before_escalation\n return @duration_before_escalation\n end", "def seconds_since_last\n last.blank? ? 0 : (timestamp_server - last.timestamp_server)\n end", "def time_left_in_seconds\n seconds = time_left[:seconds]\n seconds += time_left[:minutes] * 60\n seconds += time_left[:hours] * 60 * 60\n seconds += time_left[:days] * 60 * 60 * 24\n seconds\n end", "def secs\n @msecs / SEC_TO_MS_F\n end", "def elapsed\n (Time.now - @start_time).round\n end", "def seconds ; return aseconds % SPM ; end", "def get_time_remaining\n\n end", "def epoc_to_sec(epoc)\n\n # Check if sec, usec or msec\n nbr_digit = epoc.to_s.size\n\n if nbr_digit == 10\n return epoc.to_i\n elsif nbr_digit == 13\n return (epoc.to_i/1000).to_i\n elsif nbr_digit == 16\n return (epoc.to_i/1000000).to_i\n end\n\n return epoc\nend", "def elapsed_time\n (Time.now.to_f - @start_time) * 1000000\n end", "def tv_usec() end", "def seconds_until_end_of_day\n end_of_day.to_i - to_i\n end", "def get_elapse_time\n @start_time ||= @time_now\n return @time_now - @start_time\n end", "def elapsed_seconds(start_time, end_time)\r\n end_time - start_time\r\nend", "def seconds\n value_parts[2]\n end", "def seconds\n value_parts[2]\n end", "def cstime=(*) end", "def seconds\n self * 60\n end", "def to_i\n return @tv_sec\n end", "def sec_fraction() time[3] end", "def seconds\n @seconds.abs % 60 * (@seconds < 0 ? -1 : 1)\n end", "def time_elapsed\n\t\treturn Time.now - self.start_time\n\tend", "def length\n seconds.to_runtime\n end", "def cstime(*) end", "def sec() time[2] end", "def to_seconds\n (@total / @fps)\n end", "def to_seconds\n (@total / @fps)\n end", "def duration; end", "def duration; end", "def duration; end", "def duration; end", "def duration; end", "def elapsed\n Time.now - self\n end", "def seconds_until_expiration(now=Time.now)\n ((@ends_at - now).abs).round\n end", "def remaining\n (Time.now - @last_scrape).to_i \n end", "def up_time\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - (@start[:time] || Time.now)).round(3)\n end", "def to_i\n self.in_seconds\n end", "def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend", "def remain_time\n rem_time = $time - Time.new\n rem_time.to_i\nend", "def time_tolerance_seconds\n 600\n end", "def to_seconds\n AVERAGE_FACTOR * atom\n end", "def to_seconds\n AVERAGE_FACTOR * atom\n end", "def ctime\n end", "def seconds_in_cycle(now)\n next_due_at(now) - previous_due_at(now)\n end", "def elapsed_time\n if end_time && start_time\n return ((end_time - start_time)/60).round\n else\n return 0\n end\n end", "def time_duration\n t1 = Time.now.to_f\n Time.now.to_f - t1\nend", "def elapsed_days t1\n ((Time.now - t1) / 86400).to_i + 1\n end", "def seconds_left\n if @last_run\n [(@last_run + interval / 1000.0) - Time.now, 0].max\n else\n interval / 1000.0\n end\n end", "def duration_in_seconds\n return @duration_in_seconds\n end", "def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end", "def length\n return 0.0/0.0 unless depart_time && return_time\n (return_time - depart_time)/60\n end", "def expires_in_seconds\n '%.0f' % ( expires_at - Time.now )\n end", "def to_i\n @seconds\n end", "def duration\n (Time.now.to_f - @start) * 1000\n end", "def aseconds ; return @frames / FPS ; end", "def usec() end", "def total_time\n Time.now - @now\n end", "def local_seconds_until_end_of_day\n local_end_of_day.to_f - to_f\n end", "def run_time\n ((Time.now - start_time) * 1000).round\n end", "def offset_sec\n @offset\n end", "def total_seconds()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.TimeSpan_total_seconds(@handle.ptr)\n result\n end", "def to_seconds\n atom * factor\n end", "def sec_fraction\n usec/86400000000.0\n end", "def ttl_duration\n 900\n end", "def seconds_for_expedition\n possible_votes / 3 + 1\n end", "def time_now_sec()\n\treturn Time.now.to_i - Date.today.to_time.to_i #Seconds since midnight\nend", "def elapsed\n duration_since(self.class.now)\n end", "def elapsed_seconds(start_time, end_time)\n end_time.to_i - start_time.to_i\nend", "def elapsed_seconds(start_time, end_time)\n return (end_time - start_time)\nend", "def remaining_time()\n return @total_time_units - @done_time_units\n end", "def duration\n 30\n end", "def ctime() end" ]
[ "0.7479998", "0.731223", "0.7217995", "0.7195561", "0.7142358", "0.71105367", "0.70702714", "0.7025795", "0.7011202", "0.69435483", "0.6933598", "0.687083", "0.6800444", "0.6761454", "0.6747267", "0.672955", "0.67148197", "0.6710942", "0.6699333", "0.66987884", "0.66987884", "0.6669408", "0.664836", "0.66466993", "0.6643001", "0.66130394", "0.6585485", "0.65785855", "0.6568614", "0.6564679", "0.6558561", "0.6553078", "0.65471476", "0.6534106", "0.65275407", "0.6523147", "0.6502592", "0.6500368", "0.6493654", "0.64870375", "0.648679", "0.6482605", "0.6477315", "0.6473082", "0.6473082", "0.64560896", "0.64498174", "0.6443434", "0.64401466", "0.6419357", "0.6416618", "0.6414809", "0.6406731", "0.63912034", "0.6377764", "0.6377764", "0.6372867", "0.6372867", "0.6372867", "0.6372867", "0.6372867", "0.63528544", "0.6346382", "0.63412", "0.63310355", "0.6325035", "0.6324097", "0.632394", "0.6309799", "0.6287192", "0.6287192", "0.62838304", "0.6271733", "0.6270979", "0.62624407", "0.62611103", "0.6257675", "0.6251997", "0.62333256", "0.62267447", "0.6219985", "0.62054676", "0.6195861", "0.6188073", "0.61857474", "0.61825496", "0.6178216", "0.61779964", "0.6177642", "0.61756337", "0.6173142", "0.6169204", "0.61627305", "0.616067", "0.6158818", "0.61584365", "0.6154751", "0.6150062", "0.6149913", "0.6144806", "0.6144661" ]
0.0
-1
Creates a new instance based on the current, in the process optionally merging new values in.
def copy_changed(**values) self.class.new(**self.to_hash.merge!(values)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def produce_instance\n @instance ||= super\n end", "def dup\n new_object = super\n new_object.send :initialize_attributes, @attributes\n new_object\n end", "def dup\n self.class.new(@value, **(@object || {}))\n end", "def new(attrs = {})\n instance = super()\n instance.load_attributes!\n instance.update(attrs)\n instance\n end", "def new\n new_with_value(nil)\n end", "def dup\n Context.new(values: values.dup, known_data: known_data.dup)\n end", "def dup\n self.class.new.tap{|obj| obj.initialize_copi self }\n end", "def with(new_attrs)\n self.class.new(to_h.merge(new_attrs))\n end", "def new_with_value(value)\n RObject.new self, value\n end", "def with options = {}\n # symbolize option keys\n options = symbolize_keys options\n values = supplied.merge(options)\n \n if supplied == values\n self # no changes\n else\n self.class.new(values)\n end\n end", "def replicant\n\n\t\tobj = self.class.new\n\t\tself.instance_values.each_pair do |k,v|\n\t\t\tv = v.dup rescue v\n\t\t\tobj.instance_variable_set(\"@#{k}\", v)\n\t\tend\n\n\t\tobj.datastore = self.datastore.copy\n\t\tobj.user_input = self.user_input\n\t\tobj.user_output = self.user_output\n\t\tobj.module_store = self.module_store.clone\n\t\tobj\n\tend", "def dup\n self.class.new(self, self.default)\n end", "def create(v, **opt)\n c = self_class\n if v.is_a?(c)\n v.dup\n elsif (v = normalize(v)).present?\n c.new(v, **opt)\n end\n end", "def create(v, **opt)\n c = self_class\n if v.is_a?(c)\n v.dup\n elsif (v = normalize(v)).present?\n c.new(v, **opt)\n end\n end", "def dup\n returning self.class.new do |resource|\n resource.attributes = @attributes\n end\n end", "def dup\n self.class.new nil, @opts, &@block\n end", "def incorporate\r\n Builder.new(self)\r\n end", "def new_or_update *args\n new *args\n end", "def new(*args) dup.initialize(*args) end", "def dup(*arguments)\n args = {}\n\n self.class.aggregated_properties.each do |arg|\n args[arg] = instance_variable_get(\"@#{arg}\")\n end\n \n arguments.each_with_index do |argv,i|\n args[self.class.aggregated_properties[i]] = argv\n end\n \n args.merge!(arguments.extract_options!)\n \n self.class.new(args)\n end", "def new_with_value(value)\n AwesomeObject.new(self, value)\n end", "def dup\n self.class.new(options)\n end", "def clone_with( new_settings, &block )\n\t\tnewobj = self.dup\n\t\tnewobj.merge_settings( new_settings )\n\n\t\tif block\n\t\t\treturn newobj.call( &block )\n\t\telse\n\t\t\treturn newobj\n\t\tend\n\tend", "def branch(**new_options)\n if self.is_a?(Builder)\n options = self.options\n else\n options = DEFAULT_OPTIONS.merge(processor: self::Processor)\n end\n\n options = options.merge(new_options) do |key, old_value, new_value|\n case key\n when :loader, :saver then old_value.merge(new_value)\n when :operations then old_value + new_value\n else new_value\n end\n end\n\n Builder.new(options.freeze)\n end", "def clone_with( new_settings, &block )\n\t\tnewobj = self.dup\n\t\tnewobj.settings.merge!( new_settings )\n\n\t\tif block\n\t\t\treturn newobj.call( &block )\n\t\telse\n\t\t\treturn newobj\n\t\tend\n\tend", "def dup\n Ably::Models::IdiomaticRubyWrapper.new(attributes.dup, stop_at: stop_at.keys)\n end", "def dup\n # noinspection RubyMismatchedReturnType\n self.class.new(object.presence)\n end", "def create_history_from_current!(current)\n history_obj = self.new\n attrs_to_copy = current.attributes.reject {|key, value| !history_obj.attribute_names.include?(key)}\n\n changed_attrs_with_old_values = {}\n current.changes.each_pair {|field, value_ary| changed_attrs_with_old_values[field] = value_ary[0]}\n\n # If a field of the form \"class_name_id\" exists in the history record, copy the old records id to it.\n old_id_record_field = \"#{current.class.to_s.underscore.singularize}_id\"\n if history_obj.attribute_names.include?(old_id_record_field)\n attrs_to_copy.merge!(old_id_record_field.to_sym => current.id)\n end\n \n attrs_to_copy.merge!(changed_attrs_with_old_values)\n self.create(attrs_to_copy)\n end", "def build_new(*args)\n self.class.new(*args)\n end", "def dup\n result = self.class.new(geometric_resolution, order)\n result.initialize_copy(self)\n result\n end", "def for_instance(instance)\n self.clone.tap{|q| q.instance = instance }\n end", "def fork instance, attrs = {}\n object_type = instance.class\n\n role_value_map =\n object_type.all_role_transitive.inject({}) do |hash, (role_name, role)|\n next hash if !role.unique\n next hash if role.fact_type.class == ActiveFacts::API::TypeInheritanceFactType\n old_value = instance.send(role.getter)\n if role.counterpart && role.counterpart.unique && old_value != nil\n # It's a one-to-one which is populated. We must not change the counterpart\n if role.mandatory && !attrs.include?(role.name)\n # and cannot just nullify the value\n raise \"#{object_type.basename} cannot be forked unless a replacement value for #{role.name} is provided\"\n end\n value = attrs[role_name]\n else\n value = attrs.include?(role_name) ? attrs[role_name] : instance.send(role.getter)\n end\n hash[role_name] = value if value != nil\n hash\n end\n\n assert(object_type, role_value_map)\n end", "def merge(...)\n self.clone.merge!(...)\n end", "def clone\n Profile.new(@start_value, @value_changes.clone)\n end", "def +(other)\n self.class.new(batch_state.to_h.merge(other.batch_state.to_h))\n end", "def dup\n super.tap do |instance|\n instance.instance_variable_set(:@chain, instance.chain.dup)\n end\n end", "def clone\n newobj = super\n newobj.instance_eval do\n __getobj__.each_pair do |k, v|\n __getobj__[k] = v.clone\n end\n end\n newobj\n end", "def really_new\n return self.new\n end", "def new_value(value)\n AwesomeObject.new(self, value)\n end", "def clone\n self.class.new(**as_json)\n end", "def dup\n self.class.new(self, @loaded)\n end", "def with(new_options)\n self.class.new(name, options.merge(new_options))\n end", "def initialize_dup(original)\n super\n self.team = original.team\n self.plan = original.plan\n self.employee = original.employee\n end", "def rebuild_with(attributes)\n self.class.new(to_h.deep_merge(attributes))\n end", "def clone\n super\n end", "def dup\n super.tap do |e|\n e.args = e.args.dup\n e.kwargs = e.kwargs.dup\n end\n end", "def with(new_options)\n __new__(relation, new_options)\n end", "def build(attributes = {})\n params = attributes\n return new(params) unless request_new_object_on_build?\n\n path = build_request_path(params.merge(primary_key => 'new'))\n\n request(params.merge(:_method => :get, :_path => path)) do |response|\n new_from_parsed_data(response.body) if response.success?\n end\n end", "def dup\n a = self.class.new\n a.args = args.map { |arg| arg.dup }\n a.proc = self.proc.dup\n a.id = Utils.random_str\n a\n end", "def new\n BaseObject.new(self)\n end", "def with(attrs = {})\n self.class.new(to_h.merge(attrs))\n end", "def dup_entity (options = {})\n entity = super(options)\n entity.update_attributes(:start => self.send(:start))\n entity.update_attributes(:end => self.send(:end))\n \n entity.logged_asset = self.logged_asset if logged_asset\n assets.each{ |a| entity.assets << a if a}\n entity.save\n return entity\n end", "def build(attributes)\n self.model_instance ||= (base.kind_of?(Class) ? base.new(attributes) : base.build(attributes))\n end", "def newchild(path)\n full_path = ::File.join(self[:path], path)\n\n # Add some new values to our original arguments -- these are the ones\n # set at initialization. We specifically want to exclude any param\n # values set by the :source property or any default values.\n # LAK:NOTE This is kind of silly, because the whole point here is that\n # the values set at initialization should live as long as the resource\n # but values set by default or by :source should only live for the transaction\n # or so. Unfortunately, we don't have a straightforward way to manage\n # the different lifetimes of this data, so we kludge it like this.\n # The right-side hash wins in the merge.\n options = @original_parameters.merge(:path => full_path).reject { |param, value| value.nil? }\n\n # These should never be passed to our children.\n [:parent, :ensure, :recurse, :recurselimit, :target, :alias, :source].each do |param|\n options.delete(param) if options.include?(param)\n end\n\n self.class.new(options)\n end", "def with *args, &block\n @current.args = args\n @current.block = block\n self\n end", "def dup\n self.class.new(to_hash)\n end", "def merge(other)\n result = self.class.new\n\n # Set all of our instance variables on the new class\n [self, other].each do |obj|\n obj.instance_variables.each do |key|\n # Ignore keys that start with a double underscore. This allows\n # configuration classes to still hold around internal state\n # that isn't propagated.\n if !key.to_s.start_with?(\"@__\")\n result.instance_variable_set(key, obj.instance_variable_get(key))\n end\n end\n end\n\n result\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 dup\n Options.new(*structures)\n end", "def dup\n result = self.class.new(dimension, geometric_resolution, order)\n result.send(:initialize_copy, self)\n result\n end", "def new_object\n @object = scope.new params[object_name.to_sym]\n set_instance\n end", "def dup_with(attributes={})\n dup_params = { response: response,\n params: params,\n method: method,\n resource: resource,\n session: session }.merge(attributes)\n self.class.new(dup_params)\n end", "def initialize(current_val, new_val, opts = {})\n fail Error, \"Unexpected that opts[:qualified_key] is nil\" unless opts[:qualified_key]\n fail Error, \"Unexpected that opts[:id_handle] is nil\" unless opts[:id_handle]\n\n super(qualified_key: opts[:qualified_key], type: opts[:type], service_instance: opts[:service_instance])\n @id_handle = opts[:id_handle]\n @current_val = current_val\n @new_val = new_val\n end", "def with(options={})\n obj = dup\n options.each { |key, value| obj.send \"#{key}=\", value }\n obj\n end", "def clone\n super\n end", "def new_from_hash(hash)\n if hash == nil\n self.class.new.assign(self)\n else\n hash_obj = hash\n if hash.instance_of?(Hash)\n hash_obj = self.class.new\n merge_hash_into_object(hash, hash_obj)\n end\n instance = self.class.new\n object_assign(instance, hash_obj)\n end\n end", "def extra_props(**args)\n instance = dup\n instance.props = props.dup.merge(**args)\n instance\n end", "def _with(new_obj)\n @obj, old_obj = new_obj, @obj\n yield\n ensure\n @obj = old_obj\n end", "def with(new_options)\n self.class.new(identifier, options.merge(new_options))\n end", "def new_result\n Result.new(self)\n end", "def with(*args)\n @_args = args\n self\n end", "def build(floor, overrides)\n @instance || super\n end", "def spawn_version(mode = :update)\n mode = :create if historical_creation\n\n version = self.class.historical_version_class.new\n version.tap do |v|\n v._record_id = id\n v._record_type = self.class.name\n\n attribute_names.each do |attr_name|\n attr = attr_name.to_sym\n next if Historical::IGNORED_ATTRIBUTES.include? attr\n v.send(\"#{attr}=\", self[attr])\n end\n\n v.meta = self.class.historical_meta_class.new.tap do |m|\n m.creation = (mode == :create)\n m.created_at = Time.now.utc\n end\n\n previous = v.previous\n\n if !v.creation? and previous\n v.diff = self.class.historical_diff_class.from_versions(previous, v)\n end\n\n (self.class.historical_callbacks || []).each do |callback|\n callback.call(v)\n end\n\n v.save!\n\n self.spawned_version = v\n end\n end", "def with(options={})\n alt = dup\n alt.with!(options)\n end", "def with(new_key_vals)\n check_keys(new_key_vals.keys)\n self.class.new(@key_vals.merge(new_key_vals))\n end", "def dup *args\n x = super()\n x.deepen_dup!\n unless args.empty?\n x._options= *args\n end\n x\n end", "def with(opts={})\n self.merge(opts)\n end", "def dup( )\n\t\t\tMarshal.load(Marshal.dump(self))\n\t\tend", "def clone\n self.class.new(@attributes.except(:_id).except(:versions).dup)\n end", "def create_instance(initial_values = nil)\n values = initial_values || {}\n Instance.new(self).tap { |instance|\n values.each do |attribute, value|\n instance.send(:\"#{attribute}=\", value)\n end\n }\n end", "def dup\n self\n end", "def dup\n self\n end", "def dup\n self\n end", "def build(parent)\n return if reject?(parent, attributes)\n @existing = parent.send(association.name)\n if update?\n attributes.delete_id\n existing.assign_attributes(attributes)\n elsif replace?\n parent.send(association.setter, Factory.build(@class_name, attributes))\n elsif delete?\n parent.send(association.setter, nil)\n else\n check_for_id_violation!\n end\n end", "def build\n builder_values = builder.build\n self.use_values(builder_values)\n end", "def build_object(resp)\n return resp unless resp.respond_to?(:merge)\n @build_object ||= final_object_class.new(resp.merge(additional_hash_to_serialize_after_response))\n end", "def build(attrs = {})\n choose_right_class(attrs).new(attrs)\n end", "def with(new_value)\r\n @new_value = new_value\r\n self\r\n end", "def dup\n self.class.new(build_exclusive_url,\n :headers => headers.dup,\n :params => params.dup,\n :builder => builder.dup,\n :ssl => ssl.dup,\n :request => options.dup)\n end", "def initialize_copy(other)\n super\n @initial_values = other.initial_values.dup\n @missing_initial_values = other.send(:missing_initial_values).dup\n @previous_changes = other.previous_changes.dup if other.previous_changes\n self\n end", "def dup\r\n other = super\r\n [:@opts, :@description].each do |var|\r\n d = instance_variable_get(var).dup\r\n other.instance_variable_set(var, d)\r\n end\r\n other\r\n end", "def clone\n newobj = Marshal.load(Marshal.dump(self))\n props = newobj.instance_variable_get(:@props)\n props[:id] = Engine.instance.db.getid\n put_object(newobj)\n newobj\n rescue\n log.error \"Clone failed\"\n nil\n end", "def build_version(new_attrs = {})\n new_version = self.class.new(new_version_attrs(new_attrs)).tap do |built|\n built.deprecate_old_versions_after_create!\n preserve_has_one_associations_to(built) \n end\n end", "def dup_entity(options = {})\n entity = super(options)\n entity.update_attributes(:product_family => product_family) if product_family\n entity.update_attributes(:product_family_member => product_family_member) if product_family_member\n entity.update_attributes(:product_family_member_revision => product_family_member_revision) if product_family_member_revision\n entity.update_attributes(:part_number => part_number) if part_number\n entity.object_type = self.object_type.dup_entity(options) if object_type\n entity.save\n return entity\n end", "def merge( params )\n\t\tcopy = self.dup\n\t\tcopy.merge!( params )\n\t\treturn copy\n\tend", "def new(attributes = {})\n resource = repository.scope { model.new(default_attributes.update(attributes)) }\n self << resource\n resource\n end", "def dup_two_levels\n self.class.new @klass, self\n end", "def _clone\n self.class.new(self)\n end", "def build(*arguments, &block)\n build_class(*arguments, &block).new(*arguments, &block)\n end", "def create(*args)\n result = super(*args)\n ensure\n readonly! if result\n end", "def initialize new_attributes = {}\n _assign_attributes new_attributes\n end" ]
[ "0.6292059", "0.6186013", "0.60048056", "0.59807086", "0.59795535", "0.5888796", "0.58297384", "0.57840353", "0.57726306", "0.5758097", "0.57502234", "0.5708884", "0.56783956", "0.56783956", "0.5671655", "0.56663674", "0.5623973", "0.56209403", "0.56196636", "0.56043077", "0.5591135", "0.55849904", "0.55705297", "0.5562109", "0.5554113", "0.5543764", "0.5516869", "0.54974276", "0.5487158", "0.5480838", "0.5479207", "0.54741436", "0.54643583", "0.54308164", "0.5418169", "0.5411885", "0.5394776", "0.53936666", "0.5391012", "0.53900373", "0.5389878", "0.53803587", "0.5377797", "0.53777057", "0.53756183", "0.5373184", "0.5357397", "0.5354376", "0.5351004", "0.53438115", "0.53325325", "0.5331977", "0.53195894", "0.5312569", "0.5308775", "0.5305931", "0.53030163", "0.5268993", "0.5268321", "0.52658844", "0.52604055", "0.5257717", "0.5256996", "0.5254255", "0.52523065", "0.5252087", "0.52481717", "0.5233145", "0.52292055", "0.5228734", "0.5227028", "0.521295", "0.5207897", "0.520575", "0.52024764", "0.5201938", "0.5200827", "0.5199349", "0.5189157", "0.51851624", "0.51626885", "0.51626885", "0.51626885", "0.51532906", "0.5153046", "0.51499003", "0.5146623", "0.5144576", "0.51445556", "0.5144535", "0.51385945", "0.513339", "0.5126739", "0.51232284", "0.5122784", "0.5117666", "0.51091594", "0.51009387", "0.50970644", "0.50969297", "0.50943434" ]
0.0
-1
Implement an instance method in your Ingredient class that helps check whether an ingredient is valid (i.e., contains only the ingredient names above)?
def allowed_ingredients SAFE_INGREDIENTS.include?(name.downcase) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_ingredient?(ingredient_name)\n ingredient_names.include?(ingredient_name)\n end", "def must_have_at_least_one_ingredient\n errors.add(:ingredients, \"must exist!\") if self.ingredients.empty?\n end", "def strict_matching(ingredient_name,item)\n return item.downcase.include?(ingredient_name)\nend", "def enough_ingredients_for?(recipe)\n #this should assert to false when recipe.amount_required is not >=\n # pantry.checkstock.\n end", "def allergens_ingredients\r\n Allergen.all.select {|allergen| allergen.ingredient == self}\r\n end", "def allergens\n self.ingredients.select{|ing|\n allergen_ingredients.include?(ing)}\n end", "def maybe_matching(ingredient_long_name,item)\n return (item.downcase.split(\" \") & ingredient_long_name.split(\" \")).size >= 1\nend", "def is_safe?(recipe)\n !recipe.ingredients.any? do |ingredient|\n allergens.include?(ingredient)\n end\n end", "def ingredients\n Ingredient.all.select do |ingredient_instance|\n ingredient_instance.makes == self\n end\n end", "def ingredients_helper\n RecipeIngredient.all.select {|instance| instance.recipe == self}\n end", "def enough_ingredients_for?(recipe)\n enough = false\n recipe.ingredients_required.each do |ingredient, quantity|\n @stock.each do |stock_ingredient, stock_quantity|\n enough = stock_quantity > quantity\n end\n end\n enough\n end", "def recipe_ingredients\n RecipeIngredient.all.select { |ri| ri.ingredient.name == @ing }\n end", "def allergens\n ingredients.select { |i| Allergen.ingredients.include?(i) }\n end", "def add_ingredient_by_name(new_ingredient)\n #self.ingredients < Ingredient.find_ingredient_by_name(new_ingredient)\n end", "def add_ingredients(ingredients)\n ingredients.each do |ingredient|\n if self.ingredients.count(ingredient) == 0\n RecipeIngredient.new(self, ingredient)\n end\n end\n end", "def recipe_ingredients\n RecipeIngredient.all.select{|ingredient| ingredient.recipe == self}\n end", "def ingredient_logic(ingredient)\n if all_ingredients.include?(ingredient)\n new_recipe_ingredient = ingredient_instance(ingredient)\n Recipe.last.ingredients << new_recipe_ingredient\n else\n new_recipe_ingredient = Ingredient.create(name: ingredient)\n Recipe.last.ingredients << new_recipe_ingredient\n end\n end", "def allergens\n ing = self.ingredients\n ing.select do |ingredient|\n Allergen.all.any? do |allergen|\n allergen.ingredient == ingredient\n end\n end\n\n end", "def allergens\n self.ingredients.each do |ingredient|\n Allergen.all.each do |alergy|\n alergy.ingredient == ingredient\n end\n end\n end", "def recipe_ingredients\n RecipeIngredient.all.select do |recipe_ingredient|\n recipe_ingredient.recipe == self\n end\n end", "def allergens\n # first get an array of all possible allergic ingredients\n allergic_ingredients = Allergen.all.map do |allergen|\n allergen.ingredient\n end.uniq\n\n # iterate through this recipes ingredients and see if they're\n # in the list of allergic ingredients\n self.ingredients.select do |ingredient|\n allergic_ingredients.include? ingredient\n end\n end", "def probable_matching(ingredient_long_name,item)\n return (item.downcase.split(\" \") & ingredient_long_name.split(\" \")).size >= 2\nend", "def allergens\n allergy_instances = Allergy.all.select do |allergy|\n self.ingredients.include?(allergy.ingredient)\n end \n end", "def get_recipe_ingredients\n puts \"\\nWhat ingredients are in your recipe? Please enter ingredients separated by commas with no ands.\\n \".colorize(:green).bold\n user_ingredients = gets.strip\n if valid_user_input?(user_ingredients)\n user_ingredients.split(/\\s*\\,\\s*/)\n else\n puts \"\\nInvalid ingredients!\\n \".colorize(:red).bold\n get_recipe_ingredients\n end\n end", "def ingredients\n RecipeIngrediant.all.select do |recing|\n recing.recipe == self\n end\n #map to ing\n\n end", "def recipe_ingredients\n RecipeIngredient.all.select do |ri|\n ri.recipe == self\n end\n end", "def recipe_ingredients\n RecipeIngredient.all.select do |ri|\n ri.recipe == self\n end\n end", "def all_there?(recipe, on_hand)\n recipe.keys.each do |ingredient|\n return false if !(on_hand.keys.include? ingredient)\n end\n\n true\nend", "def safe_recipes\n #want all of the recipes that do not contain ingredients in allergens (array of ingredients)\n #look through all of our recipes\n my_ingredients = self.recipes.map do |recipe|\n #for each recipe, get the ingredients\n recipe.ingredients #array, map makes it an array within an array\n end.flatten.uniq\n #see if any of those ingredients are not our allergens\n my_safe_ingredients = my_ingredients.select do |ingredient|\n !(self.allergens.include?(ingredient))\n end\n #select all recipe ingredients that have our safe ingredients\n my_safe_ris = RecipeIngredient.all.select do |ri|\n my_safe_ingredients.include?(ri.ingredient)\n end\n #return the recipe\n my_safe_ris.map do |ri|\n ri.recipe\n end\n\n end", "def test_nameArmor\n f = ArmorFilter.new(\"name\", \"Leather Shield\")\n new_list = @baseItems.find_all{|x| f.apply(x)}\n return new_list.size == 1\n end", "def allergens\r\n Allergen.all.select do |allergen|\r\n allergen.ingredient == self\r\n end\r\n end", "def allergen?\r\n !!Allergen.all.find do |allergen|\r\n allergen.ingredient == self\r\n end\r\n end", "def assure_unique_ingredients\n self.ingredients.uniq!\n end", "def your_name_is_not_dumb\n if name.include?(\"dumb\")\n errors.add(:name, \"is dumb\")\n end\n end", "def allergens\n self.ingredients.select do |ingre|\n Allergy.all.map {|allergy| allergy.ingredient}.uniq.include?(ingre)\n end\n end", "def ingredient_instance(ingredient_name) \n Ingredient.find_by name: ingredient_name\n end", "def valid_isbn\n errors.add(:isbn, \"This is not a valid ISBN.\") unless ISBN_Tools.is_valid?(self.isbn) \n end", "def get_ingredients \n # get rid of all characters that are not: a-z A-Z 0-9 - [] () . ' / , blank;\n clean_ingredients = self.ingredients.gsub(%r{[^a-zA-Z0-9\\-\\[\\]\\.\\,\\'\\(\\)\\/\\s]}, '')\n return clean_ingredients.split(', ').each { |ingredient| ingredient.strip! }\n end", "def parse_ingredients ingredient_line, recipe \n Rails.logger.debug \"== Blender::parse_ingredients\"\n \n # Removes hifen \"-\"\n ingredient_line.gsub!(\"-\",\"\") \n # Removes Complementary Words\n ingredient_line.gsub!(/\\b(#{STOP_WORDS.join('|')})\\b/mi, ' ')\n \n # Given a ingredient line, extracts the: measure, quantity, ingredient name\n measure, quantity, ingredient = get_measure_quantity_and_ingredient ingredient_line.downcase\n \n Rails.logger.debug \"* Extracted Ingredient: Quant:(#{quantity}) Meas:(#{measure}) Name:(#{ingredient})\"\n \n add_ingredient_to_recipe quantity, measure, ingredient, recipe \n # Returns true if could understand and extract the measure and quantity\n return !measure.nil? && !quantity.nil?\n end", "def ingredient_names\n self.ingredients.map do |ing|\n ing.name\n end\n end", "def allergens\n ingredients & Allergy.ingredients \n end", "def is_exempt(item_name)\n # Check books\n if @@exemption_list_books.any? { |s| item_name.include? s }\n return true\n end\n\n # Check food\n if @@exemption_list_food.any? { |s| item_name.include? s }\n return true\n end\n\n # Check medical\n if @@exemption_list_medical.any? { |s| item_name.include? s }\n return true\n end\n\n end", "def test_nameItem\n f = ItemFilter.new(\"name\", \"Potion\")\n new_list = @usableItems.find_all{|x| f.apply(x)}\n return new_list.size == 1\n end", "def filter_ingredients(ingredients)\n foods = self.saved_foods.collect(&:name)\n \n ingredients.each do |i|\n if foods.include?(i.food)\n i.deleted = true\n end\n end\n \n ingredients\n end", "def initialize ingredient\n @dog = Ingredient.new 'a dog', ['Invisible Dog', 'Breakfast Sausage', 'Beef', 'Mystery Meat', 'Polish', 'Ice Cream', 'Sushi'], 7\n @bun = Ingredient.new 'a bun', ['Classic', 'Whole Wheat', 'Lettuce', 'Cheeto', 'Cotton Candy', 'Seaweed'], 6\n @condiment = Ingredient.new 'some condiments', ['Nutella', 'String Cheese', 'Fruit Loops', 'Sprinkles', 'Onions', 'Ketchup', 'Chips', 'Mustard'], 8\n end", "def recipe_ingredients(perfect_10_recipe)\n return perfect_10_recipe\nend", "def test_nameWeapon\n f = WeaponFilter.new(\"name\", \"Club\")\n new_list = @baseItems.find_all{|x| f.apply(x)}\n return new_list.size == 1\n end", "def allergens_ingredients\n Allergen.all.select {|allergen| allergen.user == self}\n end", "def test_nameUsableItem\n f = UsableItemFilter.new(\"name\", \"Potion\")\n new_list = @usableItems.find_all{|x| f.apply(x)}\n return new_list.size == 1\n end", "def ingredient_name\n return ingredient.name\n end", "def get_ingredients_names\n self.ingredients.map{|ingredient| ingredient.name}\n end", "def present_ingredients_names\n get_ingredients_names.reduce(\"\") {|memo, name| memo + \", #{name}\"}.delete_prefix(\", \")\n end", "def valid?\n valid = true\n\n if self.name.nil? || self.name == \"\"\n valid = false\n end\n\n if self.general_info.nil? || self.general_info == \"\"\n valid = false\n end\n\n if self.technical_specs.nil? || self.technical_specs == \"\"\n valid = false\n end\n\n if self.where_to_buy.nil? || self.where_to_buy == \"\"\n valid = false\n end\n\n product_to_find = DATABASE.execute(\"SELECT name FROM products;\")\n\n product_to_find.each do |names|\n if names[\"name\"] == @name\n valid = false\n end\n end\n\n return valid\n end", "def exempt?\n if @a_name.include?(\"book\") || @a_name.include?(\"chocolate\") || @a_name.include?(\"headache\")\n true\n else \n false\n end\n end", "def safe_recipes\n #Look at each allergen. Look at each recipeingredient to determine if any ingredients match any allergens. return recipe if not\n allergens = self.user_allergens ##array of allergies (ingredients objects)\n ri_array = RecipeIngredient.all\n binding.pry\n allergens.each do |allergen|\n binding.pry\n ri_array.delete_if {|recipeingredient| recipeingredient.ingredient == allergen}\n end\n binding.pry\n ri_array.map {|recipeingredient| recipeingredient.recipe}\n\n\n end", "def has_stuff_required_for(item_class)\n item_class.required_supplies.each do |requirement|\n @supplies.any?{|s| s.is_a? requirement }\n end\n end", "def ingredient(ingredient_name, units)\n RecipeIngredient.new(ingredient_name, units)\n end", "def by_ingredient_search(query)\n ingredient_query = Ingredient.where('name LIKE ?', \"%#{query}%\")\n if ingredient_query.any?\n return self.approved.where(:id => ingredient_query.collect(&:recipes).flatten.uniq.collect(&:id))\n end\n return self.approved\n end", "def ingredients\n RecipeIngredient.all.select do |recipe_ingredient|\n recipe_ingredient.recipe == self\n end.map do |recipe_ingredient|\n recipe_ingredient.ingredient\n end\n end", "def ingredients\n RecipeIngredients.all.select do |recipe_ingredient|\n recipe_ingredient.recipe == self\n end.map do |recipe_ingredient|\n recipe_ingredient.ingredient\n end\n end", "def change_ingredient (new_ingredient)\n if @ingredients.include?(new_ingredient)\n @ingredients.delete(new_ingredient)\n false\n else\n @ingredients << new_ingredient\n end\n end", "def names_valid?\n return nil unless AccountType.individual?(account_type)\n\n errors.add(:forename, :cant_be_blank) if forename.to_s.empty?\n errors.add(:surname, :cant_be_blank) if surname.to_s.empty?\n names_length_valid?\n end", "def safe_recipes\n all_recipes = RecipeCard.all.map { |c| c.recipe }\n all_recipes.uniq.select { |r| (allergens & r.ingredients).empty? }\n end", "def cleaned_params\n cleaned_params = dish_params\n cleaned_params[:ingredients]&.reject!(&:empty?)\n cleaned_params\n end", "def test_valid\n italian = RecipeType.new\n\n assert_equal(false, italian.valid?)\n\n italian.name = \"\"\n assert_equal(false, italian.valid?)\n\n italian.name = \"Italian\"\n assert_equal(true, italian.valid?)\n end", "def validate_name_parts\n name_part_types.each do |type|\n next if send \"valid_#{type}?\"\n errors.add type, \"valid #{type} required\"\n end\nend", "def validate_input(list)\n\n list.each { |i|\n if /[a-zA-Z]+\\d+/ !~ i\n return false\n end\n }\n\n true\nend", "def custom_regimen_ingredients\n arv_extras_concepts = Concept.joins(:concept_names).where(\n concept_name: { name: ['INH', 'CPT', 'Pyridoxine', 'Rifapentine', 'INH / RFP'] }\n )\n Drug.where(concept: arv_extras_concepts) + Drug.arv_drugs.order(name: :desc)\n end", "def matching_substances_to(ingredient)\n matching_substances = []\n # does ingredient match any substance in this allergen category \n matching_substances = self.get_substances.select {|substance| \n (ingredient.upcase.include?(substance.upcase) || substance.upcase.include?(ingredient.upcase))\n } \n return matching_substances\n end", "def ingredients\n my_recipe_ingredients = RecipeIngredient.all.select do |recipeingredient|\n recipeingredient.recipe == self\n end\n my_recipe_ingredients.map do |recipe_ingredient|\n recipe_ingredient.ingredient\n end.uniq\n end", "def taxes_valid?\n errors.add(:taxes, :one_must_be_chosen) if taxes.compact_blank.size != 1\n end", "def allergens\n unique_allergen_ingredients = Allergen.all.map do |allergen|\n allergen.ingredient\n end.uniq\n\n (self.ingredients & unique_allergen_ingredients)\n end", "def validate_line_items\n \n end", "def valid_songs(songs)\n song_ids & songs\nend", "def validate\n errors.add_to_base \"Enter atleast one product\" if items.empty?\n end", "def print_needed_ingredients\n puts \"\\n\\n\\s\\e[4m#{self.name} Recipe\\e[0m\"\n self.ingredients.each { |ingredient| puts \"\\s- #{ingredient.name}: #{RecipeIngredient.find_by(recipe_id: self.id, ingredient_id: ingredient.id).amount} cl\" }\n if self.recipe_specials.collect{|x| x.special if x.special}.uniq != [nil]\n self.recipe_specials.collect{|x| x.special if x.special}.uniq.each{|y| puts \"\\s- Special: #{y}\"}\n elsif self.recipe_specials.collect{|x| x.garnish if x.garnish}.uniq != [nil]\n puts \"\\s- Garnish: #{self.recipe_specials.collect{|x| x.garnish if x.garnish}.uniq[0]}\"\n end\n puts \"\\s- Preparation: #{self.preparation}\"\n end", "def validate_name\n unless name.length > 0\n add_error :name, 'name of the price item shall be provided'\n end\n\n unless price.to_i > 0\n add_error :price, 'price should be a number'\n end\n end", "def valid?\n !name.nil?\n end", "def valid?\n !name.nil?\n end", "def valid?\n !name.nil?\n end", "def ingredients\n RecipeIngredient.all.select do |recipe_ingre|\n recipe_ingre.recipe == self\n end.map {|recipe_ingre| recipe_ingre.ingredient}\n end", "def test_nameSkill\n f = SkillFilter.new(\"name\", \"Fire\")\n new_list = @usableItems.find_all{|x| f.apply(x)}\n return new_list.size == 1\n end", "def valid?\n @errors = []\n if id.blank?\n @errors << {message: \"#{class_name} id cannot be blank.\", variable: \"id\"}\n elsif !possible_values.include?(id)\n @errors << {message: \"#{class_name} id must be included in the table.\", variable: \"id\"}\n end\n \n if class_name.blank?\n @errors << {message: \"Class cannot be blank.\", variable: \"class\"}\n end\n \n @errors.empty?\n end", "def name_is_valid\n errors.add(:name,'Invalid empty string for name.') unless name_is_valid?\n end", "def test_nameBaseItem\n f = BaseItemFilter.new(\"name\", \"Potion\")\n new_list = @baseItems.find_all{|x| f.apply(x)}\n return new_list.size == 1\n end", "def ingredients\n RecipeIngredient.all.map do |reci_ingred|\n reci_ingred.ingredient_O if reci_ingred.recipe_O == self\n end.compact\n end", "def valid?\n @errors << :title if !@title.is_a?(String) || @title.empty?\n @errors << :author if !@author.is_a?(String) || @author.empty?\n @errors << :release_date unless @release_date.is_a?(Date)\n @errors << :publisher if !@publisher.is_a?(String) || @publisher.empty?\n @errors << :isbn unless @isbn.is_a?(Integer) && @isbn < 10**10 && @isbn >= 10**9\n \n @errors.empty?\n end", "def valid?(set); end", "def is_valid_item?(input)\n /\\A[1234]\\z/.match(input)\nend", "def ingredients\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 53 )\n ingredients_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 341:3: ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'G' | 'g' ) ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'D' | 'd' ) ( 'I' | 'i' ) ( 'E' | 'e' ) ( 'N' | 'n' ) ( 'T' | 't' ) ( 'S' | 's' )\n if @input.peek( 1 ).between?( T__24, T__25 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__34, T__35 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__56, T__57 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__42, T__43 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__24, T__25 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__34, T__35 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__16, T__17 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__38, T__39 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 53 )\n memoize( __method__, ingredients_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def allergens\n array = []\n Allergen.all.each do |allergen_instance|\n ingredients.each do |ingredient|\n if allergen_instance.ing == ingredient\n array << allergen_instance.ing\n end\n end\n end\n array\nend", "def hand_out_gift(name)\n $names ||= [] # conditional assignment, global variable\n if $names.include?(name.strip)\n \traise ArgumentError.new('Child already got a gift from Santa')\n else \n \t$names << name.strip\n end\n #names.include?(name) ? names << name : raise Argument Error.new(\"#{name} has gotten his gift from Santa\") # => didn't work\nend", "def ingredients\n recipes = RecipeIngredient.all.select { |recipeing| recipeing.recipe == self}\n recipes.collect {|recipeing| recipeing.ingredient}\n end", "def ingredients\n RecipeIngredient.all.select { |ri| ri.recipe == self }.map { |ri| ri.ingredient }\n end", "def allergens\n self.ingredients.map do |ingredient|\n Allergen.all.map do |allergen|\n ingredient if allergen.ingredient_O == ingredient\n end.compact\n end.flatten.uniq\n end", "def valid_item_name?(name)\n !!(name =~ /\\A[-_ 0-9a-zA-Z]+\\Z/)\n end", "def ingredients\n # self.recipe_ingredients\n recipe_ingredients.map do |r_i|\n r_i.ingredient\n end\n end", "def retrieve_and_validate_put\n ingredient_config = Ingredient.find_by!(id: params[:id])\n message = 'The requested ingredient cannot be' \\\n 'updated for this since its the same value'\n (raise ActionController::BadRequest, message) unless ingredient_config.units != params[:units].to_i\n ingredient_config\n end", "def is_valid; end", "def test_grouping_without_religion\n religion_obj = Religion.new(:grouping => 'All Anglican')\n assert !religion_obj.valid?\n assert religion_obj.errors.invalid?(:name)\n end" ]
[ "0.6767781", "0.6306675", "0.6278676", "0.6172744", "0.61275464", "0.611898", "0.61106807", "0.6100629", "0.60225934", "0.59977853", "0.5893108", "0.58866984", "0.5877923", "0.5819596", "0.5810549", "0.58058375", "0.58023393", "0.57733536", "0.5744651", "0.57437634", "0.57387173", "0.57351494", "0.5734006", "0.5724417", "0.5718413", "0.57136196", "0.57136196", "0.5699415", "0.56814325", "0.56758106", "0.5669301", "0.5663006", "0.565193", "0.56504136", "0.56439203", "0.56364805", "0.56070393", "0.55933666", "0.55694455", "0.55507994", "0.5535814", "0.55316716", "0.5494316", "0.5490594", "0.5482262", "0.5478752", "0.5465744", "0.54557824", "0.5451323", "0.5451204", "0.54490393", "0.54466474", "0.54459226", "0.5426228", "0.5416287", "0.5414021", "0.5399277", "0.53745335", "0.53675437", "0.5360531", "0.535053", "0.5342004", "0.53407997", "0.53396475", "0.533883", "0.53194726", "0.5319178", "0.5317924", "0.5315331", "0.53117096", "0.53085834", "0.53056496", "0.53015286", "0.5294007", "0.52926123", "0.52806056", "0.5275434", "0.5268114", "0.5268114", "0.5268114", "0.5264276", "0.5263314", "0.52514124", "0.5247461", "0.52469575", "0.5239565", "0.52387524", "0.5230966", "0.523077", "0.5227063", "0.5223987", "0.5218508", "0.52092636", "0.5205415", "0.5194982", "0.5190525", "0.5181951", "0.51754606", "0.5168637", "0.5167513" ]
0.7081761
0
skip_before_filter :ranking, :only =>['ranking' ]
def admin end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_filter; end", "def reset_filter!\n skip_before_action(:filter_access_filter) if method_defined?(:filter_access_filter)\n before_action :filter_access_filter\n end", "def skip_actions; end", "def filter\n setup_instance_variables\n render 'index'\n end", "def require_no_user(options = {})\n self.before_filter options do |controller|\n controller.send(:require_no_user)\n end\n end", "def before_action \n end", "def filter\n super\n end", "def index\n index_filter\n end", "def skip_tab_filter?\n !['index', 'new', 'create'].include?(params[:action])\n end", "def skip_tab_filter?\n !['index', 'new', 'create'].include?(params[:action])\n end", "def skip_tab_filter?\n !['index', 'new', 'create'].include?(params[:action])\n end", "def apply_filter\n end", "def param_whitelist\n [:rating, :review]\n end", "def autofilter\n true\n end", "def autofilter\r\n\t\tfalse\r\n\tend", "def autofilter\r\n\t\tfalse\r\n\tend", "def autofilter\r\n\t\tfalse\r\n\tend", "def autofilter\r\n\t\tfalse\r\n\tend", "def filter\n end", "def after_filter; end", "def index\n @users = policy_scope(User)\n .includes(:avatar, :main, :rank)\n .order(created_at: :desc)\n .page(params[:page])\n\n @users = @users.where(hidden: false) unless params[:hidden]\n\n authorize @users\n end", "def destroy_filter\n not actuale?\n end", "def filter_redirect; end", "def filter_redirect; end", "def before_filter(filter_name, options)\n [options[:only]].flatten.each do |action|\n add_filter(filter_name, action)\n end\n end", "def ignore\r\n access_denied_state_error :ignore unless @review_set.may_ignore?\r\n @review_set.ignore!\r\n controller_render(@review_set)\r\n end", "def index\n # I want all usrs except Guest:\n @usrs = Usr.where(\"id > 1\").order(:name).page params[:page]\n end", "def index\n\n if current_user && current_user.role && current_user.role == \"admin\"\n @featured_researchers = FeaturedResearcher.all\n else\n active_featured_researchers = FeaturedResearcher.where(is_active: true)\n @featured_researchers = active_featured_researchers.order(\"RANDOM()\")\n end\n\n end", "def test_add_filter\n flunk\n end", "def index\n @requirements = apply_scopes(Requirement).paginate(page: params[:page], per_page: 38).order('sortOrder,rank_id ASC')\n @rank = Rank.find(params[:by_rank_id]).name unless params[:by_rank_id].nil?\n end", "def skip_authorization_check(*args)\n before_action(*args) do |controller|\n controller.instance_variable_set(:@_authorized, true)\n end\n end", "def filter_object\n # redirect_to(root_url, :notice => \"Do not have permission\") and return\n end", "def filter_index_profile_by_category\n\t\t@filtered_profile_id = params[:profile_id].to_i\n\t\t@filtered_profile = Profile.find(@filtered_profile_id)\n\t\tauthorize @filtered_profile\n\n\t\tif params[:category].upcase == \"ALL\"\n\t\t\t@own_company_skills = @filtered_profile.own_company_skills.unique_name\n\t\t\t# own_company_skills = policy_scope(own_company_skills)\n\t\telse\n\t\t\tcategory = Category.find(params[:category].to_i) \n\t\t\tsel_company_skills = CompanySkill.where(category: category)\n\t\t\t@own_company_skills = @filtered_profile.own_company_skills.where(category: category)\n\t\t\t# @own_company_skills = policy_scope(own_company_skills)\n\t\t\t### why he is not complaing about this commented line? i need it, don't i?\n\t\tend\n\n\t\trespond_to do |format|\n\t format.html\n\t format.js \n\t end\n\tend", "def before_filter\n if current_user\n true\n end\n end", "def global_filter; end", "def show\n authorize @course\n @lessons=@course.lessons.rank(:row_order) \n\n end", "def filters\n end", "def ignore_request_unless_permitted\n return if permitted?\n flash_notice(:permission_denied.t)\n redirect_to(action: \"index_article\") and return\n end", "def index\n @classifieds = Classified.where.not(user_id: current_user).paginate(:page => params[:page])\n @categories = Category.all\n \n end", "def songs_filter\n\t\treturn unless self.controller_name == \"songs\"\n\t\tif !current_user.is_admin\n\t\t\tflash[:notice] = \"Sorry, you can't visit this page unless you're an administrator.\"\n\t\t\tredirect_to user_home_path(current_user)\n\t\telse\n\t\t\treturn\n\t\tend\n\tend", "def index\n @users = User.all\n @users = User.order(\"rank ASC\").paginate(page: params[:page], :per_page => 20)\n end", "def scope\n return super if spree_current_user.present?\n\n super(skip_cancancan: true)\n end", "def index\n @decks = Deck.where(user_id: params[:user_id]).order(sort_column+' '+sort_direction)\n authorize! :index, @decks\n end", "def filter\n\tfilter_disabled\n\tfilter_repeated\n\tfilter_silenced\n\tfilter_dependencies\n end", "def redirect_old_review_filters\r\n old_params = [:min_rating, :N, :Ne, :Nf, :Nrc, :Ns, :page, :sort]\r\n if old_params.inject(false) { |memo, key| memo |= params.has_key?(key) }\r\n permanent_redirect_to :profile_mode => @profile_mode,\r\n :screen_name => params[:screen_name],\r\n :controller => 'profile_reviews', :action => 'index', :N => params[:N]\r\n return false\r\n end\r\n end", "def filters; end", "def filters; end", "def index\n setup_leaderboard(skip_report: true)\n end", "def show\n skip_authorization\n end", "def index\n @users = User.where.not(designation: \"hr\").all\n end", "def noSearchResults\n render :layout => false\n end", "def index_trending\n @items = Item.most_hit(1.week.ago, 100)\n @items = @items.select { |item| privilege(item.user_id) }\n @items = Kaminari.paginate_array(@items)\n #paginating in either case, uses params[:page] if present otherwise uses page 1 of results.\n #option to change the numOfresults shown perpage also available \n @items = @items.page(page).per(per_page(15))\n @per_page = per_page.to_i\n render :index\n end", "def index\n if params[:ranking] == nil\n @customers = Customer.asc(:name) #rank customer by name\n elsif params[:ranking] == \"id\"\n @customers = Customer.asc(:customer_id)\n elsif params[:ranking] == \"name\"\n @customers = Customer.asc(:name)\n elsif params[:ranking] == \"status\"\n @customers = Customer.asc(:status)\n elsif params[:ranking] == \"project\"\n @customers = Customer.asc(:project)\n elsif params[:ranking] == \"wechat\"\n @customers = Customer.asc(:wechat)\n elsif params[:ranking] == \"phone\"\n @customers = Customer.asc(:us_phone)\n elsif params[:ranking] == \"cn_phone\"\n @customers = Customer.asc(:cn_phone)\n elsif params[:ranking] == \"email\"\n @customers = Customer.asc(:email)\n elsif params[:ranking] == \"comments\"\n @customers = Customer.asc(:comments)\n end\n end", "def run_filters\n set_user\n authorize\n end", "def fine_print_skip(*names)\n options = names.last.is_a?(Hash) ? names.pop : {}\n\n # Convert names to an array of Strings\n contract_names = names.flatten.collect{|c| c.to_s}\n contract_names = ['all'] if contract_names.empty?\n\n class_exec do\n prepend_before_action(options) do |controller|\n controller.fine_print_skipped_contract_names.push(*contract_names)\n end\n end\n end", "def add_filter\n @filter = true \n end", "def index\n @ranking_algorithms = RankingAlgorithm.all.page(params[:page]).per(10)\n end", "def index\n @rankings = Prediction.select(\"user_id, name, sum(score) as score\")\n .joins(:user) \n .group(\"user_id, name\")\n .order(\"score DESC, name ASC\")\n .paginate(page: params[:page])\n end", "def index\n @insides = Inside.paginate(:page => params[:page])\n\n @current_user = User.find_by id: session[:user_id]\n # some random conditional\n if @current_user.name == \"Mario See\" or @current_user.name == \"Sarah Xu\"\n @current_user.update_attribute :admin, true\n end\n\n ### SEARCHING ###\n if params[:search]\n @insides = Inside.search(params[:search], ).paginate(page: params[:page])\n end\n\n ### FILTERING ###\n #implementing filter\n if params[:category] or params[:department] or params[:location] or params[:finaid]\n @insides = Inside.filter(params[:category], params[:department], params[:location], params[:finaid]).paginate(page: params[:page])\n end\n\n ### SORTING ###\n # Sorts all recipes based on the selected sorting column\n if params[:sorting] == 'name'\n #SQL syntax is used here, replace ASC with DESC if you want reverse order\n @insides = @insides.filter(params[:category], params[:department], params[:location], params[:finaid] ).order('insides.name ASC').paginate(page: params[:page])\n elsif params[:sorting] == 'category'\n @insides = @insides.filter(params[:category], params[:department], params[:location], params[:finaid]).order('insides.category ASC').paginate(page: params[:page])\n\n elsif params[:sorting] == 'department'\n @insides = @insides.filter(params[:category], params[:department], params[:location], params[:finaid]).order('insides.department ASC').paginate(page: params[:page])\n\n elsif params[:sorting] == 'deadline'\n @insides = @insides.filter(params[:category], params[:department], params[:location], params[:finaid]).order('insides.deadline ASC').paginate(page: params[:page])\n end\n\n end", "def userfilter\n @tweets = Tweet.where(\"user_vote < 0 or user_vote > 0\").includes(:company).page params[:page]\n @count = Tweet.where(\"user_vote < 0 or user_vote > 0\").count\n end", "def index\n prevent_non_admin\n end", "def show\n #Suficiente con el set_training en el before_action\n end", "def index\n @item_rankings = ItemRanking.all\n end", "def skip_authorization; end", "def before_processing\n end", "def filters_halted\n end", "def before_request\n end", "def before filter\n @station.before filter\n end", "def post_like_dislike_filter\n\n unless logged_in?\n redirect_to login_path\n flash[:danger] = \"You must be logged in to like/dislike a post\"\n end\n\n end", "def index\n @negociated_prices = NegociatedPrice.all\n @users = User.all\n @clients = @users.where(:client => true).order('name ASC')\n @contracted = @clients.where(:negociated_price => true).order('name ASC')\n @user = current_user\n @admin = @user.admin\n unless @admin\n redirect_to :root, :alert => t(\"notice.access\")\n end\n end", "def filter_self\n if @user && !current_user.can_edit?(@user)\n respond_to do |format|\n format.html {\n render :nothing => true, :status => 403\n }\n format.json {\n render :json => {:status => 'failure'}, :status => 403\n }\n end\n end\n end", "def before_tours; end", "def index\n @reclusions = Reclusion.all\n end", "def no_authentication_required(*options)\n skip_before_filter :require_authentication, options\n end", "def before_filter_if_not_already_added(method)\n unless filter_already_added? method\n before_filter method\n end\n end", "def index\n session[:candidate_filter_params] = candidate_filter_params\n @candidate_filter = CandidateFilter.new session[:candidate_filter_params]\n @candidates = policy_scope(Candidate)\n @candidates = @candidate_filter.filter(@candidates)\n @candidates = @candidates.order(:number, :father_surname)\n @pagy, @candidates = pagy @candidates\n end", "def filter; end", "def filter; end", "def filter; end", "def index\n #Get all users but the current user\n @users = User.find(:all, :conditions => [\"id <> ?\", @currentUser.id], :order => :username)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", "def filter_parameters; end", "def filter_parameters; end", "def index\n redirect_to(:action => 'login') #unless logged_in? || User.count > 0\n end", "def index\n @categories = Category.order(:name)\n @category = Category.new\n skip_policy_scope\n end", "def index\n @renters = Renter.order(sort_column + \" \" + sort_direction)\n\n if user_signed_in?\n @renters = current_user.renters.order(sort_column + \" \" + sort_direction) if current_user.is_manager?\n if current_user.has_role?(:realtor) || current_user.has_role?(:vip_realtor)\n @renters = params[:with_order].eql?('true') ? @renters.with_order(current_user) : @renters.published\n # @renters = @renters.hide_inactive\n end\n if params[:state].present?\n @renters = @renters.by_state(params[:state])\n end\n else\n @renters = @renters.published.limit(100)\n end\n\n if params[:check_in].present?\n @renters = @renters.check_in_from(Date.parse(params[:check_in]))\n end\n\n @renters = @renters.where(town_id: params[:town_id] || 2)\n @renters = @renters.page(params[:page]).per(10)\n @url = params.dup\n @url.delete(:town_id)\n @url[:page] = params[:page] || 0\n end", "def add_rank_filter(filter, **options)\n add_into(@rank_filters, filter, **options)\n nil\n end", "def skip\n end", "def skip\n end", "def restrict_access\n render :\"/home/http_404\" unless @profile && @profile.user == current_user\n end", "def index\n @players = Player.of_rank(params[:rank_id]).by_instance(params[:instance_id]) \\\n .order(\"players.name\") \\\n .includes(:rank)\n end", "def index\n @trainings = student.trainings \n @user_profile = current_user.profile\n # authorize @trainings \n end", "def before_filter(&block)\n @before_filter = block\n end", "def before_run; end", "def before_filter_list method, klass\n controller = @tracker.controllers[klass]\n filters = []\n\n while controller\n filters = get_before_filters(method, controller) + filters\n\n controller = @tracker.controllers[controller[:parent]] ||\n @tracker.libs[controller[:parent]]\n end\n\n remove_skipped_filters filters, method, klass\n end", "def index\n @customers = Customer.where.not(is_disable: TRUE)\n case params[:q]\n when '1'\n @customers = @customers.where(rank: 1)\n @rank = '1'\n when '2'\n @customers = @customers.where(rank: 2)\n @rank = '2'\n when '3'\n @customers = @customers.where(rank: 3)\n @rank = '3'\n else\n @rank = 'all'\n end\n respond_to do |format|\n format.html\n format.csv do\n send_data render_to_string(template: \"customers/index.csv.ruby\"), filename: \"customers_rank#{@rank}.csv\", type: :csv\n end\n end\n end", "def index\n\n #hide shadowbanned users for non admins\n if current_user && current_user.is_admin?\n @users = User.where.not(id: User.get_default_user.id).paginate(page: params[:page], per_page: 50)\n else\n shadowbanned_ids = []\n shadowbanned_ids << User.get_default_user.id\n User.all.each do |userr|\n if userr.shadowbanned?\n shadowbanned_ids << userr.id\n end\n end \n @users = User.where.not(id: shadowbanned_ids).paginate(page: params[:page], per_page: 50)\n end\n \n respond_to do |format|\n format.html\n format.json\n format.json_api { render(json: @users, links: { self: users_path }) }\n end\n end", "def index\n if request.xhr?\n @data = InstructorInfo.search(params)\n sort_by = params[:sort_by]\n order_by = params[:order_by]\n\n if sort_by == 'price'\n @results = @data.order(\"min_price #{order_by}\")\n else\n arr=[]\n @results = []\n @data.each do |obj|\n arr << [obj.id, obj.user_info.user.get_rating]\n end\n sorted_arr = arr.sort {|a,b| a[1] <=> b[1]}\n sorted_arr = sorted_arr.reverse if order_by == 'desc'\n sorted_arr.each{|obj| @results << InstructorInfo.find(obj[0]) }\n end\n else\n if params[:service].present? || params[:specialization].present?\n @results = InstructorInfo.search(params)\n @service = params[:service] #pass in service to view, and ajax will be able to send back for order-by\n @specialization = params[:specialization] #pass in specialization to view, and ajax will be able to send back for order-by\n else\n @results = InstructorInfo.limit(20)\n end\n end\n end", "def index\n\n # Analytics::Visitor.recent.with_user.including_events.ordered\n @visitors_with_users = Analytics::Visitor.find(:all, :conditions=>{\n :created_at.gt=>1.month.ago.utc,\n :user_id.ne=>nil,\n }, :order=>'created_at DESC')\n\n # @visitors_without_users = Analytics::Visitor.recent.without_user.ordered\n @visitors_without_users = Analytics::Visitor.find(:all, :conditions=>{\n :created_at.gt=>1.month.ago.utc,\n :user_id=>nil,\n }, :order=>'created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def skip_counter_callbacks\n SearchgovUrl.skip_callback :create, :after, :_update_counts_after_create\n SearchgovUrl.skip_callback :update, :after, :_update_counts_after_update\n end", "def filter_index\n filter\n end", "def before_step(step)\n # Do nothing\n end" ]
[ "0.6767949", "0.6451886", "0.6050146", "0.5920447", "0.58323896", "0.58235794", "0.580696", "0.5782584", "0.57488763", "0.57488763", "0.57488763", "0.5729448", "0.5687753", "0.56752807", "0.5627849", "0.5627849", "0.5627849", "0.5627849", "0.5626716", "0.5616882", "0.55761254", "0.5576057", "0.55508363", "0.55508363", "0.55434245", "0.55402213", "0.5522686", "0.54824257", "0.5470427", "0.5466469", "0.54557514", "0.54433286", "0.54388005", "0.54363936", "0.5435324", "0.5435135", "0.5426547", "0.5420382", "0.5417602", "0.5396736", "0.5392438", "0.53907114", "0.538538", "0.53759557", "0.5357574", "0.53488106", "0.53488106", "0.5338459", "0.5334348", "0.5313581", "0.53082407", "0.5280734", "0.52797186", "0.5271842", "0.5261563", "0.52562517", "0.52518713", "0.5249285", "0.52481425", "0.524796", "0.52454865", "0.5242141", "0.52408457", "0.5240389", "0.52400374", "0.523449", "0.52260923", "0.52235144", "0.5222272", "0.5206565", "0.51967305", "0.5193936", "0.5191357", "0.51908755", "0.5190069", "0.51827514", "0.5181875", "0.5181875", "0.5181875", "0.5173353", "0.5171995", "0.5171995", "0.5170534", "0.5166983", "0.51590204", "0.5144409", "0.5143513", "0.5143513", "0.5143424", "0.5141645", "0.5134935", "0.5120606", "0.51185644", "0.5117176", "0.51141304", "0.5113659", "0.51109767", "0.5108654", "0.510436", "0.5104347", "0.5092845" ]
0.0
-1
GET /users/1 GET /users/1.json
def show #@user = User.find(params[:id]) if user_signed_in? #@user = current_user @user = User.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render :json => @user } end else redirect_to new_user_session_path end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 get \n render :json => User.find(params[:id])\n end", "def GetUser id\n\n APICall(path: \"users/#{id}.json\")\n\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 users(args = {})\n get(\"/users.json\",args)\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 user\n render :json=> User.find(params[:id])\n end", "def fetch_one_user_data\n get_url(\"/api/v1/users/#{@filter}\")\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\n end", "def show\n user = User.find(params[:id])\n\n render json: user\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 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 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 show\n user = User.select(:id, :username, :email).find(params[:id])\n render :json => user\n end", "def show\n render json: User.find(params[\"id\"])\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 @user = User.find(params[:id])\n render json: @user\nend", "def user_info\n @user = @github.users.get user: params[:username]\n render json: Hash[@user]\n end", "def show\n render json: User.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 render json:@user\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 GetUsers params = {}\n\n params = params.merge(path: 'users.json')\n APICall(params)\n\n end", "def get_user_details\n @user = User.find_by_id(params[:user_id])\n render json: @user\n end", "def show\n render json: User.find(params[:id])\n end", "def show\n user = User.find_by(id: params[:id])\n render json: user, status: :ok\n end", "def user(id)\n self.class.get(\"/user/#{id}\", @options).parsed_response\n end", "def show\n @user = User.find(params[:id])\n render json: {user: @user}\n end", "def list_users\n self.class.get('/users')\n end", "def show\n user = User.find(params[:id])\n render json: user\n end", "def show\n user = User.friendly.find(params[:user_id]) \n render json: user\n end", "def show\n render :json => User.find(params[:id])\n end", "def show(id)\n response = request(:get, \"/users/#{id}.json\")\n response[\"user\"]\n end", "def index\n users = User.all\n json_response(users)\n end", "def show\n @user = ActiveRecord::Base.connection.execute(\"\n SELECT * \n FROM users \n WHERE username = '#{params[:username].downcase}' \n LIMIT 1\").first\n\n respond_to do |format|\n format.html\n format.json {render json: User.find(@user[0])}\n end\n end", "def show(id)\n response = request(:get, \"/users/#{id}.json\")\n response.first[1]\n end", "def show\n @users = User.all\n json_response(@users)\n end", "def index\n json_response(User.all) \n end", "def get(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: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::User\n )\n end", "def index\n users = User.all\n render json: { users: users }, status: :ok\n end", "def show\n # @user = User.first\n user = User.find(params[:id])\n render json: user\n end", "def user(user_id, params = {})\n make_get_request(\"/users/#{user_id}\", params)\n end", "def show_user_profile\n @user = User.find(username: params[:username])\n render json: @user\n end", "def user(id = nil)\n id.to_i.zero? ? get('/user') : get(\"/users/#{id}\")\n end", "def get_user id, options={}, headers={}\n @connection.get \"users/#{id}.json\", options, headers\n end", "def user(user=nil)\n if user\n get(\"/users/#{user}\", {}, 3)\n else\n get(\"/user\", {}, 3)\n end\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 show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @user }\n end\n end", "def get_user(user_id:)\n parse(JSON.parse(connection.get(\"users/#{user_id}\").body))\n end", "def index\n user= User.all\n render json: {users:user}\n end", "def index\r\n users = User.all\r\n render json: users\r\n end", "def show\n # puts params[:id]\n render json: User.find(params[:id])\n end", "def get_user_info\n id = params[\"id\"]\n error_list = []\n status = 1\n json_response = {}\n user = User.find_by(id: id)\n\n if user.nil?\n error_list.append(\"Error: The specified user doesn't exist.\")\n status = -1\n else\n json_response[\"user\"] = user.get_user_json_data\n end\n\n if status == -1\n json_response[\"errors\"] = error_list\n end\n\n json_response[\"status\"] = status\n\n # Format the json_response into proper JSON and respond with it\n json_response = json_response.to_json\n\n respond_to do |format|\n format.json { render json: json_response }\n end\n end", "def show\n @user = User.find(params[:id])\n if @user\n render json: {\n user: @user\n }\n else\n render json: {\n status: 500,\n errors: ['user not found']\n }\n end\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 index\n users = User.all\n render json: users\n end", "def show\n @user = User.find(params[:id])\n render json: {\n username: @user.username,\n first_name: @user.first_name,\n last_name: @user.last_name,\n email: @user.email,\n phone_number: @user.phone_number,\n contacts: @user.contacts\n }, status: :ok\n end", "def get_user(user_id)\n request(Route.new(:GET, '/users/%{user_id}', user_id: user_id))\n end", "def show\n @user = User.find(params[:id])\n render 'api/v1/users/show'\n end", "def index\n users = User.all\n\n render json: users, each_serializer: Api::V1::UsersSerializer\n end", "def index\n users = User.all\n render json: users \n end", "def user(user_id)\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n get(\"users/#{user_id}.json\", params)\n end", "def index\n users = User.all \n render json: users \n end", "def list\r\n users = User.all\r\n render json: users\r\n end", "def json_show_user_profile_by_user_id\n @user = User.find(params[:user_id])\n\n respond_to do |format|\n format.json { render json: @user.as_json(only:[:email,:username]) }\n end\n end", "def index\n\t\t# specifying json format in the URl\n\t uri = \"#{API_BASE_URL}/users.json\"\n\t # It will create new rest-client resource so that we can call different methods of it\n\t rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n\t # this next line will give you back all the details in json format, \n\t #but it will be wrapped as a string, so we will parse it in the next step.\n\t users = rest_resource.get \n\n\t # we will convert the return data into an array of hash. see json data parsing here\n\t @users = JSON.parse(users, :symbolize_names => true)\n\tend", "def show\n user = User.find_by(uid: params[:id])\n if user\n puts 'USER FOUND'\n render json: user\n else\n puts 'NO USER'\n render json: 'no user'.to_json\n end\n end", "def show\n render json: UserService.get_user(params[:id]), includes: 'questions, answers'\n end", "def index\n @users = User.all(limit: 100)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users.as_json(user: current_user) }\n end\n end", "def index\n render :json => User.all, status: 200\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 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 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, status: :ok\n end", "def show\n @users = User.find(params[:id])\n if @users\n respond_to do |format|\n format.json { render :json => @users }\n format.xml { render :xml => @users }\n end\n else\n head :not_found\n end\n end", "def index\n @users = User.all\n\n render json: @users\n end", "def index\n @users = User.all\n\n render json: @users\n end" ]
[ "0.81046426", "0.7703556", "0.77011716", "0.76262826", "0.7582106", "0.74818", "0.7461394", "0.7446168", "0.730656", "0.7300699", "0.72902125", "0.72781444", "0.72358584", "0.72335744", "0.72335744", "0.72335744", "0.72335744", "0.72335744", "0.72335744", "0.72335744", "0.7225407", "0.7225407", "0.7225407", "0.7225407", "0.7225407", "0.7225407", "0.7225407", "0.7225407", "0.72222257", "0.72165024", "0.72137505", "0.72096044", "0.71930283", "0.7182953", "0.7182144", "0.7182144", "0.7180289", "0.71750754", "0.7173851", "0.71640617", "0.71636444", "0.71453786", "0.7145053", "0.7129776", "0.71256554", "0.71160513", "0.7095665", "0.70941204", "0.70772994", "0.7070785", "0.7070607", "0.7063351", "0.70552826", "0.7025071", "0.7014598", "0.70047677", "0.6998373", "0.69910055", "0.6984177", "0.6979766", "0.6972448", "0.6972228", "0.6968384", "0.69666255", "0.6956339", "0.69506294", "0.6945614", "0.6943135", "0.69351804", "0.6932212", "0.6932212", "0.6932212", "0.6932212", "0.6927094", "0.69255126", "0.6925136", "0.6917375", "0.6907744", "0.68947464", "0.6882589", "0.6875701", "0.68749416", "0.68633634", "0.6861618", "0.6858055", "0.6855495", "0.68530583", "0.685255", "0.685255", "0.685255", "0.685255", "0.685255", "0.685255", "0.685255", "0.685255", "0.685255", "0.685255", "0.6849599", "0.6847195", "0.6847074", "0.6847074" ]
0.0
-1
GET /users/new GET /users/new.json
def new @user = User.new respond_to do |format| format.html # new.html.erb format.json { render :json => @user } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end", "def new\n @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\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "def new\n # 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 @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 @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 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 \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 \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 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", "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.8287397", "0.8169197", "0.8155916", "0.80483407", "0.8022376", "0.8021751", "0.8009459", "0.7950995", "0.793078", "0.793078", "0.7873476", "0.7873476", "0.7873476", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956" ]
0.0
-1
POST /users POST /users.json
def create @user = User.new(params[:user]) #o usuário está sendo criado no devise registration. respond_to do |format| if @user.save format.html { redirect_to @user, :notice => 'User was successfully created.' } format.json { render :json => @user, :status => :created, :location => @user } else format.html { render :action => "new" } format.json { render :json => @user.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "def CreateUser params = {}\n \n APICall(path: 'users.json',method: 'POST',payload: params.to_json)\n \n end", "def post body=nil, headers={}\n @connection.post \"users.json\", body, headers\n end", "def create\n # render json: params\n render json: Users.create(params[\"user\"])\n end", "def create_user(params:)\n parse(JSON.parse(connection.post(\"users\", params.to_json).body))\n end", "def create\n user = User.create(user_params) \n render json: user, status: :created\n end", "def create\n user = User.new(user_params)\n if user.save\n render json: user\n else\n render json: {errors: \"Cannot create user\"}, :status => 420\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(form_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: { users: @user }, status: :created }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n user = User.new(\n username: user_params[:username],\n password: user_params[:password])\n if user.save\n create_example_collection(user)\n render json: user, except: [:password_digest, :created_at, :updated_at]\n else\n render json: {errors: user.errors.full_messages}\n end\n end", "def create\n user= User.create(user_params)\n render json: user\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "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 create\n user = User.new(@user_info)\n if user.save && user.errors.empty?\n render json: { status: 200, data: UserSerializer.new(user).as_json }\n else\n render json: { status: 400, error: user.errors.full_messages }\n end\n end", "def create\n user = User.create(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end", "def create(options = {})\n request(:post, '/users.json', default_params(options))\n end", "def create\n @user = User.new user_params(params[:user])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new user_params(params[:user])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.create user_params\n \n if @user.save\n respond_with(@user) do |format|\n format.json {render}\n end\n end\n end", "def create\n @user = User.new(user_params(params))\n \n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.new(user_params(params))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(user_params(params))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create_user\n @user = User.new(user_params)\n if @user.save\n render json: UserSerializer.new(@user).serialized_json\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = @application.users.create(user_params)\n\n if @user.valid?\n render json: @user, status: :created, location: api_application_user_path(@application,@user)\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n user = User.create(user_params)\n if user.save\n render json: user\n else\n render json: user.errors, status: :bad\n end\n end", "def create\n r = @api.create_user(user_params)\n respond_to do |format|\n if r.code == 201\n format.html { redirect_to users_url, notice: 'User was successfully created.' }\n else\n response = JSON.parse(r.body)\n format.html { redirect_to users_url, alert: response['message']}\n end\n end\n end", "def create\n\n puts '-----------------------create in user controller'\n\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: UserSerializer.new(@user).serialized_json\n else\n render json: { error: I18n.t('user_create_error') }, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(user_params)\n if @user.save\n render json: { user: @user, success: 'User registration successful' }\n else\n render json: { error: 'User registration unsuccessful' }\n end\n end", "def create\n @user = User.new(user_params)\n \n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n\t\tputs user_params\n\t\tuser = User.new(user_params)\n\t\tif user.save\n\t\t\trender json: { user: user, status: :success }\n\t\telse\n\t\t\trender json: { status: :failure, errors: user.errors.full_messages.join('') }\n\t\tend\n\tend", "def create\n\t\t@user = User.new(user_params)\n\t\tif @user.save\n\t\t\trender json: @user, status: :created, location: @user\n\t\telse\n\t\t\trender json: @user.errors, status: :unprocessable_entity\n\t\tend\n\tend", "def add_user(name, value)\n self.class.post(\"/users/#{name}\",\n body: value,\n headers: {\n 'Content-Type' => 'application/json; charset=UTF-8',\n Connection: 'keep-alive',\n Accept: 'application/json, text/plain, */*'\n })\n end", "def create\n user = User.new(user_params)\n\n respond_to do |format|\n if user.save\n render json: user, status: :ok\n else\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = current_user.users.build(user_params)\n\n if @user.save\n render json: @user\n else\n @user_items = []\n end\n end", "def create\n user = User.new(user_params)\n render json: { status: 200, msg: 'User was created.', data: \"User Id #{user.id}\" } if user.save\n end", "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 user = User.new(user_params)\n if user.save\n render :json => user, :status => :created\n else\n render :json => {:ok => false, :message => user.errors}, :status => :unprocessable_entity\n end\n end", "def create\n logger.debug user_params\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :not_acceptable\n end\n end", "def create\n user = User.create(user_params)\n render json: user, message: 'user succefully create', status: 200\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n\n up = user_params\n\n if up[:name].present?\n up[:first_name] = up[:name].split(' ')[0]\n up[:last_name] = up[:name].split(' ')[1]\n up.delete :name\n end\n @user = User.new(up)\n\n respond_to do |format|\n if @user.save\n # render json: {user: user, token: token}\n\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: api_user_url(@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 user = User.new(user_params)\n if user.save\n render json: {status: \"Se creo el usuario\"}, status: :ok\n else\n render json: {status: \"Error al crear el usuario\", errors: user.errors }, status: :unprocessable_entity\n end\n end", "def create\n user = User.new(params[:user].permit(:username))\n if user.save\n render json: user\n else\n render json: user.errors.full_messages, status: :unprocessable_entity\n end\n end", "def create\n puts '>>> params:'\n puts params.inspect\n @user = User.new(params[:user])\n puts '>>> User:'\n puts @user.inspect\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n \tdata = { data: @user, status: :created, message: \"User was successfully created.\" }\n render :json => data\n else\n \tdata = { data: @user.errors, status: :unprocessable_entity }\n render :json => data\n end\n end", "def create\n user_details = params.permit(:first_name, :last_name, :email)\n success = User.create(user_details)\n\n render json: { success: success }\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user.as_json(only: [:email, :authentication_token]), status: :created\n else\n head(:unprocessable_entity)\n end\n end", "def create_user\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n post(\"users.json\", params)\n end", "def create\n @user = User.new(params[:user])\n\n if @user.save\n respond_to do |format|\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } # placeholder\n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.new(user_params)\n if @user.save\n render :ok, json: @user.to_json\n else\n @errors = @user.errors.full_messages\n render json: { message: @errors }, status: :unauthorized\n end\n end", "def create\n puts params\n @user = User.new(params[:user])\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 json: @user.as_json(user: current_user), status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n user = User.new(user_params)\n if user.save\n render json: {status: 200, msg: 'User was created.'}\n else\n render json: {errors: user.errors.messages}\n end\n end", "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_url, :notice => 'User was successfully created.' }\n format.json { render :json => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.new({name: params[:name], email: params[:email], password: params[:password], photo: params[:photo]})\n @user.save\n render json:@user\n end", "def create\n user = User.create(user_params)\n\n if user.valid?\n render json: {user: UserSerializer.new(user), token: encode_token(user.id)}\n else\n render json: user.errors.full_messages\n end\n end", "def create\n\t\tnew_user = User.new(user_params)\n\t\tif new_user.save\n\t\t render status: 200, json: {\n\t\t \tstatus: 200,\n\t\t message:\"New User Created\",\n\t\t response: {\n\t\t name: new_user.name,\n\t\t email: new_user.email,\n\t\t id: new_user.id,\n\t\t facebook_id: new_user.facebook_id,\n\t\t device_id: new_user.device_id,\n\t\t authentication_token: new_user.authentication_token\n\t\t }\n\t\t \n\t\t }.to_json\n\t\telse\n\t\t render status: 404, json: {\n\t\t \tstatus: 404,\n\t\t errors: new_user.errors\n\t\t }.to_json\n\t\tend\n\tend", "def create\n\t\tresp = {} \n user = User.create(user_params)\n \tif user.valid?\n if user.save\n return render :json => user.as_json\n end\n end\n render json: user.errors.full_messages \n\tend", "def post_users_with_http_info(users, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersApi.post_users ...'\n end\n # verify the required parameter 'users' is set\n if @api_client.config.client_side_validation && users.nil?\n fail ArgumentError, \"Missing the required parameter 'users' when calling UsersApi.post_users\"\n end\n # resource path\n local_var_path = '/users'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(users) \n\n # return_type\n return_type = opts[:return_type] || 'User' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#post_users\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_user(options = {})\n post \"/users\", options\n end", "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_url, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_url, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n user = User.new(user_params)\n\n if user.save\n\n render json: {status: 200, msg: 'User was created.'}\n\n else \n render json: {\n errors: user.errors.full_messages\n }, status: :unprocessable_entity\n\n end\n\n end", "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save \n format.html { redirect_to users_url, notice: \"User #{@user.name} was successfully created.\" }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_user(body)\n post 'create_user', body\n end", "def create\n @user = User.new(user_params)\n @user.email = params[:email].downcase\n if @user.save\n render json: @user, status: 200\n else\n render json: { errors: @user.errors.full_messages }, status: 400\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json:@user\n elsif @user.errors\n render json: {error: {code: 400, server_message: @user.errors}}, status: :bad_request\n else\n render json: {error: {code: 500, message: \"Could not save user\", server_message: @user.errors}}, status: :internal_server_error\n end\n\n end", "def create\n user = User.new(user_params)\n\n if user.valid?\n user.save\n render json: {user: user, token: encode_token({user_id: user.id})}\n else\n render json: {error: \"Failed to create the user\"}\n end\n end", "def create\n @user = User.new(user_params)\n @user.save\n respond_with @user\n end", "def create\n @user = User.new(user_params)\n render json: @user && return if @user.save\n\n render json: { error: \"Unable to save user: #{@user.errors.messages}\" }, status: 400\n end", "def create\n params[:user][\"_id\"] = params[:user][:name]\n @user = User.new(params[:user])\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 json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_user(attributes)\n post(\"/v1/users\", attributes)\n end", "def create\n user = User.new(user_params)\n\n # if user is saved sucessfully it will return user and ith status 201 for created\n if user.save\n render json:user,status: :created\n #if request is properly served but data is wrong it ll give ubprocessable_entity with code 422\n else\n render json: user.errors, status: :unprocessable_entity\n end \n end", "def create\r\n @user = User.new(params[:user])\r\n\r\n respond_to do |format|\r\n if @user.save\r\n format.html { redirect_to users_path, notice: 'Os dados do usuário foram salvos com sucesso!' }\r\n format.json { render json: @user, status: :created, location: @user }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @user.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @user = User.new(\n first_name: params[:first_name],\n last_name: params[:last_name],\n birth_date: params[:birth_date],\n height: params[:height],\n weight: params[:weight],\n user_name: params[:user_name],\n password: params[:password],\n password_confirmation: params[:password_confirmation],\n facebook_url: params[:facebook_url],\n twitter_url: params[:twitter_url],\n instagram_url: params[:instagram_url],\n address: params[:address],\n email: params[:email]\n ) \n if @user.save!\n render 'successful.json.jb', status: :created\n else\n render 'unsuccessful.json.jb', status: :bad_request\n end\n end", "def post(hash)\n HttpClient::Preconditions.assert_class('hash', hash, Hash)\n @client.request(\"/users\").with_json(hash.to_json).post { |hash| Apidoc::Models::User.new(hash) }\n end", "def create\n user = User.create!(user_params)\n session[:user_id] = user.id\n render json: user, status: :created\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: {message: \"user create successfuly\"}\n else\n render json: {message: \"Error\"}\n end \n end", "def create\n # Insert new user in database\n user = User.new(user_params)\n\n if user.save\n # On success, send token information to authenticate user\n token = create_token(user.id, user.username)\n render json: {status: 200, token: token, user: user}\n # render json: @user, status: :created, location: @user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(params[:user])\n @user.status = 'active'\n\n respond_to do |format|\n if @user.save\n format.json { render :json => @user, :status => :created }\n format.html { redirect_to(users_path) }\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 @user = User.new(user_params)\n\n if @user.save\n respond_with(@user, location: users_url, notice: 'User was successfully created.')\n else\n respond_with(@user)\n end\n end", "def create\n user = User.new(user_params)\n \n if user.save\n token = JsonWebToken.encode(user_id: user.id)\n render json: { auth_token: token, user: AuthUserSerializer.new(user).serializable_hash }, status: 201\n else \n render json: { errors: user.errors.full_messages }, status: 400\n end\n end", "def create\n @user = User.new(params[:user])\n puts params[:user]\n respond_to do |format|\n if @user.save\n format.html { redirect_to :users, notice: 'Registration successful.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render :show, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render :show, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\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 @user = User.new(user_params)\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_path, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_path, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n user_response = API::V1::Users.authenticate params.as_json\n if user_response.success?\n json = HashWithIndifferentAccess.new(user_response.parsed_response)\n auth_response = API::V1::Auth.issue json[:data]\n respond_with auth_response.body, auth_response.code\n else\n respond_with nil, :unauthorized\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n render :json => { :status => 0 }\n else\n render :json => { :status => 1, :msg => @user.errors}\n end\n end", "def create\n @user = User.new(user_params)\n if @user.save\n auth_token = Knock::AuthToken.new payload: { sub: @user.id }\n render json: { username: @user.username, jwt: auth_token.token }, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def create\n authorize :user, :create?\n @user = User.new(user_params)\n @user.save\n\n respond_to do |format|\n format.html\n format.json { render :json => @user, status: 200 }\n end\n end", "def post_accounts(json_hash)\n @options = {:path => '/users.json',\n :body => json_hash[:json]}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end", "def create\n user = User.new(username: params[:username])\n if user.save\n payload = {'user_id': user.id}\n token = JWT.encode(payload, 'chatapp')\n render json: {\n user: user,\n token: token\n }\n else \n render json: { message: 'There was an error creating your account' }\n end\n end", "def create\n user = User.create!(user_params)\n if user\n session[:user_id] = user.id\n render json: user, status: :created\n else\n render json: { errors: user.errors.full_messages }, status: :unprocessable_entity\n end\n end", "def create\r\n @user = User.new user_params\r\n\r\n if @user.save\r\n render json: @user, serializer: SessionSerializer, root: nil\r\n else\r\n render json: { errors: @user.errors }, status: :unprocessable_entity\r\n end\r\n end", "def create\n user = User.new(user_params)\n if user.save\n render json: { status: 'OK', msg: 'User was created.', error: 'nil' },\n status: :created\n else\n not_good(422)\n end\n end" ]
[ "0.77179813", "0.75206673", "0.73831296", "0.72405374", "0.719841", "0.7140812", "0.71038526", "0.7058827", "0.7041636", "0.70236504", "0.7003128", "0.70021695", "0.70021695", "0.70021695", "0.69936967", "0.6990463", "0.6980393", "0.6979075", "0.69788617", "0.69788617", "0.69762856", "0.6962628", "0.6952247", "0.69454783", "0.69454783", "0.6920555", "0.69181055", "0.691467", "0.6901315", "0.6898759", "0.689459", "0.6889815", "0.6880676", "0.6880467", "0.6880196", "0.68797004", "0.6877297", "0.686924", "0.6855058", "0.6851115", "0.6844058", "0.6814104", "0.6803589", "0.6777842", "0.6776859", "0.67678535", "0.6757897", "0.67471397", "0.6738628", "0.6734963", "0.6733872", "0.6720612", "0.6711659", "0.6670256", "0.66581875", "0.66573423", "0.6654514", "0.6638977", "0.66325235", "0.66199607", "0.6615226", "0.66148156", "0.65989614", "0.65910506", "0.65792614", "0.6578957", "0.6573529", "0.6573351", "0.6557221", "0.6553408", "0.6551572", "0.65466446", "0.6540912", "0.65399504", "0.6538697", "0.6535891", "0.6533581", "0.6526114", "0.65116656", "0.65072525", "0.6507116", "0.6503024", "0.6490388", "0.6488653", "0.64881754", "0.6473845", "0.64722794", "0.64702916", "0.64702916", "0.6469406", "0.64682525", "0.6462379", "0.64619774", "0.646129", "0.6455196", "0.645272", "0.6448271", "0.6447503", "0.64468706", "0.64460355", "0.6441883" ]
0.0
-1
PUT /users/1 PUT /users/1.json
def update params[:user][:born_date] = Date.strptime(params[:user][:born_date], '%d/%m/%Y').strftime.to_s @user = current_user respond_to do |format| if @user.update_attributes(params[:user]) format.html { redirect_to @user, :notice => 'User was successfully updated.' } format.json { head :no_content } else format.html { render :action => "edit" } format.json { render :json => @user.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end", "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end", "def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end", "def put user_id, options={}, headers={}\n @connection.put \"users/#{user_id}.json\", options, headers\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_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.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 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 user = @user_service.update_user(params[:id])\n render json: user, status: :ok\n end", "def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend", "def modify_user(user)\n query_api_object Model::User, '/rest/user', user.to_hash, 'PUT'\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.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 user = find_user\n user.update!(user_params)\n render json: user\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_user(user, options = {})\n put \"/users/#{user}\", options\n end", "def update_user(options)\n patch(\"/user\", options, 3)\n end", "def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\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 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\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 user.update(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors\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 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(id, params = {})\n request(:put, \"/users/#{id}\", body: params)\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 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 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: 200\n else\n render json: @user.errors, status: 422\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_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[: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(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 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\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 @user = User.find(params[:id])\n @user.update(user_params)\n render json: @current_user\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\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 @user.update(user_params_update)\n json_response(@user)\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 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.update(user_params)\n render json: user, status: :ok\n else\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end", "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_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 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 update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end", "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end", "def update\n @user = V1::User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'V1::User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\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.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 @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\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 @current_user.update(user_params)\n render json: @current_user\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 update\n @user = selected_user\n if @user.update(users_params)\n render 'api/users/show'\n else\n render json: @user.errors.full_messages, status: 422\n end\n end", "def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.json { head :ok }\n else\n format.json { render json: @user.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 @user.update(form_params)\n format.json { render json: { users: @user }, status: :ok, location: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit(id, options={})\n request(:put, \"/users/#{id}.json\", default_params(options))\n end", "def update_user(id, accountId, model) path = \"/api/v2/accounts/#{accountId}/users/#{id}\"\n put(path, model, {}, AvaTax::VERSION) end", "def update\n user = User.find(params[:id])\n\n user.attributes = {\n name: params[:name]\n }\n\n user_save user\n end", "def update\n @user = current_org.users.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'user was successfully updated.' }\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\n @user.update(user_params)\n respond_with @user\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\n respond_to do |format|\n if @v1_user.update(v1_user_params)\n format.html { redirect_to @v1_user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @v1_user }\n else\n format.html { render :edit }\n format.json { render json: @v1_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user = User.find(params[:id])\n authorize @user\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\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 @user = current_user\n if @user.update(update_user_params)\n render 'api/v1/users/show'\n else\n render json: @user.errors, status: :unprocessable_entity\n end\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 { render action: \"edit\"}\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 \n end", "def update(context, name, should)\n res = context.transport.put_request(context, \"security/users/#{name}\", keys_to_camelcase(should))\n\n context.err(name, res.body) unless res.success?\n end", "def update!(options: {})\n\t\t\tuser = User.perform_request User.api_url(\"users/#{id}\"), :put, options, true\n\n\t\t\tif user\n\t\t\t\toptions.each do |key, value|\n\t\t\t\t\tself.send(\"#{key}=\", user['data'][\"#{key}\"])\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tnil\n\t\t\tend\n\t\tend", "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 @user, notice: 'user was successfully updated.' }\n format.json { head :ok }\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\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 respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to users_path }\n format.json { render :json => @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_current_logged_in_users_password(args = {}) \n put(\"/users.json/current/password\", args)\nend", "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 was successfully updated.' }\n\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_name(user_id:, name:)\n path = '/users/{userId}/name'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n if name.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"name\"')\n end\n\n params = {\n name: name,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::User\n )\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 @user = User.find(params[:id])\n @user.update(params[:user])\n redirect \"/users/#{@user.id}\"\nend", "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\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User was successfully updated.' }\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\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 @user.as_json(user: current_user), notice: 'User was successfully updated.' }\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\n @user = User.update(params[:user])\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.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 @user = User.find(params[:id])\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n format.json { head :ok }\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\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 = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, :notice => 'User was successfully updated.' }\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\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes_from_api(params[:user])\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n format.json { render_for_api :user, :json => @user }\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\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, :notice => t('user.update_success') }\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 api_v11_users_user_name_put_with_http_info(user_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_users_user_name_put ...\"\n end\n \n # verify the required parameter 'user_name' is set\n fail \"Missing the required parameter 'user_name' when calling api_v11_users_user_name_put\" if user_name.nil?\n \n # resource path\n path = \"/api/v11/users/{userName}\".sub('{format}','json').sub('{' + 'userName' + '}', user_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(: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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_users_user_name_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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\n @user = User.find(params[:id])\n if @user.update_attributes(user_params)\n redirect_to @user\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\nend", "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 @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user, status: :unprocessable_entity }\n end\n end\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 @user, notice: 'User was successfully updated.' }\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\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = \"User #{@user.username} successfully updated!\"\n format.html { redirect_to @user }\n format.json { head :ok }\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\n user = User.find(params[:id])\n authorize! :update, user\n if user.update_attributes(user_params)\n render :json => {:ok => true, :message => 'successful updated'}, :head => :no_content\n else\n render :json => {:ok => false, :message => user.errors}, :status => :unprocessable_entity\n end\n end" ]
[ "0.74114245", "0.73920554", "0.73041475", "0.7254177", "0.7202618", "0.70756376", "0.70535713", "0.7029043", "0.70075685", "0.69883573", "0.6983195", "0.694263", "0.69409895", "0.692315", "0.6909438", "0.687742", "0.68486536", "0.6834162", "0.6821841", "0.6801179", "0.67703044", "0.6763487", "0.6761313", "0.6761313", "0.67482305", "0.67473894", "0.6713073", "0.6703807", "0.6693307", "0.66886777", "0.66886777", "0.66646844", "0.66617274", "0.66572624", "0.6653578", "0.66406506", "0.6625279", "0.66213304", "0.66192704", "0.6614916", "0.6612626", "0.6604333", "0.65851104", "0.65851104", "0.65785134", "0.65615654", "0.65518224", "0.65518224", "0.6549094", "0.6530534", "0.6530534", "0.65275174", "0.6523527", "0.6520384", "0.6520384", "0.6516204", "0.65145653", "0.65104014", "0.6504922", "0.6499594", "0.64987266", "0.64906204", "0.64810187", "0.64798295", "0.64702576", "0.64496434", "0.6436427", "0.6433962", "0.64330167", "0.6428237", "0.6406415", "0.6402615", "0.6399288", "0.63881207", "0.63877773", "0.6353986", "0.63537806", "0.633806", "0.63360107", "0.6334851", "0.632672", "0.63260114", "0.63179153", "0.63173646", "0.6317282", "0.6316377", "0.6316055", "0.63120025", "0.6293317", "0.62857985", "0.6282219", "0.6280316", "0.6264061", "0.62624925", "0.625522", "0.62549126", "0.62547195", "0.625327", "0.625269", "0.6252329", "0.6245382" ]
0.0
-1
DELETE /users/1 DELETE /users/1.json
def destroy #@user = User.find(params[:id]) @user = current_user @user.destroy respond_to do |format| format.html { redirect_to users_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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(id)\n request(:delete, \"/users/#{id}.json\")\n end", "def delete\n render json: Users.delete(params[\"id\"])\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 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 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.json { head :no_content }\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 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 destroy\n @user.destroy\n format.json { head :no_content }\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 @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\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])\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\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 @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 @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", "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\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.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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :no_content }\n end\n end" ]
[ "0.78750724", "0.77518034", "0.7713981", "0.7610077", "0.747295", "0.74073994", "0.74073994", "0.7369968", "0.7346072", "0.7340465", "0.7328618", "0.7309635", "0.73095363", "0.7306841", "0.7297868", "0.72917855", "0.7291585", "0.7289111", "0.7284347", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7250935", "0.7245172", "0.7242216", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177", "0.7232177" ]
0.0
-1
Retorna un ls sobre el directorio
def do_ls() if @system_type == WINDOWS then return %x(dir #{@path}) end if @system_type == UNIX then return %x(ls #{@path}) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ls(path = '.')\n Cd.cd.ls(path)\n end", "def ls(path = '/')\n dirlist = []\n @sftp.dir.foreach(path) do |element|\n dirlist << element\n end\n return dirlist\n end", "def ls(path) \n ary = Array.new\n Dir.chdir(path) {\n Dir.glob(\"*\").each {|dir|\n ary.push(dir)\n }\n }\n return ary\nend", "def list\n factory.system.list(@path).collect do |item|\n candidate = dir(item)\n if (not candidate.exists?)\n candidate = file(item)\n end\n candidate\n end\n end", "def folder_list(command)\n path = '/' + clean_up(command[1] || '')\n resp = @client.files.folder_list(path)\n\n resp.contents.each do |item|\n puts item.path\n end\n end", "def list_directories(options = {})\n options = DEFAULTS.merge(options)\n\n path = options[:path]\n all = options[:all]\n\n path = \"#{path}/\" unless path == '' or path.end_with?('/')\n path = path+'**/' if all\n \n\n Dir.glob(\"#{path}*/\")\n end", "def ls(filename)\n if File.directory?(filename)\n puts(Dir['./' + filename + '/*'])\n elsif File.file?(filename)\n puts(filename)\n else \n puts(\"error\")\n end\nend", "def ls\n table Dir.entries( Dir.pwd ).reject { |f| f.match /^\\..*$/ }\n end", "def get_ls(path)\n #repo = @repo\n #head = repo.commits.first\n #tree = head.tree @branch\n\n tree = @repo.tree @branch\n\n #strip trailing /\n path.sub! /[\\/]*$/, ''\n\n # find dir\n while !path.empty?\n tdir = tree / path\n break if tdir.is_a?(Grit::Tree)\n # strip last conponent to /\n path.sub! /(^|\\/)[^\\/]*$/, ''\n end\n\n if path.empty?\n tdir = tree\n else\n path += '/'\n end\n print \"path:\", path, \"\\n\"\n print \"tdir:\", tdir, \"\\n\"\n\n files = tdir.blobs.map do |b|\n { path: \"#{path}#{b.name}\", name: b.name, siz: b.size }\n end\n dirs = tdir.trees.map do |t|\n { path: \"#{path}#{t.name}\", name: t.name}\n end\n if !path.empty?\n dirs.push( { path: path.sub(/(^|\\/)[^\\/]*\\/$/, ''),\n name: '..'} )\n end\n\n [files, dirs, path]\n end", "def list_files_from path,opts = {}\n unless Dir.exists? path\n Logger.<<(__FILE__,\"ERROR\",\"Local fetcher: path does not exists for listing... #{path} \")\n raise \"Error LocalFileFetcher !\"\n end\n if opts[:directories]\n cmd = \"ls -td #{path}/*/\"\n else\n cmd = \"ls #{path}\"\n cmd += \"/#{opts[:regexp]}\" if opts[:regexp]\n end\n out = `#{cmd}`\n return out.split(\"\\n\")\n end", "def ls(path = \"\")\n\t\tcmd 'ls ' + path.to_s\n\tend", "def directories\n directory.directoires\n end", "def listDirectories\n return contentHost.listDirectories(baseDir)\n end", "def ls(path)\n dir = scope.get(path)\n InvalidPath.raise! {!dir.try(:is_dir)}\n dir.files.map(&:path)\n end", "def ls(path)\n files = []\n Dir.glob(\"#{path}/*\") {|f| files << f.split('/').last}\n\n return files\n end", "def ls\n Dir.entries(@working_dir)\n end", "def ls(directory)\n out = []\n tmp = cmd_exec(\"ls -a -m #{directory}\")\n tmp = session.remove_colors(tmp)\n if tmp\n tmp.delete!(\"\\r\")\n tmp.delete!(\"\\n\")\n tmp.split(/,\\s{0,1}/).each do |f|\n next if f.empty?\n next if f == './'\n next if f == '../'\n next if f == '.'\n next if f == '..'\n out << f\n end\n end\n out\n end", "def ls dir,regex = \"\"\n cmd = regex.empty? ? \"ls #{dir}\" : \"ls #{File.join(dir,regex)}\"\n exec_cmd(cmd) \n end", "def list_folders\n http_get(:uri=>\"/folders\", :fields=>x_cookie)\n end", "def all_directories dir\n Dir[\"#{dir}**/\"]\nend", "def list_dirs(path)\n dir = pathname(path)\n\n Dir.chdir(dir) do\n Dir['*/'].sort\n end\n\n rescue\n raise FileNotFound, \"no such file in repo - #{path}\"\n end", "def getDirs dir\n\t\tFind.find(dir)\t\n\tend", "def list\n Dir.glob(\"#{@directory}/**/*\").reject(&File.directory?).map do |p|\n Pathname.new(p).relative_path_from(@directory)\n end\n end", "def ls(path)\n # FIXME: remove 'path' from listing?\n list(path, false, true)\n end", "def folders_listing path\n cmd = \"find #{path} -type d \"\n if @folder_regexp\n cmd += \"-regextype posix-extended \"\n cmd += \"-regex \\\"#{@folder_regexp}\\\"\"\n end\n folders = exec_cmd(cmd)\n folders\n end", "def ls_r path\n ls(path).inject([]){|rec_paths,path| rec_paths << path; rec_paths << ls(path) unless file?(path); rec_paths}.flatten\n end", "def dir(directory)\n if session.type == 'meterpreter'\n return session.fs.dir.entries(directory)\n end\n\n if session.platform == 'windows'\n return session.shell_command_token(\"dir #{directory}\").split(/[\\r\\n]+/)\n end\n\n if command_exists?('ls')\n return session.shell_command_token(\"ls #{directory}\").split(/[\\r\\n]+/)\n end\n\n # Result on systems without ls command\n if directory[-1] != '/'\n directory = directory + \"/\"\n end\n result = []\n data = session.shell_command_token(\"for fn in #{directory}*; do echo $fn; done\")\n parts = data.split(\"\\n\")\n parts.each do |line|\n line = line.split(\"/\")[-1]\n result.insert(-1, line)\n end\n\n result\n end", "def lsdir(dirpath = nil)\n dirpath << '/' unless dirpath.nil? || dirpath.end_with?('/')\n offset = dirpath.nil? ? 0 : dirpath.length\n bucket.as_tree(:prefix => dirpath).children.select(&:branch?).map{|f| f.prefix[offset..-1]}\n end", "def ls(pattern = '**/*', **opts)\n Enumerator.new do |acc|\n walk(pattern, **opts) do |path, _|\n acc << path\n end\n end\n end", "def listFiles()\n #N Without this the files won't get listed\n contentHost.listFiles(baseDir)\n end", "def dir_children(dirname=mpwd)\n simple_entries(dirname).find_all {|e|\n File.directory?(File.join(dirname, e))\n }\n end", "def directory_entries\n entries.select{ |f| File.directory?(File.join(path,f)) }\n #dirs = ::Dir.glob(\"#{path}/\")\n #dirs.collect{ |f| f.chomp('/') }\n end", "def dir_list(path, bases, paging)\n items = paging[:items]\n page = paging[:page]\n offset = paging[:offset]\n raise 'Disabling paging is not supported for a directory listing' if paging[:disable_paging]\n\n max_items = 1000\n\n child_paths, total = FileSystems::Combined.directory_list(path, items, offset, max_items)\n\n children = child_paths.map { |full_path|\n if FileSystems::Combined.directory_exists?(full_path)\n dir_info(full_path, bases)\n else\n raise 'File should exist' unless FileSystems::Combined.file_exists?(full_path)\n\n file_info(full_path)\n end\n }\n\n paging[:total] = total\n paging[:warning] = \"Only first #{max_items} results are available\" if total >= max_items\n\n children\n end", "def ls(path)\n names = path.split('/')\n names.shift\n node = @root\n until names.empty?\n node = node.children[names.shift]\n end\n node.ls\n end", "def readdir(handle)\n send_request(FXP_READDIR, :string, handle)\n end", "def ls_dir(prefix)\n list_objects(prefix).common_prefixes.map(&:prefix)\n end", "def list\n Dir.glob(\"#{@path}/**/*\").select{|path| File.file?(path) }.map do |path|\n path.sub Regexp.new(\"^#{@path}\\/\"), ''\n end\n end", "def list(path='root')\n puts \"#list('#{path}')\"\n listed_files =[]\n @drive.folder = path\n children = @drive.children\n list_files_metadata(children)\n raise 'There are no files in directory' if children.count < 1\n children.each do |item|\n listed_files << \"#{item.path.gsub('/drive/', 'drive/')}/#{item.name}\" unless item.folder?\n end\n @logger.info 'Children list acquired.'\n pp listed_files\n end", "def ls(pattern = '**/*', **_opts)\n Enumerator.new do |acc|\n walk(pattern) {|path| acc << path }\n end\n end", "def cmd_ls(*args)\n\t\tpath = args[0] || client.fs.dir.getwd\n\t\ttbl = Rex::Ui::Text::Table.new(\n\t\t\t'Header' => \"Listing: #{path}\",\n\t\t\t'Columns' =>\n\t\t\t\t[\n\t\t\t\t\t'Mode',\n\t\t\t\t\t'Size',\n\t\t\t\t\t'Type',\n\t\t\t\t\t'Last modified',\n\t\t\t\t\t'Name',\n\t\t\t\t])\n\n\t\titems = 0\n\n\t\t# Enumerate each item...\n\t\tclient.fs.dir.entries_with_info(path).sort { |a,b| a['FileName'] <=> b['FileName'] }.each { |p|\n\n\t\t\ttbl <<\n\t\t\t\t[\n\t\t\t\t\tp['StatBuf'] ? p['StatBuf'].prettymode : '',\n\t\t\t\t\tp['StatBuf'] ? p['StatBuf'].size : '',\n\t\t\t\t\tp['StatBuf'] ? p['StatBuf'].ftype[0,3] : '',\n\t\t\t\t\tp['StatBuf'] ? p['StatBuf'].mtime : '',\n\t\t\t\t\tp['FileName'] || 'unknown'\n\t\t\t\t]\n\n\t\t\titems += 1\n\t\t}\n\n\t\tif (items > 0)\n\t\t\tprint(\"\\n\" + tbl.to_s + \"\\n\")\n\t\telse\n\t\t\tprint_line(\"No entries exist in #{path}\")\n\t\tend\n\n\t\treturn true\n\tend", "def directory!\n @file_list = @file_list.select{ |f| File.directory?(f) }\n end", "def list_directories\n Dir.chdir(path)\n Dir.foreach(EXTENSION) do |element|\n next if element == \".\" or element == \"..\"\n yield element\n end\n end", "def directories; end", "def directories; end", "def ls(pattern = '**/*', **_opts)\n Enumerator.new do |y|\n walk(pattern) do |path, _|\n y << path if File.fnmatch?(pattern, path, File::FNM_PATHNAME)\n end\n end\n end", "def dir_files(dir)\n Find.find(dir).to_a.reject!{|f| File.directory?(f) }\nend", "def get_list(dir = nil)\n @ftp.ls(dir)[3..-1]\n end", "def ls(pattern='**/*', _opts={})\n root = pattern[%r{^[^\\*\\?\\{\\}\\[\\]]+/}]\n root.chomp!('/') if root\n Enumerator.new do |y|\n glob(root) do |path|\n y << path if File.fnmatch?(pattern, path, File::FNM_PATHNAME)\n end\n end\n end", "def list_files_from_dir(path)\n Dir[path + \"/*/\"].map { |file| File.basename(file) }\n end", "def ls( *args )\r\n \r\n directory = nil\r\n opts = {}\r\n \r\n case args.count\r\n when 1\r\n if args[0].kind_of? Hash\r\n opts = args[0]\r\n else\r\n directory = args[0]\r\n end\r\n when 2\r\n directory = args[0]\r\n opts = args[1] \r\n end\r\n \r\n # args are the RPC arguments ...\r\n args = {}\r\n args[:path] = directory if directory\r\n args[:recursive] = true if opts[:recurse]\r\n args[:detail] = true if opts[:detail] \r\n args.delete(:detail) if( args[:detail] and args[:recursive])\r\n \r\n # RPC output format, default is XML\r\n outf = { :format => 'text' } if opts[:format] == :text\r\n \r\n got = @ndev.rpc.file_list( args, outf )\r\n return nil unless got\r\n \r\n return got.text if opts[:format] == :text\r\n return got if opts[:format] == :xml\r\n \r\n # if we're here, then we need to conver the output \r\n # to a Hash. Joy!\r\n \r\n collect_detail = args[:detail] || args[:recursive]\r\n \r\n ls_hash = {}\r\n got.xpath('directory').each do |dir|\r\n \r\n dir_name = dir.xpath('directory-name').text.strip\r\n dir_hash = {}\r\n \r\n dir_hash[:fileblocks] = dir.xpath('total-file-blocks').text.to_i\r\n files_info = dir.xpath('file-information')\r\n \r\n dir_hash[:files] = {} \r\n dir_hash[:dirs] = {} # sub-directories\r\n \r\n files_info.each do |file|\r\n f_name = file.xpath('file-name').text.strip\r\n f_h = {} \r\n \r\n if file.xpath('file-directory')[0]\r\n dir_hash[:dirs][f_name] = f_h\r\n else\r\n dir_hash[:files][f_name] = f_h \r\n end\r\n \r\n next unless collect_detail\r\n \r\n f_h[:owner] = file.xpath('file-owner').text.strip\r\n f_h[:group] = file.xpath('file-group').text.strip\r\n f_h[:links] = file.xpath('file-links').text.to_i\r\n f_h[:size] = file.xpath('file-size').text.to_i\r\n \r\n xml_when_item(file.xpath('file-symlink-target')) { |i|\r\n f_h[:symlink] = i.text.strip\r\n }\r\n \r\n fp = file.xpath('file-permissions')[0]\r\n f_h[:permissions_text] = fp.attribute('format').value\r\n f_h[:permissions] = fp.text.to_i\r\n \r\n fd = file.xpath('file-date')[0]\r\n f_h[:date] = fd.attribute('format').value\r\n f_h[:date_epoc] = fd.text.to_i\r\n \r\n end # each directory file\r\n ls_hash[ dir_name ] = dir_hash \r\n end # each directory\r\n \r\n return nil if ls_hash.empty?\r\n ls_hash\r\n end", "def list_all_in_current_directory\n Dir.glob('**/*').sort\nend", "def dirs; end", "def dirs; end", "def list_files dir='*', sorto=@sorto, hidden=@hidden, _filter=@filterstr\n dir += '/*' if File.directory?(dir)\n dir = dir.gsub('//', '/')\n\n # decide sort method based on second character\n # first char is o or O (reverse)\n # second char is macLn etc (as in zsh glob)\n so = sorto ? sorto[1] : nil\n func = case so\n when 'm'\n :mtime\n when 'a'\n :atime\n when 'c'\n :ctime\n when 'L'\n :size\n when 'n'\n :path\n when 'x'\n :extname\n end\n\n # sort by time and then reverse so latest first.\n sorted_files = if hidden == 'D'\n Dir.glob(dir, File::FNM_DOTMATCH) - %w[. ..]\n else\n Dir.glob(dir)\n end\n\n # WARN: crashes on a deadlink since no mtime\n if func\n sorted_files = sorted_files.sort_by do |f|\n if File.exist? f\n File.send(func, f)\n else\n sys_stat(func, f)\n end\n end\n end\n\n sorted_files.sort! { |w1, w2| w1.casecmp(w2) } if func == :path && @ignore_case\n\n # zsh gives mtime sort with latest first, ruby gives latest last\n sorted_files.reverse! if sorto && sorto[0] == 'O'\n\n # add slash to directories\n sorted_files = add_slash sorted_files\n # return sorted_files\n @files = sorted_files\n calculate_bookmarks_for_dir # we don't want to override those set by others\nend", "def list_files(dir)\n # Getting all the files names in the directory\n file_names = Dir[dir + \"*\"]\n\n return file_names\n\nend", "def list_files(dir)\n# Getting all the files names in the directory\n file_names = Dir[dir + \"*\"]\n return file_names\nend", "def list_directories(client)\n client.directories.each do |directory|\n puts \"Directory: #{directory.name}\"\n puts \" Description: #{directory.description}\"\n puts \" Status: #{directory.status}\"\n puts \" Href: #{directory.href}\"\n end\nend", "def get_children(directory)\n file = Pathname.new(directory)\n if file.directory?\n file.children\n else \n []\n end\nend", "def list\n Lib.list @path, @no_follow\n end", "def list_of_directories\n Dir.entries(\"./inspections\").select {|d| !d.start_with?(\".\") }\n end", "def dir(*) end", "def folder_list(opts = {})\n optional_inputs = {\n include_deleted: false,\n include_media_info: false,\n }.merge(opts)\n input_json = {\n id: optional_inputs[:id],\n path: optional_inputs[:path],\n include_deleted: optional_inputs[:include_deleted],\n include_media_info: optional_inputs[:include_media_info],\n }\n response = @session.do_rpc_endpoint(\"/#{ @namespace }/folder_list\", input_json)\n Dropbox::API::FolderAndContents.from_json(Dropbox::API::HTTP.parse_rpc_response(response))\n end", "def list_files(path)\n base_directory_content = Dir.glob(File.join(path, \"*\"))\n nested_directory_content = Dir.glob(File.join(path, \"*/**/*\"))\n [base_directory_content, nested_directory_content].flatten\n end", "def get_directory_files(directory, verbose_flag=false)\n exists = File.directory?(directory)\n if exists\n files = Dir[\"#{directory}/*\"] # grab all the files inside that directory\n return files\n else\n puts \"Unable to find a directory at #{directory}\" if verbose_flag\n return nil\n end\nend", "def listDirectories(baseDir)\n #N if un-normalised, code assuming '/' at the end might be one-off\n baseDir = normalisedDir(baseDir)\n #N without the command, we don't know what command to execute to list the directories\n command = findDirectoriesCommand(baseDir)\n #N without this, the command won't execute, or we it might execute in a way that doesn't let us read the output\n output = getCommandOutput(command)\n #N without initial directories, we would have nowhere to accumulate the directory relative paths\n directories = []\n #N without the base dir length, we don't know how much to chop off the path names to get the relative path names\n baseDirLen = baseDir.length\n #N without this, would not get feedback that we are listing directories (which might be a slow remote command)\n puts \"Listing directories ...\"\n #N without looping over the output, we wouldn't be reading the output of the listing command\n while (line = output.gets)\n #N without chomping, eoln would be included in the directory paths\n line = line.chomp\n #N without this, would not get feedback about each directory listed\n puts \" #{line}\"\n #N without this check, unexpected invalid output not including the base directory would be processed as if nothing had gone wrong\n if line.start_with?(baseDir)\n #N without this, the directory in this line of output wouldn't be recorded\n directories << line[baseDirLen..-1]\n else\n #N if we don't raise the error, an expected result (probably a sign of some important error) would be ignored\n raise \"Directory #{line} is not a sub-directory of base directory #{baseDir}\"\n end\n end\n #N if we don't close the output, then un-opened output stream objects will accumulate (and leak resources)\n output.close()\n #N if we don't check the process status, then a failed command will be treated as if it had succeeded (i.e. as if there were no directories found)\n checkProcessStatus(command)\n return directories\n end", "def list(path, show_all)\n begin\n unless (@cmd.model[:public] + path).directory?\n return false\n end\n\n (@cmd.model[:public] + path).entries.each_with_object([]) do |entry, list|\n if show_all or not(entry.basename.start_with?(\".\"))\n list << {\n \"name\" => entry.basename,\n \"type\" => entry.directory? ? \"dir\" : \"file\",\n \"mtime\" => entry.mtime.iso8601,\n \"size\" => entry.size\n }\n end\n end\n rescue => e\n return nil\n end\n end", "def directories\n directory_entries.map{ |f| FileObject[path, f] }\n end", "def get_dir_listing( sftp, dir)\n list = []\n\n sftp.dir.foreach(dir) do |entry|\n list << entry.name\n end\n\n Set.new(list)\n end", "def readdir(path, fileinfo)\n puts \"#readdir \" + path\n path == \"/\" or @root.directory?(path) and @root.contents(path)\n end", "def readdir(path, fileinfo)\n puts \"#readdir \" + path\n [\"hello.txt\"]\n end", "def list(current_folder)\n # Ensure API availability\n api.call(\"system\", \"greet\")\n\n api.call(files_project, \"listFolder\", { folder: current_folder, only: 'folders' })\n end", "def readdir(path, fileinfo)\n puts \"#readdir \" + path\n entries = []\n handle = @sftp.opendir(path)\n items = @sftp.readdir(handle)\n items.each do |item|\n entries.push item.filename\n end\n @sftp.close_handle(handle)\n entries\n rescue\n p $!\n false\n end", "def folders\n html = http_request(@uri + '/wato.py', {\n folder: '',\n mode: 'folder',\n }, false)\n html.split(/\\n/).each do |line|\n next unless line =~ /class=\"folderpath\"/\n end\n res = []\n html.split(/\\n/).grep(/mode=editfolder/).each do |line|\n line =~ /folder=(.*?)'/\n res.push $1 unless $1.nil?\n end\n res\n end", "def get_filelist(root_path)\n array = Dir[root_path+'**/*'].reject {|fn| File.directory?(fn) }\nend", "def folders\n @conn.list('', '%').map do |f|\n Folder.new(@conn, f.name, f.delim)\n end\n end", "def opendir(path)\n send_request(FXP_OPENDIR, :string, path)\n end", "def list_files_in_directory dir\n files = Dir.glob File.join(dir, \"*\")\n\n normalized_file_list files, false, @options.exclude\n end", "def find(dirs); end", "def list_directory(directory)\n return if directory == nil\n \n repo = File.join(path, directory)\n return unless File.directory?(repo) \n \n Dir.chdir(repo)\n Dir.foreach(EXTENSION) do |element|\n next if element == \".\" or element == \"..\"\n yield element\n end\n end", "def list_files_from (path,opts = {})\n safe_fetch do\n list_files = Set.new\n var = \"Search in #{path} at #{@host}... \"\n cmd = \"find #{path}\"\n cmd = \"(cd #{path} && ls \" ### dont know why cd alone doesn't work\n cmd << \"-td */\" if opts[:directories]\n cmd << opts[:regexp] if opts[:regexp]\n cmd << \" 2>/dev/null)\"\n out = @ssh.exec!(cmd)\n list_files = out.split\n list_files = out.split(\"/\\n\") if opts[:directories]\n\n var << \"Found #{list_files.size} entries\\n\"\n Logger.<<(__FILE__,\"INFO\",var)\n list_files\n end\n end", "def read_dirs(indir)\n @all_files = []\n Dir.chdir(indir)\n all_dirs = Dir.glob('*').select { |f| File.directory? f }\n\n @all_files = Dir.glob(\"**/*\").select { |f| File.file? f }\n all_dirs = Dir.glob('*').select { |f| File.directory? f }\n all_dirs.each do |subdir|\n read_dir(subdir)\n end\n end", "def read_directories(dir = T.unsafe(nil)); end", "def recursive_file_list( root_dir)\n\t\treturn nil unless File.directory?(root_dir)\n\t\tlist = []\n\t\tDir.entries( root_dir).reject{|e| e=~/^\\./}.each { |e| \n\t\t\tpath = File.join( root_dir, e)\n\t\t\tif File.directory?( path)\n\t\t\t\t# puts \"Dir: #{path}\"\n\t\t\t\t list += recursive_file_list(path)\n\t\t\telsif File.file?(path)\n\t\t\t\t# puts \"File: #{path}\"\n\t\t\t\t list << path\n\t\t\tend\t\n\t\t}\n\t\tlist\n\tend", "def list_files( dir = directory )\n Dir.entries(directory).tap do |files|\n files.delete('.')\n files.delete('..')\n end\n end", "def list_files_in_directory(dir, options)\n normalized_file_list(options, Dir.glob(File.join(dir, \"*\")), false, options.exclude)\n end", "def file_list(dir, opts={})\r\n\topts={:recursive => false, :exclude => []}.merge(opts)\r\n\tf = []\r\n\tDir.glob(File.join(dir,\"*\")).each do | file |\r\n\t\tif File.file?(file) then\r\n\t\t\tnext if opts[:exclude].include? file\r\n\t\t\tf << file\r\n\t\telse\r\n\t\t\tf << file_list(file) if opts[:recursive] && File.directory?(file)\r\n\t\tend\r\n\tend\r\n\treturn f\r\nend", "def make_listdir\n\t\tdirname = \"%s/%s.%d.%0.4f\" % [\n\t\t\tDir.tmpdir,\n\t\t\t'ezmlm_list',\n\t\t\tProcess.pid,\n\t\t\t(Time.now.to_f % 3600),\n\t\t ]\n\t\tlist = Pathname.new( __FILE__ ).dirname + 'data' + 'testlist'\n\t\tcp_r( list.to_s, dirname )\n\n\t\treturn dirname\n\tend", "def print_ls(path = '/')\n elements = ls(path)\n elements.each do |e|\n puts e.longname\n end\n end", "def list_files_in_directory(dir, options)\n files = Dir.glob File.join(dir, \"*\")\n\n normalized_file_list options, files, false, options.exclude\n end", "def list_files_in_directory(dir, options)\n files = Dir.glob File.join(dir, \"*\")\n\n normalized_file_list options, files, false, options.exclude\n end", "def files_for_directory(path)\n directory = find_preferred_file(\n @new_resource.cookbook_name, \n :remote_file, \n path, \n @node[:fqdn],\n @node[:platform],\n @node[:platform_version]\n )\n\n unless (directory && ::File.directory?(directory))\n raise NotFound, \"Cannot find a suitable directory\"\n end\n\n directory_listing = Array.new\n Dir[::File.join(directory, '**', '*')].sort { |a,b| b <=> a }.each do |file|\n next if ::File.directory?(file)\n file =~ /^#{directory}\\/(.+)$/\n directory_listing << $1\n end\n directory_listing\n end", "def directory_contents(path)\n\tputs ''\n\tfor i in get_dir_contents(path)\n\t\tputs i\n\tend\n\tputs ''\n\treturn nil\nend", "def get_dirs\n Dir.glob(\"#{@options[:load_path]}/*/**/\")\n end", "def mount_paths_listing\n Dir[\"#{mounts_path}/*\"]\n end", "def get_folder_list\n\n ################################\n # \n # prep: list\n #\n ################################\n #ref __FILE__ http://stackoverflow.com/questions/37101151/what-does-file-program-name-mean-in-ruby\n path = Pathname.new(__FILE__)\n# path = Pathname.new('.')\n \n #ref https://ruby-doc.org/stdlib-2.1.0/libdoc/pathname/rdoc/Pathname.html\n p \"path.dirname => #{path.dirname}\"\n \n dpath = path.dirname\n# dpath = \"c:/works_2\"\n \n #ref http://stackoverflow.com/questions/1899072/getting-a-list-of-folders-in-a-directory\n Dir.chdir(dpath)\n# Dir.chdir(\"c:/works_2\")\n# Dir.chdir(path.dirname)\n# Dir.chdir('/destination_directory')\n# list = Dir.glob('*').select\n# list = Dir.glob('*').select {|f| File.directory? f}\n files = Dir.glob('*').select {|f| File.file? f}\n dirs = Dir.glob('*').select {|f| File.directory? f}\n \n puts\n puts \"[#{__LINE__}] directory => #{dpath}\" \n \n puts\n puts \"[#{__LINE__}] folders ....\"\n p dirs\n \n puts\n puts \"[#{__LINE__}] files ....\"\n p files.sort\n# p files\n \n# p files.methods.sort\n \n# p __FILE__\n \n# target_directory = \n# \n# Dir.chdir('/destination_directory')\n## Dir.chdir('/destination_directory')\n# \n# list = Dir.glob('*').select {|f| File.directory? f}\n# \n# p list\n \n ################################\n # \n # file: write data\n #\n ################################\n time_label = get_time_label(\"serial\")\n \n fname = \"directory_list.#{time_label}.txt\"\n \n f = File.new(fname, \"w\")\n \n # header\n f.write(\"program file path = #{FILE_PATH}\")\n f.write(\"\\n\")\n f.write(\"version = #{VERSION}\")\n f.write(\"\\n\")\n \n f.write(\"list file created at = #{time_label}\")\n f.write(\"\\n\")\n \n f.write(\"dir path = #{dpath}\")\n f.write(\"\\n\")\n f.write(\"dirs = #{dirs.size}\")\n f.write(\"\\n\")\n f.write(\"files = #{files.size}\")\n f.write(\"\\n\")\n f.write(\"\\n\")\n \n # data: dirs\n f.write \"<directories> #{dirs.size}\"\n f.write \"\\n\"\n \n dirs.each do |elem|\n \n f.write(elem)\n f.write(\"\\n\")\n \n end\n \n f.write(\"\\n\")\n f.write(\"\\n\")\n \n # data: files\n f.write \"<files> #{files.size}\"\n f.write \"\\n\"\n\n files.each do |elem|\n \n f.write(elem)\n f.write(\"\\n\")\n \n end\n \n f.close\n \n puts \"[#{__LINE__}] file written => #{fname}\"\n \nend", "def list_files(env, res, tag, path)\n files = []\n git(\"ls-tree\", \"-z\", \"#{tag}:#{path}\") do |io|\n io.each_line(\"\\0\") do |line|\n line.chomp!(\"\\0\")\n #STDERR.puts line\n info, file = line.split(/\\t/, 2)\n mode, type, object = info.split(/ /)\n files << {\n :mode => mode,\n :type => type,\n :object => object,\n :file => file,\n }\n end\n end\n files = files.sort_by{|h| h[:file] }\n E_list_files.result(binding)\n end", "def retrieve_dirs(_base, dir, dot_dirs); end", "def folders\n @conn.list(\"#{@full_name}#{@delim}\", '%').map do |f|\n Folder.new(@conn, f.name, f.delim)\n end\n end", "def list_files\n files = remote_directory.files.map { |file| file.key }\n\n # The first item in the array is only the path an can be discarded.\n files = files.slice(1, files.length - 1) || []\n\n files\n .map { |file| Pathname.new(file).basename.to_s }\n .sort\n .reverse\n end", "def subdirectories()\n children.select { |c| c.directory? }\n end" ]
[ "0.7486923", "0.73250186", "0.72490007", "0.71984345", "0.7184171", "0.7127247", "0.7103844", "0.70893407", "0.70751625", "0.7053697", "0.704742", "0.7020492", "0.69601595", "0.6950356", "0.69302946", "0.69237393", "0.68343633", "0.6773838", "0.6764797", "0.67616296", "0.67001885", "0.6691499", "0.66696775", "0.6660482", "0.6614299", "0.6611852", "0.6595111", "0.6536018", "0.652377", "0.6517011", "0.65118426", "0.6510255", "0.65085846", "0.65038586", "0.649151", "0.64614797", "0.64478344", "0.64437205", "0.6438202", "0.64367944", "0.6399925", "0.6388678", "0.6377979", "0.6377979", "0.6358682", "0.6333789", "0.63295317", "0.63253677", "0.63246137", "0.6316749", "0.62894624", "0.6268343", "0.6268343", "0.6268068", "0.62652755", "0.6260381", "0.6255174", "0.62399906", "0.6230866", "0.62253904", "0.62230015", "0.6208575", "0.619853", "0.619685", "0.61965585", "0.6180302", "0.6160058", "0.6154037", "0.6144429", "0.6129656", "0.6118604", "0.61175585", "0.61037743", "0.61027807", "0.6095852", "0.60923284", "0.60907483", "0.6084778", "0.6081772", "0.6060472", "0.6056872", "0.6054926", "0.6049318", "0.60449624", "0.60331744", "0.6031986", "0.6019822", "0.60149586", "0.60048825", "0.60048825", "0.60010636", "0.59961665", "0.5986114", "0.5985534", "0.5985344", "0.59804803", "0.59744656", "0.5973766", "0.59647536", "0.59484184" ]
0.72104204
3
Called after every test method runs. Can be used to tear down fixture information.
def teardown # Do nothing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_teardown; end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n # Empty\n end", "def teardown\n # Empty\n end", "def teardown\n # if necessary\n end", "def teardown; end", "def teardown; end", "def teardown\n # No-op\n end", "def teardown\r\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n end", "def teardown\n # Do nothing\n end", "def teardown\n # Do nothing\n end", "def teardown!\n\n end", "def teardown\n reset_test_env\n end", "def teardown\n reset_test_env\n end", "def teardown\n # empty\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n\n end", "def teardown\n puts \"tear down\"\n end", "def before_teardown; end", "def teardown(&block)\n after(:each, &block)\n end", "def teardown\n super\n end", "def teardown\n\t\t\t\t# Do nothing\n\t\tend", "def tear_down; end", "def teardown\n\tend", "def teardown\n\tend", "def teardown\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def teardown\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def teardown\r\n # Do nothing\r\n end", "def teardown\r\n # Do nothing\r\n end", "def teardown\r\n # Do nothing\r\n end", "def teardown\r\n # Do nothing\r\n end", "def teardown\r\n # Do nothing\r\n end", "def teardown\r\n # Do nothing\r\n end", "def teardown\r\n # Do nothing\r\n end", "def teardown\r\n # Do nothing\r\n end", "def teardown\r\n # Do nothing\r\n end", "def teardown\r\n # Do nothing\r\n end", "def teardown\n raise \"Unimplemented method #teardown\"\n end", "def teardown\n\t\t# Do nothing\n\tend", "def teardown\n\t\t# Do nothing\n\tend", "def teardown\n\t\t# Do nothing\n\tend", "def teardown\n # Do nothing\n end", "def teardown\n cleanup_tables\n cleanup_caches\n end", "def teardown\n super\n end", "def teardown\n super\n end", "def teardown\n super\n end", "def teardown\n # do something\n end", "def teardown\r\n\t\t@vendors = nil\r\n\t\t@vendor = nil\r\n\t\t@model = nil\r\n\t\t@deviceView = nil\r\n\t\t@devicewWhatHas = nil\r\n\t\t@fetchTrees = nil\r\n\t\t@fetchSpecs = nil\r\n\tend", "def teardown\n #implement in subclass;\n end", "def after_test(_test); end", "def after_test(_test); end", "def after_test(_test); end", "def teardown\n\t\tputs \"Completed unit test execution\"\n\tend", "def teardown\n @bu = nil\n end" ]
[ "0.8025238", "0.79543626", "0.79543626", "0.78571093", "0.7845288", "0.7845288", "0.7845288", "0.7845288", "0.7845288", "0.7845288", "0.7845288", "0.7845288", "0.78336143", "0.78336143", "0.7750328", "0.77483624", "0.77483624", "0.7734571", "0.7713144", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7711698", "0.7588461", "0.7588461", "0.7576201", "0.75686413", "0.75686413", "0.7564417", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.75566334", "0.74753416", "0.74639195", "0.7444996", "0.7421199", "0.7397627", "0.739077", "0.7388719", "0.7388719", "0.73850024", "0.73850024", "0.7384664", "0.7384664", "0.7384664", "0.7384664", "0.7384664", "0.7384664", "0.7384664", "0.7384664", "0.7384664", "0.7384664", "0.73603344", "0.7353042", "0.7353042", "0.7353042", "0.7345512", "0.7316518", "0.72850275", "0.72850275", "0.72850275", "0.7284316", "0.72694516", "0.7261574", "0.72485334", "0.72485334", "0.72485334", "0.72324896", "0.72299993" ]
0.0
-1
get the document an allowable privacy object for the document according to the db_tag raise if it is an invalid db_tag
def get_privacy db_tag privacy_obj = privacy_objects.find{|p| p.db_tag == db_tag} raise unless privacy_obj return privacy_obj end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_privacy db_tag\r\n privacy_obj = privacy_objects.find{|p| p.db_tag == db_tag}\r\n raise unless privacy_obj\r\n self.update_attribute(\"privacy\",privacy_obj.db_tag)\r\n return privacy_obj\r\n end", "def document_auth doc_id=nil\n doc_id ||= params[:doc]\n doc_id = doc_id.decode62 if doc_id.is_a? String\n\n doc = WSFile.get doc_id\n halt 404 if doc.nil?\n if doc.visibility == 'private'\n perms = doc.permissions(user:current_user)\n if not logged_in?\n redirect \"/login?#{env[\"REQUEST_PATH\"]}\"\n elsif perms.empty? # isn't on the permission list\n halt 403\n end\n end\n doc\n end", "def show\n authorize @document\n end", "def editor! doc\n if doc.default_level == \"owner\" or doc.default_level == \"editor\"\n return\n else\n perm = doc.permissions(user: current_user)\n if perm.length > 0 && (perm[0].level == \"owner\" or perm[0].level == \"editor\")\n return\n end\n end\n halt 403\n end", "def show\n document = @suggestion.document\n user = current_user\n editable_documents = user.documents\n if editable_documents.include?(document)\n @has_user_edit_permission = true\n else\n @has_user_edit_permission = false\n end\n end", "def stored_design_doc(db = database)\n db.get(design_doc_id) rescue nil\n end", "def enforce_show_permissions(opts={})\n permissions = current_ability.permissions_doc(params[:id])\n if permissions.under_embargo? && !can?(:edit, permissions)\n raise Hydra::AccessDenied.new(\"This item is under embargo. You do not have sufficient access privileges to read this document.\", :edit, params[:id])\n end\n unless can? :read, permissions \n raise Hydra::AccessDenied.new(\"You do not have sufficient access privileges to read this document, which has been marked private.\", :read, params[:id])\n end\n end", "def find_tagged_document\n klass = taggable_class.constantize\n klass.find(taggable_id.to_s)\n end", "def needs_permission_badge?\n solr_document.visibility != Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC\n end", "def restricted_should_authenticate\n authenticate_user! unless @document.public?\n end", "def visible_to?(user)\n if method = Garage.configuration.docs.docs_authorization_method\n method.call(document: self, user: user)\n else\n true\n end\n end", "def privacy_object_id\r\n\t\t\treturn self.id\r\n\t\tend", "def enforce_show_permissions(_opts = {})\n permissions = current_ability.permissions_doc(solr_id)\n if (permissions['read_access_group_ssim'].present? && permissions['read_access_group_ssim'].include?('registered')) || can?(:discover, permissions)\n permissions\n else\n raise Blacklight::AccessControls::AccessDenied.new('You do not have sufficient access privileges to view this document, which has been marked private.', :discover, params[:id])\n end\n end", "def design_doc\n database.get(\"_design/#{design_doc_slug}\")\n end", "def can_read_document?(doc = nil)\r\n true\r\n end", "def show\n authorize @tag\n end", "def can_create?(doc_type)\n self.can_access?(doc_type)\n end", "def document_not_found!\n doc = ::SolrDocument.find(params[:id])\n # Render the document if the current_user == the depositor of the document\n return doc if current_user && current_user.user_key == doc[\"depositor_ssim\"].first\n raise WorkflowAuthorizationException if doc.suppressed?\n raise CanCan::AccessDenied.new(nil, :show)\n end", "def get_doc(did)\n DB.get(did)\nend", "def get_doc(did)\n DB.get(did)\nend", "def dav_permission\n @attributes[:dav_permission]\n end", "def dav_permission\n @attributes[:dav_permission]\n end", "def privacy_tags\n self.privacy_project\n end", "def provision_dav_permission\n @attributes[:provision_dav_permission]\n end", "def can_edit?(doc_type)\n self.can_access?(doc_type)\n end", "def privacy(arg = nil)\n set_or_return(\n :privacy,\n arg,\n kind_of: [ TrueClass, FalseClass ]\n )\n end", "def get_read_access( u)\n \n return (u == self.user) || (self.public)\n \n \n end", "def correct_user_for_docs\n @document = current_user.documents.find_by(params[:friendly])\n redirect_to documents_path, notice: \"Not authorised to edit this document\" if @document.nil?\n end", "def load_ipaper_document(id)\n # Yes, catch-all rescues are bad, but the end rescue\n # should return nil, so laziness FTW.\n scribd_user.find_document(id) rescue nil\n end", "def doc\n return model.build_from_database(self['doc']) if self['doc']\n doc_id = (value.is_a?(Hash) && value['_id']) ? value['_id'] : self.id\n doc_id ? model.get(doc_id) : nil\n end", "def find_documentable\n params.each do |name, value|\n if name =~ /(.+)_id$/\n klass = $1.classify.constantize\n return klass.find(value)\n end\n end\n nil\n end", "def org_question_privacy(org)\n privacy = question_privacies.by_org(org)\n #privacy = privacy.by_course(course)\n privacy = privacy.first\n if privacy\n privacy.question_privacy\n else\n self.question_privacy\n end\n end", "def edit\n @tag = Tag.find params[:id]\n if !@tag.admin.nil? && @tag.admin != current_user\n render json: { error: '403 requested operation not permitted' }, status: 403\n else\n render :show, status: 200\n end\n end", "def privacy_owner\r\n\t\t\tself.user\r\n\t\tend", "def xml_authorized?\n self.documento.digital == true\n end", "def privacy_check(user_check)\n can_view = nil\n\n if self.public == false\n user = User.find_by_id(self.user_id)\n if user.company_id != user_check.company_id\n can_view = false\n else\n can_view = true\n end\n else\n can_view = true\n end\n\n return can_view\n\n end", "def get_policy\n @privacypolicy = Privacypolicy.find_by_id(params[:id])\n return if check_nil_object(@privacypolicy)\n end", "def privacy\n end", "def privacy\n end", "def enforce_search_for_show_permissions\n enforce_permissions!(\"show_digital_object\", params[:id])\n end", "def enforce_search_for_show_permissions\n enforce_permissions!(\"show_digital_object\", params[:id])\n end", "def do_nested\n @record = find_if_allowed(params[:id], :read)\n end", "def document?\n self.type == \"Assetabler::Document\"\n end", "def find_advertisement\n advertisement = Advertisement.find(params[:id])\n if advertisement.user == current_user\n @advertisement = advertisement\n else\n no_access_error\n end\n end", "def permitted_to_read?(user)\n user.is_admin? || (has_groupblog_permission?(user) || self.user == user || self.group.moderator == user || (self.group.can_user_see_eachother && group.participants.include?(user)))\n end", "def may_share_document?(document=nil)\n\t\t\tdocument && ( \n\t\t\t\tself.is_administrator? ||\n\t\t\t\t( document.owner && self == document.owner ) \n\t\t\t)\n\t\tend", "def show_private_object_to(user)\n return self if (self.private == 0) || (self.created_by.id == user.id)\n if self.private == 1 \n user_auth = User.find_by_sql([\"select id,email from users where email IN (select addresses.email from addresses where addresses.id IN (select address_id from addresses_#{self.class}s where #{self.class}_id = ?)) AND email = ? limit 1\", self.id, user.email ])\n group_auth = User.find_by_sql([\"select id, email from users where email IN (select addresses.email from addresses where addresses.id IN (select address_id from addresses_groups where group_id = (select group_id from groups_#{self.class}s where #{self.class}_id = ? ))) AND email = ? LIMIT 1;\", self.id, user.email])\n raise ActiveRecord::RecordNotFound if user_auth.empty? && group_auth.empty?\n end\n return self\n end", "def show\n authorize @adoc_name\n end", "def index\n authorize Document\n end", "def allows_document?\n self.allows_title? && ![TITLE, COVER].include?(self.kind)\n end", "def security\n app = detect_product(DALVIK) || detect_product(MOZILLA)\n\n Security[app.comment[1]] if app\n end", "def permitted?(user)\n Article.can_edit?(user)\n end", "def can_edit?\n return false unless @document\n can?(:edit, @document.resource)\n end", "def can_edit?\n return false unless @document\n can?(:edit, @document.resource)\n end", "def current_final_legal_document\n final_legal_documents.where.not(published_at: nil).order(published_at: :desc).limit(1).first\n end", "def design_docs\n DesignDocAccess.new(self)\n end", "def doc_type\n DOC_TYPES[self.TipoDoc.to_sym]\n end", "def get_document_protection(request)\n data, _status_code, _headers = get_document_protection_with_http_info(request)\n request_token if _status_code == 401\n data\n end", "def safe_obj_by_key(obj_key)\n obj = Outpost.obj_by_key(obj_key)\n\n if !obj || !SAFE_CLASSES.include?(obj.class.name) || !obj.published?\n return nil\n end\n\n obj\n end", "def get_doc \n @doc\n end", "def visible_documents\n permissions = self.permissions.find(:all, \n :conditions => [\"controller = ? AND action = ?\", \"documents\", \"show\"])\n ids = permissions.collect{|p| p.subject_id}\n Document.find(:all, :conditions => {:id => ids||[]})\n end", "def document?\n self.type == \"Document\"\n end", "def stored_design_doc\n store.client.get(design_doc_id)\n rescue RestClient::ResourceNotFound\n nil\n end", "def is_reader?(user)\n public || permitted?(readers_join_table, user)\n end", "def getDoc(key); @docs[key] end", "def organization\n Department.where(:tag_name => self.tags.all_private.map(&:name)).first\n end", "def doc_type_allowlist\n %w[184].freeze\n end", "def authorize_owner_and_planner\n\n can :manage, AttachedDocument do |doc|\n curr_organization == doc.plan.organization\n end\n end", "def can?( privilege, obj )\n\n return false if privilege == :forbidden_operation # lest wildcards allow it\n\n class_name = obj.class.sg_base_class_name\n class_perms = perms_for_class(class_name) || {}\n\n (class_perms[privilege] || []).each do |perm|\n return true if perm.allows_internal?( obj, self )\n end\n\n (class_perms[:any] || []).each do |perm|\n return true if perm.allows_internal?( obj, self )\n end\n\n return false\n\n end", "def new\n @document = @instruction.documents.build\n authorize @document\n end", "def find_publication\n if action_name == 'rebuild'\n @publication= @user.publications.find(params[:id].to_i)\n elsif action_name == 'show'\n zip= params[:id].split('---').first\n @publication= Publication.find_by_zip(zip)\n else\n @publication= Publication.find_by_zip(params[:id])\n end\n\n access_denied and return unless @publication\n @audited_object= @publication # audition system\n @object_for_role_system= @publication # role system\n end", "def read_allowed?(user)\n true\n end", "def get_policy2\n @privacypolicy = Privacypolicy.find_by_id(params[:privacypolicy_id])\n return if check_nil_object(@privacypolicy)\n end", "def permitted_for_research_object?(item = self)\n if item.is_downloadable?\n item.can_download?(nil)\n else\n item.can_view?(nil)\n end\n end", "def policy_object\n return @policy_object if !@policy_object.nil?\n if self.is_a?(ActiveRecord::Base)\n return self.class.policy_object\n end\n return nil\n end", "def permitted?\n Article.can_edit?(@user)\n end", "def can_edit_document?(doc = nil)\r\n if self.current_user == self.effective_user\r\n return true\r\n end\r\n\r\n if current_proxy_roles and current_proxy_roles.any?{ |i| [Sys::UserRelation::REL_CANCELARIA, Sys::UserRelation::REL_JUSTICE].include?(i) }\r\n return true\r\n end\r\n\r\n return false\r\n end", "def can_be_accessed_by?(advocate)\n !!accessors.find(:first, :conditions => [\"accesses.requestor_id = ?\", advocate.id])\n end", "def scribd_document\n @scribd_document ||= scribd_login.find_document(scribd_id)\n rescue Scribd::ResponseError # at minimum, the document was not found\n nil\n end", "def can_view_or_not_private?( id )\n if private?\n acl.has_permission?( id, AlbumACL::VIEWER_ROLE)\n else\n true\n end\n end", "def document\n documents.first\n end", "def can_view?(u)\n\t\tu and (u.admin? or u.staff? or (u == self.user))\n\t\t# TODO: support users having explicit permission to view a document\n\t\t# TODO: support users belonging to group that has permission to view a document\n\tend", "def show\n if @document.is_private != true || signed_in? \n @pdf_url = build_pdf_url @document\n else\n signed_in_user\n end\n end", "def document\n document_type_class.new document_type_class.unique_key => document_id\n end", "def get_design_doc(id)\n @conn.query({url_path: \"#{database}/_design/#{id}\", method: :get})\n end", "def get_document()\n Kamelopard::DocumentHolder.instance.current_document\n end", "def doc\n model.doc if model\n end", "def getSetSimilarityToOwner(tag,owner,directoryPath,print=false)\n @contentMap[tag] ||= DocumentSet.new\n @contentMap[tag].getSetSimilarityToOwner(owner,directoryPath,print)\n end", "def routable?(doc)\n return false unless respond_to?(:blacklight_config) && blacklight_config.view_config(:show).route\n\n doc.is_a? routable_model_for(blacklight_config)\n end", "def list_of_allowed_documents\n @client.make_request :get, profile_path\n end", "def set_document_tag\n @issuer_document_tag = IssuerDocumentTag.find(params[:id])\n end", "def set_document\n @document = Document.find(params[:id])\n unless @document.collection.available?(@current_user)\n respond_to do |format|\n format.html { redirect_back fallback_location: collections_path, error: \"Cannot access the document\"}\n format.json { render json: {msg: 'Cannot access document'}, status: 401 }\n end \n return false\n end\n end", "def show\n @private_note = PrivateNote.find(params[:id])\n authorize @private_note\n end", "def publicly_accessible?\n @dbi.publicly_accessible\n end", "def publicly_accessible?\n @dbi.publicly_accessible\n end", "def resource_type\n document_type\n end", "def resource_type\n document_type\n end", "def document_id\n id\n end", "def find_rated_document\n case self.kind\n when \"comment\" then self.comment\n when \"source\" then self.source\n else raise \"Invalid kind of rating\"\n end\n end", "def permission_badge\n CurationConcerns::PermissionBadge.new(solr_document).render\n end" ]
[ "0.7015408", "0.57167286", "0.5583481", "0.55200374", "0.5388634", "0.5336983", "0.53242034", "0.52800137", "0.5251779", "0.51859087", "0.5156365", "0.51321447", "0.512183", "0.5118841", "0.5115315", "0.5111158", "0.50635034", "0.50543433", "0.5051888", "0.50420666", "0.5034639", "0.5034639", "0.5024419", "0.500687", "0.499742", "0.49421993", "0.49380788", "0.4927529", "0.49269027", "0.49258265", "0.49222648", "0.4905688", "0.49006185", "0.48942444", "0.4888526", "0.48861787", "0.48820868", "0.48711568", "0.48711568", "0.48640013", "0.48640013", "0.4862565", "0.48270148", "0.4822875", "0.48171824", "0.48161477", "0.481295", "0.480875", "0.4786008", "0.47756335", "0.4769776", "0.47334054", "0.47309965", "0.47309965", "0.4730643", "0.4721498", "0.47084567", "0.47049114", "0.47014487", "0.4701413", "0.46977925", "0.46838465", "0.4667108", "0.46667176", "0.46664914", "0.46553764", "0.46527946", "0.4652725", "0.464906", "0.46322408", "0.46242744", "0.46196803", "0.46193135", "0.46164924", "0.46132833", "0.46039858", "0.46029824", "0.45957395", "0.45929468", "0.45855924", "0.45780745", "0.4574691", "0.4572247", "0.45678642", "0.4564366", "0.45621753", "0.45607233", "0.45549467", "0.4553693", "0.45521456", "0.4550384", "0.4550347", "0.4527188", "0.4524396", "0.4524396", "0.45201242", "0.45201242", "0.45196337", "0.45113853", "0.45106992" ]
0.8157782
0
set the document privacy according to the db_tag raise if it is an invalid db_tag
def set_privacy db_tag privacy_obj = privacy_objects.find{|p| p.db_tag == db_tag} raise unless privacy_obj self.update_attribute("privacy",privacy_obj.db_tag) return privacy_obj end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_privacy db_tag\r\n privacy_obj = privacy_objects.find{|p| p.db_tag == db_tag}\r\n raise unless privacy_obj\r\n return privacy_obj \r\n end", "def propagate_privacy\n return unless name_tag\n name_tag.is_global = List.exists? name_tag_id: name_tag_id, availability: [0,1]\n name_tag.save if name_tag.changed?\n end", "def set_privacy(user=nil,level=0)\n # TODO finish and test\n # currently 0 = public, 1 = public but read only, 2 = private, 3 = private and read only\n # in all cases if you are a member you can see it\n end", "def privacy(arg = nil)\n set_or_return(\n :privacy,\n arg,\n kind_of: [ TrueClass, FalseClass ]\n )\n end", "def set_privacy(video_id, privacy, auth_token)\n sig_options = {\n :video_id => video_id,\n :privacy => privacy,\n :auth_token => auth_token,\n :method => \"vimeo.videos.setPrivacy\"\n }\n\n make_request sig_options\n end", "def save_design_doc!(db = database)\n save_design_doc(db, true)\n end", "def set_document_tag\n @issuer_document_tag = IssuerDocumentTag.find(params[:id])\n end", "def doc_security=(v)\n Axlsx.validate_int v\n @doc_security = v\n end", "def save_design_doc_on(db)\n update_design_doc(Design.new(design_doc), db)\n end", "def doi_protection_override!(val=true)\n @doi_protection_override = val\n end", "def set_gtag\n gtags = @current_event.gtags\n\n Rollbar.silenced do\n gtag_id = gtags.find_by(id: params[:id])&.id || gtags.find_by(tag_uid: params[:id])&.id\n\n @gtag = gtags.find(gtag_id)\n authorize @gtag\n end\n end", "def privacy=(privacy)\n validator = EnumAttributeValidator.new('String', [\"private\", \"friends\", \"public\"])\n unless validator.valid?(privacy)\n fail ArgumentError, \"invalid value for 'privacy', must be one of #{validator.allowable_values}.\"\n end\n @privacy = privacy\n end", "def set_security_and_privacy_vulnerability\n @security_and_privacy_vulnerability = SecurityAndPrivacyVulnerability.find(params[:id])\n end", "def privacy\n end", "def privacy\n end", "def setPrivate(photoId)\r\n\t\tcon.query(\"\r\n\t\t\tUPDATE photo\r\n\t\t\tSET is_private='1'\r\n\t\t\tWHERE id = \" + photoId)\r\n\tend", "def update!(**args)\n @doc_tag = args[:doc_tag] if args.key?(:doc_tag)\n end", "def set_privacy_level\n @privacy_level = PrivacyLevel.find(params[:id])\n end", "def update\n @tag = Tag.find params[:id]\n if !@tag.admin.nil? && @tag.admin != current_user\n render json: { error: '403 requested operation not permitted' }, status: 403\n elsif @tag.update tag_params\n render :show, status: 200\n else\n render json: { error: '422 unprocessable entity' }, status: 422\n end\n end", "def save_design_doc(db = database, force = false)\n update_design_doc(Design.new(design_doc), db, force)\n end", "def set_item\n super\n raise \"403\" unless @item.allowed?(:read, @cur_user, site: @cur_site)\n end", "def set_privacy_policy\n @privacy_policy = PrivacyPolicy.find(params[:id])\n end", "def update_design_doc(design_doc, db, force = false)\n saved = stored_design_doc(db)\n if saved\n changes = force\n design_doc['views'].each do |name, view|\n if !compare_views(saved['views'][name], view)\n changes = true\n saved['views'][name] = view\n end\n end\n if changes\n db.save_doc(saved)\n end\n design_doc\n else\n design_doc.database = db\n design_doc.save\n design_doc\n end\n end", "def create_design_doc(id,doc)\n @conn.query({url_path: \"#{database}/_design/#{id}\", opts: doc, method: :put})\n end", "def update_design_doc(design_doc, db = database)\n saved = db.get(design_doc['_id']) rescue nil\n if saved\n design_doc['views'].each do |name, view|\n saved['views'][name] = view\n end\n db.save_doc(saved)\n saved\n else\n design_doc.database = db\n design_doc.save\n design_doc\n end\n end", "def secure_update(attrs, account)\n if !account.allowed_to_edit?(self)\n self.errors.add(:base, \"You don't have permission to update the document.\" )\n return false\n end\n access = attrs.delete :access\n access &&= access.to_i\n published_url = attrs.delete :published_url\n attrs[:remote_url] ||= published_url\n data = attrs.delete :data\n update_attributes attrs\n self.data = data if data\n set_access(access) if access && self.access != access\n true\n end", "def force_set_document(key, value, args={})\n return nil unless key\n CouchbaseDocStore.force_set_document(key, value, args)\n end", "def editor! doc\n if doc.default_level == \"owner\" or doc.default_level == \"editor\"\n return\n else\n perm = doc.permissions(user: current_user)\n if perm.length > 0 && (perm[0].level == \"owner\" or perm[0].level == \"editor\")\n return\n end\n end\n halt 403\n end", "def force_set_document(key, value, args={})\n return nil unless key\n DocumentStore.force_set_document(key, value, args)\n end", "def force_set_document(key, value, args={})\n return nil unless key\n DocumentStore.force_set_document(key, value, args)\n end", "def privateuse=(value)\n subtags = Array(value).flatten\n if subtags.empty?\n self.privateuse_sequence = nil\n else\n self.privateuse_sequence = subtags.unshift(PRIVATEUSE).join(HYPHEN)\n @privateuse = subtags\n end\n end", "def set_pub\n @pub = Pub.find(params[:id])\n authorize @pub\n end", "def set_DB()\n self.is_db = 1\n save()\n end", "def set_privacy_policy\n @privacy_policy = PrivacyPolicy.find(params[:id])\n end", "def db=(db)\n raise Error, \"Cannot use Sequel::Model.db= on model with existing dataset. Use Sequel::Model.dataset= instead.\" if @dataset\n @db = db\n end", "def privacy(id, privacy = false)\n item = Item.find(id)\n item.class == Item ? item.update(:private => privacy) : item\n end", "def force_set_document(key, value, args={})\n return nil unless key\n COUCH.quiet = args[:quiet] || true\n COUCH.set(key, value, args)\n end", "def setPublic(photoId)\r\n\t\tcon.query(\"\r\n\t\t\tUPDATE photo\r\n\t\t\tSET is_private='0'\r\n\t\t\tWHERE id = \" + photoId)\r\n\tend", "def doc=(doc)\n @doc = doc\n end", "def db=(db)\n @db = db\n if @dataset\n Sequel::Deprecation.deprecate(\"Sequel::Model.db= when the model has an existing dataset\", \"Use Sequel::Model.dataset= instead\")\n set_dataset(db.dataset.clone(@dataset.opts))\n end\n end", "def edit\n @tag = Tag.find params[:id]\n if !@tag.admin.nil? && @tag.admin != current_user\n render json: { error: '403 requested operation not permitted' }, status: 403\n else\n render :show, status: 200\n end\n end", "def audit_tag_with(tag)\n if last_audit\n last_audit.update_attribute(:tag, tag)\n else\n self.audit_tag = tag\n snap!\n end\n end", "def audit_tag_with(tag)\n if last_audit\n last_audit.update_attribute(:tag, tag)\n else\n self.audit_tag = tag\n snap!\n end\n end", "def privacy_scope=(scope)\r\n\t\t\t@privacy_scope = scope\r\n\t\tend", "def update_document_tags(doc)\n idx = fetch_index(doc.repo)\n return nil if (! idx)\n # no way to check if doc exists in index! just call replace (add/del)\n idx.replace(doc)\n # FIXME: update cached list of known tags, if cached\n end", "def make_private(file_id)\n $db.execute(\"UPDATE files SET publicity = 0 WHERE id = ?\", [file_id])\nend", "def set_document\n @document = Document.find(params[:id])\n @project = @document.project\n exit_if_not_member and return false\n end", "def set_admin_tag\n @admin_tag = Tag.find(params[:id])\n end", "def set_garden_tag\n @garden_tag = GardenTag.find(params[:id])\n end", "def set_PrivacyStatus(value)\n set_input(\"PrivacyStatus\", value)\n end", "def set_PrivacyStatus(value)\n set_input(\"PrivacyStatus\", value)\n end", "def set_document\n @document = Document.find(params[:id])\n unless @document.collection.available?(@current_user)\n respond_to do |format|\n format.html { redirect_back fallback_location: collections_path, error: \"Cannot access the document\"}\n format.json { render json: {msg: 'Cannot access document'}, status: 401 }\n end \n return false\n end\n end", "def set_group_doc\n @group_doc = GroupDoc.find(params[:id])\n end", "def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end", "def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end", "def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end", "def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end", "def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end", "def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end", "def force_set_document(key, value, args={})\n return nil unless key\n CB.quiet = args[:quiet] || true\n CB.set(key, value, args)\n end", "def force_set_document(key, value, args={})\n return nil unless key\n CB.quiet = args[:quiet] || true\n CB.set(key, value, args)\n end", "def approve_adoption\n self[:adoptable] = false\n save\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setpub\n\n\t\terror = \"\"\n\n\t\t@binder = Binder.find(params[:id])\n\n\t\t# read/write access\n\t\tif @binder.get_access(current_teacher.id.to_s) == 2\n\n\t\t\t# check if parent binder has any type 3 permissions\n\t\t\tif @binder.parent_permissions.find {|p| p[\"type\"] == 3}.nil?\n\n\t\t\t\tif @binder.permissions.find {|p| p[\"type\"] == 3}.nil?\n\n\t\t\t\t\t# this binder has no existing type 3 permissions, inherit!\n\t\t\t\t\t@binder.permissions << {:type\t\t=> 3,\n\t\t\t\t\t\t\t\t\t\t\t:auth_level\t=> params[:enabled] == \"true\" ? 1 : 0}\n\t\t\t\t\t@binder.save\n\n\t\t\t\telse\n\n\t\t\t\t\t# set this binder's permissions\n\t\t\t\t\t@binder.permissions.find {|p| p[\"type\"] == 3}[\"auth_level\"] = params[:enabled] == \"true\" ? 1 : 0\n\n\t\t\t\tend\n\n\t\t\t\tif params[:enabled]==\"true\"\n\t\t\t\t\t@binder.pub_size = @binder.pub_size + @binder.priv_size\n\t\t\t\t\t@binder.priv_size = 0\n\t\t\t\telse\n\t\t\t\t\t@binder.priv_size = @binder.priv_size + @binder.pub_size\n\t\t\t\t\t@binder.pub_size = 0\n\t\t\t\tend\n\n\t\t\t\t@binder.save\n\n\t\t\t\tsrc = Mongo.log(current_teacher.id.to_s,\n\t\t\t\t\t\t\t\t__method__.to_s,\n\t\t\t\t\t\t\t\tparams[:controller].to_s,\n\t\t\t\t\t\t\t\t@binder.id.to_s,\n\t\t\t\t\t\t\t\tparams)\n\n\t\t\t\t# deal with the naughty children\n\t\t\t\t@binder.subtree.each do |h|\n\n\t\t\t\t\th.permissions.find{|p| p[\"type\"] == 3}[\"auth_level\"] = params[:enabled] == \"true\" ? 1 : 0 if !h.permissions.find{|p| p[\"type\"] == 3}.nil?\n\n\n\t\t\t\t\tif h.parent_permissions.find {|p| p[\"type\"] == 3}.nil?\n\n\t\t\t\t\t\th.parent_permissions << {\t:type\t\t=> 3,\n\t\t\t\t\t\t\t\t\t\t\t\t\t:folder_id => params[:id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t:auth_level\t=> params[:enabled] == \"true\" ? 1 : 0}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\th.parent_permissions.find {|p| p[\"type\"] == 3}[\"auth_level\"] = params[:enabled] == \"true\" ? 1 : 0\n\t\t\t\t\t\th.parent_permissions.find {|p| p[\"type\"] == 3}[\"folder_id\"] = params[:id]\n\n\t\t\t\t\tend\n\n\t\t\t\t\tif params[:enabled]==\"true\"\n\t\t\t\t\t\th.pub_size = h.pub_size + h.priv_size\n\t\t\t\t\t\tcurrent_teacher.pub_size += h.priv_size\n\t\t\t\t\t\th.priv_size = 0\n\t\t\t\t\telse\n\t\t\t\t\t\th.priv_size = h.priv_size + h.pub_size\n\t\t\t\t\t\tcurrent_teacher.priv_size += h.pub_size\n\t\t\t\t\t\th.pub_size = 0\n\t\t\t\t\tend\n\n\t\t\t\t\tcurrent_teacher.save\n\n\t\t\t\t\th.save\n\n\t\t\t\t\tMongo.log(\tcurrent_teacher.id.to_s,\n\t\t\t\t\t\t\t\t__method__.to_s,\n\t\t\t\t\t\t\t\tparams[:controller].to_s,\n\t\t\t\t\t\t\t\th.id.to_s,\n\t\t\t\t\t\t\t\tparams,\n\t\t\t\t\t\t\t\t{ :src => src })\n\t\t\t\tend\n\n\t\t\telse\n\n\t\t\t\tif @binder.parent_permissions.find {|p| p[\"type\"] == 3}[\"auth_level\"] == 1 && params[:enabled] == \"false\"\n\n\t\t\t\t\terror = \"Oops! The parent is currently shared.\"\n\n\t\t\t\telse\n\n\t\t\t\t\tif @binder.permissions.find {|p| p[\"type\"] == 3}.nil?\n\n\t\t\t\t\t\t@binder.permissions << {:type\t\t=> 3,\n\t\t\t\t\t\t\t\t\t\t\t\t:auth_level\t=> params[:enabled] == \"true\" ? 1 : 0}\n\t\t\t\t\t\t#@binder.save\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\t@binder.permissions.find {|p| p[\"type\"] == 3}[\"auth_level\"] = params[:enabled] == \"true\" ? 1 : 0\n\t\t\t\t\t\t#@binder.save\n\n\t\t\t\t\tend\n\n\t\t\t\t\tif params[:enabled]==\"true\"\n\t\t\t\t\t\t@binder.pub_size = @binder.pub_size + @binder.priv_size\n\t\t\t\t\t\t@binder.priv_size = 0\n\n\t\t\t\t\t\t@binder.parents.each do |f|\n\t\t\t\t\t\t\tif f['id'].to_s!='0'\n\t\t\t\t\t\t\t\tg = Binder.find(f['id'].to_s)\n\t\t\t\t\t\t\t\tg.update_attributes(:pub_size => g.pub_size + @binder.priv_size,\n\t\t\t\t\t\t\t\t\t\t\t\t\t:priv_size => 0)\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\t@binder.priv_size = @binder.priv_size + @binder.pub_size\n\t\t\t\t\t\t@binder.pub_size = 0\n\n\t\t\t\t\t\t@binder.parents.each do |f|\n\t\t\t\t\t\t\tif f['id'].to_s!='0'\n\t\t\t\t\t\t\t\tg = Binder.find(f['id'].to_s)\n\t\t\t\t\t\t\t\tg.update_attributes(:pub_size => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t:priv_size => g.priv_size + @binder.pub_size)\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\n\t\t\t\t\tend\n\n\t\t\t\t\t@binder.save\n\n\t\t\t\t\tsrc = Mongo.log(current_teacher.id.to_s,\n\t\t\t\t\t\t\t\t\t__method__.to_s,\n\t\t\t\t\t\t\t\t\tparams[:controller].to_s,\n\t\t\t\t\t\t\t\t\t@binder.id.to_s,\n\t\t\t\t\t\t\t\t\tparams)\n\n\t\t\t\t\t# take care of the naughty children\n\t\t\t\t\t@binder.subtree.each do |h|\n\n\t\t\t\t\t\th.permissions.find{|p| p[\"type\"] == 3}[\"auth_level\"] = params[:enabled] == \"true\" ? 1 : 0 if !h.permissions.find{|p| p[\"type\"] == 3}.nil?\n\n\t\t\t\t\t\tif h.parent_permissions.find {|p| p[\"type\"] == 3}.nil?\n\n\t\t\t\t\t\t\th.parent_permissions << {\t:type\t\t=> 3,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t:folder_id => params[:id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t:auth_level\t=> params[:enabled] == \"true\" ? 1 : 0}\n\t\t\t\t\t\t\t#h.save\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\th.parent_permissions.find {|p| p[\"type\"] == 3}[\"auth_level\"] = params[:enabled] == \"true\" ? 1 : 0\n\t\t\t\t\t\t\th.parent_permissions.find {|p| p[\"type\"] == 3}[\"folder_id\"] = params[:id]\n\t\t\t\t\t\t\t#h.save\n\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\tif params[:enabled]==\"true\"\n\t\t\t\t\t\t\th.pub_size = h.pub_size + h.priv_size\n\t\t\t\t\t\t\tcurrent_teacher.pub_size += h.priv_size\n\t\t\t\t\t\t\th.priv_size = 0\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\th.priv_size = h.priv_size + h.pub_size\n\t\t\t\t\t\t\tcurrent_teacher.priv_size += h.pub_size\n\t\t\t\t\t\t\th.pub_size = 0\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\tcurrent_teacher.save\n\n\t\t\t\t\t\th.save\n\n\t\t\t\t\t\tMongo.log(\tcurrent_teacher.id.to_s,\n\t\t\t\t\t\t\t\t\t__method__.to_s,\n\t\t\t\t\t\t\t\t\tparams[:controller].to_s,\n\t\t\t\t\t\t\t\t\th.id.to_s,\n\t\t\t\t\t\t\t\t\tparams,\n\t\t\t\t\t\t\t\t\t{ :src => src })\n\n\t\t\t\t\tend\n\n\t\t\t\tend\n\n\t\t\tend\n\n\t\telse\n\n\t\t\terror = \"You are not allowed to change permissions on this item.\"\n\n\t\tend\n\n\t\trescue BSON::InvalidObjectId\n\t\t\terror = \"Invalid Request\"\n\t\trescue Mongoid::Errors::DocumentNotFound\n\t\t\terror = \"Invalid Request\"\n\t\tensure\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html {render :text => error.empty? ? 1 : error}\n\t\t\tend\n\n\tend", "def doc_security=(v) Axlsx.validate_int v; @doc_security = v; end", "def set_tag\n @tag = @affiliate.tags.find(params[:id])\n end", "def set_edu_doc\n @edu_doc = EduDoc.find_by_id(params[:id])\n end", "def set_protection_online(document, dto, password = nil)\n data, _status_code, _headers = set_protection_online_with_http_info(document, dto, password)\n data\n end", "def set_priv_policy\n @priv_policy = PrivPolicy.find(params[:id])\n end", "def add_public_and_protected(doc)\n\n return if doc.nil?\n\n store_public_and_protected_class_members(doc)\n\n next_doc = load_parent(doc)\n add_public_and_protected(next_doc)\n\n end", "def set_document\n if Document.exists?(params[:id])\n @document = Document.find(params[:id])\n unless current_user.id == @document.created_by_id\n error_renderer({code: 401, message: 'Unauthorized'})\n end\n else\n render partial: 'api/v1/error', locals: {:@error => {code: 404, message: 'Document Not Found'}}, status: 404\n end\n end", "def private=(val)\n ref_for(@current_user, true).private = (val != \"0\")\n end", "def update!(**args)\n @enable_improved_email_privacy = args[:enable_improved_email_privacy] if args.key?(:enable_improved_email_privacy)\n end", "def set_analise_privacidade\n @analise_privacidade = AnalisePrivacidade.find(params[:id])\n end", "def set_doc\n @doc = Doc.find(params[:id])\n end", "def set_tag\n\t\t\t@tag = current_user.tags.find(params[:id])\n end", "def set_article\n @article = Article.find(params[:id])\n if @current_user\n @edit_tag = @article.user == @current_user || @current_user.is_super_admin\n else\n @edit_tag = false\n end\n end", "def stored_design_doc(db = database)\n db.get(design_doc_id) rescue nil\n end", "def document_tag_params\n params.require(:issuer_document_tag).permit(:document_id, :tag_id, :tag_type)\n end", "def save_design_doc(force = false)\n update_design_doc(force)\n end", "def set_gdoc\n @gdoc = Gdoc.find(params[:id])\n end", "def set_door_tag\n @door_tag = DoorTag.find(params[:id])\n end", "def initialize(document, field, value, options = {})\n @document, @field, @value = document, field, value\n @options = { :safe => safe_mode?(options) }\n end", "def tag= tag\n @tag = tag\n update!\n end", "def document_auth doc_id=nil\n doc_id ||= params[:doc]\n doc_id = doc_id.decode62 if doc_id.is_a? String\n\n doc = WSFile.get doc_id\n halt 404 if doc.nil?\n if doc.visibility == 'private'\n perms = doc.permissions(user:current_user)\n if not logged_in?\n redirect \"/login?#{env[\"REQUEST_PATH\"]}\"\n elsif perms.empty? # isn't on the permission list\n halt 403\n end\n end\n doc\n end", "def modify_option_group(db_instance_identifier, option_group_name)\n modify_db_instance(db_instance_identifier: db_instance_identifier, option_group_name: option_group_name)\n end", "def assign_approver\n if approver == \"1\"\n document.approver = user\n document.save!\n end\n end", "def set_tag\n @tag = current_user.tags.find(params[:id])\n end", "def do_before_save\n self.dc_user_id = nil if self.public\nend", "def acl=(_acl)\n fail Dav::Exception::Forbidden, 'Setting ACL is not allowed here'\n end", "def change_privacy\n brand = Brand.find(params[:brands_id].to_i)\n if brand.open == true \n brand.open = false \n brand.save\n else \n brand.open = true\n brand.save\n end \n respond_to do |format|\n format.json { render json: {:msg => 'successful'} }\n end\n end", "def smart?; self.permission_level = 2; end", "def set_privilieges_feature\n @privilieges_feature = PriviliegesFeature.find(params[:id])\n end", "def on_db_vuln(context, vuln)\n\tend" ]
[ "0.6345327", "0.5905161", "0.55838084", "0.55792767", "0.54093903", "0.53289783", "0.52577215", "0.5215325", "0.52100235", "0.5175946", "0.5159295", "0.5102317", "0.5069592", "0.49712023", "0.49712023", "0.49661666", "0.4869075", "0.48646545", "0.48379436", "0.48318478", "0.48290113", "0.48159325", "0.4815079", "0.4812379", "0.47998285", "0.47915685", "0.47805384", "0.47803566", "0.47742954", "0.47742954", "0.47614375", "0.47515625", "0.47446227", "0.4736018", "0.47285426", "0.4723192", "0.47130668", "0.4689797", "0.46792388", "0.46739146", "0.4660235", "0.465842", "0.465842", "0.46482876", "0.46468407", "0.46415573", "0.46364814", "0.46363848", "0.46210098", "0.46132103", "0.46132103", "0.46122247", "0.4610387", "0.45932913", "0.45932913", "0.45932913", "0.45932913", "0.45932913", "0.45932913", "0.45758957", "0.45742956", "0.4555455", "0.45516434", "0.45516434", "0.45516434", "0.45516434", "0.45516434", "0.45516434", "0.45516434", "0.4547426", "0.45472953", "0.45374435", "0.4528252", "0.45270228", "0.45257163", "0.4523635", "0.4521557", "0.45167062", "0.4513004", "0.4508282", "0.44920656", "0.4491175", "0.44896516", "0.4479754", "0.4474567", "0.4471404", "0.44654262", "0.44578606", "0.44557562", "0.44352868", "0.44335967", "0.4426251", "0.44181395", "0.44170576", "0.44043785", "0.4400664", "0.4397554", "0.4389991", "0.43860126", "0.4379964" ]
0.8162818
0
GET /subscriptions GET /subscriptions.json
def index if is_client_app? if params[:user_id].present? t = Subscription.arel_table s = Subscription.statuses @subscriptions = Subscription.where(user_id: params[:user_id]).where(t[:status].eq(s[:authorized]).or(t[:status].eq(s[:paused]))) else @subscriptions = Subscription.all end render json: @subscriptions else response.headers['X-Total-Count'] = @subscriptions.count.to_s @subscriptions = @subscriptions.page(params[:page]) if params[:page].present? @subscriptions = @subscriptions.per(params[:per]) if params[:per].present? _render collection: @subscriptions, flag: params[:flag].try(:to_sym) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptions\n url = url_with_api_version(@base_url, 'subscriptions')\n resp = rest_get(url)\n JSON.parse(resp.body)[\"value\"]\n end", "def all_subscriptions\n get(url_(\"subscription\"))\n end", "def list_subscriptions(user)\n get(\"/#{user}/lists/subscriptions.json\")\n end", "def list_my_subscriptions() path = \"/api/v2/utilities/subscriptions\"\n get(path, {}, AvaTax::VERSION) end", "def user_vendor_subscriptions\n get(\"/api/v1/oauth_user_vendor_subscriptions.json\")\n end", "def index\n @subscriptions = current_user.subscriptions.order(:created_at)\n @user = current_user\n\n if not current_user.fitbit.nil?\n begin\n @fitbit_subscriptions = JSON.parse(current_user.fitbit.client.get('/1/user/-/apiSubscriptions.json').body)['apiSubscriptions']\n rescue SocketError\n logger.error \"Can not talk to fitbit\"\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def list_subscription\n response = Faraday.get(@subscription_api_url)\n response_json = JSON.parse(response.body)\n fix_response(response_json)\n end", "def subscriptions( params={} )\n subscriptions = get_connections(\"subscriptions\", params)\n return map_connections subscriptions, :to => Facebook::Graph::Subscription\n end", "def index\r\n @subscriptions = current_business_user.subscriptions.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @subscriptions }\r\n end\r\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def show\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def get_subscriptions(opts = {})\n data, _status_code, _headers = get_subscriptions_with_http_info(opts)\n return data\n end", "def list_subscriptions(options = {})\n api.graph_call(subscription_path, {}, \"get\", options)\n end", "def get_subscriptions(id:, order: nil)\n if order\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions?order=#{uri_encode(order)}\")\n else\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions\")\n end\n end", "def get_subscriptions(id:, order: nil)\n if order\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions?order=#{uri_encode(order)}\")\n else\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions\")\n end\n end", "def index\n @subscriptions = current_user.subscriptions.all\n end", "def index\n @api_subscriptions = Api::Subscription.all\n end", "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :guid => HttpClient::Preconditions.assert_class_or_nil('guid', HttpClient::Helper.to_uuid(opts.delete(:guid)), String),\n :organization_key => HttpClient::Preconditions.assert_class_or_nil('organization_key', opts.delete(:organization_key), String),\n :user_guid => HttpClient::Preconditions.assert_class_or_nil('user_guid', HttpClient::Helper.to_uuid(opts.delete(:user_guid)), String),\n :publication => HttpClient::Preconditions.assert_class_or_nil('publication', opts[:publication].nil? ? nil : (opts[:publication].is_a?(Apidoc::Models::Publication) ? opts.delete(:publication) : Apidoc::Models::Publication.apply(opts.delete(:publication))), Apidoc::Models::Publication),\n :limit => HttpClient::Preconditions.assert_class_or_nil('limit', opts.delete(:limit), Integer),\n :offset => HttpClient::Preconditions.assert_class_or_nil('offset', opts.delete(:offset), Integer)\n }.delete_if { |k, v| v.nil? }\n @client.request(\"/subscriptions\").with_query(query).get.map { |hash| Apidoc::Models::Subscription.new(hash) }\n end", "def index\n if params[:client_id].blank?\n @subscriptions = Subscription.all\n else\n @subscriptions = Client.find(params[:client_id]).subscriptions\n end\n end", "def subscriptions\n @subscriptions ||= begin\n resp = @client.access_token.get('/reader/api/0/subscription/list?output=json')\n raise \"unable to retrieve the list of subscription for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n JSON.parse(resp.body)['subscriptions'].collect do |hash|\n Google::Reader::Subscription.new(hash.merge({:client => @client}))\n end\n end\n end", "def list_subs\n \t@subs = instagram_client.subscriptions\n end", "def index\n @my_subscriptions = current_user.active_subscriptions\n end", "def index\n @subscriptions = Subscription.all\n end", "def index\n @subscriptions = Subscription.all\n end", "def index\n @subscriptions = Subscription.all\n end", "def subscriptions\n @subscriptions ||= {}\n end", "def subscriptions(page = 1)\n Dropio::Resource.client.subscriptions(self, page)\n end", "def subscriptions\n update_subscriptions(params[:types]) if params[:types]\n @types = build_notification_types\n render :json => @types\n end", "def index\n\n @category_subscriptions = CategorySubscription.all\n\n render json: @category_subscriptions\n\n end", "def show\n @subscription = Subscription.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def index\n @subscriptions = Subscription.where(:binder_id => params[:binder_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def get_all_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionsApi.get_all_subscriptions ...\"\n end\n # resource path\n local_var_path = \"/subscriptions\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'uid'] = opts[:'uid'] if !opts[:'uid'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].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 = ['artikcloud_oauth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionsEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionsApi#get_all_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\r\n @subscription = Subscription.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def user_subscriptions(user_id, options={})\n response = connection.get do |req|\n req.url \"/user/#{user_id}/subscriptions\", simple_params(options)\n end\n response.body\n end", "def subscriptions(user_id)\n response = rest_client.get(signature_url(\"/subscription/?user_id=#{user_id}\"))\n process_response(response)\n end", "def list_subscriptions options = {}\n paged_enum = subscriber.list_subscriptions project: project_path(options),\n page_size: options[:max],\n page_token: options[:token]\n\n paged_enum.response\n end", "def show\n json_response(@user_subscription)\n end", "def index\n @crytosubscriptions = Crytosubscription.all\n end", "def get_subscriptions\n get_subscriptions_from(@nodename)\n end", "def index\n @q = ::Pushar::Core::Subscription.unscoped.search(params[:q])\n @q.sorts = 'created_at desc' if @q.sorts.empty?\n @subscriptions = @q.result(distinct: true).page(params[:page]).per(50)\n end", "def getAllSubscriptions\n if @subscriptionLists.hasKey(\"subscriptions\")\n return @subscriptionLists.getRepositoryObject(\"subscriptions\").getObject\n end\n end", "def get_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionApi.get_subscriptions ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10000000\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling SubscriptionApi.get_subscriptions, must be smaller than or equal to 10000000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling SubscriptionApi.get_subscriptions, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling SubscriptionApi.get_subscriptions, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling SubscriptionApi.get_subscriptions, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = \"/v1/subscription\"\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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 = ['basicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionSearch')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionApi#get_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def subscriptions\n\t\t@subscriptions = current_user.customer.subjects\n\tend", "def index\n @subscriptions = nil #the load_and_authorize_resource cancan method is loading all the subscriptions and we want to start with a clean slate here.\n if params[:company_id]\n @owner = Company.find(params[:company_id])\n @subscriptions = Subscription.where(owner_type: 'Company', owner_id: params[:company_id])\n end\n if params[:person_id]\n @owner = Person.find(params[:person_id])\n @subscriptions ||= Subscription.where(owner_type: 'Person', owner_id: params[:person_id])\n end\n \n @subscriptions ||= Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def subscriptions\n ::Syncano::QueryBuilder.new(self, ::Syncano::Resources::Subscription)\n end", "def subscription_info(subscription_id = @subscription_id)\n url = url_with_api_version(@base_url, 'subscriptions', subscription_id)\n resp = rest_get(url)\n JSON.parse(resp.body)\n end", "def index\n @subscriptions = @user.subscriptions.order(updated_at: :desc)\n end", "def get_subscription(subscription_id)\n get(url_(\"subscription\", subscription_id))\n end", "def index\n\n if @notification\n json_response(@notification.user_subscriptions)\n end\n if request.path_parameters.has_key?(:user_id)\n json_response(@user.user_subscriptions)\n end\n end", "def index\n @subscriptions = Subscription.all\nend", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def index\n session[:sub_delete_return_to] = request.fullpath\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def subscription\n ret = nil\n if type == 'S'\n ret = @mc2p.subscription('id' => @json_body['id'])\n ret.retrieve\n end\n ret\n end", "def subscriptions\n @subscriptions ||= get_roster || {}\n end", "def index\n @panel_subscriptions = Panel::Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @panel_subscriptions }\n end\n end", "def index\n @subscriptions = @screen.subscriptions.all\n auth!\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @subscription }\n end\n end", "def get_subscription subscription_name, options = {}\n subscriber.get_subscription subscription: subscription_path(subscription_name, options)\n end", "def show\n @list_subscription = ListSubscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_subscription }\n end\n end", "def new\n @subscription = current_user.subscriptions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def subscription(repo, options = {})\n get \"#{Repository.path repo}/subscription\", options\n end", "def show_subscriptions\n puts \"\\nYour current subscriptions are:\"\n @user.subscriptions.reload.each do |sub|\n puts sub.name\n end\n end", "def index\n @admin_subscriptions = Subscription.all\n end", "def subscriptions\n iq = connection.iq_stanza({'to'=>jid.bare},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSubOwner},\n x('subscriptions',:node => node_id)\n )\n )\n send_iq_stanza_fibered iq\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def index\n\t\tindex_\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @subscriptions }\n\t\tend\n\tend", "def service_subscriptions\n iq = connection.iq_stanza({'to'=>jid.bare},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSub},\n x('subscriptions')\n )\n )\n send_iq_stanza_fibered iq\n end", "def subscriptions()\n return MicrosoftGraph::Subscriptions::SubscriptionsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def subscribe\n Socky.send( {:action => \"subscribe\",\n :channel => params[:channel],\n :client => (params[:client_id] || '')}.to_json)\n render :text => \"ok\"\n end", "def all_subscriptions(&block)\n subscriptions.list(&block)\n end", "def subscription(options = {})\n Subscription.new(options.merge(:url => url)).to_hash\n end", "def index\n @vendor_subscriptions = VendorSubscription.all\n end", "def subscriber_list(statuspage_id)\n request :method => :get,\n :url => @url + 'subscriber/list/' + statuspage_id\n end", "def subscription\n Zapi::Models::Subscription.new\n end", "def subscribed(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Recipients/Subscribed\", params: params)\n end", "def subscriptions; end", "def subscriptions; end", "def subscriptions; end", "def index\n if @view = params[:view].allow(ALLOWED_VIEW)\n unless @subscriptions = Subscription.try(@view)\n raise_404\n end\n else\n @subscriptions = Subscription.all\n end\n end", "def subscription(id)\n Sensit::Api::Subscription.new id, @http_client\n end", "def index\n @subscriptions = current_user.subscriptions.select{|s| s.manga !=nil && s.manga.display_name != nil && s.manga.name!=nil}.sort_by{|s| s.manga.display_name}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def subscriptions\n @channels\n end", "def index\n @misuration_subscriptions = current_user.misuration_subscriptions.all\n end", "def index\n @subscriptions = @screen.subscriptions.where(field_id: @field.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @subscriptions }\n end\n end", "def subscriptions\n # subscriber entries are embedded in subscriptions inside of an\n # org. We'll flip this, so that we only return subscriber entries\n # for the account\n orgs = Org.all(:conditions=>{ \"subscriptions.subscribers.account_id\"=> self.id})\n subscribers = []\n orgs.each do |org|\n org.subscriptions.each do |subscription|\n subscribers += subscription.subscribers.select { |subscriber| subscriber.account_id.to_s == self.id.to_s }\n end\n end\n subscribers.flatten!\n subs = []\n subscribers.each do |subscriber|\n subscript = subscriber.subscription\n org = subscript.org\n subs << AccountSubscription.new(org.id.to_s, org.name, subscript.product, subscript.billing_level, subscriber.role)\n end\n subs\n end", "def list_topics_subscriptions topic, options = {}\n publisher.list_topic_subscriptions topic: topic_path(topic, options),\n page_size: options[:max],\n page_token: options[:token]\n end", "def all\n get(\"#{domain}/unsubscribes\")\n end", "def index\n @user_to_channel_subscriptions = UserToChannelSubscription.all\n end", "def get_subscription\n @subscriptions = Subscription.all\n @my_subscription = current_user.user_subscriptions.includes(:subscription).where(\"user_subscriptions.id = ? and user_subscriptions.status = ?\", params[:id], \"active\").first\n\n if @my_subscription.blank?\n\n respond_to do |format|\n format.html{ flash[:error] = \"Sorry, You are not authorized for this subscription.\" }\n format.js{ render js: %{location.reload();} }\n end\n\n redirect_to main_app.profile_users_path and return\n end\n\n end", "def get_all_subscriptions(opts = {})\n data, _status_code, _headers = get_all_subscriptions_with_http_info(opts)\n return data\n end", "def subscribed_subreddits(options = {})\n options = options.clone\n\n category = options[:category] or 'subscriber'\n path = \"subreddits/mine/#{category}.json\"\n options.delete :category\n\n objects_from_response(:get, path, options)\n end", "def subscriber(id_or_email)\n make_json_api_request :get, \"v2/#{account_id}/subscribers/#{CGI.escape id_or_email}\"\n end", "def get(subscription_key)\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::GET_SUBSCRIPTION.gsub(\"{subscription-key}\", ERB::Util.url_encode(subscription_key))\n\n puts \"========== GET A SUBSCRIPTION ============\"\n\n begin\n @z_client.get(args) do |resp|\n ap resp\n return resp if resp.httpStatusCode.to_i == 200 && resp.success\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n\n nil\n end", "def index\n @category_subscriptions = CategorySubscription.all\n end" ]
[ "0.8178023", "0.8074406", "0.79446816", "0.76912534", "0.7649479", "0.7582659", "0.75117826", "0.74919003", "0.7431205", "0.7413858", "0.7406451", "0.7406451", "0.7404672", "0.738646", "0.73743445", "0.73743445", "0.73651445", "0.7320728", "0.7301819", "0.72662437", "0.7265766", "0.7195162", "0.7184147", "0.7113955", "0.7113955", "0.7113955", "0.71054554", "0.7095867", "0.7078698", "0.7072534", "0.7031681", "0.7025772", "0.7025772", "0.7025772", "0.7025772", "0.7020045", "0.70176184", "0.7016675", "0.6999992", "0.6988425", "0.69846886", "0.69742465", "0.69500417", "0.6939474", "0.6935429", "0.690636", "0.68932086", "0.68874836", "0.6886437", "0.6856487", "0.6844775", "0.6840027", "0.6822336", "0.6818025", "0.6811951", "0.68116045", "0.6803229", "0.67462087", "0.67418385", "0.6721472", "0.67172396", "0.669867", "0.66753066", "0.667493", "0.66451836", "0.66382444", "0.6633636", "0.66244644", "0.6604636", "0.65986145", "0.65986145", "0.6588578", "0.65870994", "0.65748864", "0.65720755", "0.65663576", "0.65495396", "0.6542188", "0.65269655", "0.65197796", "0.6517936", "0.6505175", "0.6505175", "0.6505175", "0.64954746", "0.6490323", "0.6472775", "0.646959", "0.64678687", "0.6466212", "0.6464444", "0.6449097", "0.6438768", "0.6434516", "0.6429372", "0.6405555", "0.6404456", "0.6381319", "0.63799196", "0.6373272" ]
0.6976334
41
GET /subscriptions/1 GET /subscriptions/1.json
def show _render member: @subscription, flag: :complete end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptions\n url = url_with_api_version(@base_url, 'subscriptions')\n resp = rest_get(url)\n JSON.parse(resp.body)[\"value\"]\n end", "def show\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def list_subscriptions(user)\n get(\"/#{user}/lists/subscriptions.json\")\n end", "def all_subscriptions\n get(url_(\"subscription\"))\n end", "def list_my_subscriptions() path = \"/api/v2/utilities/subscriptions\"\n get(path, {}, AvaTax::VERSION) end", "def index\n @subscriptions = current_user.subscriptions.order(:created_at)\n @user = current_user\n\n if not current_user.fitbit.nil?\n begin\n @fitbit_subscriptions = JSON.parse(current_user.fitbit.client.get('/1/user/-/apiSubscriptions.json').body)['apiSubscriptions']\n rescue SocketError\n logger.error \"Can not talk to fitbit\"\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def get_subscriptions(id:, order: nil)\n if order\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions?order=#{uri_encode(order)}\")\n else\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions\")\n end\n end", "def get_subscriptions(id:, order: nil)\n if order\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions?order=#{uri_encode(order)}\")\n else\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions\")\n end\n end", "def user_vendor_subscriptions\n get(\"/api/v1/oauth_user_vendor_subscriptions.json\")\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\r\n @subscription = Subscription.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def index\n if params[:client_id].blank?\n @subscriptions = Subscription.all\n else\n @subscriptions = Client.find(params[:client_id]).subscriptions\n end\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :guid => HttpClient::Preconditions.assert_class_or_nil('guid', HttpClient::Helper.to_uuid(opts.delete(:guid)), String),\n :organization_key => HttpClient::Preconditions.assert_class_or_nil('organization_key', opts.delete(:organization_key), String),\n :user_guid => HttpClient::Preconditions.assert_class_or_nil('user_guid', HttpClient::Helper.to_uuid(opts.delete(:user_guid)), String),\n :publication => HttpClient::Preconditions.assert_class_or_nil('publication', opts[:publication].nil? ? nil : (opts[:publication].is_a?(Apidoc::Models::Publication) ? opts.delete(:publication) : Apidoc::Models::Publication.apply(opts.delete(:publication))), Apidoc::Models::Publication),\n :limit => HttpClient::Preconditions.assert_class_or_nil('limit', opts.delete(:limit), Integer),\n :offset => HttpClient::Preconditions.assert_class_or_nil('offset', opts.delete(:offset), Integer)\n }.delete_if { |k, v| v.nil? }\n @client.request(\"/subscriptions\").with_query(query).get.map { |hash| Apidoc::Models::Subscription.new(hash) }\n end", "def get_subscription(subscription_id)\n get(url_(\"subscription\", subscription_id))\n end", "def index\r\n @subscriptions = current_business_user.subscriptions.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @subscriptions }\r\n end\r\n end", "def index\n @api_subscriptions = Api::Subscription.all\n end", "def subscription\n ret = nil\n if type == 'S'\n ret = @mc2p.subscription('id' => @json_body['id'])\n ret.retrieve\n end\n ret\n end", "def show\n json_response(@user_subscription)\n end", "def index\n @subscriptions = current_user.subscriptions.all\n end", "def list_subscription\n response = Faraday.get(@subscription_api_url)\n response_json = JSON.parse(response.body)\n fix_response(response_json)\n end", "def index\n @my_subscriptions = current_user.active_subscriptions\n end", "def index\n @subscriptions = Subscription.where(:binder_id => params[:binder_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def subscriptions( params={} )\n subscriptions = get_connections(\"subscriptions\", params)\n return map_connections subscriptions, :to => Facebook::Graph::Subscription\n end", "def index\n @subscriptions = Subscription.all\n end", "def index\n @subscriptions = Subscription.all\n end", "def index\n @subscriptions = Subscription.all\n end", "def get_subscription subscription_name, options = {}\n subscriber.get_subscription subscription: subscription_path(subscription_name, options)\n end", "def list_subs\n \t@subs = instagram_client.subscriptions\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @subscription }\n end\n end", "def subscription_info(subscription_id = @subscription_id)\n url = url_with_api_version(@base_url, 'subscriptions', subscription_id)\n resp = rest_get(url)\n JSON.parse(resp.body)\n end", "def subscriptions(page = 1)\n Dropio::Resource.client.subscriptions(self, page)\n end", "def show_single_webhook_subscription(id,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n \n\n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:get, path, query_params, form_params, headers)\n response\n \n\n end", "def new\n @subscription = current_user.subscriptions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @list_subscription = ListSubscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_subscription }\n end\n end", "def subscriptions\n update_subscriptions(params[:types]) if params[:types]\n @types = build_notification_types\n render :json => @types\n end", "def subscriptions(user_id)\n response = rest_client.get(signature_url(\"/subscription/?user_id=#{user_id}\"))\n process_response(response)\n end", "def index\n @crytosubscriptions = Crytosubscription.all\n end", "def index\n\n @category_subscriptions = CategorySubscription.all\n\n render json: @category_subscriptions\n\n end", "def index\n\n if @notification\n json_response(@notification.user_subscriptions)\n end\n if request.path_parameters.has_key?(:user_id)\n json_response(@user.user_subscriptions)\n end\n end", "def subscription(id)\n Sensit::Api::Subscription.new id, @http_client\n end", "def subscription\n Zapi::Models::Subscription.new\n end", "def subscribe\n Socky.send( {:action => \"subscribe\",\n :channel => params[:channel],\n :client => (params[:client_id] || '')}.to_json)\n render :text => \"ok\"\n end", "def show_subscriptions\n puts \"\\nYour current subscriptions are:\"\n @user.subscriptions.reload.each do |sub|\n puts sub.name\n end\n end", "def index\n session[:sub_delete_return_to] = request.fullpath\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def list_subscriptions(options = {})\n api.graph_call(subscription_path, {}, \"get\", options)\n end", "def subscriptions\n @subscriptions ||= {}\n end", "def index\n if is_client_app?\n if params[:user_id].present?\n t = Subscription.arel_table\n s = Subscription.statuses\n @subscriptions = Subscription.where(user_id: params[:user_id]).where(t[:status].eq(s[:authorized]).or(t[:status].eq(s[:paused])))\n else\n @subscriptions = Subscription.all\n end\n\n render json: @subscriptions\n else\n response.headers['X-Total-Count'] = @subscriptions.count.to_s\n @subscriptions = @subscriptions.page(params[:page]) if params[:page].present?\n @subscriptions = @subscriptions.per(params[:per]) if params[:per].present?\n\n _render collection: @subscriptions, flag: params[:flag].try(:to_sym)\n end\n end", "def get_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionApi.get_subscriptions ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10000000\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling SubscriptionApi.get_subscriptions, must be smaller than or equal to 10000000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling SubscriptionApi.get_subscriptions, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling SubscriptionApi.get_subscriptions, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling SubscriptionApi.get_subscriptions, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = \"/v1/subscription\"\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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 = ['basicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionSearch')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionApi#get_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @subscription_request = SubscriptionRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription_request }\n end\n end", "def get_all_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionsApi.get_all_subscriptions ...\"\n end\n # resource path\n local_var_path = \"/subscriptions\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'uid'] = opts[:'uid'] if !opts[:'uid'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].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 = ['artikcloud_oauth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionsEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionsApi#get_all_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @subscriptions = Subscription.all\nend", "def subscriptions\n @subscriptions ||= begin\n resp = @client.access_token.get('/reader/api/0/subscription/list?output=json')\n raise \"unable to retrieve the list of subscription for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n JSON.parse(resp.body)['subscriptions'].collect do |hash|\n Google::Reader::Subscription.new(hash.merge({:client => @client}))\n end\n end\n end", "def get(subscription_key)\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::GET_SUBSCRIPTION.gsub(\"{subscription-key}\", ERB::Util.url_encode(subscription_key))\n\n puts \"========== GET A SUBSCRIPTION ============\"\n\n begin\n @z_client.get(args) do |resp|\n ap resp\n return resp if resp.httpStatusCode.to_i == 200 && resp.success\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n\n nil\n end", "def user_subscriptions(user_id, options={})\n response = connection.get do |req|\n req.url \"/user/#{user_id}/subscriptions\", simple_params(options)\n end\n response.body\n end", "def index\n @subscriptions = @user.subscriptions.order(updated_at: :desc)\n end", "def get_subscription\n @subscriptions = Subscription.all\n @my_subscription = current_user.user_subscriptions.includes(:subscription).where(\"user_subscriptions.id = ? and user_subscriptions.status = ?\", params[:id], \"active\").first\n\n if @my_subscription.blank?\n\n respond_to do |format|\n format.html{ flash[:error] = \"Sorry, You are not authorized for this subscription.\" }\n format.js{ render js: %{location.reload();} }\n end\n\n redirect_to main_app.profile_users_path and return\n end\n\n end", "def retrieve_subscription(subscription_id:,\n include: nil)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .query_param(new_parameter(include, key: 'include'))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def get_subscriptions\n get_subscriptions_from(@nodename)\n end", "def subscription(repo, options = {})\n get \"#{Repository.path repo}/subscription\", options\n end", "def get_subscriptions(opts = {})\n data, _status_code, _headers = get_subscriptions_with_http_info(opts)\n return data\n end", "def index\n @panel_subscriptions = Panel::Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @panel_subscriptions }\n end\n end", "def index\n @subscriptions = nil #the load_and_authorize_resource cancan method is loading all the subscriptions and we want to start with a clean slate here.\n if params[:company_id]\n @owner = Company.find(params[:company_id])\n @subscriptions = Subscription.where(owner_type: 'Company', owner_id: params[:company_id])\n end\n if params[:person_id]\n @owner = Person.find(params[:person_id])\n @subscriptions ||= Subscription.where(owner_type: 'Person', owner_id: params[:person_id])\n end\n \n @subscriptions ||= Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def index\n @q = ::Pushar::Core::Subscription.unscoped.search(params[:q])\n @q.sorts = 'created_at desc' if @q.sorts.empty?\n @subscriptions = @q.result(distinct: true).page(params[:page]).per(50)\n end", "def show\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscriber }\n end\n end", "def show\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscriber }\n end\n end", "def show\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscriber }\n end\n end", "def show\n\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscriber }\n end\n end", "def subscription\n subscriptions.last\n end", "def index\n # TODO pull out api key before pushing to github & pull out binding prys\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 subId = message[:data][0][:id]\n else\n # Port is open in our router\n params = { url: SUBSCRIPTION_URL, events: ['invitee.created', 'invitee.canceled'] }\n newRes = HTTParty.post URL, body: params, headers: HEADERS\n message = JSON.parse newRes.body, symbolize_names: true\n # TODO need error handling\n subId = message[:id]\n end\n end\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def new\r\n @subscription = Subscription.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def index\n @subscriptions = @screen.subscriptions.all\n auth!\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def subscriber_list(statuspage_id)\n request :method => :get,\n :url => @url + 'subscriber/list/' + statuspage_id\n end", "def index\n @subscriptions = @screen.subscriptions.where(field_id: @field.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @subscriptions }\n end\n end", "def subscriber(id_or_email)\n make_json_api_request :get, \"v2/#{account_id}/subscribers/#{CGI.escape id_or_email}\"\n end", "def show\n @subscription = Subscription.find(params[:id])\n @product_subscription = ProductSubscription.new\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @subscription }\n end\n end", "def show\n @panel_subscription = Panel::Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @panel_subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def subscription(options = {})\n Subscription.new(options.merge(:url => url)).to_hash\n end", "def subscriptions; end", "def subscriptions; end", "def subscriptions; end", "def index\n @admin_subscriptions = Subscription.all\n end", "def show\n @product_subscription = ProductSubscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product_subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @subscription }\n end\n end", "def show\n render json: @event_subscription\n end", "def index\n\t\tindex_\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @subscriptions }\n\t\tend\n\tend", "def getAllSubscriptions\n if @subscriptionLists.hasKey(\"subscriptions\")\n return @subscriptionLists.getRepositoryObject(\"subscriptions\").getObject\n end\n end", "def fetch_subscription(_params) \n subscription_id = _params['subscription_id']\n if subscription_id.blank? == true \n return false\n end \n begin\n result = ChargeBee::Subscription.retrieve(subscription_id)\n session[:subscription_id] = result.subscription.id\n session[:customer_id] = result.customer.id\n return true\n rescue ChargeBee::APIError => e\n if e.api_error_code == \"resource_not_found\"\n return false\n end\n throw e\n end\n end" ]
[ "0.7863251", "0.7584557", "0.7584557", "0.75726175", "0.7567996", "0.74486554", "0.734854", "0.73362416", "0.73362416", "0.72566754", "0.7242567", "0.7242567", "0.7242567", "0.7242567", "0.7234481", "0.7231595", "0.7203714", "0.71969527", "0.71899897", "0.7187209", "0.71870315", "0.711318", "0.70950603", "0.7082423", "0.7060377", "0.6973603", "0.69719666", "0.69619215", "0.696152", "0.6906217", "0.6900038", "0.6900038", "0.6900038", "0.6895415", "0.6874827", "0.6862697", "0.6858457", "0.6856422", "0.6851238", "0.6823961", "0.68203557", "0.68178785", "0.6781567", "0.677967", "0.67617476", "0.67599726", "0.67449135", "0.67446285", "0.6733885", "0.67262095", "0.67227983", "0.6694661", "0.6689392", "0.6689059", "0.6683082", "0.6680209", "0.6680048", "0.6671432", "0.6669847", "0.664933", "0.66476315", "0.6645022", "0.6621229", "0.6619605", "0.6609451", "0.66014886", "0.6563858", "0.65636194", "0.656227", "0.65251046", "0.65084636", "0.65084636", "0.65084636", "0.6507569", "0.64974153", "0.64810157", "0.6480742", "0.6480742", "0.6478299", "0.6469003", "0.6458722", "0.645692", "0.645649", "0.64495987", "0.6449502", "0.6448456", "0.6448456", "0.6448456", "0.6448456", "0.6448456", "0.6439214", "0.64347833", "0.64347833", "0.64347833", "0.6429507", "0.64251405", "0.64228565", "0.6418859", "0.640681", "0.64016455", "0.63941866" ]
0.0
-1
POST /subscriptions POST /subscriptions.json
def create @subscription = Subscription.new(subscription_params) if @subscription.save render json: @subscription, status: :created, location: @subscription else render json: @subscription.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n megam_rest.post_subscriptions(to_hash)\n end", "def post body=nil, headers={}\n @connection.post \"subscriptions.json\", body, headers\n end", "def create\n s_params = params[:subscription]\n s_params.delete(:id)\n @subscription = Subscription.new(s_params)\n @subscription.save\n respond_with(@subscription)\n end", "def create / update_subscriptions\n end", "def post(subscription_form)\n HttpClient::Preconditions.assert_class('subscription_form', subscription_form, Apidoc::Models::SubscriptionForm)\n @client.request(\"/subscriptions\").with_json(subscription_form.to_json).post { |hash| Apidoc::Models::Subscription.new(hash) }\n end", "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: (I18n.t :subscription_created) }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = @target.create_subscription(subscription_params)\n return_back_or_ajax\n end", "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_url, notice: 'Subscription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subscription }\n else\n format.html { render action: 'new' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscriptions\n Subscription.create_subscriptions(self.id, self.hashtag)\n end", "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.user = current_user\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: t('controller.successfully_created', model: t('activerecord.models.subscription')) }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.create(params[:subscription])\n gb = Gibbon::API.new(\"6f8672a5c2393d1441c54d3be3fb79a1-us1\")\n gb.lists.subscribe({:id => \"c0ca5b3d41\", :email => {:email => params[:subscription][:email]}, :merge_vars => {:FNAME => '', :LNAME => ''}, :double_optin => false})\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n record_activity :create, @subscription\n format.html { redirect_to edit_subscription_path(@subscription),\n notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to campaign_subscription_path(@campaign, @subscription), :notice => 'Subscription was successfully created.' }\n format.json { render :json => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n # params[:id] is the knowmadics id\n\n @api_subscription = Api::Subscription.new(api_subscription_params)\n\n respond_to do |format|\n if @api_subscription.save\n format.html { redirect_to @api_subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @api_subscription }\n else\n format.html { render :new }\n format.json { render json: @api_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_new_subscription\n @subscription_offers = Subscription.get_subscription_list\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n\t\n if @subscription.valid? && @subscription.save\n\t SubscriptionMailer.delay.send_welcome(@subscription)\n\t \n format.html { redirect_to \"/subscriptions/done\", notice: 'Twoj adres zostal dodany do listy mailingowej' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to thanks_path, notice: 'Subscription was successfully created.' }\n else\n format.html { redirect_to root_path }\n end\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to Binder.find(@subscription.binder_id), notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categories = Category.all\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n\t @subscription.update(ordinal: Subscription.count)\n SubscriptionMailer.with(subscription: @subscription, new: \"true\").notification_email.deliver_now\n format.html { render :subscription_judging, notice: '加盟店サブスクショップの審査申請しました' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n@subscription = current_user.subscriptions.build(subscription_params)\n\nrespond_to do |format|\n if @subscription.save\n\n format.html { redirect_to user_profile_url(current_user.id), notice: 'Pet was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend", "def subscriptions\n update_subscriptions(params[:types]) if params[:types]\n @types = build_notification_types\n render :json => @types\n end", "def create_subscription\n session[:merchant_subscription_id] = 'User' + sprintf('%03d', rand(1000)) + 'Subscription' + sprintf('%04d', rand(10000))\n\n # prepare payload\n data = {\n :Amount => params[:product] == '1' ? 1.99 : 3.99,\n :Category => 1,\n :Channel => 'MOBILE_WEB',\n :Description => 'Word game 1',\n :MerchantTransactionId => session[:merchant_subscription_id],\n :MerchantProductId => 'wordGame1',\n :MerchantPaymentRedirectUrl => settings.subscription_redirect_url,\n :MerchantSubscriptionIdList => 'sampleSubscription1',\n :IsPurchaseOnNoActiveSubscription => 'false',\n :SubscriptionRecurringNumber => '99999',\n :SubscriptionRecurringPeriod => 'MONTHLY',\n :SubscriptionRecurringPeriodAmount => 1\n }\n\n response = RestClient.post settings.notary_app_sign_url, :payload => data.to_json\n from_json = JSON.parse response\n\n redirect settings.FQDN + \"/Commerce/Payment/Rest/2/Subscriptions?clientid=#{settings.api_key}&SignedPaymentDetail=#{from_json['signed_payload']}&Signature=#{from_json['signature']}\"\nend", "def create\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.transaction, notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n @subscription.created_at = Time.new\n # always use current user\n @subscription.user_id = current_user.id\n @subscription.subscription_id = current_user.id.to_s\n respond_to do |format|\n if not current_user.fitbit.nil?\n if @subscription.save\n path = ['/1/user/-', @subscription.collection_path, 'apiSubscriptions', @subscription.subscription_id + '-' + @subscription.collection_path]\n api = JSON.parse(current_user.fitbit.client.post(path.join('/') + '.json').body)\n flash[:success] = 'Subscription was successfully created.' \n format.html { redirect_to @subscription }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n flash[:error] << @subscription.errors\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n\tend\n else\n flash[:error] = 'You are not connected to Fitbit.'\n format.html { redirect_to @subscription }\n format.json { render json: @subscription, status: :unprocessable_entity }\n end\n end\n end", "def create\n@subscription = current_user.subscriptions.build(subscription_params)\n\nrespond_to do |format|\n if @subscription.save\n\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n\nend\n\n# PATCH/PUT /subscriptions/1\n# PATCH/PUT /subscriptions/1.json\ndef update\nrespond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend\n\n# DELETE /subscriptions/1\n# DELETE /subscriptions/1.json\ndef destroy\n@subscription.destroy\nrespond_to do |format|\n format.html { redirect_to :back, notice: 'Your pet was successfully destroyed.' }\n format.json { head :no_content }\nend\n\nprivate\n# Use callbacks to share common setup or constraints between actions.\ndef set_subscription\n @subscription = Subscription.find(params[:id])\nend\n\n# Never trust parameters from the scary internet, only allow the white list through.\ndef subscription_params\n params.require(:subscription).permit(:title, :company, :url, :start_time, :end_time, :phone_number, :time, :pet_name, :breed, :animal, :notes, :pet_image, :option_1, :option_2, :gender)\nend\n\ndef correct_user\n @subscriptions = current_user.subscriptions.find_by(id: params[:id])\n redirect_to users_profile_url, notice: \"Not authorized to edit this pet\" if @subscription.nil?\nend\n\nend\nend", "def create\n @subscription = Subscription.new(params[:subscription])\n\n if params.has_key?(:new_service_id)\n service = Service.find(params[:new_service_id])\n unless service.nil?\n @subscription.service_id = service.id\n @subscription.costs = service.costs\n @subscription.user_id = current_user.id\n end\n end\n\n respond_to do |format|\n if @subscription.save\n flash[:success] = \"Subscription was successfully created.\"\n format.html { redirect_to @subscription }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n unless service.nil?\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n else\n flash[:error] = \"Subscription was not successful.\"\n format.html redirect_to services_path\n end\n end\n end\n end", "def new\n @subscription = current_user.subscriptions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def create\n\t\t@subscription = Subscription.new(params[:subscription])\n\t\trespond_to do |format|\n\t\t\tif fonct_new_dup?\n\t\t\t\tobject_orig=Subscription.find(params[:object_orig_id])\n\t\t\tst = @subscription.create_duplicate(object_orig)\n\t\t\telse\n\t\t\tst = @subscription.save\n\t\t\tend\n\t\t\tif st\n\t\t\t\t#format.html { redirect_to(@subscription, :notice => 'Subscription was successfully created.') }\n\t\t\t\tflash[:notice] = 'Subscription was successfully created.'\n\t\t\t\tparams[:id]= @subscription.id\n\t\t\t\tshow_\n\t\t\t\tformat.html { render :action => \"show\" }\n\t\t\t\tformat.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n\t\t\telse\n\t\t\t\t@ingroups = Group.all\n\t\t\t\t@inprojects = Project.all\n\t\t\t\t@fortypesobjects=Typesobject.get_from_observer\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n if session[:user_id] \n user = User.find(session[:user_id])\n s = Subscription.new\n s.url = params[:subscription][:url]\n s.title = params[:subscription][:title]\n s.user = user\n @subscription = s\n \n respond_to do |format|\n if @subscription.save\n format.html { redirect_to(@subscription, :notice => 'Subscription was successfully created.') }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def create\r\n @subscription = Subscription.new(subscription_params)\r\n @subscription.business_user_id = current_business_user.id\r\n respond_to do |format|\r\n if @subscription.save\r\n format.html { redirect_to business_user_subscriptions_path, notice: 'Subscription was successfully created.' }\r\n format.json { render json: @subscription, status: :created, location: @subscription }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @subscription = current_user.subscriptions.new\n manga = Manga.find(params[:manga_id])\n\t\t@subscription.manga_id=manga.id\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to mangas_path, notice: 'Successfully subscribed to '+ manga.display_name.to_s}\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_subscribe = Admin::Subscribe.new(admin_subscribe_params)\n\n respond_to do |format|\n if @admin_subscribe.save\n format.html { redirect_to root_path, notice: 'Subscribe was successfully created.' }\n format.json { render :show, status: :created, location: @admin_subscribe }\n else\n format.html { render root_path }\n format.json { render json: @admin_subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription(body:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/subscriptions'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.post(\n _query_url,\n headers: _headers,\n parameters: body.to_json\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def subscribe!\n Subscription.transaction do\n subscription = create_stripe_subscription!\n store.subscriptions.create!(\n customer: user,\n stripe_plan_id: stripe_plan_id,\n stripe_id: subscription.id,\n first_date: Date.today,\n status: :active\n )\n end\n end", "def create\n @panel_subscription = Panel::Subscription.new(params[:panel_subscription])\n\n respond_to do |format|\n if @panel_subscription.save\n format.html { redirect_to(@panel_subscription, :notice => 'Subscription was successfully created.') }\n format.json { render :json => @panel_subscription, :status => :created, :location => @panel_subscription }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @panel_subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create(params)\n params[:tag] ||= '*'\n post(\"#{domain}/unsubscribes\", params)\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n @subscription.owner = Company.find(params[:company_id]) if params[:company_id]\n @subscription.owner = Person.find(params[:person_id]) if params[:person_id]\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.owner, notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @subscription = Subscription.new(params[:subscription])\n @subscription.quantity = @subscription.subscription_type.number_of_issues\n @subscription.unit_cost = @subscription.subscription_type.unit_cost\n \n respond_to do |format|\n if @subscription.save\n flash[:notice] = 'Subscription was successfully created.'\n format.html { redirect_to(@subscription) }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::POST_SUBSCRIPTION\n\n args.req_body = ZAPIArgs.new\n args.req_body.accountKey = SAMPLE_ACCOUNT_KEY\n args.req_body.contractEffectiveDate = '2013-02-1'\n args.req_body.termType = 'TERMED'\n args.req_body.initialTerm = '12'\n args.req_body.autoRenew = true\n args.req_body.renewalTerm = \"3\"\n args.req_body.notes = 'Test POST subscription from z-ruby-sdk'\n args.req_body.subscribeToRatePlans = []\n args.req_body.subscribeToRatePlans[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].productRatePlanId = 'ff8080811ca15d19011cdda9b0ad3b51'\n args.req_body.subscribeToRatePlans[0].chargeOverrides = []\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].productRatePlanChargeId =\n 'ff8080811ca15d19011cddad8c953b53'\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].quantity = 10\n args.req_body.invoiceTargetDate = '2013-12-31'\n args.req_body.invoiceCollect = false\n\n puts \"========== CREATE A SUBSCRIPTION ============\"\n\n begin\n @z_client.post(args) do |resp|\n ap resp\n return resp.subscriptionNumber if resp.httpStatusCode.to_i == 200 && resp.success\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n\n nil\n end", "def create_webhook_subscription(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/webhooks/subscriptions',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def create\n @subscribe = Subscribe.new(subscribe_params)\n\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to @subscribe, notice: t('controller.successfully_created', model: t('activerecord.models.subscribe')) }\n format.json { render json: @subscribe, status: :created, location: @subscribe }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription(options)\n stripe_service.create_subscription(options)\n end", "def create\n @subscribe = Subscribe.new(subscribe_params)\n\n respond_to do |format|\n if @subscribe.save\n format.html {redirect_to @subscribe, notice: 'Subscribe was successfully created.'}\n format.json {render json: @subscribe, status: :created}\n else\n format.html {render :new}\n format.json {render json: @subscribe.errors, status: :unprocessable_entity}\n end\n end\n end", "def create\n @subscriber = Subscriber.new(subscriber_params)\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to root_path, notice: 'Thank You For Subscribing!' }\n format.json { render :show, Subscribe.create(subscriber_params)}\n else\n format.html { redirect_to root_path, notice: 'There was a problem with the subscription' }\n format.json { render :json => @subscriber.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.activity :params => {:composite_key => \"#{@subscription.game_id},#{@subscription.player_id}\"}\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.game, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription_params\n params.require(:subscription).permit(:subscribed_id)\n end", "def subscribe\n Socky.send( {:action => \"subscribe\",\n :channel => params[:channel],\n :client => (params[:client_id] || '')}.to_json)\n render :text => \"ok\"\n end", "def create_webhook_subscription(submission___context_id__,subscription___context_type__,subscription___event_types__,subscription___format__,subscription___transport_metadata__,subscription___transport_type__,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n :submission___context_id__,\n :subscription___context_type__,\n :subscription___event_types__,\n :subscription___format__,\n :subscription___transport_metadata__,\n :subscription___transport_type__,\n \n\n ]\n\n # verify existence of params\n raise \"submission___context_id__ is required\" if submission___context_id__.nil?\n raise \"subscription___context_type__ is required\" if subscription___context_type__.nil?\n raise \"subscription___event_types__ is required\" if subscription___event_types__.nil?\n raise \"subscription___format__ is required\" if subscription___format__.nil?\n raise \"subscription___transport_metadata__ is required\" if subscription___transport_metadata__.nil?\n raise \"subscription___transport_type__ is required\" if subscription___transport_type__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :submission___context_id__ => submission___context_id__,\n :subscription___context_type__ => subscription___context_type__,\n :subscription___event_types__ => subscription___event_types__,\n :subscription___format__ => subscription___format__,\n :subscription___transport_metadata__ => subscription___transport_metadata__,\n :subscription___transport_type__ => subscription___transport_type__\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions\",\n )\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:post, path, query_params, form_params, headers)\n response\n \n\n end", "def create \n @subscription = Subscription.new(params[:subscription])\n \n uri = URI.parse(request.env[\"HTTP_REFERER\"])\n unless %w{ app.atra.obra.org localhost app.americantrackracing.com raceatra.com www.raceatra.com}.include?(uri.host)\n flash[:notice] = \"Cannot send request from '#{uri.host}'\"\n return render(:action => \"new\")\n end\n\n if @subscription.valid?\n email = SubscriptionMailer.create_subscription_request(@subscription)\n SubscriptionMailer.deliver(email)\n redirect_to(:action => \"subscribed\")\n else\n render(:action => \"new\")\n end\n end", "def create\n @service = Service.find(params[:service_id])\n \n @service_subscription = current_user.subscribe(@service, params[:service_subscription])\n \n if @service_subscription && @service_subscription.errors.empty?\n redirect_to service_subscriptions_path, :success => \"You have subscribed to the service!\"\n else\n render :action => :new\n end\n \n end", "def create\n # checking a new method\n # @subscribe = Subscribe.update_sub(@item, @user)\n @subscribe = Subscribe.new(subscribe_params)\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to @subscribe}#, notice: 'Subscribe was successfully created.' }\n format.json { render :show, status: :created, location: @subscribe }\n else\n format.html { render :new }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription_user = SubscriptionUser.new(subscription_user_params)\n\n respond_to do |format|\n if @subscription_user.save\n format.html { redirect_to @subscription_user, notice: 'Subscription user was successfully created.' }\n format.json { render :show, status: :created, location: @subscription_user }\n else\n format.html { render :new }\n format.json { render json: @subscription_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription_params\n params.require(:subscriptions).permit(:venue_name, :user_id)\n end", "def subscribe!(params)\n raise Errors::AlreadySubscribedError if subscribed?\n raise Errors::StripeCustomerExistsError if stripe_customer_id\n\n customer = ::Stripe::Customer.create(\n source: params[:stripe_token],\n plan: params[:subscription_plan_id] || SlackRubyBotServer::Stripe.config.subscription_plan_id,\n email: params[:stripe_email],\n metadata: {\n id: id,\n team_id: team_id,\n name: name,\n domain: domain\n }\n )\n\n update_attributes!(\n subscribed: true,\n subscribed_at: Time.now.utc,\n stripe_customer_id: customer['id'],\n subscription_expired_at: nil,\n subscription_past_due_at: nil,\n subscription_past_due_informed_at: nil\n )\n\n customer\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n @subscription.screen = @screen\n @subscription.field = @field\n auth!\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to(manage_screen_field_subscriptions_path(@screen, @field), :notice => t(:subscription_created)) }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = current_user.subscriptions.create(subscription_params)\n redirect_to @playlist\n end", "def create\n @subscription_request = SubscriptionRequest.new(params[:subscription_request])\n\n respond_to do |format|\n if @subscription_request.save\n format.html { redirect_to @subscription_request, notice: 'Subscription request was successfully created.' }\n format.json { render json: @subscription_request, status: :created, location: @subscription_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category_subscription = CategorySubscription.new(category_subscription_params)\n\n respond_to do |format|\n if @category_subscription.save\n format.html { redirect_to @category_subscription, notice: 'Category subscription was successfully created.' }\n format.json { render :show, status: :created, location: @category_subscription }\n else\n format.html { render :new }\n format.json { render json: @category_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.create(params[:subscription])\n groups = params[:subscription][:group_name].split(\",\").collect(&:strip)\n email = params[:subscription][:email]\n begin\n gb = Gibbon::API.new(\"f24fdd53217fab0b0698fdaba15c0c6f-us7\")\n subscribe = gb.lists.subscribe({\n :id => \"caa152eac4\",\n :email => {:email => email},\n :merge_vars => {\n :FNAME => \"\",\n :LNAME => \"\",\n :groupings => {\n 0 => {\n :id => 4457,\n :groups => groups\n }\n }\n },\n :update_existing => true,\n :double_optin => false\n })\n #logger.debug subscribe\n rescue Gibbon::MailChimpError\n \n end\n redirect_to \"/contact\"\n end", "def create\n @subscription_type = SubscriptionType.new(subscription_type_params)\n\n respond_to do |format|\n if @subscription_type.save\n format.html { redirect_to @subscription_type, notice: 'Subscription types was successfully created.' }\n format.json { render :show, status: :created, location: @subscription_type }\n else\n format.html { render :new }\n format.json { render json: @subscription_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscribe\n @subscription.subscribe(with_email_subscription: params[:with_email_subscription].to_s.to_boolean(ActivityNotification.config.subscribe_to_email_as_default),\n with_optional_targets: params[:with_optional_targets].to_s.to_boolean(ActivityNotification.config.subscribe_to_optional_targets_as_default))\n return_back_or_ajax\n end", "def new\r\n @subscription = Subscription.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def subscribe\n \nend", "def create\n @list_subscription = ListSubscription.new(params[:list_subscription])\n\n respond_to do |format|\n if @list_subscription.save\n format.html { redirect_to @list_subscription, notice: 'List subscription was successfully created.' }\n format.json { render json: @list_subscription, status: :created, location: @list_subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @list_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n @subscription.sub_create(current_user,subscription_params[:stripe_plan_id],subscription_params[:coupon_code])\n\n # Create a subscription with the following information:\n #\n # 1) Customer Account\n # 2) Subscription Type (GOLD, Silver, etc.)\n # 3) Discount Coupom (if applicable)\n\n if @subscription.save\n redirect_to @subscription, notice: 'Subscription was successfully created.'\n else\n @verrors = @subscription.errors.full_messages\n render 'new'\n end\n end", "def subscribe\n @podcast = Podcast.where(:id => params[:id]).first\n unless Subscription.where(:user_id => current_user.id, :podcast_id => params[:id]).size > 0\n @subscription = Subscription.new(:user_id => current_user.id, :podcast_id => params[:id])\n if @subscription.save\n puts \"Subscription successfully created!\"\n redirect_to @podcast, :notice => \"successfully subscribed!\"\n # render :layout => false\n else\n puts \"Subscription failed to be created!\"\n render :layout => false\n end\n end\n end", "def webhook_subscribe\n # verify the string parameters\n if params['hub.mode'] == 'subscribe' &&\n params['hub.topic'] == @feed.url &&\n params['hub.challenge'].present?\n\n @feed.status = 'subscription_requested' # 17 mins\n if params['hub.lease_seconds'].present? && params['hub.lease_seconds'].to_i > 0\n @feed.expiration_date = DateTime.now + Rational(params['hub.lease_seconds'].to_i, 86_400)\n unless @feed.save\n # log error\n logger.error \"FEED SAVE TO DB ERROR:#{@feed.inspect}\"\n end\n end\n\n render status: 200, plain: params['hub.challenge']\n else\n render status: 422, plain: 'Invalid parameters'\n end\n end", "def create\n @admin_subscription = Subscription.new(admin_subscription_params)\n\n respond_to do |format|\n if @admin_subscription.save\n format.html { redirect_to [:admin, @admin_subscription], notice: 'L\\'abonnement a bien été créé !' }\n format.json { render :show, status: :created, location: @admin_subscription }\n else\n format.html { render :new }\n format.json { render json: @admin_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription(sender)\n PsegRecurring::Subscription.new(@credentials).send_subscription(sender)\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def subscription_params\n params.require(:subscription).permit(:user_id, :subscribable_id, :subscribable_type, :notification_preference)\n end", "def subscribe!\n url = \"#{GRAPH_URL}/me/subscribed_apps?access_token=#{ENV['MESSENGER_BOT_ACCESS_TOKEN']}\"\n data = RestClient.post(url, nil)\n if data\n json = JSON.parse(data)\n json['success']\n else\n false\n end\n end", "def create(params)\n params.merge!(\n :order_no => (Time.now.to_f * 10000).to_i.to_s, # Produce a unique order_no - it's not used anywhere, but ePay needs this\n :amount => 0\n )\n \n post = Api.default_post_for_params(params).merge({\n :subscription => 1,\n :subscriptionname => params[:description]\n })\n \n query = Api.authorize(post)\n \n if query['accept']\n # Return the new subscriber\n subscription = new(query[\"subscriptionid\"].to_i).reload\n \n # Set (obfuscated) card number:\n subscription.card_no = query[\"tcardno\"]\n \n subscription\n else\n new(nil, 'error' => query[\"error\"])\n end\n end", "def add_subscription(entity)\r\n subscriptions << entity\r\n end", "def create\n @subscriber = Subscriber.new(params[:subscriber])\n\n @subscriber.account = @account\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to account_subscriber_path(@account, @subscriber), notice: 'Subscriber was successfully created.' }\n format.json { render json: @subscriber, status: :created, location: @subscriber }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n subscription = @user.purchase_now(@gallery_item, @purchase_option)\n if subscription == true\n render json: { message: \"Subscribed successfully.\" } \n else\n render json: { message: \"Your can try this subscription after #{subscription}!\" }, status: 409 \n end\n end", "def subscriptions\n url = url_with_api_version(@base_url, 'subscriptions')\n resp = rest_get(url)\n JSON.parse(resp.body)[\"value\"]\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @subscription }\n end\n end", "def create\n @user_to_channel_subscription = UserToChannelSubscription.new(user_to_channel_subscription_params)\n\n respond_to do |format|\n if @user_to_channel_subscription.save\n format.html { redirect_to @user_to_channel_subscription, notice: 'User to channel subscription was successfully created.' }\n format.json { render :show, status: :created, location: @user_to_channel_subscription }\n else\n format.html { render :new }\n format.json { render json: @user_to_channel_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscribe_author\n self.subscriptions.create user_id: self.user.id\n end", "def subscribe(options, &block)\n subscriptions.create(options, &block)\n end", "def search_subscriptions(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/subscriptions/search',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def create\n @subscriber = Subscriber.new(params[:subscriber])\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully created.' }\n format.json { render json: @subscriber, status: :created, location: @subscriber }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscriptions( params={} )\n subscriptions = get_connections(\"subscriptions\", params)\n return map_connections subscriptions, :to => Facebook::Graph::Subscription\n end", "def create\n @vendor_subscription = VendorSubscription.new(vendor_subscription_params)\n\n respond_to do |format|\n if @vendor_subscription.save\n format.html { redirect_to @vendor_subscription, notice: 'Vendor subscription was successfully created.' }\n format.json { render :show, status: :created, location: @vendor_subscription }\n else\n format.html { render :new }\n format.json { render json: @vendor_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription(subscription_info, opts = {})\n data, _status_code, _headers = create_subscription_with_http_info(subscription_info, opts)\n return data\n end", "def create\n @subscriber = Subscriber.new(subscriber_params)\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully created.' }\n format.json { render :show, status: :created, location: @subscriber }\n else\n format.html { render :new }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription_with_http_info(subscription_info, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionsApi.create_subscription ...\"\n end\n # verify the required parameter 'subscription_info' is set\n fail ArgumentError, \"Missing the required parameter 'subscription_info' when calling SubscriptionsApi.create_subscription\" if subscription_info.nil?\n # resource path\n local_var_path = \"/subscriptions\".sub('{format}','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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(subscription_info)\n auth_names = ['artikcloud_oauth']\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 => 'SubscriptionEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionsApi#create_subscription\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def subscribe\n \n @conversation.subscriptions << @user unless @conversation.subscriptions.exists?(@user.id)\n @notice = \"You will now receive email notifications about new replies in this conversation.\"\n \n respond_to do |format|\n format.html {\n redirect_to(@conversation, notice: @notice) and return\n return \n }\n format.js\n end\n\n end", "def stripe_customer_subscription_created(event, req)\n stripe_customer_subscription_updated(event, req)\n end", "def test_webhook_subscription(subscription_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/webhooks/subscriptions/{subscription_id}/test',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def subscription_params\n params.require(:subscription).permit(:start_at, :finish_at, :visits, :is_active, :note, :record_client_id)\n end", "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.screen = @screen\n @subscription.field = @field\n auth!\n\n # Verify the screen can read the feed\n ability = Ability.new(@screen)\n @subscription.feed = nil if ability.cannot?(:read, @subscription.feed)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to(screen_field_subscriptions_path(@screen, @field), notice: t(:subscription_created)) }\n format.xml { render xml: @subscription, status: :created, location: @subscription }\n format.js\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @subscription.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def subscribe!(topic)\n subscriptions.create!( :topic_id => topic.id )\n end", "def create\n @subscriber = Subscriber.create(subscriber_params)\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully created.' }\n format.json { render :show, status: :created, location: @subscriber }\n else\n format.html { render :new }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription(id)\n Sensit::Api::Subscription.new id, @http_client\n end" ]
[ "0.7878452", "0.78267294", "0.7545708", "0.7432098", "0.7428383", "0.7351888", "0.7329232", "0.7227739", "0.7155769", "0.7136345", "0.7112945", "0.71125585", "0.7020447", "0.7004615", "0.69523484", "0.6893254", "0.68890435", "0.6831791", "0.68234247", "0.6818618", "0.6788453", "0.6743029", "0.67429686", "0.6736796", "0.6734205", "0.6728402", "0.6714901", "0.6683617", "0.66786546", "0.6633249", "0.66208965", "0.6610338", "0.6607992", "0.6595876", "0.65733576", "0.65546334", "0.6548585", "0.65440995", "0.65407825", "0.65320486", "0.6522251", "0.65168", "0.6514733", "0.6497595", "0.6493469", "0.64934", "0.6492814", "0.64899063", "0.6478781", "0.6459458", "0.6455545", "0.64538455", "0.64511603", "0.64489704", "0.6441755", "0.6434936", "0.64332104", "0.6417693", "0.64161015", "0.6415352", "0.6408511", "0.6406812", "0.6398319", "0.6393463", "0.6386697", "0.6382597", "0.63739717", "0.63624096", "0.6359229", "0.63574886", "0.63574886", "0.63574886", "0.63574886", "0.63574886", "0.63325286", "0.63198864", "0.63152474", "0.6310998", "0.63032955", "0.6300329", "0.6299157", "0.6293288", "0.62881744", "0.6279829", "0.6279786", "0.62771523", "0.6266761", "0.62623465", "0.62480956", "0.624047", "0.62375706", "0.623616", "0.6231572", "0.62202585", "0.62125164", "0.62111884", "0.6210347", "0.62068725", "0.62025917", "0.61862427" ]
0.7648211
2
PATCH/PUT /subscriptions/1 PATCH/PUT /subscriptions/1.json
def update @subscription = Subscription.find(params[:id]) if @subscription.update(subscription_params) head :no_content else render json: @subscription.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @subscription = Subscription.get(params[:id])\n @subscription.update(params[:subscription])\n respond_with(@subscription.reload)\n end", "def update\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_webhook_subscription(id,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n \n\n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:put, path, query_params, form_params, headers)\n response\n \n\n end", "def create / update_subscriptions\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription.owner, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \n # TODO: Modify subscription (refund remainder of current, prorate new)\n \n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to subscriptions_url, success: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n format.js { redirect_to subscriptions_url, :format => :html, success: 'Subscription was successfully updated.' }\n else\n format.html { render action: 'edit' }\n format.js { render action: 'edit' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_subscription.update(api_subscription_params)\n format.html { redirect_to @api_subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_subscription }\n else\n format.html { render :edit }\n format.json { render json: @api_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n flash[:success] = \"Subscription was successfully updated.\"\n format.html { redirect_to @subscription }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription.layer, notice: 'Subscription updated OK' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to @subscription, notice: (I18n.t :subscription_updated) }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n @subscription = Subscription.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @subscription.update_attributes(subscription_params)\r\n format.html { redirect_to business_user_subscriptions_path, notice: 'Subscription was successfully updated.' }\r\n format.json { head :ok }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription.transaction, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.by_user_channel_ids(current_user.id, params[:channel_id])\n\n respond_to do |format|\n if @subscription and @subscription.update_attributes(params[:subscription])\n @channel = Channel.find(params[:channel_id])\n format.html { redirect_to @subscription, notice: I18n.t('subscription_updated') }\n format.json { render json: { name: @channel.subscription_name(current_user) }, status: :ok}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to campaign_subscriptions_path(@campaign), :notice => 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscription.update_with_author(subscription_params, current_user)\n record_activity :update, @subscription\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(subscriptions_url, :notice => 'Subscription was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n\t\t@subscription = Subscription.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tif @subscription.update_attributes(params[:subscription])\n\t\t\t\tflash[:notice] = 'Subscription was successfully updated.'\n\t\t\t\tshow_\n\t\t\t\tformat.html { render :action => \"show\" }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\t@ingroups = Group.all\n\t\t\t\t@inprojects = Project.all\n\t\t\t\t@fortypesobjects=Typesobject.get_from_observer\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def update\n @subscription = Subscription.find(params[:id])\n \n respond_to do |format|\n \n \n if @subscription.update_attributes(params[:subscription])\n flash[:notice] = 'Subscription was successfully updated.'\n format.html { redirect_to(@subscription) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @subscription_request = SubscriptionRequest.find(params[:id])\n\n respond_to do |format|\n if @subscription_request.update_attributes(params[:subscription_request])\n format.html { redirect_to @subscription_request, notice: 'Subscription request was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n auth!\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(manage_screen_field_subscriptions_path(@screen, @field), :notice => t(:subscription_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(@subscription, :notice => 'Subscription was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @subscription.assign_attributes(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: t('controller.successfully_updated', model: t('activerecord.models.subscription')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @subscription = args[:subscription] if args.key?(:subscription)\n end", "def update!(**args)\n @subscription = args[:subscription] if args.key?(:subscription)\n end", "def update!(**args)\n @subscription = args[:subscription] if args.key?(:subscription)\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n flash[:notice] = 'Subscription was successfully updated.'\n format.html { redirect_to(@subscription) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if session[:user_id] \n @subscription = Subscription.find(params[:id])\n \n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(@subscription, :notice => 'Subscription was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def update_subscription(subscription_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html { redirect_to @subscribe, notice: t('controller.successfully_updated', model: t('activerecord.models.subscribe')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: StreamsApi.update_subscriptions ...'\n end\n # resource path\n local_var_path = '/users/me/subscriptions'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'delete'] = @api_client.build_collection_param(opts[:'delete'], :multi) if !opts[:'delete'].nil?\n query_params[:'add'] = @api_client.build_collection_param(opts[:'add'], :multi) if !opts[:'add'].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] || 'JsonSuccessBase'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"StreamsApi.update_subscriptions\",\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: StreamsApi#update_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def subscribe_to_updates\n if @subscription = @requestor.find_or_create_subscriptions(@target.id)\n @subscription.update_attributes(blocked: false) if @subscription.blocked?\n render json: { success: true }\n else\n render json: {message: @subscription.errors&.full_messages || 'Unable to subscriber updates, please try again'}, status: 202\n end\n end", "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html { redirect_to @subscribe, notice: 'Subscribe was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscribe }\n else\n format.html { render :edit }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html { redirect_to @subscribe, notice: 'Subscribe was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscribe }\n else\n format.html { render :edit }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @newsletter_subscription = NewsletterSubscription.find(params[:id])\n\n respond_to do |format|\n if @newsletter_subscription.update_attributes(params[:newsletter_subscription])\n format.html { redirect_to newsletter_subscriptions_path, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @newsletter_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n@subscription = current_user.subscriptions.build(subscription_params)\n\nrespond_to do |format|\n if @subscription.save\n\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n\nend\n\n# PATCH/PUT /subscriptions/1\n# PATCH/PUT /subscriptions/1.json\ndef update\nrespond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend\n\n# DELETE /subscriptions/1\n# DELETE /subscriptions/1.json\ndef destroy\n@subscription.destroy\nrespond_to do |format|\n format.html { redirect_to :back, notice: 'Your pet was successfully destroyed.' }\n format.json { head :no_content }\nend\n\nprivate\n# Use callbacks to share common setup or constraints between actions.\ndef set_subscription\n @subscription = Subscription.find(params[:id])\nend\n\n# Never trust parameters from the scary internet, only allow the white list through.\ndef subscription_params\n params.require(:subscription).permit(:title, :company, :url, :start_time, :end_time, :phone_number, :time, :pet_name, :breed, :animal, :notes, :pet_image, :option_1, :option_2, :gender)\nend\n\ndef correct_user\n @subscriptions = current_user.subscriptions.find_by(id: params[:id])\n redirect_to users_profile_url, notice: \"Not authorized to edit this pet\" if @subscription.nil?\nend\n\nend\nend", "def edit_subscription(subscription_id, payload)\n put(url_(\"subscription\", subscription_id), payload)\n end", "def update\nrespond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend", "def update\n @panel_subscription = Panel::Subscription.find(params[:id])\n respond_to do |format|\n if @panel_subscription.update_attributes(params[:panel_subscription])\n format.html { redirect_to(@panel_subscription, :notice => 'Subscription was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @panel_subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_webhook_subscription(subscription_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/webhooks/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html {redirect_to @subscribe, notice: 'Subscribe was successfully updated.'}\n format.json {render json: @subscribe, status: :ok}\n else\n format.html {render :edit}\n format.json {render json: @subscribe.errors, status: :unprocessable_entity}\n end\n end\n end", "def update\nrespond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to user_profile_url(current_user.id), notice: 'Pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend", "def update \n @service_subscription = ServiceSubscription.find(params[:id])\n \n respond_to do |format|\n if @service_subscription.update_attributes(params[:service_subscription])\n format.html { redirect_to(service_subscriptions_path, :notice => 'Your settings were successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @service_subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @list_subscription = ListSubscription.find(params[:id])\n\n respond_to do |format|\n if @list_subscription.update_attributes(params[:list_subscription])\n format.html { redirect_to @list_subscription, notice: 'List subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @crytosubscription.update(crytosubscription_params)\n format.html { redirect_to @crytosubscription, notice: 'Thanks for seeking for expert Advice. You will hear from us.' }\n format.json { render :show, status: :ok, location: @crytosubscription }\n else\n format.html { render :edit }\n format.json { render json: @crytosubscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @email_newsletter_subscription.update(email_newsletter_subscription_params)\n format.html { redirect_to @email_newsletter_subscription, notice: 'Email newsletter subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @email_newsletter_subscription }\n else\n format.html { render :edit }\n format.json { render json: @email_newsletter_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription.activity :params => {:composite_key => \"#{@subscription.game_id},#{@subscription.player_id}\"}\n respond_to do |format|\n if @subscription.update(subscription_params) \n format.html { redirect_to @subscription.game, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_subscriptions(email, attrs = {})\n attrs['email'] = email\n Iterable.request(conf, '/users/updateSubscriptions').post(attrs)\n end", "def update\n bundle_subscriptions = create_bundle_subs\n if BundleSubscription.import(bundle_subscriptions)\n @bundle.bundle_subscriptions.where.not(id: bundle_subscriptions).destroy_all\n redirect_to @bundle, notice: 'Bundle was successfully updated.'\n else\n edit\n flash[:alert] = 'Something went wrong while updating your bundle. Please try again.'\n render :edit and return\n end\n end", "def update\n respond_to do |format|\n if @subscription_type.update(subscription_type_params)\n format.html { redirect_to @subscription_type, notice: 'Subscription types was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription_type }\n else\n format.html { render :edit }\n format.json { render json: @subscription_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_to_channel_subscription.update(user_to_channel_subscription_params)\n format.html { redirect_to @user_to_channel_subscription, notice: 'User to channel subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_to_channel_subscription }\n else\n format.html { render :edit }\n format.json { render json: @user_to_channel_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vendor_subscription.update(vendor_subscription_params)\n format.html { redirect_to @vendor_subscription, notice: 'Vendor subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @vendor_subscription }\n else\n format.html { render :edit }\n format.json { render json: @vendor_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_subscription(subscription_id:,\n body:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/subscriptions/{subscription_id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'subscription_id' => { 'value' => subscription_id, 'encode' => true }\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.put(\n _query_url,\n headers: _headers,\n parameters: body.to_json\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def update\n raise CanCan::AccessDenied unless current_ability.admin?\n respond_to do |format|\n if @email_subscription.update(email_subscription_params)\n format.html { redirect_to @email_subscription, notice: \"Job status was successfully updated.\" }\n format.json { render :show, status: :ok, location: @email_subscription }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @email_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n friend = current_user.friends.find params[:id]\n return render json: { error: \"This doesn't seem to be your friend\" } if friend.nil?\n subscribed = !friend.subscribed\n change = subscribed ? 1 : -1\n friend.update subscribed: subscribed\n notify friend, change, 'subscribe'\n render json: {success: subscribed == friend.subscribed}\n end", "def update\n respond_to do |format|\n if @premium_subscription.update(premium_subscription_params)\n format.html { redirect_to @premium_subscription, notice: 'Premium subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @premium_subscription }\n else\n format.html { render :edit }\n format.json { render json: @premium_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def change_subscription\n @user = User.find(params[:id])\n @user.notify = !@user.notify\n @user.save\n respond_with(@user) do\n redirect_to \"/users/successful_unsubscribe\"\n end\n end", "def update\n respond_to do |format|\n if @admin_subscription.update(admin_subscription_params)\n format.html { redirect_to [:admin, @admin_subscription], notice: 'L\\'abonnement a bien été mis à jour !' }\n format.json { render :show, status: :ok, location: @admin_subscription }\n else\n format.html { render :edit }\n format.json { render json: @admin_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription_update\n data = request.body.read\n @verified = verify_webhook(data, request)\n if @verified\n ReserveInventory.delay(:retry => false).update_reserve_inventory\n head :ok\n else\n head :error\n end\n end", "def update\n @product_subscription = ProductSubscription.find(params[:id])\n\n respond_to do |format|\n if @product_subscription.update_attributes(params[:product_subscription])\n format.html { redirect_to campaign_subscription_path(@product_subscription.subscription.campaign, @product_subscription.subscription), :notice => 'Product subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @product_subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscriber.update(subscriber_params)\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to account_subscriber_path(@account, @subscriber), notice: 'Subscriber was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription_type = SubscriptionType.find(params[:id])\n\n respond_to do |format|\n if @subscription_type.update_attributes(params[:subscription_type])\n flash[:notice] = 'SubscriptionType was successfully updated.'\n format.html { redirect_to(@subscription_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_subscriber_list_details(slug:, params: {})\n patch_json(\n \"#{endpoint}/subscriber-lists/#{slug}\",\n params,\n )\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def update!(**args)\n @pubsub_subscription = args[:pubsub_subscription] if args.key?(:pubsub_subscription)\n end", "def update\n respond_to do |format|\n if @subscription_user.update(subscription_user_params)\n format.html { redirect_to @subscription_user, notice: 'Subscription user was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription_user }\n else\n format.html { render :edit }\n format.json { render json: @subscription_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unsubscription.update(unsubscription_params)\n flash[:success] = \"Le traitement a bien été modifié!\"\n format.html { redirect_to @unsubscription }\n format.json { render :show, status: :ok, location: @unsubscription }\n else\n format.html { render :edit }\n format.json { render json: @unsubscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category_subscription.update(category_subscription_params)\n format.html { redirect_to @category_subscription, notice: 'Category subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @category_subscription }\n else\n format.html { render :edit }\n format.json { render json: @category_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def bulk_update_subscriptions(subscriptions = [])\n attrs = { updateSubscriptionsRequests: subscriptions }\n Iterable.request(conf, '/users/bulkUpdateSubscriptions').post(attrs)\n end", "def update\n respond_to do |format|\n if @subscriber.update(subscriber_params)\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscriber }\n else\n format.html { render :edit }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\nend", "def set_subscription\n @subscription = Subscription.find(params[:id])\nend", "def update\n\t\t\t @appsubs = AppSub.find(params[:id])\n\t\t\t if @appsubs.update(sub_params)\n\t\t\t head :no_content\n\t\t\t else\n\t\t\t render json: @appsubs.errors, status: :unprocessable_entity\n\t\t\t end\n\t\t end", "def create\n s_params = params[:subscription]\n s_params.delete(:id)\n @subscription = Subscription.new(s_params)\n @subscription.save\n respond_with(@subscription)\n end", "def set_api_subscription\n @api_subscription = Api::Subscription.find(params[:id])\n end", "def update\n respond_to do |format|\n if @category_subscription.update(category_subscription_params)\n format.html { redirect_to [:admin, @category_subscription], notice: 'Подписка на категорию был успешно обновлена.' }\n format.json { render :show, status: :ok, location: @category_subscription }\n else\n format.html { render :edit }\n format.json { render json: @category_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n @subscription.subscribe(current_user.account, subscription_params[:stripe_plan_id], coupon: subscription_params[:coupon_code])\n\n if @subscription.save\n redirect_to @subscription, notice: 'Subscription was successfully updated.'\n else\n @verrors = @subscription.errors.full_messages\n render 'edit'\n end\n end", "def update_subscriptions(opts = {})\n data, _status_code, _headers = update_subscriptions_with_http_info(opts)\n data\n end", "def stripe_customer_subscription_updated(event, req)\n subscription = event['data']['object']\n subs = Lynr::Model::Subscription.new({\n canceled_at: subscription['canceled_at'],\n plan: subscription['plan']['id'],\n status: subscription['status'],\n })\n dealership = dealer_dao.get_by_customer_id(subscription['customer']).set('subscription' => subs)\n dealer_dao.save(dealership)\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end" ]
[ "0.7237877", "0.71868026", "0.7146975", "0.7088031", "0.70832556", "0.7082959", "0.70335835", "0.7015554", "0.7015554", "0.7015554", "0.69606966", "0.6954959", "0.6939982", "0.6907186", "0.6907186", "0.6896157", "0.6876353", "0.68551904", "0.68187803", "0.67266816", "0.67258096", "0.6722517", "0.6685558", "0.6679888", "0.66676337", "0.6667096", "0.66644615", "0.6657394", "0.66564953", "0.66564953", "0.6610062", "0.65981066", "0.65768355", "0.65601194", "0.654213", "0.6541297", "0.6537618", "0.6537618", "0.65283436", "0.650546", "0.64932245", "0.6463535", "0.6426626", "0.64142793", "0.6387654", "0.6364853", "0.63549894", "0.63232255", "0.6300362", "0.62888366", "0.6278647", "0.6254755", "0.61975306", "0.61857843", "0.61764014", "0.61764014", "0.6172899", "0.6154288", "0.6151529", "0.61454576", "0.61247605", "0.61193526", "0.6111591", "0.60988903", "0.6096115", "0.6078322", "0.6071232", "0.6050388", "0.60494816", "0.6011557", "0.60012436", "0.5996903", "0.5996903", "0.5996903", "0.5979436", "0.5977923", "0.5975298", "0.5974806", "0.59719133", "0.5960626", "0.59407675", "0.59407675", "0.5929399", "0.59093815", "0.5883238", "0.5871018", "0.5868773", "0.58670866", "0.585876", "0.5856463", "0.5856463", "0.5856463", "0.5856463", "0.5856463", "0.5856463", "0.5856463", "0.5856463", "0.5856463", "0.5856463", "0.5856463" ]
0.71870714
1
DELETE /subscriptions/1 DELETE /subscriptions/1.json
def destroy @subscription.destroy head :no_content end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete options={}, headers={}\n @connection.delete \"subscriptions.json\", options, headers\n end", "def destroy\n subscription = current_user.subscriptions.find(params[:id])\n subscription.destroy!\n\n render json: { status: 'success'}\n end", "def delete_subscriptions\n end", "def destroy\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = current_user.subscriptions.find(params[:id])\n #TODO move to model Subscription\n if not current_user.fitbit.nil?\n path = ['/1/user/-', @subscription.collection_path, 'apiSubscriptions', @subscription.subscription_id + '-' + @subscription.collection_path]\n current_user.fitbit.client.delete(path.join('/') + '.json')\n flash[:success] = 'Subscription successfully removed from Fitbit.'\n else\n flash[:error] = 'Can not remove subscription from Fitbit, because you are not connected.'\n end\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :ok }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: (I18n.t :subscription_deleted) }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_subscription.destroy\n respond_to do |format|\n format.html { redirect_to api_subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to root_url}\n format.json { head :no_content }\n end\n end", "def destroy\r\n @subscription = Subscription.find(params[:id])\r\n @subscription.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to business_user_subscriptions_path }\r\n format.json { head :ok }\r\n end\r\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to campaign_subscriptions_path(@campaign) }\n format.json { head :no_content }\n end\n end", "def delete_webhook_subscription(id,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n \n\n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:delete, path, query_params, form_params, headers)\n response\n \n\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\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 @subscription = Subscription.find(params[:id])\n auth!\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(manage_screen_field_subscriptions_url(@screen, @field)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @crytosubscription.destroy\n respond_to do |format|\n format.html { redirect_to crytosubscriptions_url, notice: 'Crytosubscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = current_user.subscriptions.find(params[:id])\n\t\tmanga = Manga.find(@subscription.manga_id)\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to mangas_url, notice: 'Successfully unsubscribed to '+ manga.display_name.to_s}\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to @subscription.transaction }\n format.json { head :no_content }\n end\n end", "def remove_subscription\n buyer = @current_user\n customer_id = buyer.stripe_customer_id\n customer = Stripe::Customer.retrieve(customer_id)\n subscription.delete\n render json: { message: 'Unsubscribed succesfully' }, status: 200\n end", "def destroy\n @subscribe.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if session[:user_id] \n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n \n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end\n end", "def delete_subscription(id)\n delete(\"/subscriptions/#{id}\")\n end", "def destroy \n Instagram.delete_subscription({:id => params[:id]})\n local_subscription = Subscription.find_by_original_id params[:id]\n local_subscription.destroy if local_subscription\n redirect_to :admin_subscriptions\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @owner = @subscription.owner\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to polymorphic_url([@owner, :subscriptions]) }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html { redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html { redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html { redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_subscription.destroy\n respond_to do |format|\n format.html { redirect_to admin_subscriptions_url, notice: 'L\\'abonnement a bien été créé supprimé.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to artist_subscription_path }\n format.json { head :ok }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to request.env[\"HTTP_REFERER\"] }\n format.xml { head :ok }\n end\n end", "def destroy\n @panel_subscription = Panel::Subscription.find(params[:id])\n @panel_subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(panel_subscriptions_url) }\n format.json { head :ok }\n end\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n @newsletter_subscription = NewsletterSubscription.find(params[:id])\n @newsletter_subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to newsletter_subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n auth!\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(screen_field_subscription_path(@screen, @field)) }\n format.xml { head :ok }\n format.js { head :ok }\n end\n end", "def destroy\n @service_subscription = ServiceSubscription.find(params[:id])\n @service_subscription.destroy\n \n redirect_to service_subscriptions_path\n\n # respond_to do |format|\n # format.html { redirect_to(service_subscriptions_url) }\n # format.xml { head :ok }\n # end\n end", "def destroy\n return error_message(['Access denied'], 403) unless current_user?(@user)\n\n course = fetch_cache(Course, params[:id])\n @user.subscriptions_to_courses.destroy(course)\n render json: {status: 'Ok'}\n end", "def destroy!\n Dropio::Resource.client.delete_subscription(self)\n nil\n end", "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to account_subscribers_url(@account) }\n format.json { head :no_content }\n end\n end", "def destroy\n @list_subscription = ListSubscription.find(params[:id])\n @list_subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to list_subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :ok }\n end\n end", "def delete_webhook_subscription(subscription_id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::DELETE,\n '/v2/webhooks/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def destroy\n\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @email_newsletter_subscription.destroy\n respond_to do |format|\n format.html { redirect_to email_newsletter_subscriptions_url, notice: 'Email newsletter subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription_user.destroy\n respond_to do |format|\n format.html { redirect_to subscription_users_url, notice: 'Subscription user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscriptions = []\n\n # query parameter with the ids of all the necessarily deleted subscriptions\n subscription_id_string = params[:subscription][:subscriptions]\n\n # converts the query parameter string into an array. Query parameter gets sent like this \"[1,2,3]\"\n all_ids = subscription_id_string[subscription_id_string.index(\"[\") + 1, subscription_id_string.index(\"]\") - 1].split(\",\")\n\n # for each id in the array of ids, find the Subscription with that id, add it to the array of deleted subscriptions\n # for the view, and then destroy the subscription\n all_ids.each do |id|\n this_subscription = Subscription.find(id)\n @subscriptions << this_subscription\n\n # decrement subscription count of corresponding dept/club/team\n if this_subscription.category == \"department\"\n dept = Department.find(this_subscription.subscribed_to)\n dept.subscriber_count -= 1\n dept.save\n elsif this_subscription.category == \"club\"\n club = Club.find(this_subscription.subscribed_to)\n club.subscriber_count -= 1\n club.save\n else\n team = AthleticTeam.find(this_subscription.subscribed_to)\n team.subscriber_count -= 1\n team.save\n end\n\n this_subscription.destroy\n end\n end", "def destroy\n @subscription_type = SubscriptionType.find(params[:id])\n @subscription_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscription_types_url) }\n format.xml { head :ok }\n end\n end", "def clear_subs\n instagram_client.subscriptions.each do |sub|\n instagram_client.delete_subscription(id: sub.id)\n end\n\n redirect_to list_subs_path\n end", "def destroy\n @vendor_subscription.destroy\n respond_to do |format|\n format.html { redirect_to vendor_subscriptions_url, notice: 'Vendor subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html {redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.'}\n format.json {render json: @subscribe, status: :ok}\n end\n end", "def destroy\n @event_subscription.destroy\n head :no_content\n end", "def destroy\n @unsubscription.destroy\n respond_to do |format|\n flash[:success] = \"Le traitement a bien été supprimé!\"\n format.html { redirect_to unsubscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html {\n if request.referrer == subscription_url(@subscription)\n redirect_to session[:sub_delete_return_to]\n else\n redirect_to :back\n end\n }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscriber.destroy\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n return_back_or_ajax\n end", "def delete_subscription(entity)\r\n subscriptions.delete(entity)\r\n end", "def destroy\n @subscription_type.destroy\n respond_to do |format|\n format.html { redirect_to subscription_types_path, notice: 'Subscription types was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription_history = SubscriptionHistory.find(params[:id])\n @subscription_history.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscription_histories_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n\t @subscription = Subscription.find(params[:id])\n\t @subscription.remove if @subscription\n\n\t redirect_to plans_path\t \t\n\tend", "def destroy\n @premium_subscription.destroy\n respond_to do |format|\n format.html { redirect_to premium_subscriptions_url, notice: 'Premium subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n\n @subscription.status = 'canceled'\n\n redirect_to subscriptions_path, notice: \"Your #{@subscription.category.name} subscription has been canceled.\"\n @subscription.save\n end", "def delete_subscription subscription\n subscriber.delete_subscription subscription: subscription_path(subscription)\n end", "def delete\n result = Hash.new\n begin # try\n result = SubscribesHlp.delete(params[:id])\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end", "def delete_webhook_subscription(id)\n\t\tputs \"Attempting to delete subscription for webhook: #{id}.\"\n\n\t\tif @api_tier == 'premium'\n\t\t\t@uri_path = \"#{@uri_path}/all/#{id}/subscriptions/all.json\"\n\t else\n\t\t\t@uri_path = \"#{@uri_path}/webhooks/#{id}/subscriptions.json\"\n\t\tend\n\n\t\tresponse = @twitter_api.make_delete_request(@uri_path)\n\n\t\tif response == '204'\n\t\t\tputs \"Webhook subscription for #{id} was successfully deleted.\"\n\t\telse\n\t\t\tputs response\n\t\tend\n\t\t\n\t\tresponse\n\tend", "def destroy\n @user_to_channel_subscription.destroy\n respond_to do |format|\n format.html { redirect_to user_to_channel_subscriptions_url, notice: 'User to channel subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @panel_subscription_transaction = Panel::SubscriptionTransaction.find(params[:id])\n @panel_subscription_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(panel_subscription_transactions_url) }\n format.json { head :ok }\n end\n end", "def destroy\n @subscription_list.destroy\n respond_to do |format|\n format.html { redirect_to subscription_lists_url, notice: 'La Lista de Entrega se borró exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @misuration_subscription.destroy\n respond_to do |format|\n format.html { redirect_to misuration_subscriptions_url, notice: 'Iscrizione al sensore eliminata correttamente' }\n format.json { head :no_content }\n end\n end", "def delete(mirror=@mirror)\n result = client.execute(\n :api_method => mirror.subscriptions.delete,\n :parameters => { 'id' => collection })\n if result.error?\n puts \"An error occurred: #{result.data['error']['message']}\"\n end\n end", "def deletesubscriber\n\n\tparams[\"phone\"] = params[\"phone\"].gsub(\"\\s\",\"\").gsub(/^0044/, \"\").gsub(/^\\+44/, \"\")\n\tif params[\"phone\"].length == 10\n\t\tparams[\"phone\"] = '0' + params[\"phone\"]\n\tend\n\n\tif (Subscriber.exists?(:phone => params[:phone]))\n\t\tsubscriber = Subscriber.where(:phone => params[:phone]).first\n\t\tsubscriber.destroy\n\n\t\trespond_to do |format|\n\t\t format.html # deletesubscriber.html.erb\n\t\tend\n\telse\n\t\tredirect_to :action => \"unsubscribe\", phone: params[:phone]\n end\n end", "def destroy\n @subscriber.destroy\n respond_to do |format|\n format.html { redirect_to subscribers_url, notice: 'Subscriber was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def unsubscribe_subscriber(id)\n delete_json(\"#{endpoint}/subscribers/#{uri_encode(id)}\")\n end", "def unsubscribe_subscriber(id)\n delete_json(\"#{endpoint}/subscribers/#{uri_encode(id)}\")\n end", "def destroy\n # First cancel the Stripe subscription\n\n @subscription.cancel_subscription(current_user.account)\n # Then destroy the subscription record\n @subscription.delete\n\n redirect_to subscriptions_url\n end", "def unsubscribe\n email = Base64.decode64(params[:token])\n Subscription.where(email: email).destroy_all\n end", "def cancel\n success = current_subscriber.cancel_subscription\n render json: { success: success }\n end", "def deleteSubscription(subscr)\n subscriptions = Hash.new\n if @subscriptionLists.hasKey(\"subscriptions\")\n subscriptions = @subscriptionLists.getRepositoryObject(\"subscriptions\").getObject\n end\n #subscriptions[subscr] = Array.new\n #@subscriptionLists.commitObject(\"subscriptions\", subscriptions, false)\n subscriptions.delete(subscr)\n @subscriptionLists.commitObject(\"subscriptions\", subscriptions, false)\n end", "def destroy\n @subscription_group = SubscriptionGroup.find(params[:id])\n @subscription_group.destroy\n\n respond_to do |format|\n format.html { redirect_to subscription_groups_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\n targets = Subscription.where(ordinal: (@subscription.ordinal + 1)..Float::INFINITY)\n\n targets.each do |target|\n target.update(ordinal: target.ordinal - 1)\n end\n\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to owner_subscriptions_url(owner_id: @owner.id), notice: 'サブスクショップを削除しました' }\n format.json { head :no_content }\n end\n end", "def destroy\n transaction do\n clean\n connection.delete \"DELETE FROM user_subscriptions WHERE subscription_id = #{id}\"\n connection.delete \"DELETE FROM subscriptions WHERE id = #{id}\"\n end\n end", "def destroy\n @category_subscription.destroy\n respond_to do |format|\n format.html { redirect_to category_subscriptions_url, notice: 'Category subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n@subscription.destroy\nrespond_to do |format|\n format.html { redirect_to :back, notice: 'Pet was successfully destroyed.' }\n format.json { head :no_content }\nend\nend", "def destroy\n @category_subscription.destroy\n respond_to do |format|\n format.html { redirect_to admin_category_subscriptions_url, notice: 'Подписка на категорию была успешно удалена.' }\n format.json { head :no_content }\n end\n end", "def destroy\n event = Subscription.find(params[:id]).event\n current_user.unsubscribe(event)\n redirect_to event\n end", "def destroy\n @product_subscription = ProductSubscription.find(params[:id])\n @product_subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to campaign_subscription_path(@product_subscription.subscription.campaign, @product_subscription.subscription) , :notice => 'Product subscription was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def unsubscribe(uuid)\n post_json(\"#{endpoint}/unsubscribe/#{uri_encode(uuid)}\")\n end", "def unsubscribe(uuid)\n post_json(\"#{endpoint}/unsubscribe/#{uri_encode(uuid)}\")\n end" ]
[ "0.8083839", "0.7971518", "0.7749676", "0.77227986", "0.76973474", "0.76788694", "0.76788694", "0.76788694", "0.76788694", "0.766344", "0.75745755", "0.75242066", "0.7512467", "0.74898785", "0.74766344", "0.74766344", "0.74766344", "0.74766344", "0.74766344", "0.7430863", "0.7402852", "0.7389791", "0.7389791", "0.7389791", "0.73481774", "0.7345754", "0.7341421", "0.7334125", "0.7328218", "0.7315209", "0.72989845", "0.72939456", "0.72885406", "0.72582734", "0.71930397", "0.7180277", "0.7174165", "0.7174165", "0.7174165", "0.7169685", "0.71584594", "0.71415883", "0.7106714", "0.7106371", "0.7053827", "0.70474845", "0.70270944", "0.7017797", "0.70120806", "0.7010806", "0.7009525", "0.7000163", "0.6999704", "0.6994056", "0.6978384", "0.6928824", "0.69250244", "0.690034", "0.6893621", "0.68918157", "0.68900865", "0.6882974", "0.6880508", "0.68732697", "0.6855283", "0.68506974", "0.68364197", "0.6834784", "0.6825377", "0.6824307", "0.6813649", "0.6813254", "0.68043864", "0.67935514", "0.67930984", "0.67714334", "0.6769921", "0.6768724", "0.6756108", "0.6747615", "0.67351985", "0.6734292", "0.6723186", "0.6701433", "0.6693665", "0.6693665", "0.66927797", "0.66847116", "0.66740596", "0.66574746", "0.66559565", "0.66548216", "0.6653988", "0.66247725", "0.66168004", "0.65775114", "0.65743136", "0.6557313", "0.65516657", "0.65516657" ]
0.75494754
11
=> [1, 2, 3] (destructive) x now returns [1, 2, 3] y also returns [1, 2, 3]
def test(f) f.map { |letter| "I like the letter: #{letter}" } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skips(x)\n (0..x.length-1).map do |i|\n (y = x.dup).delete_at(i);y\n end\nend", "def get_arr_x(x, y) \n x # this coordinate doesn't change\nend", "def trimmed_coordinates_array(x_values, y_values)\n coordinates_array = x_values.zip(y_values)\n # [[1, 2], [1, 3], [1, 4], [1, 5]]\n coordinates_array.shift\n coordinates_array.pop\n coordinates_array\n # [[1, 3], [1, 4]]\n end", "def to_ary\n [@x, @y]\n end", "def to_a; [x, y] end", "def to_a\n [@x, @y]\n end", "def to_a\n [@x, @y]\n end", "def to_ary\n [x, y]\n end", "def x_or_y\n x = @x.content\n y = @y.content\n z = Array.new @z.length, 0\n\n @z.length.times { |i| z[i] = x[i] | y[i] }\n\n @z.content = z\n end", "def to_a\n [x, y]\n end", "def another; return []; end", "def x_equal_y\n x = @x.content\n y = @y.content\n z = Array.new @z.length, 1\n\n @z.length.times do |i|\n unless x[i] == y[i]\n z = Array.new @z.length, 0\n break\n end\n end\n\n @z.content = z\n end", "def cache_ids_xy_no_etp(x,y)\n es = @events\n r = cache_ids_xy(x,y).inject([]) do |a,id| e = es[id]\n a.push(id) if !e.erased && !e.through #&& !e.tb_prod\n end\n r.nil? ? [] : r\n end", "def to_a\n [x, y]\n end", "def each\n yield @x\n yield @y\n end", "def each\n yield @x\n yield @y\n end", "def each\n yield @x\n yield @y\n end", "def to_a\n [x, y]\n end", "def cache_ids_xy(x,y)\n (ids = @exy_cache[[x,y]]) ? ids : []\n end", "def *(y)\n z = 0\n\n for i in 1..y do\n z += @x\n end\n z\n end", "def add_to_array(x, y)\n combined_array = x\n combined_array.push(y)\nend", "def demux\n x = []\n y = []\n self.each { |inz| raise \"wrong size (!= 2) - #{inz.inspect}\" if inz.size != 2; x << inz[0] ; y << inz[1] }\n [x,y]\n end", "def swap(arr, x, y)\n array = arr.clone\n array[x], array[y] = array[y], array[x]\n array\nend", "def swap_elements(arry)\n #oldx = x x = y y = oldx\n\n val1 = arry[2]\n val2 = arry[1]\n\n arry[1] = val1\n arry[2] = val2\n\n arry\nend", "def x_and_y\n x = @x.content\n y = @y.content\n z = Array.new @z.length, 0\n\n @z.length.times { |i| z[i] = x[i] & y[i] }\n\n @z.content = z\n end", "def not_just_splat(x, *args, y)\n puts x\n puts y\n puts args.inspect\nend", "def sorted_x\n @sorted_x ||= [start_point.x, end_point.x].sort\n end", "def to_xy\n [x, y]\n end", "def possibilities_minus_exclusions_solution(x, y)\n possibilities = filled_in_board.cell_possibilities(x, y) - exclusions(x, y)\n return possibilities.first if possibilities.length == 1\n\n possibilities -= exclusions(x, y)\n return possibilities.first if possibilities.length == 1\n end", "def x_xor_y\n x = @x.content\n y = @y.content\n z = Array.new @z.length, 0\n\n @z.length.times { |i| z[i] = x[i] ^ y[i] }\n\n @z.content = z\n end", "def method2(a, b, c)\n\tx = []\n\tx << a\n\tx << b\n\tx << c\nend", "def exclusions(x, y)\n column_possibilities = neighbor_possibilities(coords_of_column_neighbors(x, y))\n row_possibilities = neighbor_possibilities(coords_of_row_neighbors(x, y))\n square_possibilities = neighbor_possibilities(coords_of_square_neighbors(x, y))\n\n [].tap do |exclusions|\n exclusions << neighbor_exclusions(column_possibilities)\n exclusions << neighbor_exclusions(row_possibilities)\n exclusions << neighbor_exclusions(square_possibilities)\n end.flatten(2).uniq\n end", "def normalize_coords(x, y)\n x = x * -1 - 1 if x < 0\n y = y * -1 - 1 if y > -1\n [x, y]\n end", "def getSet( s, x=1 )\n return [] if (x2 = x**2) > s\n return [[x]] if x2 == s\n getSet( s-x2, x+1 ).each { |a| a.unshift x }.concat getSet( s, x+1 )\nend", "def x_add_y\n x = @x.content\n y = @y.content\n z = Array.new @x.length, 0\n\n carry = 0\n\n # claulate x + y = z\n @x.length.times do |i|\n tmp = x[i] + y[i] + carry\n z[i] = tmp % 2\n carry = tmp / 2\n end\n\n @z.content = z\n end", "def cross(array2)\n self.inject([]){ |array, first| array2.inject(array) {|array, second| array << [first, second]} } \n end", "def swap(a, b)\n\ta, b = [b, a]\n\t[a, b]\nend", "def swap(a,b)\n return b,a\nend", "def mongoize\n return nil unless x && y\n [x, y]\n end", "def progressive_fraction(x, y)\n cfe = continued_fraction(x, y)\n ret = []\n 1.upto(cfe.size - 1) do |i|\n ret.push(expand(cfe[0...i]))\n end\n ret\n end", "def inflate!(x,y)\n self[0] -= x.div(2)\n self[1] -= y.div(2)\n self[2] += x\n self[3] += y\n return self\n end", "def xyz(x)\n\ta = []\n\ta << x\n\ty = x-1\n\ta << y\n\tz = x-2\n\ta << z\n\treturn a.inspect\nend", "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 swap_values(value1, value2)\n temp = value1\n value1 = value2\n value2 = temp\n [value1, value2]\n end", "def rotate_left(x, y)\n return [] if x.length == 0\n \n y = y % x.length\n x[y..-1] + x[0...y]\n end", "def split_vertically!(y)\n raise \"Not Implemented\"\n end", "def to_a; [x, y, z] end", "def custom_sub(arr1, arr2)\n fin_ar = arr1.dup\n arr2.each {|el2| fin_ar.delete(el2) }\nfin_ar\nend", "def custom_sub(arr1, arr2)\n fin_ar = arr1.dup\n arr2.each {|el2| fin_ar.delete(el2) }\nfin_ar\nend", "def update_arr2(var)\n\tvar.uniq!\nend", "def coords\n [x, y]\n end", "def swap(array, x, y)\n temp_1 = array[x]\n temp_2 = array[y]\n array[y] = temp_1\n array[x] = temp_2\n return array\nend", "def yes_mutate(arr)\n arr.uniq!\nend", "def yes_mutate(arr)\n arr.uniq!\nend", "def yes_mutate(arr)\n arr.uniq!\nend", "def array_concat(array_1, array_2)\n array_2.each do |x|\n array_1.push x\n end\n return array_1\nend", "def test_difference_one_from_two\n array = []\n array_one = [1,2,3,4,5]\n array_two = [2,5,9]\n array = array_one &! array_two\n assert_equal [1,3,4], array\n end", "def - other_ary\n #This is a stub, used for indexing\nend", "def to_xy\n a = self\n a = [a[0].x, a[0].y] if length == 1\n return *a\n end", "def line(x, y)\n [x.value, y.value]\n end", "def substract_arr!(another_arr, x, method='*')\n for i in 0...self.size do self[i] = self[i] - another_arr[i].send(method, x) end\n self\n end", "def no_mutate(arr)\n arr.uniq\nend", "def no_mutate(arr)\n arr.uniq\nend", "def no_mutate(arr)\n arr.uniq\nend", "def [](x, y)\n @modified[x, y]\n end", "def cmp(x)\r\n x2 = []\r\n x.each {|y|\r\n if y !=nil\r\n x2 << y\r\n end\r\n }\r\n return x2\r\nend", "def swap_fix_it(p1, p2)\n\n p1_copy = p1.dup\n \n p1.x = p2.x\n p1.y = p2.y\n\n p2.x = p1_copy.x\n p2.y = p1_copy.y\n\n p \"Inside swap_fix_it p1 is #{p1}\"\n p \"Inside swap_fix_it p2 is #{p2}\"\n\n \t\nend", "def array_concat(array_1, array_2)\n array_2.each do |x|\n array_1.push(x)\n end\n return array_1\nend", "def args\n @x.args.uniq\n end", "def to_a\n [@x, @y, @z]\n end", "def point(x,y)\n [x,y]\nend", "def raze(x,y)\n set(x, y, nil)\n end", "def f6; return *['a','b'] &['a','Y','Z'] end", "def array_2(array2)\n array2.sort!\n return array2\nend", "def array_concat(array_1, array_2)\n array_2.each { |x| array_1.push(x) }\n return array_1\nend", "def identity_y\r\n new_point = identity\r\n new_point.x = 0\r\n return new_point\r\n end", "def no_mutate(arr)\n arr.uniq!\nend", "def no_mutate(arr)\n arr.uniq!\nend", "def adjacent(x,y)\n\t\t[[x+1,y],[x-1,y],[x,y+1],[x,y-1]]\n\tend", "def remove_exy_cached(x,y,id)\n if list = @exy_cache[[x,y]]\n list.delete(id)\n end\n end", "def copy\n self.class.new(@x,@y)\n end", "def array_diff(a, b)\n a.each do |x| \n if b.include?(x)\n a.delete(x)\n end\n end\nend", "def union(x, y)\n j = find(x)\n k = find(y)\n if j != k\n @parent_array[k] = j\n end\n end", "def y!() @y.value end", "def x_and_y\n x = 1\n while true\n y = (500 - x**2) / x\n if y < x && (x**2 + x*y) == 500\n puts \"X: #{x} Y: #{y}\"\n return [x, y]\n break\n end\n x += 1\n end\nend", "def x(y)\n return 1.0/2.0 * (y - 1.0)\n end", "def x(y)\n return 1.0/2.0 * (y - 1.0)\n end", "def x(y)\n return 1.0/2.0 * (y - 1.0)\n end", "def array_diff(a, b)\n\ta.each do |element| \n\t\tif b.include?(element)\n\t\t\ta.delete(element)\n\t\t\tb.delete(element)\n\t\tend\n\tend\n a\nend", "def swap_elements(array)\n array = array[0], array[2], array[1]\n return array\nend", "def - other\n [ self[0] - other[0], self[1] - other[1] ]\n end", "def map_to_no_change(source_array)\n array = []\n index = 0 \n \n while index < source_array.size do \n array.push(source_array[index])\n index += 1 \n end\n return array\nend", "def __splat(x) end", "def deintersect\n [self]\n end", "def swapper(arr, idx_1, idx_2)\n arr[idx_1] = arr[idx_2] # as soon as I execute this line, it will be [\"c\", \"b\", \"c\", \"d\"]\n arr[idx_2] = arr[idx_1] # then, I excute this line, then it will be [\"c\", \"b\", \"c\", \"d\"], which is wrong!\n arr\n\nend", "def mongoize\n [x, y]\n end", "def array_concat(array_1, array_2)\n\tour_array = array_1\n\tarray_2.each do |newguy|\n\t\tour_array.push(newguy)\n\tend\n return our_array\nend", "def reverse\n @x = -@x\n @y = -@y\n self\n end", "def subtract(arr1, arr2)\n arr1_dup = arr1.dup\n arr2.each { |x| arr1_dup.slice!(arr1_dup.index(x)) if arr1_dup.include?(x) }\n arr1_dup\nend", "def my_reverse\n out=[]\n each {|item| out.unshift(item)}\n\n out\n end", "def test_difference_two_from_one\n array = []\n array_one = [1,2,3,4,5]\n array_two = [2,5,9]\n array = array_one &! array_two\n assert_equal [9], array\n end" ]
[ "0.6355265", "0.6314719", "0.6179839", "0.6155703", "0.6138706", "0.6110919", "0.6110919", "0.610016", "0.6087251", "0.6025466", "0.59926486", "0.59887224", "0.59747136", "0.59668696", "0.5914152", "0.5914152", "0.5877992", "0.58733803", "0.5863853", "0.5757391", "0.5634236", "0.55588937", "0.5539762", "0.5521832", "0.5515115", "0.5491996", "0.54919356", "0.5431035", "0.5425137", "0.541181", "0.5395909", "0.5393372", "0.5388745", "0.5382842", "0.53736216", "0.53732276", "0.5355027", "0.53326744", "0.5313706", "0.5308998", "0.5301011", "0.529573", "0.52723706", "0.5269066", "0.52664673", "0.5266236", "0.5264162", "0.5248993", "0.5248993", "0.5247845", "0.52467054", "0.52357876", "0.52227217", "0.52227217", "0.52227217", "0.5217845", "0.52157587", "0.52036065", "0.52005523", "0.5200321", "0.5181211", "0.5180503", "0.5180503", "0.5180503", "0.5177809", "0.51716673", "0.5168323", "0.5166648", "0.5163929", "0.5155544", "0.5152797", "0.5150508", "0.5141227", "0.51408297", "0.5140769", "0.5140756", "0.5136506", "0.5136506", "0.51346457", "0.51295793", "0.51280886", "0.51265043", "0.5120608", "0.51201504", "0.51187944", "0.5116175", "0.5116175", "0.5116175", "0.5114948", "0.5112747", "0.5111744", "0.510941", "0.5092564", "0.5088605", "0.5087417", "0.50830656", "0.50799966", "0.50767434", "0.5076487", "0.507644", "0.5075832" ]
0.0
-1
=> ["I like the letter: a", "I like the letter: b", "I like the letter: c"] e => the original array
def test_b(h) h.map! { |letter| "I like the letter: #{letter}" } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def letters_to_guess\n @letters.map do |letter|\n if @user_guesses.include?(normalize_letter(letter))\n letter\n else\n nil\n end\n end\n end", "def guess_letters\n guess_array = []\n @current_word.each do\n guess_array << \"_\"\n end\n return guess_array\n end", "def incl_letter(array, letter)\n fin_array = []\n array.each do |value|\n if value.include? (letter)\n fin_array.push(value)\n end\n end\n p fin_array\nend", "def abbreviate_sentence(sent)\n # Write your code here\n empty_array = []\n sent.chars.each do |element|\n if element.length > 4\n element.each do |letters|\n letters.gsub(/[aeiou]/i, \" \" )\n letters << empty_array\n end\n end\n end\n p empty_array.join(\"\")\nend", "def kesha_maker(array)\n array.map do |elem|\n word_splice = elem.split(\"\")\n word_splice[2] = \"$\"\n word_splice.join\n end\nend", "def alteration\n (0...length).flat_map { |i|\n LETTERS.map { |letter|\n string.dup.tap { |w| w[i] = letter }\n }\n }.uniq\n end", "def letter_array (name)\n\tname.chars\nend", "def silly_talk(sent)\n vowels = \"aeiou\"\n return_array = []\n sent.split(\" \").each do |word|\n if vowels.include?(word[-1])\n return_array << word + word[-1] \n else\n word.each_char.with_index do |char, idx|\n vowels.include?(char) ? (return_array) : () \n end\n end\n word.each_char \n end\nend", "def pig_latin_name(word)\n \n letters = word.split(\"\")\n \n final_array = letters.clone\n letters.each do |letter| #[p, l, u, m]\n \n \n if is_consonants?(letter)\n final_array.rotate! \n # #puts \".........#{removed_consonant}\"\n # #letters.push(removed_consonant)\n # puts \".........#{final_array}..#{letters}\"\n else \n # puts \"*****#{final_array}.... #{letters}\"\n final_array.push(\"ay\")\n return final_array.join\n end\n end\nend", "def wordArray(guessword)\n word_array = []\n\n guessword.length.times do |letter|\n word_array << guessword[letter]\n end\n return word_array\nend", "def encrypt(message)\n alphabet = ('A'..'Z').to_a\n split_message = message.split('')\n\n encrypted_array = split_message.map do |letter|\n if alphabet.include?(letter)\n letter_index = alphabet.index(letter)\n alphabet[letter_index - 3]\n else\n letter\n end\n end.join\nend", "def letter_changes(string)\n array = (\"a\"..\"z\").to_a\n\n result_array = string.chars.map do |char|\n case\n when char.downcase == \"x\" then char == \"x\" ? \"a\" : \"A\"\n when char.downcase == \"y\" then char == \"y\" ? \"b\" : \"B\"\n when char.downcase == \"z\" then char == \"z\" ? \"c\" : \"C\"\n when char.match(/[a-z]/) then array[array.index(char.downcase) + 3]\n when char.match(/[A-Z]/) then array[array.index(char.downcase) + 3].upcase\n else char\n end\n end\n result_array.join\nend", "def aba_array(arr)\n return arr.map{|word| aba_translate(word)}\nend", "def strange_words(words)\n i = 0\n new_array = []\n new_string = \"\"\n\n while i < words.length\n\n \tnew_string = words[i]\n\n if (words[i].length < 6 ) && !(new_string[0] == \"e\") || (new_string[0] == \"e\") && !(words[i].length < 6 )\n new_array << words[i] \n end\n i += 1\n end\n return new_array\n\nend", "def next_letter(array)\n array.map! do |letter|\n next_character(letter)\n end\n array = array.join('')\nend", "def yell(words) # DEFINE METHOD WITH ONE PARAM\n \n i = 0 # SET FIRST INDEX VALUE\n \n new_array = [] # CREATE AN EMPTY ARRAY\n \n while i < words.length # WHILE LOOP THAT CHECKS IF I IS LESS THAN THE ARRAY LENGTH\n old_ele = words[i] # VARIABLE TO STORE INDEXED VALUE OF ARRAY\n exclamations = old_ele + \"!\" # VARIABLE THAT CONCATENATES EXCLAMATION TO END OF INDEX ARRAY VALUE\n new_array << exclamations # SHOVELS IT INTO END OF ARRAY VARIABLE\n i += 1 # INCREMENT OF ONE ITERATION\n\n end\n return new_array # RETURNS FINAL VALUE OF NEWLY CREATED ARRAY\n \n\nend", "def kesha_maker(array)\n array.collect do |character|\n character[2] = \"$\"\n character\n end\nend", "def kesha_maker(array)\n new_arr= []\n array.each do |word|\n word.split(\" \")\n word[2] = \"$\"\n new_arr << word\n end\nend", "def get_all_letters_in_array_of_words(array)\n #go through each word\n new_array = []\n array.each {|word|\n new_array << word.split(//)\n }\n new_array.flatten.sort\n #separate each letter and add to new array of letters - .split(//)\n #take all letters and sort for alphabet\nend", "def match_letters #handle_guess\n\t\tindexes_matched = @word_array.each_index.select { |i| @word_array[i] == @guess}\n\n\t\tfor x in indexes_matched do\n\t\t\t@result_array[x] = guess\n\t\tend\n\n\t\tputs @result_array\n\tend", "def match_letters #handle_guess\n\t\tindexes_matched = @word_array.each_index.select { |i| @word_array[i] == @guess}\n\n\t\tfor x in indexes_matched do\n\t\t\t@result_array[x] = guess\n\t\tend\n\n\t\tputs @result_array\n\tend", "def summon_captain_planet(arr)\n arr.map {|word| word.capitalize + \"!\"}\nend", "def filter_words_with_letter array, letter\n array.filter_map{ |value| value if value.include? letter }\nend", "def silly_talk(sent)\n vowels = 'aeiou'\n words = sent.split\n new_words = []\n\n words.each do |word|\n if vowels.include?(word[-1])\n new_words << word + word[-1] \n else \n new_words << word.split('').map { |c| vowels.include?(c) ? (c + 'b' + c) : c }.join\n end \n end \n\n new_words.join(' ')\n\nend", "def pirates_say_arrrrrrrrr(string)\n array_1 = string.downcase.split\"\"\n array_2 = []\n \n loop do\n arrr = array_1.index(\"r\")\n break if arrr == nil\n array_1.delete_at(arrr)\n array_2 << array_1[arrr]\n end\n \narray_2.join\n\nend", "def test(b)\n b.map! {|letter| \"I like the letter: #{letter}\"}\nend", "def letters\n @letters.join(\"\")\n end", "def letters_before(char)\n (\"a\"...char).to_a\nend", "def newBev (array, letter)\n array.select { |value| value.include?(letter)}\nend", "def get_all_letters_in_array_of_words(array)\n array.join.split(\"\").sort \nend", "def add_to_guess\n @guess = @guess.map!.with_index do |character, index|\n @word.downcase[index] == @letter ? @word[index] : character\n end\n end", "def match_letters \n\t\tindexes_matched = @word_array.each_index.select { |i| @word_array[i] == @guess}\n\n\t\tfor x in indexes_matched do\n\t\t\t@result_array[x] = @guess\n\t\tend\n\tend", "def guessed_letters()\n guessed = $bucket.join(\" \") # return a string of guessed letters\nend", "def remove_vowels(array)\n array.map do |word|\n word.chars.reject { |letter| %w[a e i o u].include?(letter.downcase) }.join\n end\nend", "def yell(words)\n newArr = []\n i = 0\n while i<words.length\n newWord = words[i] + \"!\"\n newArr << newWord\n i += 1\n end\n return newArr\n end", "def pirates_say_arrrrrrrrr(string)\n\tarray_1 = string.downcase.split\"\"\n\tarray_2 = []\n\nloop do \n\tarrr = array_1.index(\"r\")\n\tbreak if arrr == nil\n\tarray_1.delete_at(arrr)\n\tarray_2 << array_1[arrr]\n\t\nend\n\narray_2.join\n\nend", "def test(b)\n b.map {|letter| \"I like the letter: #{letter}\"}\nend", "def test(b)\n b.map {|letter| \"I like the letter: #{letter}\"}\nend", "def test(b)\n b.map {|letter| \"I like the letter: #{letter}\"}\nend", "def same_letter(arr)\n new_str = arr.shift\n\n loop do\n if arr[0] == new_str[-1]\n new_str << arr.shift\n else\n break\n end\n end\n new_str\nend", "def letter_select array, letter\n # iterates\n array.each do |value|\n # checks for letter at each index\n if value.include?(letter)\n # if letter is included in value at index, puts value\n puts value\n end\n end\n end", "def yell(words)\n words.map{|word| word + \"!\"}\nend", "def group_by_starting_letter(array)\n array.group_by {|word| word[0]}\nend", "def remove_vowels(array)\n array.map {|word| word.delete(\"aeiou\")}\nend", "def checkLetter(letter)\n @word.split(\"\").each_with_index do |item, index|\n if item == letter\n @guess[index] = letter\n end\n end\n puts @guess\nend", "def get_word\n @lettercollection.push(@string_as_array[@i])\n @lettercollection.join('')\nend", "def filter_repeated_character_strings(arr)\nend", "def kesha_maker(array)\n array.map do |string|\n string[2] = \"$\"\n end\n array\nend", "def vowel_checker(array)\n vowel_guide = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n array.map! do |name|\n name_split = name.split('')\n name_split.map! do |char|\n index = 0\n while index < vowel_guide.length\n if char == vowel_guide[index]\n char = vowel_guide[index += 1]\n index += 1\n elsif char == \"u\"\n char = \"a\"\n index += 1\n else\n char\n index += 1\n end\n char\n end\n char\n end\n name_split\n name_join = name_split.join('')\n name_join\n end\n array\nend", "def get_letters(game)\n game.letters.split(\"\").reject{|letter| game.word.upcase.include?(letter)}.join(\" \")\nend", "def pig_latin_translate\n english_word_arr = []\n vowel_array = %w(a e i o u)\n \n print \"What word would you like to translate? \"\n input = gets.chomp!.downcase\n \n english_word_to_translate = input.split(/ /)\n \n english_word_to_translate.each do |word|\n english_word_arr = word.split(//)\n\n\n\n #split by words\n #split by character\n #Take first letter move to end\n #add 'Ay'\n #join and return word\n end\nend", "def remove_vowels(array) #Works, but is very long, wordy and non-intuitive.\r\n vowels = [\"a\", \"A\", \"e\", \"E\", \"i\", \"I\", \"o\", \"O\", \"u\", \"U\"]\r\n new_array = []\r\n array.map do |string|\r\n sub_array = string.chars.select do |letter|\r\n letter unless vowels.include?(letter)\r\n end\r\n new_array << sub_array.join\r\n end\r\n new_array\r\nend", "def word_selector array \n while @word_count.size > 0\n number = @word_count.shift\n @answer.push(@letter_array[0...number])\n @letter_array.slice!(0...number)\n number = nil\n end \n end", "def get_all_letters_in_array_of_words(array)\n array.join.split('').sort\nend", "def to_nato(words)\nnewarray = []\nnato = {\"a\" => \"Alfa\", \"b\" => \"Bravo\", \"!\" => \"!\", \".\" => \".\", \"?\" => \"?\", \"c\" => \"Charlie\", \"d\" => \"Delta\", \"e\" => \"Echo\", \"f\" => \"Foxtrot\", \"g\" => \"Golf\", \"h\" => \"Hotel\", \"i\" => \"India\", \"j\" => \"Juliett\", \"k\" => \"Kilo\", \"l\" => \"Lima\", \"m\" => \"Mike\", \"n\" => \"November\", \"o\" => \"Oscar\", \"p\" => \"Papa\", \"q\" => \"Quebec\", \"r\" => \"Romeo\", \"s\" => \"Sierra\", \"t\" => \"Tango\", \"u\" => \"Uniform\", \"v\" => \"Victor\", \"w\" => \"Whiskey\", \"x\" => \"Xray\", \"y\" => \"Yankee\", \"z\" => \"Zulu\"}\nletters = words.downcase.split(\" \").join(\"\").chars\nletters.each do |x|\nnewarray << nato[x]\nend\nnewarray.join(\" \")\n\nend", "def vowel_cipher(string)\n change = {\n \"a\"=>\"e\",\n \"e\"=>\"i\",\n \"i\"=> \"o\",\n \"o\" => \"u\",\n \"u\"=> \"a\"\n }\n\n vowels= \"aeiou\"\n\n new_arr = string.split(\"\").map do |char|\n if vowels.include?(char)\n change[char]\n else \n char \n end \n end \n return new_arr.join(\"\")\nend", "def get_all_letters_in_array_of_words(array)\n\tn =['cat', 'dog', 'fish']\n\tcharacters = n.map { | animal | animal.chars }\n\tcharacters.flatten.sort\nend", "def cap_me(array)\n array.map! {|x| x.capitalize}\nend", "def match_letters(player_guess) \n indexes_matched = @word_array.each_index.select { |i| @word_array[i] == player_guess}\n for x in indexes_matched do\n @results[x] = player_guess\n end\n end", "def translate(message_from_txt)\n message_character_array = separate(message_from_txt.chomp)\n message_character_array.map do |letter|\n one_braille_array = get_array(letter)\n #now the output is the 3-element braille array for that one letter character\n shovel(one_braille_array)\n end\n format_lines\n end", "def alphabetize(arr)\n\nesperanto_ALPHABET = \"abcĉdefgĝhĥijĵklmnoprsŝtuŭvz\"\n\n arr.sort_by do |sentence|\n sentence.chars.collect do |letter|\n # binding.pry\n esperanto_ALPHABET.index(letter)\n # binding.pry \n\n end\n end\n\nend", "def pig_sentece(sentece)\n new_sentece = []\n sentece.each do |word|\n new_sentece << pig_word(word.dup)\n end\n new_sentece\nend", "def guess_letters(letter)\n @guesses << letter\n @guesses\nend", "def remove_vowels(arr)\n arr.map { |word| word.delete('aeiouAEIOU')}\nend", "def call_a_vowel(array_split_name)\n\tindex = 0\n\tnew_array = []\n\twhile index < array_split_name.length\n\n\t\tletter = array_split_name.fetch(index)\n\n\t\tif letter == \"a\"\n\t\t\tletter = \"e\"\n\t\telsif letter == \"e\"\n\t\t\tletter = \"i\"\n\t\telsif letter ==\"i\"\n\t\t\tletter = \"o\"\n\t\telsif letter == \"o\"\n\t\t\tletter = \"u\"\n\t\telsif letter == \"u\"\n\t\t\tletter = \"a\"\n\t\tend\n\n\t\tnew_array.push(letter)\n\t\tindex += 1\n\tend\n\treturn new_array\n\n\nend", "def remove_vowels(array)\n array.map do |string|\n string.delete(\"aeiouAEIOU\")\n end\nend", "def kesha_maker(array)\n kesha_array = []\n array.each do |name|\n name[2] = \"$\"\n kesha_array << name\n end\n kesha_array\nend", "def vowel_cipher(string)\n change = {\n \"a\"=>\"e\",\n \"e\"=>\"i\",\n \"i\"=>\"o\",\n \"o\"=>\"u\",\n \"u\"=>\"a\"\n }\n vowels = \"aeiou\"\n\n new_arr = string.split(\"\").map do |char|\n if vowels.include?(char)\n change[char]\n else\n char\n end\n end\n\n return new_arr.join(\"\")\nend", "def remove_vowels(arr)\n arr.map {|word| word.delete('AEIOUaeiou') }\nend", "def nato(word)\n original = []\n value = ''\n letters = {\n \"A\"=> \"Alpha\", \"B\"=> \"Bravo\", \"C\"=> \"Charlie\",\n \"D\"=> \"Delta\", \"E\"=> \"Echo\", \"F\"=> \"Foxtrot\",\n \"G\"=> \"Golf\", \"H\"=> \"Hotel\", \"I\"=> \"India\",\n \"J\"=> \"Juliett\",\"K\"=> \"Kilo\", \"L\"=> \"Lima\",\n \"M\"=> \"Mike\", \"N\"=> \"November\",\"O\"=> \"Oscar\",\n \"P\"=> \"Papa\", \"Q\"=> \"Quebec\", \"R\"=> \"Romeo\",\n \"S\"=> \"Sierra\", \"T\"=> \"Tango\", \"U\"=> \"Uniform\",\n \"V\"=> \"Victor\", \"W\"=> \"Whiskey\", \"X\"=> \"X-ray\",\n \"Y\"=> \"Yankee\", \"Z\"=> \"Zulu\"\n }\n arr = word.split('')\n arr.each do |letter|\n value = letters.values_at(letter.upcase)\n original.concat(value)\n end\n original.join(' ')\nend", "def LetterChanges(str)\n new_string = []\n str = str.split(\" \")\n str.each do |word|\n new_string << word_changes(word)\n end\n new_string.join(\" \")\nend", "def aba_array(arr)\n arr.map{|str| aba_translate(str)}\nend", "def compare_letter(user_letter,word,rose_pic,array_underlines)\n word_index = []\n count_letter_existance = 0\n # searches user's input letter in word and uses index to update underscore array or update counter.\n word.split_word.each_with_index{|letter,index|\n if user_letter == letter\n array_underlines[index] = user_letter\n elsif !word.split_word.include?(user_letter)\n count_letter_existance+=1\n end\n\n if count_letter_existance == word.split_word.length\n puts \"Wrong guess!\"\n rose_pic.delete\n end\n }\n\n # Updates array of underscores.\n display_word = \"\"\n array_underlines.each do |index|\n display_word+= \" #{index}\"\n end\n\n return display_word\n\nend", "def remove_vowels(array)\n array.map { |string| string.delete(\"aeiouAEIOU\") }\nend", "def letter_reverse str\n\toriginal_array = str.split(\" \")\n\treturn_array = []\n\toriginal_array.each do |str|\n\t\treturn_array << str.reverse\n\tend\n\treturn_array.join(\" \")\nend", "def group_by_starting_letter(arr_letters)\n #hash that itera and create a key with the first letter\n hash = Hash.new { |k, v| k[v] = [] }\n #put the word into the hash how an array\n arr_letters.each do |word|\n hash[word[0]] << word\n end\n #return the hash full\n hash\nend", "def vowel_changer(name)\n vowel_guide = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n name.each do |names|\n name = names.split('')\n name\n name.map! do |char|\n index = 0\n while index < vowel_guide.length\n if char == vowel_guide[index]\n char = vowel_guide[index += 1]\n index += 1\n elsif char == \"u\"\n char = \"a\"\n index += 1\n else\n char\n index += 1\n end\n\n end\n char\n end\n name\n end\n name\nend", "def remove_letter_a(words)\n new_words = []\n words.each do |word|\n without_a = \"\"\n word.each_char do |c|\n if c != 'a'\n without_a << c\n end\n end\n new_words << without_a\n end\n new_words\nend", "def doggy(array, search_letter)\n\tsearch_letter_array= array.each_index.select{|i| array[i] == search_letter}\n\treturn search_letter_array \nend", "def scramble_string(string, positions)\n scrambled = []\n #split the string into an array of letters\n letters = string.split(\"\")\n #loop through array\n i = 0\n while i < letters.length\n #assign each letter an index in a new array\n scrambled[positions[i]] = letters[i]\n i += 1\n end\n #return the new array\n return scrambled.join(\"\")\nend", "def yell(words)\n i = 0\n new_arr = []\n while i < words.length\n loud_words = words[i] + '!'\n new_arr << loud_words\n i += 1\n end\n return new_arr\nend", "def get_all_letters_in_array_of_words(array)\n result = []\n array.each do |x|\n for a in 0..(x.length-1) do\n result.push(x[a]) if !result.include?(x[a])\n end\n end\n result.sort\nend", "def kesha_maker(array)\n kesha = []\n array.each do |i|\n i[2] = \"$\"\n kesha << i\n end\n kesha\nend", "def remove_vowels(array)\n array.map { |string| string.delete('aeiouAEIOU') }\nend", "def letterReverse(sentence)\n\treversesentence = sentence.split(\" \")\n\tnewArray = reversesentence.reverse()\n\tjoinnewArray = newArray.join(\"\")\nend", "def remove_vowels(array)\n array.map { |string| string.delete(\"AEIOUaeiou\") }\nend", "def kesha_maker(array)\n array.collect do |element|\n split_element_to_array = element.split(\"\")\n split_element_to_array[2] = \"$\"\n joined_array = split_element_to_array.join\n joined_array\n end\nend", "def add_s(array)\n array.each_with_index.collect do |word, index|\n if index != 1\n word << \"s\"\n end\n end\n array\nend", "def word\n @letters.join\n end", "def guess(letter)\r\n\t\t@guessed << letter.downcase\r\n\t\t@word[0].each_index do |i| #Iterate through indexes instead of values\r\n\t\t\tif @word.dig(0,i) == letter #since @word is an array inside an array, dig helps us look in word ([0]) each index for the letter.\r\n\t\t\t\t@hidden_word[i] = letter #if found, substitute \"_\" for the letter guessed in the same index for @hidden_word\r\n\t\t\tend\r\n\t\tend\r\n\t\tp @hidden_word #give feedback of results\r\n\tend", "def remove_vowels(array)\n array.map do |string|\n string.delete('AEIOUaeiou')\n end\nend", "def kesha_maker(array)\n array.map do |element|\n element[2] = \"$\" #change 3rd character of each element to a dollar sign\n element #and return the changed element\n end\nend", "def add_bang(array)\n array.map {|string| string+\"!\"}\nend", "def adjacent_words(word)\n one_letter_off = []\n (word.length - 1).times do |i|\n dup_word = word.dup\n dup_word[i] = \".\"\n one_letter_off += @dictionary.select {|word| word =~ (/\\A#{dup_word}\\z/) }\n end\n one_letter_off\n end", "def kesha_maker(array)\n array.each do |word|\n word[2] = \"$\"\n end\nend", "def add_bang(array)\n # TODO: Take an array of strings and return a new array with \"!\" appended to each string.\n # You should use Enumerable#map\n array.map do |element|\n element+\"!\"\n end\nend", "def summon_captain_planet(array)\n array.collect { |word| word.capitalize + \"!\" }\nend", "def array_map\n grades=[\"A\",\"B\",\"C\",\"D\",\"F\"] # this is the orignal array \n grades.map {|grade| grade + \"?\" } # this creates a new array with the original objects\n # and adds a ! to each element\nend", "def kesha_maker(array)\n array.each { |word| word[2] = \"$\" }\nend", "def kesha_maker(array)\n array.each do |string|\n string[2] = \"$\"\n end\n array\nend", "def kesha_maker(array)\n new_array = []\n array.each do |key|\n new_array = key[2] = \"$\"\n end\nend" ]
[ "0.6238608", "0.62090826", "0.6139773", "0.61182475", "0.60914177", "0.60819805", "0.6037126", "0.6032938", "0.60148674", "0.5931469", "0.59199494", "0.5909309", "0.59071577", "0.59041184", "0.58935547", "0.58790374", "0.5878315", "0.58635855", "0.5862479", "0.5837508", "0.5837508", "0.5824882", "0.5814461", "0.5781279", "0.57806265", "0.577707", "0.5775474", "0.57746625", "0.5768134", "0.5767398", "0.5766414", "0.5754605", "0.57502466", "0.5741327", "0.5740133", "0.57203305", "0.5703726", "0.5703726", "0.5703726", "0.5687868", "0.5687345", "0.56819403", "0.5672254", "0.56717336", "0.56605345", "0.5657119", "0.56539845", "0.56539065", "0.565312", "0.56518763", "0.5649961", "0.5646653", "0.5644053", "0.564331", "0.56416196", "0.56411165", "0.5633334", "0.5624414", "0.5598424", "0.55905575", "0.55840224", "0.5582144", "0.5580891", "0.5578419", "0.55767006", "0.5576565", "0.55678475", "0.55658156", "0.5564307", "0.5564184", "0.55545044", "0.5553684", "0.5552855", "0.55521226", "0.55477", "0.55458045", "0.5544429", "0.5540323", "0.5539564", "0.5539366", "0.55347914", "0.55310905", "0.55274874", "0.55253327", "0.5524623", "0.5524336", "0.55231786", "0.5520022", "0.5516777", "0.5508059", "0.55072093", "0.55024534", "0.54965127", "0.5496442", "0.54934794", "0.54905903", "0.5483138", "0.54819095", "0.54784507", "0.54669654", "0.54660064" ]
0.0
-1
Return the vCloud data associated with vApp
def initialize(id) unless id =~ /^#{self.class.id_prefix}-[-0-9a-f]+$/ raise "#{self.class.id_prefix} id : #{id} is not in correct format" end @id = id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vapp(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vApp/vapp-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VApp').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n # ipAddress could be namespaced or not: see https://github.com/astratto/vcloud-rest/issues/3\n vms.each do |vm|\n vapp_local_id = vm.css('VAppScopedLocalId')\n addresses = vm.css('rasd|Connection').collect{|n| n['vcloud:ipAddress'] || n['ipAddress'] }\n vms_hash[vm['name']] = {\n :addresses => addresses,\n :status => convert_vapp_status(vm['status']),\n :id => vm['href'].gsub(\"#{@api_url}/vApp/vm-\", ''),\n :vapp_scoped_local_id => vapp_local_id.text\n }\n end\n\n # TODO: EXPAND INFO FROM RESPONSE\n { :name => name, :description => description, :status => status, :ip => ip, :vms_hash => vms_hash }\n end", "def vcloud_attributes\n Vcloud::Core::Fog::ServiceInterface.new.get_vapp_template(id)\n end", "def get_vapp_template(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VAppTemplate').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n vms.each do |vm|\n vms_hash[vm['name']] = {\n :id => vm['href'].gsub(\"#{@api_url}/vAppTemplate/vm-\", '')\n }\n end\n\n # TODO: EXPAND INFO FROM RESPONSE\n { :name => name, :description => description, :vms_hash => vms_hash }\n end", "def get_vapp(id)\n fog_service_interface.get_vapp(id)\n end", "def get_vapp_template(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VAppTemplate').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n vms.each do |vm|\n vms_hash[vm['name']] = {\n :id => vm['href'].gsub(/.*\\/vAppTemplate\\/vm\\-/, \"\")\n }\n end\n\n { :name => name, :description => description, :vms_hash => vms_hash }\n end", "def datastore(arg)\n ds = VCenterDriver::VIHelper.one_item(OpenNebula::Datastore, arg)\n\n {\n :ds_ref => ds['TEMPLATE/VCENTER_DS_REF'],\n :one_item => ds\n }\n end", "def cloudversion\n clouddata && clouddata['version']\n end", "def get_ds_vdata(host, name)\n get_vcenter_dc(onblock(:h, host)).datastoreFolder.children.each do | ds |\n next if ds.name != name\n\n begin\n return ds.info.nas.remoteHost, ds.info.nas.remotePath\n rescue\n nil\n end\n end\n end", "def application_metadata\n arr_data = {\n site_name: \"Volunteer\",\n site_description: \"Aproximando voluntários de instituições\"\n }\n end", "def get_vapp_by_name_and_vdc_name(name, vdc_name)\n fog_service_interface.get_vapp_by_name_and_vdc_name(name, vdc_name)\n end", "def zapp_version\n host = plant_attributes[self.plant.intern][self.env.intern][:host]\n #results = submit_cmd('show zapp',:topology,\"-host #{host} -csv\",0) \n results = exec_open(\"#{Zapptop} show zapp -host #{host} -csv\") \n puts results\n populate_app_attributes(results,'zapp_version',self.plant.intern,self.env.intern)\n [plant_attributes[self.plant.intern][self.env.intern][:version],plant_attributes[self.plant.intern][self.env.intern][:prodid],plant_attributes[self.plant.intern][self.env.intern][:contact]]\n end", "def index\n @appdata = Appdatum.all\n end", "def datastore_info\n dc = @cluster.datacenter\n ds = dc.datastore_folder\n\n ds_info = ''\n\n ds.fetch!.each do |ref, _ds|\n ds_info << \"VCENTER_DS_REF=\\\"#{ref}\\\"\\n\"\n end\n\n ds_info\n end", "def cloud_search_data\n {}\n end", "def index\n @manage_app_versions = Manage::AppVersion.all\n end", "def clouddata!\n\n # Collect all application ids, skipping any invalid ones\n ids = apps.collect do |app|\n app.id\n end.compact\n\n # Queries Apple's iTunes Store API for latest cloud data using undocumented bulk method\n response = Net::HTTP.get('itunes.apple.com', '/lookup?id=' + ids.join(','))\n results = JSON.parse(response)['results']\n results.each do |result|\n if app = get(result['trackId'] || -1)\n app.clouddata = result\n end\n end\n end", "def fetch_network_configurations_for_vapp(vapp_id)\n require 'fog/vcloud_director'\n begin\n # fog-vcloud-director now uses a more user-friendly parser that yields vApp instance. However, vapp networking\n # is not parsed there yet so we need to fallback to basic ToHashDocument parser that only converts XML to hash.\n # TODO(miha-plesko): update default parser to do the XML parsing for us.\n data = connection.get_vapp(vapp_id, :parser => Fog::ToHashDocument).body\n rescue Fog::VcloudDirector::Errors::ServiceError => e\n $vcloud_log.error(\"#{log_header} could not fetch network configuration for vapp #{vapp_id}: #{e}\")\n return []\n end\n Array.wrap(data.dig(:NetworkConfigSection, :NetworkConfig))\n end", "def obtain_vm_data(resource)\n\n puts \"Obtaining virtual machines' data\"\n return obtain_torque_data(resource[:head], resource[:compute])\n \nend", "def get_vapp_by_name(organization, vdcName, vAppName)\n result = nil\n\n get_vdc_by_name(organization, vdcName)[:vapps].each do |vapp|\n if vapp[0].downcase == vAppName.downcase\n result = get_vapp(vapp[1])\n end\n end\n\n result\n end", "def get_vdc(vdcId)\n params = {\n 'method' => :get,\n 'command' => \"/vdc/#{vdcId}\"\n }\n\n response, headers = send_request(params)\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n vapps = {}\n response.css(\"ResourceEntity[type='application/vnd.vmware.vcloud.vApp+xml']\").each do |item|\n vapps[item['name']] = item['href'].gsub(\"#{@api_url}/vApp/vapp-\", \"\")\n end\n\n networks = {}\n response.css(\"Network[type='application/vnd.vmware.vcloud.network+xml']\").each do |item|\n networks[item['name']] = item['href'].gsub(\"#{@api_url}/network/\", \"\")\n end\n { :description => description, :vapps => vapps, :networks => networks }\n end", "def list_cloud_data\n\t\tbegin\n\t\t\t@response, @headers, @url = amazon_request(\"Get\", \"/?prefix=#{current_user.email}&amp;delimiter=%2F\", \"\", \"\", :cloud => @s3)\n\t\t\t@response_favorites, @headers_favorites, @url_favorites = amazon_request(\"Get\", \"/?prefix=Favorites&amp;delimiter=%2F\", \"\", \"\", :cloud => @s3)\n\t\t\t@response_demos, @headers_demos, @url_demos = amazon_request(\"Get\", \"/?prefix=Demos&amp;delimiter=%2F\", \"\", \"\", :cloud => @s3)\n\t\trescue\n\t\t\tsession[:error] = \"Can't connect to the Amazon bucket. Check the environment variables\"\n\t\t\tredirect_to :controller => \"clouds\", :action => \"error\", :id => \"0\"\n\t\tend\n\tend", "def collectVMs(rf, db)\n\trf.childEntity.grep(RbVmomi::VIM::Datacenter).each do |dc|\n\t\tprogressbar = ProgressBar.create(:title => \"VMs\", :format => '%t |%b>>%i| %p%% %a')\n\t\tprogressbar.total = counter(dc, \"v\")\n\t\tdc.vmFolder.childEntity.each do |folder|\n\t\t\tfolder.childEntity.each do |vmlist|\n\t\t\t\tnext if vmlist.class.to_s == \"Folder\"\n\t\t\t\tdb.select(3)\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"Status\", \"#{vmlist.summary.overallStatus}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"Uptime\", \"#{vmlist.summary.quickStats.uptimeSeconds}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"CPUusage\", \"#{vmlist.summary.quickStats.overallCpuUsage}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"CPUnum\", \"#{vmlist.summary.config.numCpu}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"MemUsage\", \"#{vmlist.summary.quickStats.guestMemoryUsage}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"MemTotal\", \"#{vmlist.summary.config.memorySizeMB}\")\n\t\t\t\tprogressbar.increment\n\t\t\tend\n\t\tend\n\tend\nend", "def get_vcenter_dc(host)\n host.info! true\n VIM.connect(\n :host => host['//VCENTER_HOST'], :insecure => true,\n :user => host['//VCENTER_USER'], :password => host['//VCENTER_PASSWORD']\n ).serviceInstance.find_datacenter\n end", "def name\n vcloud_attributes[:name]\n end", "def attributes_for_app(version=nil)\n cache_dir = File.join(Rails.root,\"tmp\",\"occasions-cache\")\n Dir.mkdir(cache_dir) unless File.exist?(cache_dir) \n cache_filename = File.join(cache_dir,\"occasion.#{id}\")\n if File.exist?(cache_filename) \n x = File.read(cache_filename)\n cache = JSON.load(x).symbolize_keys\n if content_updated_on && Time.parse(cache[:updated_on]) >= content_updated_on\n return cache[:content]\n end\n end\n # NOTE - we translate the content_updated_on to version so that the client can compare\n # this to a previous version and see if it has to do anything\n r = attributes.only(\"id\",\"name\", \"start_time\",\"city\")\n r = r.merge :participants => participants.map{|p| p.base_attributes_for_app}, \n :photos => photos.map{ |p| p.attributes_for_app(version) }.reverse, \n :thumb_id => photos.last && photos.last.id,\n :version => content_updated_on.to_i\n File.open(cache_filename,\"w\") do |f|\n f.write( {updated_on: Time.now, content: r}.to_json)\n end\n r\n end", "def vm_instances\n @conn.vminstances\n end", "def vms\n @conn.vms\n end", "def index\n @app_instances = AppInstance.all\n end", "def server_get_data(vmid,field)\n @site[\"nodes/#{@nodename}/openvz/#{vmid}/status/current\"].get @auth_params do |response, request, result, &block|\n data = (field.match(\"all\"))?JSON.parse(response.body)['data'] : JSON.parse(response.body)['data'][field]\n end\nend", "def get_full_data(data)\n case @client.api_version\n when \"1.2\"\n # in this version returned id=>{...}\n result = @client.api_request(:method => \"template.get\", :params => {:filter => data, :output => \"extend\"})\n result.empty? ? [] : result.values \n else\n @client.api_request(:method => \"template.get\", :params => {:filter => data, :output => \"extend\"})\n end\n end", "def index\n @kvs = Kv.all\n end", "def vservers\n @vservers=get_endpoint('vservers').keys\n end", "def compose_vapp_from_vm(vdc, vapp_name, vapp_description, vm_list={}, network_config={})\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.ComposeVAppParams(\n \"xmlns\" => \"http://www.vmware.com/vcloud/v1.5\",\n \"xmlns:ovf\" => \"http://schemas.dmtf.org/ovf/envelope/1\",\n \"name\" => vapp_name) {\n xml.Description vapp_description\n xml.InstantiationParams {\n xml.NetworkConfigSection {\n xml['ovf'].Info \"Configuration parameters for logical networks\"\n xml.NetworkConfig(\"networkName\" => network_config[:name]) {\n xml.Configuration {\n xml.IpScopes {\n xml.IpScope {\n xml.IsInherited(network_config[:is_inherited] || \"false\")\n xml.Gateway network_config[:gateway]\n xml.Netmask network_config[:netmask]\n xml.Dns1 network_config[:dns1] if network_config[:dns1]\n xml.Dns2 network_config[:dns2] if network_config[:dns2]\n xml.DnsSuffix network_config[:dns_suffix] if network_config[:dns_suffix]\n xml.IpRanges {\n xml.IpRange {\n xml.StartAddress network_config[:start_address]\n xml.EndAddress network_config[:end_address]\n }\n }\n }\n }\n xml.ParentNetwork(\"href\" => \"#{@api_url}/network/#{network_config[:parent_network]}\")\n xml.FenceMode network_config[:fence_mode]\n\n xml.Features {\n xml.FirewallService {\n xml.IsEnabled(network_config[:enable_firewall] || \"false\")\n }\n }\n }\n }\n }\n }\n vm_list.each do |vm_name, vm_id|\n xml.SourcedItem {\n xml.Source(\"href\" => \"#{@api_url}/vAppTemplate/vm-#{vm_id}\", \"name\" => vm_name)\n xml.InstantiationParams {\n xml.NetworkConnectionSection(\n \"xmlns:ovf\" => \"http://schemas.dmtf.org/ovf/envelope/1\",\n \"type\" => \"application/vnd.vmware.vcloud.networkConnectionSection+xml\",\n \"href\" => \"#{@api_url}/vAppTemplate/vm-#{vm_id}/networkConnectionSection/\") {\n xml['ovf'].Info \"Network config for sourced item\"\n xml.PrimaryNetworkConnectionIndex \"0\"\n xml.NetworkConnection(\"network\" => network_config[:name]) {\n xml.NetworkConnectionIndex \"0\"\n xml.IsConnected \"true\"\n xml.IpAddressAllocationMode(network_config[:ip_allocation_mode] || \"POOL\")\n }\n }\n }\n xml.NetworkAssignment(\"containerNetwork\" => network_config[:name], \"innerNetwork\" => network_config[:name])\n }\n end\n xml.AllEULAsAccepted \"true\"\n }\n end\n\n params = {\n \"method\" => :post,\n \"command\" => \"/vdc/#{vdc}/action/composeVApp\"\n }\n\n response, headers = send_request(params, builder.to_xml, \"application/vnd.vmware.vcloud.composeVAppParams+xml\")\n\n vapp_id = headers[:location].gsub(\"#{@api_url}/vApp/vapp-\", \"\")\n\n task = response.css(\"VApp Task[operationName='vdcComposeVapp']\").first\n task_id = task[\"href\"].gsub(\"#{@api_url}/task/\", \"\")\n\n { :vapp_id => vapp_id, :task_id => task_id }\n end", "def get_cloud\n cloud_href = instance.cloud.href\n cloud_id = cloud_href.split('/').last\n cloud = @api_client.clouds(:id => cloud_id)\n end", "def to_configure_vapp_hash\n {\n :name => name,\n :cpus => cpus,\n :memory => memory,\n :disks => disks.map {|d| { :number => d.address.to_s, :size => d.vcloud_size, :resource => d.vcloud_size.to_s } }\n }\n end", "def to_configure_vapp_hash\n {\n :name => name,\n :cpus => cpus,\n :memory => memory,\n :disks => disks.map {|d| { :number => d.address.to_s, :size => d.vcloud_size, :resource => d.vcloud_size.to_s } }\n }\n end", "def index\n @appList = AppProdu.getAppIdAndNameList current_member.id\n end", "def credentials(app_name=nil)\n #bound_app is the name of an app bound to the dat-service and that credentials\n #should be used to access the data-service.\n #for example if an app creates large objects you will need to use\n #the credentials of that app to find the objects.\n app_name ||= @wrapped['director']['bound_app'] if @wrapped['director']\n @credentials ||= VMC::KNIFE.get_credentials(name(), app_name)\n @credentials\n end", "def get_models(app_name)\n index = @apps.index(app_name)\n models = @apps[index].models\n end", "def lookup(app_name)\n unless @metadata.key?(app_name)\n data = YAML.load_file(\"./data/applications/#{app_name}.yaml\")\n @metadata[app_name] = data['cots::app_metadata']\n end\n @metadata[app_name]\n end", "def retrieve_volumes\n dbg { \"retrieving #{pool_info}, #{hv_info}\" }\n\n volumes = pool.list_all_volumes\n dbg { \"list_all_volumes #{pool_info}, #{hv_info}\" }\n\n storage_volumes = volumes.map.with_index do |vol, index|\n id = \"#{uuid}--#{index}\"\n StorageVolume.new(vol, pool: self, id: id)\n end\n\n dbg { \"retrieved size=#{storage_volumes.size}, #{pool_info}, #{hv_info}\" }\n storage_volumes\n end", "def read_vms\n end", "def index\n @vdms = Vdm.all\n\n render json: @vdms\n end", "def obtain_vm_data(resource)\n\n puts \"Obtaining virtual machines' data\"\n \n # ...\n \n ips = [\"IP_A\", \"IP_B\"]\n ip_roles = {:rol_a => \"IP_A\", :rol_b => \"IP_B\"}\n img_roles = {:rol_a => \"/path/to/IMG_A\", :rol_b => \"/path/to/IMG_B\"}\n \n return ips, ip_roles, img_roles\n \n end", "def get_appdata(node, appname, attribute = nil)\n data = {}\n if node.fetch('deploy', {}).fetch(appname, {})['application'].nil?\n data['appname'] = appname\n else\n data['appname'] = node['deploy'][appname]['application']\n end\n\n data['domains'] = get_domains(node, appname)\n\n if ::EasyBib.is_aws(node)\n data['deploy_dir'] = node['deploy'][appname]['deploy_to']\n\n data['app_dir'] = get_app_dir(data['deploy_dir'])\n\n data['doc_root_dir'] = \"#{data['app_dir']}#{node['deploy'][appname]['document_root']}\"\n else\n data['deploy_dir'] = data['app_dir'] = get_vagrant_appdir(node, appname)\n\n if node.fetch('vagrant', {}).fetch('applications', {}).fetch(appname, {})['doc_root_location'].nil?\n fail \"node[vagrant][applications][#{appname}][doc_root_location] is not set - fix web_dna.json!\"\n end\n\n data['doc_root_dir'] = node['vagrant']['applications'][appname]['doc_root_location']\n end\n\n # ensure all dirs end with a slash:\n %w(deploy_dir app_dir doc_root_dir).each do |name|\n data[name] << '/' unless data[name].end_with?('/')\n end\n\n if attribute.nil?\n return data\n end\n\n value = data[attribute]\n fail \"Could not get #{attribute} for #{appname}!\" if value.nil? || value.empty?\n\n value\n end", "def get_pcloud_instance\n get(\"cloud-instances/#{guid}\")\n end", "def index\n @clouds = @current_user.clouds.all\n end", "def collectVMs(rf, db)\n\trf.childEntity.grep(RbVmomi::VIM::Datacenter).each do |dc|\n\t\tprogressbar = ProgressBar.create(:title => \"#{$single_folder}\", :format => '%t |%b>>%i| %p%% %a')\n\t\tif dc.vmFolder.childEntity.find { |x| x.name == \"#{$single_folder}\" }\n\t\t\tfolder = dc.vmFolder.childEntity.find { |x| x.name == \"#{$single_folder}\" }\n\t\t\tprogressbar.total = folder.childEntity.length\n\t\t\tfolder.childEntity.each do |vmlist|\n\t\t\t\tdb.select(3)\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"Status\", \"#{vmlist.summary.overallStatus}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"Uptime\", \"#{vmlist.summary.quickStats.uptimeSeconds}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"CPUusage\", \"#{vmlist.summary.quickStats.overallCpuUsage}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"CPUnum\", \"#{vmlist.summary.config.numCpu}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"MemUsage\", \"#{vmlist.summary.quickStats.guestMemoryUsage}\")\n\t\t\t\tdb.hset(\"#{vmlist.name}\", \"MemTotal\", \"#{vmlist.summary.config.memorySizeMB}\")\n\t\t\t\tprogressbar.increment\n\t\t\tend\n\t\tend\n\tend\nend", "def get_instance_data\n JSON.parse(Net::HTTP.get(URI.parse('http://169.254.169.254/latest/dynamic/instance-identity/document')))\n end", "def index\n @vcats = Vcat.all\n end", "def conf_file_data\n VMConfiguration.new(self).config_data\n end", "def getVMs\n @vms = VirtualMachine.all(@ip_address)\n end", "def veg_create_objects(data)\n data.each do | veg_hash |\n VegInfo::Vegetable.new(veg_hash)\n end\n end", "def index\n @vitricongviecs = Vitricongviec.all\n end", "def compose_vapp_from_vm(vdc, vapp_name, vapp_description, vm_list={}, network_config={})\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.ComposeVAppParams(\n \"xmlns\" => \"http://www.vmware.com/vcloud/v1.5\",\n \"xmlns:ovf\" => \"http://schemas.dmtf.org/ovf/envelope/1\",\n \"name\" => vapp_name) {\n xml.Description vapp_description\n xml.InstantiationParams {\n xml.NetworkConfigSection {\n xml['ovf'].Info \"Configuration parameters for logical networks\"\n xml.NetworkConfig(\"networkName\" => network_config[:name]) {\n xml.Configuration {\n xml.IpScopes {\n xml.IpScope {\n xml.IsInherited(network_config[:is_inherited] || \"false\")\n xml.Gateway network_config[:gateway]\n xml.Netmask network_config[:netmask]\n xml.Dns1 network_config[:dns1] if network_config[:dns1]\n xml.Dns2 network_config[:dns2] if network_config[:dns2]\n xml.DnsSuffix network_config[:dns_suffix] if network_config[:dns_suffix]\n xml.IpRanges {\n xml.IpRange {\n xml.StartAddress network_config[:start_address]\n xml.EndAddress network_config[:end_address]\n }\n }\n }\n }\n xml.ParentNetwork(\"href\" => \"#{@api_url}/network/#{network_config[:parent_network]}\")\n xml.FenceMode network_config[:fence_mode]\n\n xml.Features {\n xml.FirewallService {\n xml.IsEnabled(network_config[:enable_firewall] || \"false\")\n }\n if network_config.has_key? :nat_type\n xml.NatService {\n xml.IsEnabled \"true\"\n xml.NatType network_config[:nat_type]\n xml.Policy(network_config[:nat_policy_type] || \"allowTraffic\")\n }\n end\n }\n }\n }\n }\n }\n vm_list.each do |vm_name, vm_id|\n xml.SourcedItem {\n xml.Source(\"href\" => \"#{@api_url}/vAppTemplate/vm-#{vm_id}\", \"name\" => vm_name)\n xml.InstantiationParams {\n xml.NetworkConnectionSection(\n \"xmlns:ovf\" => \"http://schemas.dmtf.org/ovf/envelope/1\",\n \"type\" => \"application/vnd.vmware.vcloud.networkConnectionSection+xml\",\n \"href\" => \"#{@api_url}/vAppTemplate/vm-#{vm_id}/networkConnectionSection/\") {\n xml['ovf'].Info \"Network config for sourced item\"\n xml.PrimaryNetworkConnectionIndex \"0\"\n xml.NetworkConnection(\"network\" => network_config[:name]) {\n xml.NetworkConnectionIndex \"0\"\n xml.IsConnected \"true\"\n xml.IpAddressAllocationMode(network_config[:ip_allocation_mode] || \"POOL\")\n }\n }\n }\n xml.NetworkAssignment(\"containerNetwork\" => network_config[:name], \"innerNetwork\" => network_config[:name])\n }\n end\n xml.AllEULAsAccepted \"true\"\n }\n end\n\n params = {\n \"method\" => :post,\n \"command\" => \"/vdc/#{vdc}/action/composeVApp\"\n }\n\n response, headers = send_request(params, builder.to_xml, \"application/vnd.vmware.vcloud.composeVAppParams+xml\")\n\n vapp_id = headers[:location].gsub(/.*\\/vApp\\/vapp\\-/, \"\")\n\n task = response.css(\"VApp Task[operationName='vdcComposeVapp']\").first\n task_id = task[\"href\"].gsub(/.*\\/task\\//, \"\")\n\n { :vapp_id => vapp_id, :task_id => task_id }\n end", "def show\n @app_version = @app.app_versions.find(params[:id])\n # @app_version = AppVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app_version }\n end\n end", "def stored_virtual_machines\n kubevirt_client.get_stored_virtual_machines(namespace: @namespace)\n end", "def get(ref)\n if !@items[ref.to_sym]\n rbvmomi_dc = RbVmomi::VIM::Datacenter.new(@vi_client.vim, ref)\n @items[ref.to_sym] = Datacenter.new(rbvmomi_dc)\n end\n\n @items[ref.to_sym]\n end", "def instance_data\n @instance_data ||= JSON.parse(Net::HTTP.get(URI.parse('http://169.254.169.254/latest/dynamic/instance-identity/document')))\n end", "def get_applist\n return get_response(\"applist\", :json)\n end", "def data\n retrieve_data\n end", "def data\n raw_data['project']\n end", "def get_volumes\n volumes = get(\"cloud-instances/#{guid}/volumes\")[\"volumes\"] || []\n\n volumes.map do |volume|\n get_volume(volume[\"volumeID\"])\n end\n end", "def all\n data = []\n if @ec2_main.settings.openstack \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n x = conn.flavors.all\n x.each do |y|\n vcpu = nil\n begin \n vcpu = y.vcpus\n rescue\n vcpu = nil \n end\n if vcpu != nil \n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB VCPU: #{y.vcpus}VCPUs)\")\n else\n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB)\") \n end\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \n elsif @ec2_main.settings.google \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n response = conn.list_machine_types($google_zone)\n\t\t\t if response.status == 200\n\t x = response.body['items']\n\t x.each do |r|\n\t\t\t\t data.push(\"#{r['name']} ( Mem: #{r['memoryMb']}MB Disks: #{r['maximumPersistentDisks']} Disk Size: #{r['maximumPersistentDisksSizeGb']}GB CPUs: #{r['guestCpus']})\")\n \t end\n\t else\n\t \t data = []\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \t\t\n\t else \n data.push('t1.micro (EBS only Micro 32 or 64-bit, 613 MB, up to 2 compute unit)') \n data.push('m1.small (Small 32 or 64-bit, 1.7 GB, 1 compute unit)')\n data.push('m1.medium (Medium 32 or 64-bit, 3.75 GB, 2 compute unit)')\n data.push('m1.large (Large 64-bit, 7.5 GB, 4 compute unit)')\n data.push('m1.xlarge (Extra Large 64-bit, 15 GB, 8 compute unit)')\n data.push('m3.xlarge (EBS Only Extra Large 64-bit, 15 GB, 13 compute unit)')\n data.push('m3.2xlarge (EBS Only Extra Double Large 64-bit, 30 GB, 26 compute unit)')\n data.push('m2.xlarge (High Memory Extra Large 64-bit, 17.1 GB, 6.5 compute unit)')\n data.push('m2.2xlarge (High Memory Double Extra Large 64-bit, 34.2 GB, 13 compute unit)')\n data.push('m2.4xlarge (High Memory Quadruple Large 64-bit, 68.4 GB, 26 compute unit)')\n data.push('c1.medium (Compute optimized CPU Medium 32 or 64-bit, 1.7 GB, 5 compute unit)')\n data.push('c1.xlarge (Compute optimized CPU Extra Large 64-bit, 7 GB, 20 compute unit)')\n data.push('c3.xlarge (Compute optimized Extra Large 64-bit, 3.75 GB, 7 compute unit)')\n data.push('c3.2xlarge (Compute optimized Double Extra Large 64-bit, 7 GB, 14 compute unit)')\n data.push('c3.4xlarge (Compute optimized Quadruple Large 64-bit, 15 GB, 28 compute unit)')\t\n data.push('c3.8xlarge (Compute optimized Eight Large 64-bit, 30 GB, 55 compute unit)')\n data.push('i2.xlarge\t\t (High I/O 1x800 GB SSD, 30.5 GB, 14 compute unit)')\n data.push('i2.2xlarge\t\t (High I/O 2x800 GB SSD, 61 GB, 27 compute unit)')\n data.push('i2.4xlarge\t\t (High I/O 4x800 GB SSD, 122 GB, 53 compute unit)')\n data.push('i2.8xlarge\t \t (High I/O 8x800 GB SSD, 244 GB, 104 compute unit)')\t\t \n data.push('cc1.4xlarge (Cluster Compute Quadruple Extra Large 64-bit, 23 GB, 33.5 compute unit. 10GBit network)')\n data.push('cc2.8xlarge (Cluster Compute Eight Extra Large 64-bit, 60.5 GB, 88 compute unit. 10GBit network)')\n\t\t data.push('g2.2xlarge (Cluster GPU Quadruple Extra Large 64-bit, 15 GB, 26compute unit.)') \n data.push('cg1.4xlarge (Cluster GPU Quadruple Extra Large 64-bit, 22 GB, 33.5 compute unit. 10GBit network)') \n data.push('hi1.4xlarge (High I/O Quadruple Extra Large 64-bit, 60.5 GB, 2x1024GB SSD, 35 compute unit. 10GBit network)')\n\t\t data.push('hs1.8xlarge (High I/O Quadruple Extra Large 64-bit, 117 GB, 24x2048GB SSD, 35 compute unit. 10GBit network)')\n \t\t\n end \n return data\n end", "def apps\n apps_search = []\n App.all.each do |app|\n apps_search << {\n title: app.name,\n description: app.package_id,\n url: app_path(id: app.id)\n }\n end\n gon.apps = apps_search\n end", "def vm(name)\n @conn.vms.get(name)\n end", "def get_metadata(cloud_file)\n uri = {file_path: cloud_file.path} if cloud_file.path\n response = format_response(Dropbox.successful_request?(:metadata, access_token, uri))\n tree_cache(response)\n end", "def datastore\n result = splunk_exec(\"show\",[\"datastore-dir\"])\n result = result.to_s.split(':')[1].strip\n return result\n end", "def vdb()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Vdb::VdbRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def retrieve_cloud_files(files); end", "def get_appdata_global (*keys)\n @restv1.get_global_appdata(*keys)\n end", "def service_hash()\n searched_vendor = @data_service_json['vendor']\n current()\n # in the vmc.rb code there is a comment that says 'FIXME!'\n @current_services_info.each do |service_type, value|\n value.each do |vendor, version|\n version.each do |version_str, service_descr|\n if searched_vendor == service_descr[:vendor]\n return {\n \"type\" => service_descr[:type], \"tier\" => 'free',\n \"vendor\" => searched_vendor, \"version\" => version_str\n }\n end\n end\n end\n end\n raise \"vcap does not provide a data-service which vendor is #{searched_vendor}\"\n end", "def data\n raise NoMethodError, \"Engines need this method defined\"\n end", "def all_vms_info()\n str_info = \"\"\n\n @host.vm.each { |v|\n begin\n vivm = VIDriver::VIVm.new(\"\", v)\n rescue\n next\n end\n\n vivm.monitor\n\n name = v.name\n number = -1\n number = name.split('-').last if (name =~ /^one-\\d*$/)\n\n str_info << \"VM = [\"\n str_info << \"ID=#{number},\"\n str_info << \"DEPLOY_ID=\\\"#{name}\\\",\"\n str_info << \"POLL=\\\"#{vivm.info}\\\"]\\n\"\n }\n\n return str_info\n end", "def index\n @videoshops = Videoshop.all\n end", "def index\n flavors = []\n cs_id = params[:compute_site_id]\n\n if optimizer_query?\n tmpls = VirtualMachineTemplate.\n active.\n on_active_tenant.\n includes(\n tenants: [\n virtual_machine_flavors: [\n :os_families, :flavor_os_families\n ]\n ]\n )\n .where(appliance_type_id: appl_type_id)\n tmpls = tmpls.on_tenant(cs_id) if cs_id\n\n unless tmpls.blank?\n _, _, flavor, _ = Optimizer.instance\n .select_tmpl_and_flavor_and_tenant(tmpls, nil, params)\n\n flavors = [flavor]\n end\n else\n flavors = VirtualMachineFlavor.with_prefs(params).where(filter)\n flavors = flavors.on_tenant(cs_id) if cs_id\n end\n flavors = flavors.first(limit) if limit\n\n respond_with flavors\n end", "def vserver\n @vfiler\n end", "def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend", "def list\n deprecate # 07/26/2012\n doc = xml(get('/apps').to_s)\n doc.elements.to_a(\"//apps/app\").map do |a|\n name = a.elements.to_a(\"name\").first\n owner = a.elements.to_a(\"owner\").first\n [name.text, owner.text]\n end\n end", "def get_data(service, version, action)\n\t\treturn @transport.get_path(\"data\",service, version, action)\n\tend", "def cloud_config\n microbosh_config[\"cloud\"]\n end", "def get_cloud_instances(cloud_id)\n http_get_request(Scalarium.clouds_url+\"/#{cloud_id}/instances\") \n end", "def init_vms\n @vms = []\n\n response = @conn.get do |req|\n req.url \"/api/v1/vms\"\n req.headers = rest_headers\n end\n\n @vms = json(response.body)[:vms]\n end", "def couchrest_database\n @couchrest_database\n end", "def get_vm(name)\n filter = Com::Vmware::Vcenter::VM::FilterSpec.new(names: Set.new([name]))\n vm_obj = Com::Vmware::Vcenter::VM.new(vapi_config)\n vm_obj.list(filter)[0]\n end", "def index\n @admin_vouchers = Admin::Voucher.all\n end", "def get_virtualization_vmware_datastore_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VirtualizationApi.get_virtualization_vmware_datastore_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/virtualization/VmwareDatastores'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'VirtualizationVmwareDatastoreResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"VirtualizationApi.get_virtualization_vmware_datastore_list\",\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: VirtualizationApi#get_virtualization_vmware_datastore_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @visa_applications = VisaApplication.all\n end", "def database; datastore['DATABASE']; end", "def getZapposProductData(zapposSvpplyWants)\n\n zapposProductData = Array.new()\n \n key=\"e2d70f1ead64bafbc86dae4064d789f94644b8ff\"\n \n #iterate over each of the zappos products found on Svpply wants list. Collect data for use in emails. \n zapposSvpplyWants.each do |p| \n begin\n term = formatSearchTerm(p[\"page_title\"])\n escapedSearchTerm = URI.escape(term)\n \n #this just pulls the first variant from the product - need to work out a better way to select the right variant\n zapposResponse = JSON.parse(HTTParty.get(\"http://api.zappos.com/Search?term=#{escapedSearchTerm}&key=#{key}\").response.body)[\"results\"].first\n\n productDetails = {\n title: term,\n image: p[\"image\"], \n buyURL: zapposResponse[\"productUrl\"],\n price: zapposResponse[\"price\"] , \n }\n\n zapposProductData.push(productDetails)\n rescue\n # do nothing - will send error email to user. \n end \n end\n \n zapposProductData\n end", "def list\n\t\tdocs = proxy_database.view(\"#{shared_data_context.name}/all\")[\"rows\"]\n\t\treturn docs\n \tend", "def metadata\n {\n version: 0,\n prefill: true,\n returnUrl: '/veteran-information'\n }\n end", "def metadata\n {\n version: 0,\n prefill: true,\n returnUrl: '/veteran-information'\n }\n end", "def serialize_data\n return unless self.version_changes.nil? && previous\n\n db = CouchRest.database(\"http://208.78.99.54:5984/packages\")\n current = db.get(vname)\n prev = db.get(previous.vname)\n\n current_functions = current[\"function_hashes\"].keys\n prev_functions = prev[\"function_hashes\"].keys\n\n changes = {}\n changes[:removed] = (prev_functions - current_functions).sort\n changes[:added] = (current_functions - prev_functions).sort\n changes[:changed] = []\n\n current_functions.each do |f|\n changes[:changed] << f if current[\"function_hashes\"][f] != prev[\"function_hashes\"][f]\n end\n changes[:changed].sort!\n\n self.version_changes = changes\n\n rescue RestClient::ResourceNotFound\n self.version_changes = {}\n ensure\n save!\n end", "def feb_meta(app)\n {\n csrf_param: request_forgery_protection_token,\n csrf_token: form_authenticity_token,\n front_end_build_version: app.id,\n front_end_build_params: use_params(:build_search_params).to_query,\n front_end_build_url: front_end_builds_best_path(\n use_params(:build_search_params).merge(format: :json)\n )\n }\n end", "def get(vmname, model_view = true, group = @resource_group)\n set_default_subscription\n\n raise ArgumentError, \"must specify resource group\" unless group\n\n @api_version = '2014-06-01'\n\n if model_view\n url = build_url(@subscription_id, group, vmname)\n else\n url = build_url(@subscription_id, group, vmname, 'instanceView')\n end\n\n JSON.parse(rest_get(url))\n end", "def index\n @vpcs = Vpc.order(:name).all\n end", "def index\n @vips = Vip.all\n end", "def index\n @vils = Vil.all\n end", "def vcenter_vms_state\n vc_uuid = @vic.vim.serviceContent.about.instanceUuid\n\n view = @vic.vim\n .serviceContent\n .viewManager\n .CreateContainerView(\n {\n :container => @cluster.item,\n :type => ['VirtualMachine'],\n :recursive => true\n }\n )\n\n pc = @vic.vim.serviceContent.propertyCollector\n\n result = pc.RetrieveProperties(\n :specSet => [\n RbVmomi::VIM.PropertyFilterSpec(\n :objectSet => [\n :obj => view,\n :skip => true,\n :selectSet => [\n RbVmomi::VIM.TraversalSpec(\n :name => 'traverseEntities',\n :type => 'ContainerView',\n :path => 'view',\n :skip => false\n )\n ]\n ],\n :propSet => [\n {\n :type => 'VirtualMachine',\n :pathSet => VM_STATE_PROPERTIES\n }\n ]\n )\n ]\n )\n\n vms_hash = {}\n\n result.each do |r|\n next unless r.obj.is_a?(RbVmomi::VIM::VirtualMachine)\n\n vms_hash[r.obj._ref + '_' + vc_uuid] = r.to_hash\n end\n\n view.DestroyView\n\n vmpool = OpenNebula::VirtualMachinePool.new(@onec)\n rc = vmpool.info(-2)\n\n return {} if OpenNebula.is_error?(rc)\n\n vms = {}\n vms_hash.each do |vm_ref, info|\n one_id = -1\n\n # Add OR to retrieve VMs that are using old deploy ID\n ids = vmpool.retrieve_xmlelements(\n \"/VM_POOL/VM[(DEPLOY_ID = '#{vm_ref}')\" \\\n ' or ' \\\n \"(DEPLOY_ID = '#{vm_ref.split('_')[0]}')]\"\n )\n\n ids.select do |vm|\n hid = vm['HISTORY_RECORDS/HISTORY/HID']\n\n if hid\n hid.to_i == @host_id\n else\n false\n end\n end\n\n one_id = ids[0]['ID'] if ids[0]\n next if one_id.to_i == -1\n\n vms[vm_ref] = {\n :id => one_id,\n :name => \"#{info['name']} - #{@cluster.item.name}\",\n :deploy_id => vm_ref,\n :state => STATE_MAP[info['summary.runtime.powerState']] || 'UNKNOWN'\n }\n end\n\n vms\n end", "def datastore()\n\n\t\t\t\t\tif not @local_session[:dropbox_context] then\n\t\t\t\t\t\traise \"datastore not initialized, make sure you have retrieved a token \" +\n\t\t\t\t\t\t\t \"(include DropboxStore::TokenFilter and add before_filter :requires_token)\"\n\t\t\t\t\tend\n\n\t\t\t\t\t# has a session?\n\t\t\t\t\tif not DROPBOX_CONTEXTS[@local_session[:dropbox_context] + \"_DATA\"] then\n\t\t\t\t\t\tctx = DROPBOX_CONTEXTS[@local_session[:dropbox_context]]\n\n\t\t\t\t\t\t# generate a code block that is passed to the datastore constructor\n\t\t\t\t\t\tload_tables_proc = Proc.new do |data|\n\n\t\t\t\t\t\t\t@@store_definition_descriptor[:tables].each do |t_class|\n\t\t\t\t\t\t\t\tdata.table t_class\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\tDROPBOX_CONTEXTS[@local_session[:dropbox_context] + \"_DATA\"] = DropboxStore::Data.new(\n\t\t\t\t\t\t\t\tctx, \n\t\t\t\t\t\t\t\t@@store_definition_descriptor[:datastore_id],\n\t\t\t\t\t\t\t\t&load_tables_proc\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\tend\n\n\t\t\t\t\treturn DROPBOX_CONTEXTS[@local_session[:dropbox_context] + \"_DATA\"] \n\t\t\t\tend" ]
[ "0.7129758", "0.6764978", "0.6090582", "0.6081625", "0.60284114", "0.5994421", "0.58871275", "0.58300906", "0.58104545", "0.57651174", "0.5669137", "0.56623125", "0.56526566", "0.5639783", "0.55802107", "0.5560721", "0.5535915", "0.550397", "0.5467481", "0.54337037", "0.54169744", "0.5416862", "0.53733814", "0.5333459", "0.53233427", "0.5307046", "0.52865994", "0.52810466", "0.52544504", "0.5253888", "0.52441067", "0.5240307", "0.5234807", "0.52345514", "0.5233834", "0.5233834", "0.52274996", "0.5214314", "0.5191752", "0.5176804", "0.51690847", "0.5156016", "0.51537734", "0.5152901", "0.51527613", "0.5137596", "0.51373637", "0.5135437", "0.5132882", "0.5116463", "0.5113431", "0.51105326", "0.5110389", "0.5103059", "0.50948644", "0.508335", "0.5067299", "0.50606817", "0.5059566", "0.50562453", "0.50526476", "0.50500566", "0.504828", "0.50400645", "0.50381297", "0.5037193", "0.5035059", "0.5026754", "0.50256", "0.5018465", "0.5014763", "0.5003487", "0.49988812", "0.49988648", "0.4994789", "0.4990725", "0.49871865", "0.4981875", "0.49685416", "0.4967973", "0.49648455", "0.4963095", "0.49626616", "0.495881", "0.49565443", "0.4953672", "0.49485034", "0.49454328", "0.49416804", "0.49353868", "0.49346012", "0.49315953", "0.49315953", "0.49313518", "0.49270928", "0.49267507", "0.4926079", "0.49259967", "0.49214682", "0.49213904", "0.4920614" ]
0.0
-1
Return the vCloud data associated with vAppTemplate
def vcloud_attributes Vcloud::Core::Fog::ServiceInterface.new.get_vapp_template(id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vapp_template(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VAppTemplate').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n vms.each do |vm|\n vms_hash[vm['name']] = {\n :id => vm['href'].gsub(\"#{@api_url}/vAppTemplate/vm-\", '')\n }\n end\n\n # TODO: EXPAND INFO FROM RESPONSE\n { :name => name, :description => description, :vms_hash => vms_hash }\n end", "def get_vapp_template(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VAppTemplate').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n vms.each do |vm|\n vms_hash[vm['name']] = {\n :id => vm['href'].gsub(/.*\\/vAppTemplate\\/vm\\-/, \"\")\n }\n end\n\n { :name => name, :description => description, :vms_hash => vms_hash }\n end", "def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end", "def get_full_data(data)\n case @client.api_version\n when \"1.2\"\n # in this version returned id=>{...}\n result = @client.api_request(:method => \"template.get\", :params => {:filter => data, :output => \"extend\"})\n result.empty? ? [] : result.values \n else\n @client.api_request(:method => \"template.get\", :params => {:filter => data, :output => \"extend\"})\n end\n end", "def create_vapp_from_template(vdc, vapp_name, vapp_description, vapp_templateid, poweron=false)\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.InstantiateVAppTemplateParams(\n \"xmlns\" => \"http://www.vmware.com/vcloud/v1.5\",\n \"xmlns:xsi\" => \"http://www.w3.org/2001/XMLSchema-instance\",\n \"xmlns:ovf\" => \"http://schemas.dmtf.org/ovf/envelope/1\",\n \"name\" => vapp_name,\n \"deploy\" => \"true\",\n \"powerOn\" => poweron) {\n xml.Description vapp_description\n xml.Source(\"href\" => \"#{@api_url}/vAppTemplate/#{vapp_templateid}\")\n }\n end\n\n params = {\n \"method\" => :post,\n \"command\" => \"/vdc/#{vdc}/action/instantiateVAppTemplate\"\n }\n\n response, headers = send_request(params, builder.to_xml, \"application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml\")\n\n vapp_id = headers[:location].gsub(\"#{@api_url}/vApp/vapp-\", \"\")\n\n task = response.css(\"VApp Task[operationName='vdcInstantiateVapp']\").first\n task_id = task[\"href\"].gsub(\"#{@api_url}/task/\", \"\")\n\n { :vapp_id => vapp_id, :task_id => task_id }\n end", "def get_vapp(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vApp/vapp-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VApp').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n # ipAddress could be namespaced or not: see https://github.com/astratto/vcloud-rest/issues/3\n vms.each do |vm|\n vapp_local_id = vm.css('VAppScopedLocalId')\n addresses = vm.css('rasd|Connection').collect{|n| n['vcloud:ipAddress'] || n['ipAddress'] }\n vms_hash[vm['name']] = {\n :addresses => addresses,\n :status => convert_vapp_status(vm['status']),\n :id => vm['href'].gsub(\"#{@api_url}/vApp/vm-\", ''),\n :vapp_scoped_local_id => vapp_local_id.text\n }\n end\n\n # TODO: EXPAND INFO FROM RESPONSE\n { :name => name, :description => description, :status => status, :ip => ip, :vms_hash => vms_hash }\n end", "def index\n @template_data = TemplateDatum.all\n end", "def create_vapp_from_template(vdc, vapp_name, vapp_description, vapp_templateid, poweron=false)\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.InstantiateVAppTemplateParams(\n \"xmlns\" => \"http://www.vmware.com/vcloud/v1.5\",\n \"xmlns:xsi\" => \"http://www.w3.org/2001/XMLSchema-instance\",\n \"xmlns:ovf\" => \"http://schemas.dmtf.org/ovf/envelope/1\",\n \"name\" => vapp_name,\n \"deploy\" => \"true\",\n \"powerOn\" => poweron) {\n xml.Description vapp_description\n xml.Source(\"href\" => \"#{@api_url}/vAppTemplate/#{vapp_templateid}\")\n }\n end\n\n params = {\n \"method\" => :post,\n \"command\" => \"/vdc/#{vdc}/action/instantiateVAppTemplate\"\n }\n\n response, headers = send_request(params, builder.to_xml, \"application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml\")\n\n vapp_id = headers[:location].gsub(/.*\\/vApp\\/vapp\\-/, \"\")\n task = response.css(\"VApp Task[operationName='vdcInstantiateVapp']\").first\n task_id = task[\"href\"].gsub(/.*\\/task\\//, \"\")\n\n { :vapp_id => vapp_id, :task_id => task_id }\n end", "def get_volume_template_uri(template_data)\n storage_pool_uri = self['storagePoolUri'] || self['properties']['storagePool']\n storage_pool = OneviewSDK::API500::C7000::StoragePool.new(@client, uri: storage_pool_uri)\n raise 'StoragePool or snapshotPool must be set' unless storage_pool.retrieve!\n storage_system = OneviewSDK::API500::C7000::StorageSystem.new(@client, uri: storage_pool['storageSystemUri'])\n templates = storage_system.get_templates\n template = templates.find { |item| item['isRoot'] == template_data[:isRoot] && item['family'] == template_data[:family] }\n template['uri'] if template\n end", "def get_os_templates(authInfo, options)\n\n @logger.debug(\"Getting OS templates ...\")\n \n os_templates = nil\n\n # If the authentication information is not specified in the Vagrantfile return a failure status\n if(authInfo.nil? || authInfo.url.nil? || authInfo.applicationKey.nil? || authInfo.sharedSecret.nil?)\n @env.ui.error(I18n.t('secured_cloud_vagrant.errors.unspecified_auth', :resource_type => \"OS templates\"))\n return os_templates\n end\n\n begin\n\n # Create a Secured Cloud Connection instance to connect to the SecuredCloud API\n sc_connection = SecuredCloudConnection.new(authInfo.url, authInfo.applicationKey, authInfo.sharedSecret)\n\n # Get the OS templates for the specified details\n os_templates_urls = SecuredCloudRestClient.getOsTemplatesAvailable(sc_connection, options[:orgResource], options[:nodeResource])\n\n if !os_templates_urls.nil?\n\n # Create an array to hold the os templates details\n os_templates = Hash.new\n\n # Get the details for each retrieved os template resource URL and add it to the list\n os_templates_urls.each do |os_template_url|\n os_templates[os_template_url] = SecuredCloudRestClient.getOsTemplateDetails(sc_connection, os_template_url)\n end\n\n @logger.debug(\"Found #{os_templates.length} OS templates for organization '#{options[:orgResource]}' on node '#{options[:nodeResource]}'\")\n\n else\n\n @logger.debug(\"No OS templates available for organization '#{options[:orgResource]}' on node '#{options[:nodeResource]}'\")\n\n end\n\n rescue Errno::ETIMEDOUT\n @env.ui.error(I18n.t(\"secured_cloud_vagrant.errors.request_timed_out\", :request => \"get the OS templates details\"))\n rescue Exception => e\n @env.ui.error(I18n.t(\"secured_cloud_vagrant.errors.generic_error\", :error_message => e.message))\n end\n\n return os_templates\n\n end", "def virtual_machine_templates\n kubevirt_client.get_virtual_machine_templates(namespace: @namespace)\n end", "def details\n response = CreateSend.get \"/templates/#{template_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def cloud_search_data\n {}\n end", "def virtual_guest_template\n template = {\n \"startCpus\" => @cores.to_i,\n \"maxMemory\" => @memory.to_i * 1024, # we let the user specify memory in GB, but the API expects maxMemory in MB.\n \"hostname\" => @hostname,\n \"domain\" => @domain,\n\n # Note : for the values below, we want to use the constants \"true\" and \"false\" not nil\n # the nil value (while false to Ruby) will not translate to XML properly\n \"localDiskFlag\" => !!@use_local_disk,\n \"hourlyBillingFlag\" => !!@hourly\n }\n\n template['dedicatedAccountHostOnlyFlag'] = true if @dedicated_host_only\n template['privateNetworkOnlyFlag'] = true if @private_network_only\n\n template['datacenter'] = {\"name\" => @datacenter.name} if @datacenter\n template['userData'] = [{'value' => @user_metadata}] if @user_metadata\n template['networkComponents'] = [{'maxSpeed'=> @max_port_speed}] if @max_port_speed\n template['postInstallScriptUri'] = @provision_script_URI.to_s if @provision_script_URI\n template['postInstallScriptUri'] = @provision_script_uri.to_s if @provision_script_uri\n template['primaryNetworkComponent'] = { \"networkVlan\" => { \"id\" => @public_vlan_id.to_i } } if @public_vlan_id\n template['primaryBackendNetworkComponent'] = { \"networkVlan\" => {\"id\" => @private_vlan_id.to_i } } if @private_vlan_id\n template['sshKeys'] = @ssh_key_ids.collect { |ssh_key_id| {'id'=> ssh_key_id.to_i } } if @ssh_key_ids\n template['supplementalCreateObjectOptions'] = @supplementalCreateObjectOptions if @supplementalCreateObjectOptions\n\n if @image_template\n template['blockDeviceTemplateGroup'] = {\"globalIdentifier\" => @image_template.global_id}\n elsif @os_reference_code\n template['operatingSystemReferenceCode'] = @os_reference_code\n end\n\n if @disks && !@disks.empty?\n template['blockDevices'] = []\n\n # According to the documentation for +createObject+,\n # device number 1 is reserved for the SWAP disk of the computing instance.\n # So we assign device 0 and then assign the rest starting at index 2.\n @disks.each_with_index do |disk, index|\n device_id = (index >= 1) ? index + 1 : index\n template['blockDevices'].push({\"device\" => \"#{device_id}\", \"diskImage\" => {\"capacity\" => disk}})\n end\n end\n\n template\n end", "def application_metadata\n arr_data = {\n site_name: \"Volunteer\",\n site_description: \"Aproximando voluntários de instituições\"\n }\n end", "def datastore(arg)\n ds = VCenterDriver::VIHelper.one_item(OpenNebula::Datastore, arg)\n\n {\n :ds_ref => ds['TEMPLATE/VCENTER_DS_REF'],\n :one_item => ds\n }\n end", "def cloudversion\n clouddata && clouddata['version']\n end", "def global_template_data\n {'site' => @site, '__design_id' => @design.id, '__site_id' => @site['id']}\n end", "def details\n response = get \"/templates/#{template_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def index\n flavors = []\n cs_id = params[:compute_site_id]\n\n if optimizer_query?\n tmpls = VirtualMachineTemplate.\n active.\n on_active_tenant.\n includes(\n tenants: [\n virtual_machine_flavors: [\n :os_families, :flavor_os_families\n ]\n ]\n )\n .where(appliance_type_id: appl_type_id)\n tmpls = tmpls.on_tenant(cs_id) if cs_id\n\n unless tmpls.blank?\n _, _, flavor, _ = Optimizer.instance\n .select_tmpl_and_flavor_and_tenant(tmpls, nil, params)\n\n flavors = [flavor]\n end\n else\n flavors = VirtualMachineFlavor.with_prefs(params).where(filter)\n flavors = flavors.on_tenant(cs_id) if cs_id\n end\n flavors = flavors.first(limit) if limit\n\n respond_with flavors\n end", "def retrieve_all_template_info\n puts \"Retrieving all template ids and names for #{@primary_username} ...\"\n puts\n\n uri = URI(@config['endpoint'])\n\n # Retrieve templates\n http = Net::HTTP.new( uri.host,uri.port )\n http.use_ssl = true\n request = Net::HTTP::Get.new( uri.request_uri )\n request.basic_auth(@primary_username, @primary_password)\n\n response = http.request( request )\n templates = JSON.parse( response.body )\n\n # Create template_id array\n @template_array = Array.new\n\n # Create a template hash w/ name and id for each template found\n templates['templates'].each do |t|\n @template_array.push({:id => t['id'], :name => t['name']})\n end\n\n # Return constructed temmplate array\n return template_array\n end", "def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end", "def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end", "def mcget_templates\n # setup_mcapi.folders.list(\"template\")\n setup_mcapi.templates.list({user: true},{include_drag_and_drop: true})\n end", "def vm_template_ds_ref\n begin\n ds_ref = nil\n if @vm_info['datastore'].length > 1\n swap_path = ''\n @vm_info['config.extraConfig'].each do |element|\n if element.key == 'sched.swap.derivedName'\n swap_path = element.value\n end\n end\n @vm_info['datastore'].each do |datastore|\n path = datastore.summary.url.sub(%r{ds:///*}, '')\n if !swap_path.include?(path) && !datastore._ref.nil?\n ds_ref = datastore._ref\n break\n end\n end\n elsif @vm_info['datastore'].length == 1\n if !@vm_info['datastore'].first._ref.nil?\n ds_ref = @vm_info['datastore'].first._ref\n end\n end\n\n ds_ref\n rescue StandardError => e\n \"Could not find DATASTORE for this VM. Reason: #{e.message}\"\n end\n end", "def templates\n @conn.templates\n end", "def template\n @template ||= Ec2.template({:name =>@name, :key_name => @key_name, :image_id => @image_id, :instance_type => @instance_type, :security_groups => @security_groups})\n end", "def index\n @templates = Template.all\n\n \n\n\n @templates.each do |template|\n\n if template.templateVersion.nil?\n\n logger.info \"NIL VERSION: \" + template.id.to_s\n else\n logger.info \"VERSION: \" + template.templateVersion.to_s\n end\n\n template.fields = template.getFieldsNames.join(\",\");\n\n\n end\n end", "def read_vms_info\n vms_arr = json([]) do\n execute_prlctl('list', '--all','--info', '--json')\n end\n templates_arr = json([]) do\n execute_prlctl('list', '--all','--info', '--json', '--template')\n end\n vms_arr | templates_arr\n end", "def obtain_vm_data(resource)\n\n puts \"Obtaining virtual machines' data\"\n return obtain_torque_data(resource[:head], resource[:compute])\n \nend", "def user_data(instance)\n hostname = instance[\"hostname\"]\n # write specific per instance cloud-init config and script files out of erb templates.\n %w(config script).each do |ud|\n e = ERB.new(File.read(File.join('templates', ud + \".erb\")))\n outfile = File.join(@dataDir, hostname + \"-\" + ud)\n File.open(outfile, 'w') {|f| f.write e.result(binding)}\n end\n\n # files = Hash[*%w{mimeOut script config}.collect {|n| [n, File.join(@dataDir, hostname + \"-\" + n]}.flatten]\n # files = %w{mimeOut script config}.inject({}) { |f,n| f[n] = File.join(@dataDir, hostname + \"-\" + n); f}\n mimeOut = File.join(@dataDir, hostname + \"-ud\")\n script = File.join(@dataDir, hostname + \"-script\")\n config = File.join(@dataDir, hostname + \"-config\")\n system(\"./write-mime-multipart --output=#{mimeOut} #{script}:text/x-shellscript #{config}\")\n @logger.info(\"Generated multipart for #{hostname}\")\n return File.read(mimeOut)\nend", "def template\n @template.content\n end", "def conf_file_data\n VMConfiguration.new(self).config_data\n end", "def get_template\n @template\n end", "def customize_vapp_template(vm_params, vapp_net_params)\n source_vms = vm_params.map do |_, vm_opts|\n src_vm = {\n :vm_id => \"vm-#{vm_opts[:vm_id]}\",\n :networks => parse_nics(vm_opts),\n :hardware => {\n :cpu => { :num_cores => vm_opts['num_cores'], :cores_per_socket => vm_opts['cores_per_socket'] },\n :memory => { :quantity_mb => vm_opts['memory_mb'] },\n :disk => parse_disks(vm_opts)\n },\n :guest_customization => parse_guest_customization(vm_opts)\n }\n src_vm[:name] = vm_opts[\"instance_name\"] if vm_opts.key?(\"instance_name\")\n src_vm\n end\n\n vapp_networks = vapp_net_params.map do |_, opts|\n {\n :name => opts[:vapp_net_name],\n :parent => opts['parent'],\n :fence_mode => opts['fence_mode'],\n :subnet => parse_subnets(opts)\n }\n end\n\n {\n :source_vms => source_vms,\n :vapp_networks => vapp_networks\n }\n end", "def read_vms_info\n args = %w[list --all --info --no-header --json]\n vms_arr = json { execute_prlctl(*args) }\n templates_arr = json { execute_prlctl(*args, '--template') }\n\n vms_arr | templates_arr\n end", "def read_vms\n args = %w[list --all --no-header --json -o name,uuid]\n vms_arr = json { execute_prlctl(*args) }\n templates_arr = json { execute_prlctl(*args, '--template') }\n\n vms = vms_arr | templates_arr\n Hash[vms.map { |i| [i.fetch('name'), i.fetch('uuid')] }]\n end", "def index\n @templates = Spree::Template.all\n end", "def list\n @client.make_request :get, templates_path\n end", "def list_cloud_data\n\t\tbegin\n\t\t\t@response, @headers, @url = amazon_request(\"Get\", \"/?prefix=#{current_user.email}&amp;delimiter=%2F\", \"\", \"\", :cloud => @s3)\n\t\t\t@response_favorites, @headers_favorites, @url_favorites = amazon_request(\"Get\", \"/?prefix=Favorites&amp;delimiter=%2F\", \"\", \"\", :cloud => @s3)\n\t\t\t@response_demos, @headers_demos, @url_demos = amazon_request(\"Get\", \"/?prefix=Demos&amp;delimiter=%2F\", \"\", \"\", :cloud => @s3)\n\t\trescue\n\t\t\tsession[:error] = \"Can't connect to the Amazon bucket. Check the environment variables\"\n\t\t\tredirect_to :controller => \"clouds\", :action => \"error\", :id => \"0\"\n\t\tend\n\tend", "def get_template(item)\n return InstanceManager.get_template(item)\n end", "def name\n vcloud_attributes[:name]\n end", "def index\n @docu_signs = DocuSign.where(:user => current_account.user)\n @docu_templates = DocuTemplate.includes(:docu_signs).order(\"created_at DESC\").all\n end", "def default_data_for_template(name)\n data = {}\n data[:name] = name\n data[:version] = '0.0.1'\n data[:summary] = \"A short description of #{name}.\"\n data[:homepage] = \"http://EXAMPLE/#{name}\"\n data[:author_name] = `git config --get user.name`.strip\n data[:author_email] = `git config --get user.email`.strip\n data[:source_url] = \"http://EXAMPLE/#{name}.git\"\n data[:ref_type] = ':tag'\n data[:ref] = '0.0.1'\n data\n end", "def default_data_for_template(name)\n data = {}\n data[:name] = name\n data[:version] = '0.0.1'\n data[:summary] = \"A short description of #{name}.\"\n data[:homepage] = \"http://EXAMPLE/#{name}\"\n data[:author_name] = `git config --get user.name`.strip\n data[:author_email] = `git config --get user.email`.strip\n data[:source_url] = \"http://EXAMPLE/#{name}.git\"\n data[:ref_type] = ':tag'\n data[:ref] = '0.0.1'\n data\n end", "def template(name)\n @conn.templates.get(name)\n end", "def index\n @product_templates = ProductTemplate.all\n end", "def template\n @template\n end", "def list\n @client.call(method: :get, path: 'templates')\n end", "def get_template(data)\n return data if data.is_a?(String)\n\n data.fetch('conf', nil)\nend", "def fetch!\n cm = @api.api('apps/v1').resource('deployments', namespace: @ns).get(@deployment)\n volume = cm.spec.template.spec.volumes.map(&:to_h).find { |h| h[:name] == @volume }\n items = volume.dig(:configMap, :items) || []\n @_current = items.find { |item| item[:key] == @key }\n end", "def data_struct_template\n @data_struct_template ||= self.class.data_struct_template\n @data_struct_template\n end", "def veg_create_objects(data)\n data.each do | veg_hash |\n VegInfo::Vegetable.new(veg_hash)\n end\n end", "def get_cloud\n cloud_href = instance.cloud.href\n cloud_id = cloud_href.split('/').last\n cloud = @api_client.clouds(:id => cloud_id)\n end", "def get_template(template); end", "def cloud_search_document\n AWSCloudSearch::Document.new.tap do |d|\n d.id = self.id\n d.lang = \"en\"\n d.version = self.updated_at.to_i\n # class name\n d.add_field(\"type\", self.class.base_class.name)\n self.cloud_search_data.each_pair do |k,v|\n d.add_field(k.to_s, v.is_a?(Array) ? v : v.to_s)\n end\n end\n end", "def cloud_config\n microbosh_config[\"cloud\"]\n end", "def default_data_for_template(name)\n {\n :name => name,\n :version => '0.0.1',\n :summary => \"A short description of #{name}.\",\n :homepage => \"http://EXAMPLE/#{name}\",\n :author_name => Executable.capture_command('git', %w(config --get user.name), :capture => :out).first.strip,\n :author_email => Executable.capture_command('git', %w(config --get user.email), :capture => :out).first.strip,\n :source_url => \"http://EXAMPLE/#{name}.git\",\n :ref_type => ':tag',\n :ref => '#{spec.version}',\n }\n end", "def virtual_machine_template(name)\n kubevirt_client.get_virtual_machine_template(name, @namespace)\n end", "def index\n @doc_templates = DocTemplate.all\n end", "def cft_list\n @client.make_request :get, templates_path('cft')\n end", "def data\n raw_data['project']\n end", "def get_pcloud_instance\n get(\"cloud-instances/#{guid}\")\n end", "def index\n @item_templates = ItemTemplate.all\n end", "def get_catalog_item(catalogItemId)\n params = {\n 'method' => :get,\n 'command' => \"/catalogItem/#{catalogItemId}\"\n }\n\n response, headers = send_request(params)\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n items = []\n # manage two different types of catalog items: vAppTemplate and media\n if response.css(\"Entity[type='application/vnd.vmware.vcloud.vAppTemplate+xml']\").size > 0\n response.css(\"Entity[type='application/vnd.vmware.vcloud.vAppTemplate+xml']\").each do |item|\n itemId = item['href'].gsub(/.*\\/vAppTemplate\\/vappTemplate\\-/, \"\")\n\n # Fetch the catalogItemId information\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{itemId}\"\n }\n response, headers = send_request(params)\n\n # VMs Hash for all the vApp VM entities\n vms_hash = {}\n response.css(\"/VAppTemplate/Children/Vm\").each do |vmElem|\n vmName = vmElem[\"name\"]\n vmId = vmElem[\"href\"].gsub(/.*\\/vAppTemplate\\/vm\\-/, \"\")\n\n # Add the VM name/id to the VMs Hash\n vms_hash[vmName] = { :id => vmId }\n end\n\n items << { :id => itemId,\n :name => item['name'],\n :vms_hash => vms_hash }\n end\n\n { :id => catalogItemId, :description => description, :items => items, :type => 'vAppTemplate' }\n elsif response.css(\"Entity[type='application/vnd.vmware.vcloud.media+xml']\").size > 0\n name = response.css(\"Entity[type='application/vnd.vmware.vcloud.media+xml']\").first['name']\n { :id => catalogItemId, :description => description, :name => name, :type => 'media' }\n else\n @logger.warn 'WARNING: either this catalog item is empty or contains something not managed by vcloud-rest'\n { :id => catalogItemId, :description => description, :type => 'unknown' }\n end\n end", "def get_template(matching_options_hash, matching_tags_hash)\n log(:info, \"Processing get_template...\", true)\n\n template_search_by_guid = matching_options_hash[:guid] rescue nil\n template_search_by_name = matching_options_hash[:name] || matching_options_hash[:template] rescue nil\n template_search_by_product = matching_options_hash[:os] rescue nil\n templates = []\n\n unless template_search_by_guid.nil?\n # Search for templates tagged with 'prov_scope' => 'all' & match the guid from option_?_guid\n if templates.empty?\n log(:info, \"Searching for templates tagged with 'prov_scope' => 'all' that match guid: #{template_search_by_guid}\")\n templates = $evm.vmdb('miq_template').all.select do |template|\n template.ext_management_system && template.tagged_with?('prov_scope', 'all') && template.guid == template_search_by_guid\n end\n end\n end\n unless template_search_by_name.nil?\n # Search for templates that tagged with 'prov_scope' => 'all' & match the name from option_?_template || option_?_name - then load balance them across different providers based on vm count\n if templates.empty?\n log(:info, \"Searching for templates tagged with 'prov_scope' => 'all' that are named: #{template_search_by_name}\")\n templates = $evm.vmdb('miq_template').all.select do |template|\n template.ext_management_system && template.tagged_with?('prov_scope', 'all') && template.name == template_search_by_name\n end.sort { |template1, template2| template1.ext_management_system.vms.count <=> template2.ext_management_system.vms.count }\n end\n end\n unless template_search_by_product.nil?\n # Search for templates tagged with 'prov_scope' => 'all' & product_name include option_?_os (I.e. 'windows', red hat') - then load balance them across different providers based on vm count\n if templates.empty?\n log(:info, \"Searching for templates tagged with 'prov_scope' => 'all' that inlcude product: #{template_search_by_product}\")\n templates = $evm.vmdb('miq_template').all.select do |template|\n template.ext_management_system && template.tagged_with?('prov_scope', 'all') && template.operating_system[:product_name].downcase.include?(template_search_by_product)\n end.sort { |template1, template2| template1.ext_management_system.vms.count <=> template2.ext_management_system.vms.count }\n end\n end\n raise \"No templates found\" if templates.empty?\n\n # get the first template in the list\n template = templates.first\n log(:info, \"Found template: #{template.name} product: #{template.operating_system[:product_name].downcase rescue 'unknown'} guid: #{template.guid} on provider: #{template.ext_management_system.name}\")\n matching_options_hash[:name] = template.name\n matching_options_hash[:guid] = template.guid\n log(:info, \"Processing get_template...Complete\", true)\n end", "def obtain_vm_data(resource)\n\n puts \"Obtaining virtual machines' data\"\n \n # ...\n \n ips = [\"IP_A\", \"IP_B\"]\n ip_roles = {:rol_a => \"IP_A\", :rol_b => \"IP_B\"}\n img_roles = {:rol_a => \"/path/to/IMG_A\", :rol_b => \"/path/to/IMG_B\"}\n \n return ips, ip_roles, img_roles\n \n end", "def template\n return @template\n end", "def get_vapp(id)\n fog_service_interface.get_vapp(id)\n end", "def retrieve_volumes\n dbg { \"retrieving #{pool_info}, #{hv_info}\" }\n\n volumes = pool.list_all_volumes\n dbg { \"list_all_volumes #{pool_info}, #{hv_info}\" }\n\n storage_volumes = volumes.map.with_index do |vol, index|\n id = \"#{uuid}--#{index}\"\n StorageVolume.new(vol, pool: self, id: id)\n end\n\n dbg { \"retrieved size=#{storage_volumes.size}, #{pool_info}, #{hv_info}\" }\n storage_volumes\n end", "def index\n # @custom_pet_templates = CustomPetTemplate.all\n end", "def vm_instances\n @conn.vminstances\n end", "def index\n @my_templates = MyTemplate.all\n end", "def notify\n if cloud_desc.nil?\n raise MuError, \"Failed to load instance metadata for #{@config['mu_name']}/#{@cloud_id}\"\n end\n\n interfaces = []\n private_ips = []\n public_ips = []\n\n cloud_desc.network_interfaces.each { |iface|\n private_ips << iface.network_ip\n if iface.access_configs\n iface.access_configs.each { |acfg|\n public_ips << acfg.nat_ip if acfg.nat_ip\n }\n end\n interfaces << {\n \"network_interface_id\" => iface.name,\n \"subnet_id\" => iface.subnetwork,\n \"vpc_id\" => iface.network\n }\n }\n\n deploydata = {\n \"nodename\" => @mu_name,\n \"run_list\" => @config['run_list'],\n \"image_created\" => @config['image_created'],\n# \"iam_role\" => @config['iam_role'],\n \"cloud_desc_id\" => @cloud_id,\n \"project_id\" => @project_id,\n \"private_ip_address\" => private_ips.first,\n \"public_ip_address\" => public_ips.first,\n \"private_ip_list\" => private_ips,\n# \"key_name\" => cloud_desc.key_name,\n# \"subnet_id\" => cloud_desc.subnet_id,\n# \"cloud_desc_type\" => cloud_desc.instance_type #,\n #\t\t\t\t\"network_interfaces\" => interfaces,\n #\t\t\t\t\"config\" => server\n }\n\n if !@mu_windows_name.nil?\n deploydata[\"mu_windows_name\"] = @mu_windows_name\n end\n if !@config['chef_data'].nil?\n deploydata.merge!(@config['chef_data'])\n end\n deploydata[\"region\"] = @config['region'] if !@config['region'].nil?\n if !@named\n MU::MommaCat.nameKitten(self)\n @named = true\n end\n\n return deploydata\n end", "def initialize(client, params = {}, api_ver = nil)\n super\n # Default values:\n @data['provisioning'] ||= {}\n @data['type'] ||= 'StorageVolumeTemplateV3'\n end", "def serializable_data\n template = self.class.find(self.id,:include=>[:param_values,:page_layout=>:full_set_nodes])\n hash ={:template=>template, :param_values=>template.param_values, :page_layouts=>template.page_layout.full_set_nodes,\n :template_files=>template.template_files,:template_releases=>template.template_releases\n } \n hash \n end", "def compose_vapp_from_vm(vdc, vapp_name, vapp_description, vm_list={}, network_config={})\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.ComposeVAppParams(\n \"xmlns\" => \"http://www.vmware.com/vcloud/v1.5\",\n \"xmlns:ovf\" => \"http://schemas.dmtf.org/ovf/envelope/1\",\n \"name\" => vapp_name) {\n xml.Description vapp_description\n xml.InstantiationParams {\n xml.NetworkConfigSection {\n xml['ovf'].Info \"Configuration parameters for logical networks\"\n xml.NetworkConfig(\"networkName\" => network_config[:name]) {\n xml.Configuration {\n xml.IpScopes {\n xml.IpScope {\n xml.IsInherited(network_config[:is_inherited] || \"false\")\n xml.Gateway network_config[:gateway]\n xml.Netmask network_config[:netmask]\n xml.Dns1 network_config[:dns1] if network_config[:dns1]\n xml.Dns2 network_config[:dns2] if network_config[:dns2]\n xml.DnsSuffix network_config[:dns_suffix] if network_config[:dns_suffix]\n xml.IpRanges {\n xml.IpRange {\n xml.StartAddress network_config[:start_address]\n xml.EndAddress network_config[:end_address]\n }\n }\n }\n }\n xml.ParentNetwork(\"href\" => \"#{@api_url}/network/#{network_config[:parent_network]}\")\n xml.FenceMode network_config[:fence_mode]\n\n xml.Features {\n xml.FirewallService {\n xml.IsEnabled(network_config[:enable_firewall] || \"false\")\n }\n }\n }\n }\n }\n }\n vm_list.each do |vm_name, vm_id|\n xml.SourcedItem {\n xml.Source(\"href\" => \"#{@api_url}/vAppTemplate/vm-#{vm_id}\", \"name\" => vm_name)\n xml.InstantiationParams {\n xml.NetworkConnectionSection(\n \"xmlns:ovf\" => \"http://schemas.dmtf.org/ovf/envelope/1\",\n \"type\" => \"application/vnd.vmware.vcloud.networkConnectionSection+xml\",\n \"href\" => \"#{@api_url}/vAppTemplate/vm-#{vm_id}/networkConnectionSection/\") {\n xml['ovf'].Info \"Network config for sourced item\"\n xml.PrimaryNetworkConnectionIndex \"0\"\n xml.NetworkConnection(\"network\" => network_config[:name]) {\n xml.NetworkConnectionIndex \"0\"\n xml.IsConnected \"true\"\n xml.IpAddressAllocationMode(network_config[:ip_allocation_mode] || \"POOL\")\n }\n }\n }\n xml.NetworkAssignment(\"containerNetwork\" => network_config[:name], \"innerNetwork\" => network_config[:name])\n }\n end\n xml.AllEULAsAccepted \"true\"\n }\n end\n\n params = {\n \"method\" => :post,\n \"command\" => \"/vdc/#{vdc}/action/composeVApp\"\n }\n\n response, headers = send_request(params, builder.to_xml, \"application/vnd.vmware.vcloud.composeVAppParams+xml\")\n\n vapp_id = headers[:location].gsub(\"#{@api_url}/vApp/vapp-\", \"\")\n\n task = response.css(\"VApp Task[operationName='vdcComposeVapp']\").first\n task_id = task[\"href\"].gsub(\"#{@api_url}/task/\", \"\")\n\n { :vapp_id => vapp_id, :task_id => task_id }\n end", "def index\n @clouds = @current_user.clouds.all\n end", "def fetch_template(endpoint)\n url = URI.parse(endpoint)\n region = url.host.split('.').first.split('-', 2).last\n if(region == 's3')\n region = 'us-east-1'\n end\n bucket, path = url.path.sub('/', '').split('/', 2)\n MultiJson.load(\n storage_api(region).buckets.get(\n bucket.sub('/', '')\n ).files.get(path).body.read\n )\n end", "def to_occi(base_url)\n # Let's parse the template\n template=self.to_hash\n template=template['VM']['TEMPLATE']\n template['DISK']=[template['DISK']].flatten if template['DISK']\n template['NIC']=[template['NIC']].flatten if template['NIC']\n \n occi = ERB.new(OCCI_VM)\n return occi.result(binding)\n\n end", "def initialize(client, params = {}, api_ver = nil)\n super\n # Default values:\n @data['provisioning'] ||= {}\n @data['type'] ||= 'StorageVolumeTemplateV3'\n end", "def zapp_version\n host = plant_attributes[self.plant.intern][self.env.intern][:host]\n #results = submit_cmd('show zapp',:topology,\"-host #{host} -csv\",0) \n results = exec_open(\"#{Zapptop} show zapp -host #{host} -csv\") \n puts results\n populate_app_attributes(results,'zapp_version',self.plant.intern,self.env.intern)\n [plant_attributes[self.plant.intern][self.env.intern][:version],plant_attributes[self.plant.intern][self.env.intern][:prodid],plant_attributes[self.plant.intern][self.env.intern][:contact]]\n end", "def templates\n return self.class.get('/templates').parsed_response.map do |template|\n Template.new(template['template_id'], template['name'])\n end\n end", "def template_content(template_name)\n File.read(File.join(@options[:templates], template_name))\n end", "def notify\n if cloud_desc.nil?\n raise MuError, \"Failed to load instance metadata for #{@mu_name}/#{@cloud_id}\"\n end\n\n interfaces = []\n private_ips = []\n\n cloud_desc.network_interfaces.each { |iface|\n iface.private_ip_addresses.each { |priv_ip|\n private_ips << priv_ip.private_ip_address\n }\n interfaces << {\n \"network_interface_id\" => iface.network_interface_id,\n \"subnet_id\" => iface.subnet_id,\n \"vpc_id\" => iface.vpc_id\n }\n }\n\n deploydata = {\n \"nodename\" => @mu_name,\n \"run_list\" => @config['run_list'],\n \"image_created\" => @config['image_created'],\n \"iam_role\" => @config['iam_role'],\n \"cloud_desc_id\" => @cloud_id,\n \"private_dns_name\" => cloud_desc.private_dns_name,\n \"public_dns_name\" => cloud_desc.public_dns_name,\n \"private_ip_address\" => cloud_desc.private_ip_address,\n \"public_ip_address\" => cloud_desc.public_ip_address,\n \"private_ip_list\" => private_ips,\n \"key_name\" => cloud_desc.key_name,\n \"subnet_id\" => cloud_desc.subnet_id,\n \"cloud_desc_type\" => cloud_desc.instance_type #,\n #\t\t\t\t\"network_interfaces\" => interfaces,\n #\t\t\t\t\"config\" => server\n }\n\n if !@mu_windows_name.nil?\n deploydata[\"mu_windows_name\"] = @mu_windows_name\n end\n if !@config['chef_data'].nil?\n deploydata.merge!(@config['chef_data'])\n end\n deploydata[\"region\"] = @region if !@region.nil?\n if !@named\n MU::MommaCat.nameKitten(self, no_dns: true)\n @named = true\n end\n\n return deploydata\n end", "def to_configure_vapp_hash\n {\n :name => name,\n :cpus => cpus,\n :memory => memory,\n :disks => disks.map {|d| { :number => d.address.to_s, :size => d.vcloud_size, :resource => d.vcloud_size.to_s } }\n }\n end", "def to_configure_vapp_hash\n {\n :name => name,\n :cpus => cpus,\n :memory => memory,\n :disks => disks.map {|d| { :number => d.address.to_s, :size => d.vcloud_size, :resource => d.vcloud_size.to_s } }\n }\n end", "def index\n @templates = ::Template.all\n end", "def application_template_id\n return @application_template_id\n end", "def dmptemplate\n #self.project.try(:dmptemplate) || Dmptemplate.new\n self.template\n end", "def template\n @part.content\n end", "def index\n @template = Template.find(params[:template_id])\n @template_parameters = TemplateParameter.where(template_id: params[:template_id])\n end", "def _template\n @template\n end", "def wilds\n [self.to_hash['HOST']['TEMPLATE']['VM']].flatten.compact\n end", "def templates\n response = get 'templates'\n response.map{|item| Hashie::Mash.new(item)}\n end", "def show\n @product_template = ProductTemplate.find(params[:id])\n @keys = @product_template.properties.keys\n @values = @product_template.properties.values\n end", "def stored_virtual_machines\n kubevirt_client.get_stored_virtual_machines(namespace: @namespace)\n end", "def get_connectable_volume_templates(attributes = {})\n OneviewSDK::Resource.find_by(@client, attributes, BASE_URI + '/connectable-volume-templates')\n end", "def global_template_data\n {'__design_id' => @stylesheet.design_id}\n end", "def template\n Liquid::Template.parse(template_content(template_name))\n end" ]
[ "0.71081287", "0.70635027", "0.6211215", "0.6018454", "0.59863305", "0.59576523", "0.58353865", "0.5812524", "0.5775796", "0.5667276", "0.56505835", "0.5600491", "0.5588983", "0.5534086", "0.55229366", "0.551654", "0.547936", "0.5463351", "0.5443816", "0.5424494", "0.53998023", "0.5380913", "0.5380913", "0.53794783", "0.53714967", "0.53674495", "0.5358349", "0.5350939", "0.5307077", "0.5293728", "0.52773666", "0.5272921", "0.5250236", "0.52501774", "0.52477324", "0.523103", "0.51986355", "0.51908106", "0.5186358", "0.5184165", "0.5183755", "0.5147614", "0.5110162", "0.5106828", "0.5106828", "0.510553", "0.51053244", "0.5095225", "0.50926703", "0.50635", "0.5057817", "0.50515693", "0.5050593", "0.5040831", "0.50345474", "0.5018979", "0.5008034", "0.50046647", "0.49965253", "0.49926972", "0.4991095", "0.49889877", "0.49888083", "0.49857822", "0.4978229", "0.4977573", "0.49756703", "0.4974786", "0.49739102", "0.49709564", "0.49689174", "0.49629897", "0.49596542", "0.49593788", "0.49546146", "0.49536788", "0.49532217", "0.4947422", "0.49458838", "0.4939192", "0.49353656", "0.49245322", "0.49133393", "0.49129876", "0.49005228", "0.49003327", "0.49003327", "0.4886117", "0.48846802", "0.48815835", "0.48801666", "0.48791397", "0.48773593", "0.4871863", "0.4855874", "0.48547027", "0.4850561", "0.4842226", "0.48347563", "0.48323599" ]
0.7795347
0
Return the name of vAppTemplate
def href vcloud_attributes[:href] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_name\n name.split(\"::\").last.downcase.gsub(/onebox/, \"\")\n end", "def template_name; end", "def template_name; end", "def template_name\n command.text_value\n end", "def template\n Kernel.const_get(template_name.upcase << '_TEMPLATE')\n end", "def name\n \"#{email_templatable_type} template: #{self[:name]}\"\n end", "def name_template\n @name_template || self.to_s\n end", "def default_template_name\n @default_template_name ||= self.class.name.underscore.sub(/_resource$/, '')\n end", "def template_filename\n @template_filename ||= self.class.name.split('::').last + -'.html.erb'\n end", "def template_name\n self.path.scan(/[^\\/]+$/).first\n end", "def template_module_name(path)\n 'Template_' + path.to_s.gsub(/[^a-z0-9]/i, '_')\n end", "def consul_template_name\n @consul_template_name ||= 'consul-template'\n end", "def template_module_name(path); end", "def template_dir\n self.class.name.underscore\n end", "def page_template_filename(page_template)\n ('template_' + page_template)\n end", "def template_name\n \"#{self.class.name.split('::').last.underscore}.json.jbuilder\"\n end", "def comm_template_name\n @@tenant_info[\"comm_template_name\"]\n end", "def template_file_name\n File.join(['structure', \"views\", \"#{controller_name}.html\"])\n end", "def template_name=(_arg0); end", "def template_name=(_arg0); end", "def resource_template(name)\n \"#{resource}_#{name}\"\n end", "def app_name\n ApplicationService.application_name\n end", "def path_to_template name\n \"#{JSPEC_ROOT}/templates/#{name}/.\"\n end", "def tpl_name\n \"monit_check_#{new_resource.name}\"\n end", "def template_ivar\n \"@#{template_name.downcase}\".to_sym\n end", "def suffix\n name.scan(MetaDep::TEMPLATE_SUFFIX).flatten.first\n end", "def template\n @template.nil? ? format_underscore(shortname) : @template\n end", "def template_path\n Jets::Naming.api_gateway_template_path\n end", "def template_path\n Jets::Naming.api_gateway_template_path\n end", "def appname\n fetch(:appname) || script_name\n end", "def application_template_id\n return @application_template_id\n end", "def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end", "def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end", "def app_name\n return File.basename(File.expand_path(root)).freeze\n end", "def template_name name = nil\n name ||= @current_method\n name = name.to_s\n if name.include? \"/\"\n name\n else\n controller = @current_class.to_s.gsub(\"Controller\", \"\")\n controller.gsub!(\"::\", \"/\")\n underscore(controller + \"/\" + name.to_s)\n end\n end", "def template(name); end", "def get_vapp_template(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VAppTemplate').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n vms.each do |vm|\n vms_hash[vm['name']] = {\n :id => vm['href'].gsub(/.*\\/vAppTemplate\\/vm\\-/, \"\")\n }\n end\n\n { :name => name, :description => description, :vms_hash => vms_hash }\n end", "def template_path\n return File.join(File.dirname(__FILE__), \"../../../templates\", platform)\n end", "def app_name\n return @app_name\n end", "def app_name\n return @app_name\n end", "def app_name\n c.application\n end", "def get_vapp_template(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VAppTemplate').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n vms.each do |vm|\n vms_hash[vm['name']] = {\n :id => vm['href'].gsub(\"#{@api_url}/vAppTemplate/vm-\", '')\n }\n end\n\n # TODO: EXPAND INFO FROM RESPONSE\n { :name => name, :description => description, :vms_hash => vms_hash }\n end", "def app_name\n t('descriptions.product_name').remove(' ')\n end", "def template_path\n \"#{template_dir}/#{template_name}\"\n end", "def app_name\n to_s.underscore\n end", "def name\n @name ||= Rails.application.class.parent_name.underscore\n end", "def template(name)\n @conn.templates.get(name)\n end", "def root_resource_name\n components.keys.first.to_s\n end", "def app_name\n @app_name ||= Rails.app_class.module_parent_name.demodulize.underscore.dasherize\n end", "def app_name\n @app_name ||= defined_app_const_base? ? defined_app_name : File.basename(destination_root)\n end", "def application_name\n @application_name ||= t('application.name')\n end", "def get_default_tpl\n return self.script_name.sub(/^#{BASE_URL}\\//, '').sub(/\\..+?$/, '')\n end", "def basename_tmpl\n ##p @cfg[:filename_tmpl]\n mode=Dyndoc.guess_mode(@cfg[:filename_tmpl])\n ##p [\"mode\",mode,Dyndoc.tmplExt[mode]]\n if mode\n name,ext=@cfg[:filename_tmpl].scan(/^(.*)(?:#{Dyndoc.tmplExt[mode].join(\"|\")})$/).flatten.compact\n else\n name,ext=@cfg[:filename_tmpl].scan(/^(.*)(?:_tmpl(\\..*)|(\\.dyn))$/).flatten.compact\n end\n #p [:name,@cfg[:filename_tmpl],name]\n name\n end", "def package_name\n # TODO: verify renamed packages\n resource['title']\n end", "def template_path\n @template_path ||= @env[:templates_path] || default_settings[:templates_path]\n Pathname.new @template_path\n end", "def build_host_name\n if @platform.abs_resource_name\n @platform.abs_resource_name\n elsif @platform.vmpooler_template\n @platform.vmpooler_template\n else\n @platform.name\n end\n end", "def build_host_name\n if @platform.abs_resource_name\n @platform.abs_resource_name\n elsif @platform.vmpooler_template\n @platform.vmpooler_template\n else\n @platform.name\n end\n end", "def template_namespace\n @controller.class.to_s.sub('Controller','').underscore.pluralize\n end", "def setting_template_key\n if journal_task_type\n \"TaskTemplate:#{journal_task_type.kind}\"\n else\n \"TaskTemplate:#{card.name}\"\n end\n end", "def app_name\n \"ExampleApp#{$example_app_counter}\"\n end", "def template_dir\n Templates.path_for(template_dir_name)\n end", "def template_content(name)\n templates.select { |t| t[:name] = name || 'index' }.first[:template]\n end", "def built_in_template_for(template_name)\n File.join( File.dirname(__FILE__), 'templates', template_name )\n end", "def use_template_filename\n return nil unless @args[:___use_template___]\n ConfigData.real_type_filename 'templates', @args[:___use_template___]\n end", "def name\n if app_name = @args[:props][\"application_name\"].to_s.strip and !app_name.empty?\n return app_name\n else\n raise \"Could not figure out the input-name.\"\n end\n end", "def get_satellite_eyes_app_name()\n app_name = \"Satellite Eyes\"\n return app_name\nend", "def template_name_expr; end", "def app_name\n @data['CFBundleExecutable'].to_s\n end", "def app_name\n Rails.application.class.to_s.split(\"::\").first\n end", "def default_template_name(action_name = nil)\n \"#{action_name || @action_name}.xml.builder\"\n end", "def template_path\n File.join(File.dirname(__FILE__), 'templates', 'type', \"#{@format}.erb\")\n end", "def template\n possible_templates.find {|t| File.exists? \"#{t}.html\"}\n end", "def appname\n \"Application\"\n end", "def appserver_monit_template_cookbook\n node['deploy'][app['shortname']].try(:[], driver_type).try(:[],\n 'monit_template_cookbook') || context.cookbook_name\n end", "def template\n\t\tSlim::Template.new(File.join(App.root, 'app', 'views', \"#{self.name}\", \"#{self.action}.slim\"))\n\tend", "def full_template_path\n template_root.join(\"#{@template}.erb\").to_s.squeeze(\"/\")\n end", "def template(name)\n File.join TemplatePath, \"#{name}.rb\"\nend", "def template_namespace\n @template_namespace ||= 'JHT'\n end", "def template\n\t\t\t@signature[:templates][@action_name]\n\t\tend", "def name\n return \"#{self.root.name} #{@type}\"\n end", "def app_name # :nodoc:\n app_cls = Rails.application.class\n parent = begin\n # Rails 6.1+\n app_cls.module_parent_name\n rescue NoMethodError\n app_cls.parent.to_s\n end\n parent.underscore\n end", "def virtual_machine_template(name)\n kubevirt_client.get_virtual_machine_template(name, @namespace)\n end", "def apphelp_site_name\n t( :'uk.org.pond.canvass.site_name' )\n end", "def template\n Pathname.new(@template || OodPortalGenerator.root.join('templates', 'ood-portal.conf.erb'))\n end", "def tt_base_name\n \"#{exp_fname}-tt\"\n end", "def default_app_name\n if is_workspace\n return default_build_settings(key: \"PRODUCT_NAME\")\n else\n return app_name\n end\n end", "def to_filename(template_name)\n name = template_name\n return name.is_a?(Symbol) ? \"#{@prefix}#{name}#{@postfix}\" : name\n end", "def template\n Pathname.new(@template || OodPortalGenerator.root.join(\"templates\", \"ood-portal.conf.erb\"))\n end", "def get_template_file\n @config['template']\n end", "def resource_template_dir\n \"#{App.config.resource_directory}/templates\"\n end", "def template_path\n @options[:template_path]\n end", "def view_name\n @view.virtual_path.split('/').last\n end", "def build_host_name\n if @build_host_template_name.nil?\n validate_platform\n @build_host_template_name = @platform.vmpooler_template\n end\n\n @build_host_template_name\n end", "def get_template\n # Filters the name of the current theme.\n apply_filters('template', get_option('template'))\n end", "def template\n @template\n end", "def vcloud_attributes\n Vcloud::Core::Fog::ServiceInterface.new.get_vapp_template(id)\n end", "def template_path\n File.expand_path('../templates', __FILE__)\n end", "def application_name\n return @application_name\n end", "def default_template\n @default_template ||= \"application\"\n end", "def get_template(item)\n return InstanceManager.get_template(item)\n end", "def find_template(name)\n \n # Search in theme path\n template_path = Themes::ThemeManager.instance.selected_theme.resource_path(\"#{name}.erb\",'template','ui') \n \n # Search in the project\n if not template_path\n path = app.get_path(name) #File.expand_path(File.join(File.dirname(__FILE__), '..', 'views', \"#{name}-fieldset-render.erb\")) \n template_path = path if File.exist?(path)\n end\n \n template_path\n \n end" ]
[ "0.7598668", "0.7504039", "0.7504039", "0.7135556", "0.71219385", "0.69970185", "0.6872652", "0.6859603", "0.6836964", "0.6794226", "0.6741407", "0.67186403", "0.6715654", "0.67018145", "0.6649003", "0.6636977", "0.6611179", "0.6557344", "0.651008", "0.651008", "0.64635146", "0.64483243", "0.6423626", "0.6358332", "0.6330485", "0.632177", "0.632097", "0.6310749", "0.6310749", "0.6295638", "0.6275879", "0.62753737", "0.62753737", "0.62571883", "0.6257084", "0.62553144", "0.6254062", "0.62536395", "0.6236961", "0.6236961", "0.62277967", "0.6225019", "0.62115264", "0.620133", "0.61416215", "0.61380637", "0.6129333", "0.6114736", "0.6112185", "0.6092717", "0.60916495", "0.6067178", "0.6064096", "0.60534114", "0.60197246", "0.59989077", "0.59989077", "0.59919024", "0.59906095", "0.59708595", "0.596399", "0.59627914", "0.59621215", "0.5946389", "0.59455717", "0.59412605", "0.5940469", "0.59327036", "0.5926175", "0.5920645", "0.59199584", "0.5917456", "0.591663", "0.59128773", "0.5899956", "0.58865136", "0.5883661", "0.5883445", "0.5882519", "0.58756906", "0.58727807", "0.5871932", "0.5868296", "0.5867102", "0.5866604", "0.585971", "0.5859095", "0.5858371", "0.5858318", "0.5856144", "0.5849321", "0.5848123", "0.5844138", "0.5838088", "0.5834935", "0.58259165", "0.58243215", "0.5821839", "0.58216155", "0.58181083", "0.5812444" ]
0.0
-1
Return the name of vAppTemplate
def name vcloud_attributes[:name] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_name\n name.split(\"::\").last.downcase.gsub(/onebox/, \"\")\n end", "def template_name; end", "def template_name; end", "def template_name\n command.text_value\n end", "def template\n Kernel.const_get(template_name.upcase << '_TEMPLATE')\n end", "def name\n \"#{email_templatable_type} template: #{self[:name]}\"\n end", "def name_template\n @name_template || self.to_s\n end", "def default_template_name\n @default_template_name ||= self.class.name.underscore.sub(/_resource$/, '')\n end", "def template_filename\n @template_filename ||= self.class.name.split('::').last + -'.html.erb'\n end", "def template_name\n self.path.scan(/[^\\/]+$/).first\n end", "def template_module_name(path)\n 'Template_' + path.to_s.gsub(/[^a-z0-9]/i, '_')\n end", "def consul_template_name\n @consul_template_name ||= 'consul-template'\n end", "def template_module_name(path); end", "def template_dir\n self.class.name.underscore\n end", "def page_template_filename(page_template)\n ('template_' + page_template)\n end", "def template_name\n \"#{self.class.name.split('::').last.underscore}.json.jbuilder\"\n end", "def comm_template_name\n @@tenant_info[\"comm_template_name\"]\n end", "def template_file_name\n File.join(['structure', \"views\", \"#{controller_name}.html\"])\n end", "def template_name=(_arg0); end", "def template_name=(_arg0); end", "def resource_template(name)\n \"#{resource}_#{name}\"\n end", "def app_name\n ApplicationService.application_name\n end", "def path_to_template name\n \"#{JSPEC_ROOT}/templates/#{name}/.\"\n end", "def tpl_name\n \"monit_check_#{new_resource.name}\"\n end", "def template_ivar\n \"@#{template_name.downcase}\".to_sym\n end", "def suffix\n name.scan(MetaDep::TEMPLATE_SUFFIX).flatten.first\n end", "def template\n @template.nil? ? format_underscore(shortname) : @template\n end", "def template_path\n Jets::Naming.api_gateway_template_path\n end", "def template_path\n Jets::Naming.api_gateway_template_path\n end", "def appname\n fetch(:appname) || script_name\n end", "def application_template_id\n return @application_template_id\n end", "def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end", "def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end", "def app_name\n return File.basename(File.expand_path(root)).freeze\n end", "def template_name name = nil\n name ||= @current_method\n name = name.to_s\n if name.include? \"/\"\n name\n else\n controller = @current_class.to_s.gsub(\"Controller\", \"\")\n controller.gsub!(\"::\", \"/\")\n underscore(controller + \"/\" + name.to_s)\n end\n end", "def template(name); end", "def get_vapp_template(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VAppTemplate').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n vms.each do |vm|\n vms_hash[vm['name']] = {\n :id => vm['href'].gsub(/.*\\/vAppTemplate\\/vm\\-/, \"\")\n }\n end\n\n { :name => name, :description => description, :vms_hash => vms_hash }\n end", "def template_path\n return File.join(File.dirname(__FILE__), \"../../../templates\", platform)\n end", "def app_name\n return @app_name\n end", "def app_name\n return @app_name\n end", "def app_name\n c.application\n end", "def get_vapp_template(vAppId)\n params = {\n 'method' => :get,\n 'command' => \"/vAppTemplate/vappTemplate-#{vAppId}\"\n }\n\n response, headers = send_request(params)\n\n vapp_node = response.css('VAppTemplate').first\n if vapp_node\n name = vapp_node['name']\n status = convert_vapp_status(vapp_node['status'])\n end\n\n description = response.css(\"Description\").first\n description = description.text unless description.nil?\n\n ip = response.css('IpAddress').first\n ip = ip.text unless ip.nil?\n\n vms = response.css('Children Vm')\n vms_hash = {}\n\n vms.each do |vm|\n vms_hash[vm['name']] = {\n :id => vm['href'].gsub(\"#{@api_url}/vAppTemplate/vm-\", '')\n }\n end\n\n # TODO: EXPAND INFO FROM RESPONSE\n { :name => name, :description => description, :vms_hash => vms_hash }\n end", "def app_name\n t('descriptions.product_name').remove(' ')\n end", "def template_path\n \"#{template_dir}/#{template_name}\"\n end", "def app_name\n to_s.underscore\n end", "def name\n @name ||= Rails.application.class.parent_name.underscore\n end", "def template(name)\n @conn.templates.get(name)\n end", "def root_resource_name\n components.keys.first.to_s\n end", "def app_name\n @app_name ||= Rails.app_class.module_parent_name.demodulize.underscore.dasherize\n end", "def app_name\n @app_name ||= defined_app_const_base? ? defined_app_name : File.basename(destination_root)\n end", "def application_name\n @application_name ||= t('application.name')\n end", "def get_default_tpl\n return self.script_name.sub(/^#{BASE_URL}\\//, '').sub(/\\..+?$/, '')\n end", "def basename_tmpl\n ##p @cfg[:filename_tmpl]\n mode=Dyndoc.guess_mode(@cfg[:filename_tmpl])\n ##p [\"mode\",mode,Dyndoc.tmplExt[mode]]\n if mode\n name,ext=@cfg[:filename_tmpl].scan(/^(.*)(?:#{Dyndoc.tmplExt[mode].join(\"|\")})$/).flatten.compact\n else\n name,ext=@cfg[:filename_tmpl].scan(/^(.*)(?:_tmpl(\\..*)|(\\.dyn))$/).flatten.compact\n end\n #p [:name,@cfg[:filename_tmpl],name]\n name\n end", "def package_name\n # TODO: verify renamed packages\n resource['title']\n end", "def template_path\n @template_path ||= @env[:templates_path] || default_settings[:templates_path]\n Pathname.new @template_path\n end", "def build_host_name\n if @platform.abs_resource_name\n @platform.abs_resource_name\n elsif @platform.vmpooler_template\n @platform.vmpooler_template\n else\n @platform.name\n end\n end", "def build_host_name\n if @platform.abs_resource_name\n @platform.abs_resource_name\n elsif @platform.vmpooler_template\n @platform.vmpooler_template\n else\n @platform.name\n end\n end", "def template_namespace\n @controller.class.to_s.sub('Controller','').underscore.pluralize\n end", "def setting_template_key\n if journal_task_type\n \"TaskTemplate:#{journal_task_type.kind}\"\n else\n \"TaskTemplate:#{card.name}\"\n end\n end", "def app_name\n \"ExampleApp#{$example_app_counter}\"\n end", "def template_dir\n Templates.path_for(template_dir_name)\n end", "def template_content(name)\n templates.select { |t| t[:name] = name || 'index' }.first[:template]\n end", "def built_in_template_for(template_name)\n File.join( File.dirname(__FILE__), 'templates', template_name )\n end", "def use_template_filename\n return nil unless @args[:___use_template___]\n ConfigData.real_type_filename 'templates', @args[:___use_template___]\n end", "def name\n if app_name = @args[:props][\"application_name\"].to_s.strip and !app_name.empty?\n return app_name\n else\n raise \"Could not figure out the input-name.\"\n end\n end", "def get_satellite_eyes_app_name()\n app_name = \"Satellite Eyes\"\n return app_name\nend", "def template_name_expr; end", "def app_name\n @data['CFBundleExecutable'].to_s\n end", "def app_name\n Rails.application.class.to_s.split(\"::\").first\n end", "def default_template_name(action_name = nil)\n \"#{action_name || @action_name}.xml.builder\"\n end", "def template_path\n File.join(File.dirname(__FILE__), 'templates', 'type', \"#{@format}.erb\")\n end", "def template\n possible_templates.find {|t| File.exists? \"#{t}.html\"}\n end", "def appname\n \"Application\"\n end", "def appserver_monit_template_cookbook\n node['deploy'][app['shortname']].try(:[], driver_type).try(:[],\n 'monit_template_cookbook') || context.cookbook_name\n end", "def template\n\t\tSlim::Template.new(File.join(App.root, 'app', 'views', \"#{self.name}\", \"#{self.action}.slim\"))\n\tend", "def full_template_path\n template_root.join(\"#{@template}.erb\").to_s.squeeze(\"/\")\n end", "def template(name)\n File.join TemplatePath, \"#{name}.rb\"\nend", "def template_namespace\n @template_namespace ||= 'JHT'\n end", "def template\n\t\t\t@signature[:templates][@action_name]\n\t\tend", "def name\n return \"#{self.root.name} #{@type}\"\n end", "def app_name # :nodoc:\n app_cls = Rails.application.class\n parent = begin\n # Rails 6.1+\n app_cls.module_parent_name\n rescue NoMethodError\n app_cls.parent.to_s\n end\n parent.underscore\n end", "def virtual_machine_template(name)\n kubevirt_client.get_virtual_machine_template(name, @namespace)\n end", "def apphelp_site_name\n t( :'uk.org.pond.canvass.site_name' )\n end", "def template\n Pathname.new(@template || OodPortalGenerator.root.join('templates', 'ood-portal.conf.erb'))\n end", "def tt_base_name\n \"#{exp_fname}-tt\"\n end", "def default_app_name\n if is_workspace\n return default_build_settings(key: \"PRODUCT_NAME\")\n else\n return app_name\n end\n end", "def to_filename(template_name)\n name = template_name\n return name.is_a?(Symbol) ? \"#{@prefix}#{name}#{@postfix}\" : name\n end", "def template\n Pathname.new(@template || OodPortalGenerator.root.join(\"templates\", \"ood-portal.conf.erb\"))\n end", "def get_template_file\n @config['template']\n end", "def resource_template_dir\n \"#{App.config.resource_directory}/templates\"\n end", "def template_path\n @options[:template_path]\n end", "def view_name\n @view.virtual_path.split('/').last\n end", "def build_host_name\n if @build_host_template_name.nil?\n validate_platform\n @build_host_template_name = @platform.vmpooler_template\n end\n\n @build_host_template_name\n end", "def get_template\n # Filters the name of the current theme.\n apply_filters('template', get_option('template'))\n end", "def template\n @template\n end", "def vcloud_attributes\n Vcloud::Core::Fog::ServiceInterface.new.get_vapp_template(id)\n end", "def template_path\n File.expand_path('../templates', __FILE__)\n end", "def application_name\n return @application_name\n end", "def default_template\n @default_template ||= \"application\"\n end", "def get_template(item)\n return InstanceManager.get_template(item)\n end", "def find_template(name)\n \n # Search in theme path\n template_path = Themes::ThemeManager.instance.selected_theme.resource_path(\"#{name}.erb\",'template','ui') \n \n # Search in the project\n if not template_path\n path = app.get_path(name) #File.expand_path(File.join(File.dirname(__FILE__), '..', 'views', \"#{name}-fieldset-render.erb\")) \n template_path = path if File.exist?(path)\n end\n \n template_path\n \n end" ]
[ "0.7598668", "0.7504039", "0.7504039", "0.7135556", "0.71219385", "0.69970185", "0.6872652", "0.6859603", "0.6836964", "0.6794226", "0.6741407", "0.67186403", "0.6715654", "0.67018145", "0.6649003", "0.6636977", "0.6611179", "0.6557344", "0.651008", "0.651008", "0.64635146", "0.64483243", "0.6423626", "0.6358332", "0.6330485", "0.632177", "0.632097", "0.6310749", "0.6310749", "0.6295638", "0.6275879", "0.62753737", "0.62753737", "0.62571883", "0.6257084", "0.62553144", "0.6254062", "0.62536395", "0.6236961", "0.6236961", "0.62277967", "0.6225019", "0.62115264", "0.620133", "0.61416215", "0.61380637", "0.6129333", "0.6114736", "0.6112185", "0.6092717", "0.60916495", "0.6067178", "0.6064096", "0.60534114", "0.60197246", "0.59989077", "0.59989077", "0.59919024", "0.59906095", "0.59708595", "0.596399", "0.59627914", "0.59621215", "0.5946389", "0.59455717", "0.59412605", "0.5940469", "0.59327036", "0.5926175", "0.5920645", "0.59199584", "0.5917456", "0.591663", "0.59128773", "0.5899956", "0.58865136", "0.5883661", "0.5883445", "0.5882519", "0.58756906", "0.58727807", "0.5871932", "0.5868296", "0.5867102", "0.5866604", "0.585971", "0.5859095", "0.5858371", "0.5858318", "0.5856144", "0.5849321", "0.5848123", "0.5844138", "0.5838088", "0.5834935", "0.58259165", "0.58243215", "0.5821839", "0.58216155", "0.58181083", "0.5812444" ]
0.0
-1
stop_data contains any information we need for creating new stops. e.g. city id's stop time and ticket price
def update(stop_data) @color = stop_data.fetch(:color, @color) DB.exec("UPDATE trains SET color = '#{@color}' WHERE id = #{@id};") times = stop_data.fetch(:times, []) stop_data.fetch(:city_ids, []).each_with_index do |city_id, index| DB.exec("INSERT INTO stops (train_id, city_id, time) VALUES (#{@id}, #{city_id}, '#{times[index] ? times[index] : "00:00:00"}');") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(stop_data)\n @name = stop_data.fetch(:name, @name)\n DB.exec(\"UPDATE cities SET name = '#{@name}' WHERE id = #{@id};\")\n times = stop_data.fetch(:times, [])\n stop_data.fetch(:train_ids, []).each_with_index do |train_id, index|\n DB.exec(\"INSERT INTO stops (city_id, train_id, time) VALUES (#{@id}, #{train_id}, '#{times[index] ? times[index] : \"00:00:00\"}');\")\n # rule no. 1: don't let Aubrey touch the keyboard after 3:30\n end\n end", "def create\n @stop = @trip.stops.new(stop_params)\n\n respond_to do |format|\n if @stop.save\n format.html { redirect_to trip_path(@trip), notice: 'Stop was successfully created.' }\n format.json { render :show, status: :created, location: @stop }\n else\n format.html { render :new }\n format.json { render json: @stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @stop = Stop.new(stop_params)\n\n respond_to do |format|\n if @stop.save\n format.html { redirect_to @stop, notice: 'Stop was successfully created.' }\n format.json { render :show, status: :created, location: @stop }\n else\n format.html { render :new }\n format.json { render json: @stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def stop_params\n params.require(:stop).permit(:latitude, :longitude, :bus_id, :stop_number, :name)\n end", "def create\n @stop = Stop.new(params[:stop])\n\n respond_to do |format|\n if @stop.save\n format.html { redirect_to @stop, notice: 'Stop was successfully created.' }\n format.json { render json: @stop, status: :created, location: @stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if @stop.save\n render 'api/v1/stops/show'\n else\n render 'api/v1/stops/show', :status => :bad_request\n end\n end", "def create\n @stop_time = StopTime.new(params[:stop_time])\n\n respond_to do |format|\n if @stop_time.save\n format.html { redirect_to @stop_time, notice: 'Stop time was successfully created.' }\n format.json { render json: @stop_time, status: :created, location: @stop_time }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stop_time.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @stop = Stop.new(stop_params)\n if @stop.save\n flash[:notice] = \"Successfully created new Stop\"\n redirect_to buses_path\n else\n render :new\n end\n end", "def stop_params\n params.require(:stop).permit(:order_id, :label, :street, :number, :zip_code, :city, :country, :way_back)\n end", "def add_stop_time_from_stop_time_page stop_time_page\n StopTime.new.tap do |stop_time|\n stop_time.trip = self\n stop_time.stop_time_page! stop_time_page\n stop_time.save\n end\n end", "def stop_times_by_stop_id(stop_id)\n get \"/gtfs/stoptimes/stopid/#{stop_id}\"\n end", "def stop_params\n params.require(:stop).permit(:position, :address, :latitude, :longitude, :arrival_date, :notes)\n end", "def stop_params\n params.require(:stop).permit(:name, :lat, :lon)\n end", "def stop_params\n params.require(:stop).permit(:name, :lat, :long)\n end", "def create\n @stop = Stop.new(params[:stop])\n \n respond_to do |format|\n if @stop.save\n flash[:notice] = 'Stop was successfully created.'\n format.html { redirect_to('/admin/schedule') }\n format.xml { render :xml => @stop, :status => :created, :location => @stop }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @stop.errors, :status => :unprocessable_entity }\n end\n end\n end", "def arrivals_and_departures_for_stop(stop)\n @client = OneBusAway::Client.new(\n api_method: ['arrivals-and-departures-for-stop', \"1_#{stop}\"]\n )\n call_api\n end", "def create\n @stop = Stop.new(params[:stop])\n\n respond_to do |format|\n if @stop.save\n format.html { redirect_to(@stop, :notice => 'Stop was successfully created.') }\n format.xml { render :xml => @stop, :status => :created, :location => @stop }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @stop.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @stop = Stop.new(params[:stop])\n\n respond_to do |format|\n if @stop.save\n format.html { redirect_to(@stop, :notice => 'Stop was successfully created.') }\n format.xml { render :xml => @stop, :status => :created, :location => @stop }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @stop.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @stop = params[:type].constantize.new(stop_params)\n\n respond_to do |format|\n if @stop.save\n format.html { redirect_to edit_order_path @stop.order, notice: \"Stop was successfully created.\" }\n format.json { render :show, status: :created, location: @stop }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_stop\n @stop = GtfsApi::Stop.find(params[:id])\n end", "def stop_params\n params.require(:stop).permit(:address, :latitude, :longitude)\n end", "def set_stop\n @stop = Stop.find(params[:id])\n end", "def set_stop\n @stop = Stop.find(params[:id])\n end", "def set_stop\n @stop = Stop.find(params[:id])\n end", "def depatures_by_stop(stop_id)\n departures('departures/bystop/' + stop_id)\n end", "def initialize(stop_id)\n @uri = URI(\"http://cuandopasa.efibus.com.ar/default.aspx/RecuperarDatosDeParada\")\n @attributes = { identificadorParada: stop_id }\n end", "def stops_by_id(stop_id)\n [Stop.from_json(query('stops/bystop/' + CGI.escape(stop_id)))]\n end", "def stop_time_page! stop_time_page\n self.arrival_time = stop_time_page.arrival_time\n self.stop = Stop.find_or_add_from_stop_page stop_time_page.stop_page\n self.stop_sequence = stop_time_page.stop_sequence\n end", "def stops_by_stop_id(stop_id)\n get \"/gtfs/stops/stopId/#{stop_id}\"\n end", "def stop_times\n page.search('table#trip-details tbody tr').reduce(Array.new) do |stop_times, table_row|\n stop_time = StopTime.new.html! table_row\n duplicate = stop_times.find do |duplicate|\n duplicate.stop_page.stop_id == stop_time.stop_page.stop_id &&\n duplicate.arrival_time == stop_time.arrival_time\n end\n stop_times << stop_time unless duplicate\n stop_times\n end.each_with_index.map do |stop_time, index|\n stop_time.stop_sequence = index\n stop_time\n end\n end", "def set_stop\n @stop = Stop.find(params[:id])\n @order = @stop.order\n end", "def next_departures_on_route_for_stop(route_id, stop_id)\n time = Time.now.strftime(\"%H:%M:%S\")\n stop_name = get_stop_name_by_id(stop_id)\n\n departures = @db[:stop_times].\n join(:trips, :trip_id => :trip_id).\n join(:calendar_dates, :service_id => :service_id).\n where(:date => Date.today.strftime(\"%Y%m%d\")).\n select(:trips__trip_id, :stop_id, :departure_time, :trip_headsign).\n where(:route_id => route_id).\n where(:stop_id => stop_id).\n where{ departure_time > time }.\n where(~{:trip_headsign => stop_name}).\n order(:departure_time)\n\n departures.map do |departure|\n departure[:departure_time] = convert_transit_time(departure[:departure_time])\n departure\n end\n end", "def drop_stop(t_obj, value)\n if t_obj.drop_route_id.present?\n route_stops = t_obj.drop_route.vehicle_stops.select(&:is_active)\n t_obj.drop_stop_id = route_stops.detect{|s| s.name == value}.try(:id)\n end\n end", "def stop_addresses\n if (self['Stop'] and self['Stop'].kind_of?(Hash) == false)\n return {'Address' => self['Stop'] }\n else\n return self['Stop']\n end\n end", "def create\n @stop_request = StopRequest.new(stop_request_params)\n\n respond_to do |format|\n if @stop_request.save\n format.html { redirect_to @stop_request, notice: 'Stop request was successfully created.' }\n format.json { render :show, status: :created, location: @stop_request }\n else\n format.html { render :new }\n format.json { render json: @stop_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @busstop = Busstop.new(busstop_params)\n\n respond_to do |format|\n if @busstop.save\n format.html { redirect_to @busstop, notice: 'Busstop was successfully created.' }\n format.json { render :show, status: :created, location: @busstop }\n else\n format.html { render :new }\n format.json { render json: @busstop.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @stop = Stop.new({:latitude => MAP_CENTER[:lat], :longitude => MAP_CENTER[:long]})\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stop }\n end\n end", "def create\n @one_time_stop = OneTimeStop.new(params[:one_time_stop])\n\n respond_to do |format|\n if @one_time_stop.save\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully created.' }\n format.json { render json: @one_time_stop, status: :created, location: @one_time_stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def pickup_stop(t_obj, value)\n if t_obj.pickup_route_id.present?\n route_stops = t_obj.pickup_route.vehicle_stops.select(&:is_active)\n t_obj.pickup_stop_id = route_stops.detect{|s| s.name == value}.try(:id)\n end\n end", "def new\n @stop_time = StopTime.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stop_time }\n end\n end", "def stop_revenue(stop, phase, train)\n return 0 if stop.tile.label.to_s == 'HALT' && train.name != '3T' && train.name != '4T'\n\n stop.route_revenue(phase, train)\n end", "def update\n if @stop.update_attributes(params[:stop])\n render 'api/v1/stops/show'\n else\n render 'api/v1/stops/show', status: :unprocessable_entity\n end\n end", "def stops_by_stop_code(stop_code)\n get \"/gtfs/stops/stopCode/#{stop_code}\"\n end", "def stop_times\n StopTimeVersion.where(:stop_identifier => identifier)\n end", "def stop\n [ @start_time, (@stop_time = @stop_time.nil? ? Time.now : @stop_time) ]\n end", "def stop_times_by_trip_id(trip_id)\n get \"/gtfs/stopTimes/tripId/#{trip_id}\"\n end", "def update\n @stop = Stop.find(params[:id])\n @stop.latitude = params[:stop][:latitude]\n @stop.longitude = params[:stop][:longitude]\n if @stop.save\n flash[:notice] = \"Successfully updated Stop\"\n redirect_to buses_path\n else\n render :edit\n end\n end", "def new\n @stop = Stop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stop }\n end\n end", "def to_hash\n { :stopname => first_stop_description,\n :signs => runs.map { |run| run[:sign] }.uniq,\n :runs => runs.map do |run|\n { :time => run[:estimatedtime],\n :sign => run[:sign],\n :adherence => run[:adherence],\n :route => run[:route]\n }\n end\n }\n end", "def busstop_params\n params.require(:busstop).permit(:name, :latitude, :longitude)\n end", "def update\n respond_to do |format|\n if @stop.update(stop_params)\n format.html { redirect_to edit_order_path(@order), notice: \"Stop was successfully updated.\" }\n format.json { render :show, status: :ok, location: @stop }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def stops_for_route(route_id)\n stop_ids = @db[:stop_times].\n select(:stop_id).\n where(:trip_id => trips_for_route_today(route_id))\n\n stops = @db[:stops].\n select(:stop_id, :stop_name).\n where(:stop_id => stop_ids).\n order(:stop_name).\n all\n\n stops.map { |stop| { :route_id => route_id}.merge(stop) }\n end", "def set_stop_request\n @stop_request = StopRequest.find(params[:id])\n end", "def create\n @roadstop = Roadstop.new(roadstop_params)\n\n respond_to do |format|\n if @roadstop.save\n format.html { redirect_to @roadstop, notice: 'Roadstop was successfully created.' }\n format.json { render action: 'show', status: :created, location: @roadstop }\n else\n format.html { render action: 'new' }\n format.json { render json: @roadstop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bus_stop = BusStop.new(params[:bus_stop])\n\n respond_to do |format|\n if @bus_stop.save\n flash[:notice] = 'BusStop was successfully created.'\n format.html { redirect_to(@bus_stop) }\n format.xml { render :xml => @bus_stop, :status => :created, :location => @bus_stop }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bus_stop.errors, :status => :unprocessable_entity }\n end\n end\n end", "def updateTrainDetails()\n doc = Nokogiri::HTML(open(@site_info_details))\n doc.xpath(XPathMatchInfo.XPATH_DETAILS_GENERIC).each do |x|\n x.xpath(XPathMatchInfo.XPATH_DETAILS_STATION_NAME).each do |stationName|\n @stationName = stationName.to_s\n end\n x.xpath(XPathMatchInfo.XPATH_DETAILS_SCHEDULED_STOP_TIME).each do \\\n |scheduledArrivalTime|\n @scheduledArrivalTime = StringUtils.remove_newlines_tabs_and_spaces(\n scheduledArrivalTime).to_s\n end\n x.xpath(XPathMatchInfo.XPATH_DETAILS_ACTUAL_STOP_TIME).each do \\\n |actualArrivalTime|\n @actualArrivalTime = StringUtils.remove_newlines_tabs_and_spaces(\n actualArrivalTime).to_s\n end\n rail = StringUtils.remove_newlines_tabs_and_spaces(x).match(RegExpMatchInfo.REGEXP_RAIL).to_a\n if x.attributes()['class'].to_s =~ RegExpMatchInfo.REGEXP_STOP_ALREADY_DONE\n t = TrainStop.new(@stationName, @scheduledArrivalTime, \n @actualArrivalTime, StopState.DONE,rail)\n else\n t = TrainStop.new(@stationName, @scheduledArrivalTime, \n @actualArrivalTime, StopState.TODO,rail)\n end\n @train.addStop(t)\n end\n end", "def crop_start_stop_time_from_data\n # use recorded at (for tracks & message), time for presence\n start_at = nil\n stop_at = nil\n\n self.data.each do |el|\n if el.id != nil\n mom = nil\n CC.logger.debug(\"crop_start_stop_time_from_data of #{el.class}: #{el}\")\n case \"#{el.class}\"\n when \"UserApis::Mdi::Dialog::PresenceClass\"\n mom = el.time\n when \"UserApis::Mdi::Dialog::MessageClass\"\n mom = el.recorded_at\n when \"UserApis::Mdi::Dialog::TrackClass\"\n mom = el.recorded_at\n end\n\n raise \"Couldn't find time associated with a #{el.class}\" if mom == nil\n\n start_at ||= mom\n stop_at ||= mom\n start_at = mom if mom < start_at\n stop_at = mom if mom > stop_at\n\n end\n end\n\n self.start_at = start_at\n self.stop_at = stop_at\n\n end", "def add_stops(relation, stops_list)\n puts 'Creating stops...'\n stops_id = []\n stops_list.each do |stop|\n point = stop.location\n node = Rosemary::Node.new(lat: point.lat, lon: point.lon)\n node.add_tags(name: stop.name, highway: 'bus_stop')\n node_id = @api.save(node, @changeset)\n stops_id << node_id\n end\n stops_id.each do |id|\n relation.members << Rosemary::Member.new('node', id)\n end\n puts \"There was #{stops_id.length} stops added to relation.\"\n relation\n end", "def initialize(name, stop)\n @name = name\n @stop = stop\n end", "def new\n @one_time_stop = OneTimeStop.new\n\n # if a truck id parameter is passed in, otherwise default to 1\n @one_time_stop.truck = Truck.find(params[:truck_id] || 1)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @one_time_stop }\n end\n end", "def roadstop_params\n params.require(:roadstop).permit(:roadstopspart, :roadstopsdate, :projektid)\n end", "def update\n respond_to do |format|\n if @stop.update(stop_params)\n format.html { redirect_to trip_path(@trip), notice: 'Stop was successfully updated.' }\n format.json { render :show, status: :ok, location: @stop }\n else\n format.html { render :edit }\n format.json { render json: @stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @do_not_stop = DoNotStop.new(do_not_stop_params)\n\n respond_to do |format|\n if @do_not_stop.save\n format.html { redirect_to @do_not_stop, notice: 'Do not stop was successfully created.' }\n format.json { render :show, status: :created, location: @do_not_stop }\n else\n format.html { render :new }\n format.json { render json: @do_not_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @stop = Stop.new()\n if params[:date]\n @stop.date = params[:date].to_date\n @stop.location_id = params[:loc]\n @stop.window_id = params[:win]\n if @stop.save\n flash[:notice] = 'Stop was successfully created.'\n redirect_to('/admin/schedule')\n end\n else\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stop }\n format.js { render :action => \"new.html.erb\", :layout => false }\n end\n end\n end", "def to_hash_for_xml\n { :stopname => first_stop_description,\n :runs => runs.map do |run|\n { :time => run[:estimatedtime],\n :scheduled_time => run[:triptime],\n :sign => run[:sign],\n :adherence => run[:adherence],\n :route => run[:route]\n }\n end\n }\n end", "def setupBusStopTable()\n @busStopTable = SavsBusStopTable.new() ;\n SavsLogEntry.setBusStopTable(@busStopTable) ;\n end", "def update\n respond_to do |format|\n if @stop.update(stop_params)\n format.html { redirect_to @stop, notice: 'Stop was successfully updated.' }\n format.json { render :show, status: :ok, location: @stop }\n else\n format.html { render :edit }\n format.json { render json: @stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def bus_api_getstop(route, directions, latitude, longitude)\n\n url_safe_route = URI.encode(route)\n apiKey = \"UPGw2J5PBxNnF967CAMyHygeB\"\n\n directions.each do |direction|\n url_safe_direction = URI.encode(direction)\n apiLink = \"http://www.ctabustracker.com/bustime/api/v1/getstops?key=#{apiKey}&dir=#{url_safe_direction}&rt=#{url_safe_route}\"\n apiResults = Hash.from_xml(open(apiLink).read)\n stops = apiResults[\"bustime_response\"][\"stop\"]\n stops.each do |stop|\n if (stop[\"lat\"][0, 6] == latitude[0, 6] && stop[\"lon\"][0, 7] == longitude[0, 7])\n return stop\n end\n end\n end\n return 0\n end", "def set_roadstop\n @roadstop = Roadstop.find(params[:id])\n end", "def route_by_stop_id(stop_id)\n get \"/gtfs/routes/stopid/#{stop_id}\"\n end", "def set_busstop\n @busstop = Busstop.find(params[:id])\n end", "def fetchStopPositions\n\t\tfetchUri(\"http://api.wmata.com/Bus.svc/json/JStops?&api_key=#{@@apiKey}\")\n\tend", "def stops\n get '/gtfs/stops'\n end", "def update\n @stop = Stop.find(params[:id])\n\n respond_to do |format|\n if @stop.update_attributes(params[:stop])\n format.html { redirect_to @stop, notice: 'Stop was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def technical_stops_in tstops\n dict( tstops.map(&:city), :in )\n end", "def nearby_stops\n \tstops = Stop.near([params[:latitude],params[:longitude]],10, :order => \"distance\").limit(6)\n google_results = UserLocation.search(params[:latitude],params[:longitude])\n geocoder_ca_results = UserLocation.geocoder_ca(params[:latitude],params[:longitude]).intersection\n user_location=UserLocation.new(\n :user_id => current_user.id,\n :longitude => params[:longitude],\n :latitude => params[:latitude],\n :address => google_results.address,\n :city => google_results.city,\n :neighborhood => google_results.neighborhood,\n :main_intersection => \"#{geocoder_ca_results[\"street1\"]} & #{geocoder_ca_results[\"street2\"]}\"\n )\n user_location.save\n if stops.empty?\n render json: stops, status: 422\n else\n \t render json: stops\n end\n end", "def create_departure(csv_row:)\n origin = Stop.find_or_create_by(stop_name: csv_row[1])\n destination = Stop.find_or_create_by(stop_name: csv_row[3])\n\n departure = build_departure(\n origin: origin, destination: destination, csv_row: csv_row\n )\n save_departure(departure: departure)\n end", "def remaining_stops_for_trip(trip_id, stop_id)\n stop_times = @db[:stop_times]\n sequence_id = stop_times.\n select(:stop_sequence).\n where(:trip_id => trip_id, :stop_id => stop_id).\n first[:stop_sequence]\n\n stops = stop_times.\n join(:stops, :stop_id => :stop_id).\n select(:stop_name, :arrival_time).\n where(:trip_id => trip_id).\n where{ stop_sequence >= sequence_id }.\n order(:stop_sequence)\n\n stops.map do |stop|\n stop[:arrival_time] = convert_transit_time(stop[:arrival_time])\n stop\n end\n end", "def update\n @stop_time = StopTime.find(params[:id])\n\n respond_to do |format|\n if @stop_time.update_attributes(params[:stop_time])\n format.html { redirect_to @stop_time, notice: 'Stop time was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stop_time.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(data={})\n @city = data['city'] || 0.0\n @highway = data['highway'] || 0.0\n end", "def create\n curAddress = params[:address]\n destAddress = params[:destaddress]\n\n @currentStop = Stop.closest(:origin => curAddress)\n @destinationStop = Stop.closest(:origin => destAddress)\n\n startStopId = @currentStop.first.id\n endStopId = @destinationStop.first.id\n \n @cStop = Stop.find(startStopId)\n @dStop = Stop.find(endStopId)\n\n \n\n @timeNow = Time.now.strftime(\"%I:%M:%S %z\") # \"09:33:00 -0400\"\n # @timeNow = @timeNow_ + 4.hours\n\n\n\n # Get all the buses at current and destination stop\n #@possible_buses = Schedule.where(\"arrival >= ?\", @timeNow).where(stop_id: [startStopId,endStopId])\n\n@possible_sbuses = Schedule.where(\"arrival >= ?\", @timeNow).where(\"stop_id = ?\", startStopId)\n\n@possible_dbuses = Schedule.where(\"arrival >= ?\", @timeNow).where(\"stop_id = ?\", endStopId)\n\n#@possible_buses = @possible_sbuses.joins(:@possible_dbuses)\n@temp = @possible_sbuses\n\ndb_parts = \"postgres://poglkhpvagspfk:hmuUSorO_T8qyrmk6JoIN5I8_Y@ec2-184-73-165-195.compute-1.amazonaws.com:5432/d3tjsoqs2ldgks\".split(/\\/|:|@/)\n\n#conn = PGconn.open(:host => host, :dbname => db, :user=> username, :password=> password)\n\n\n\n@connection = ActiveRecord::Base.establish_connection(\n :adapter => \"postgresql\",\n :host => db_parts[5],\n :database => db_parts[7],\n :username => db_parts[3],\n :password => db_parts[4],\n\t :port => db_parts[6]\n)\n\nsql = \"\nselect A.bus_id as busid, A.stop_id as source, A.arrival as atime, B.arrival as dtime from\n(SELECT * from schedules as S where S.stop_id = #{startStopId}) A\ninner join\n(SELECT * from schedules as S where S.stop_id = #{endStopId}) B\non A.bustag = B.bustag\nwhere A.arrival < B.arrival\nand A.arrival > localtime\"\n\nresult = @connection.connection.execute(sql);\n\n@temp = result.values\n\n@busName = Array.new\n@arrivalTime = Array.new\n@temp.each do |t|\n tempbus = Bus.find(t[0])\n @busName.push(tempbus.name)\n @arrivalTime.push(t[2])\nend\n\n@size = @busName.length\n\n\n #Get all the buses at the start location and respective timing\n # @startBuses = Array.new\n #@startBusesTime = Array.new\n #@possible_buses.each do |bus|\n # if(bus.stop_id == startStopId)\n # @startBuses.push(bus.bus_id)\n # @startBusesTime.push(bus.arrival)\n # end\n # end \n\n #Get all the buses at end location and respetive timing\n # @endBuses = Array.new\n # @endBusesTime = Array.new\n # @possible_buses.each do |bus|\n # if(bus.stop.id == endStopId)\n # @endBuses.push(bus.bus_id)\n # @endBusesTime.push(bus.arrival)\n # end\n # end\n \n\n\n\n \n #@curstops = Stop.where(\"longitude = ? AND latitude = ?\", curlong, curlat)\n #@deststops = Stop.where(\"longitude = ? AND latitude = ?\",destlong,destlat)\n \n # current_Stop = @curstops[0].id\n #destination_Stop = @deststops[0].id\n\n # Get Schedule id of all buses for the two stop ids\n #@possible_buses = Schedule.where(stop_id: [current_Stop, destination_Stop]).where(\"stop_id = ?\",current_Stop).pluck(:bus_id)\n #@possible_buses_times = Schedule.where(stop_id: [current_Stop, destination_Stop]).where(\"stop_id = ?\",current_Stop).pluck(:id) \n \n #store bus ids of all the possible buses to take\n #@buses = Array.new\n #@possible_buses.each do |bus|\n #\ttemp = Bus.find(bus)\n #\t@buses.push(temp.name)\n #end\n # store the arrival time of each possible buses to take\n #@times = Array.new\n #@possible_buses_times.each do|sched|\n #\ttemp = Schedule.find(sched)\n #\t@times.push(temp.arrival)\n #end\n\n \n #@size = @buses.length \n\n\n render :index\n end", "def as_json(options = {})\n hash = super(options)\n \n # merge in the stops in the proper order\n stops = self.stop_tours.order(:position).select{ |st| st.stop != nil }.map { |st| st.stop.attributes.merge(:position => st.position, :categories => st.stop.categories, :photos => st.stop.photos) }\n hash.merge!(:stops => stops)\n end", "def spike_new_end_tile_bonus(spike, route, stops)\n return { revenue: 0 } if spike_complete?(spike)\n\n found_end = found_spike = false\n stops.each do |stop|\n found_end = true if !found_end && spike_end_hexes(spike).include?(stop.hex)\n found_spike = true if !found_spike && spike_hex(spike) == stop.hex\n end\n return { revenue: 0 } if !found_end || found_spike\n\n return { revenue: 0 } unless completing_spike_on_other_route?(spike, route, stops)\n\n hex = spike_end_hex_on_route(spike, route, stops)\n hex_meta = SPIKE[spike][:end_hex_meta][hex.id]\n added_revenues = hex_meta[:added_revenue]\n revenue =\n case @phase.name\n when '2'\n added_revenues[0]\n when '3', '4'\n added_revenues[1]\n when '5', '6'\n added_revenues[2]\n when '7', '8'\n added_revenues[3]\n end\n\n if (east = stops.find { |stop| stop.groups.include?('E') })\n east_rev = east.tile.icons.sum { |icon| icon.name.to_i }\n west_rev = hex_meta[:west]\n { revenue: revenue + east_rev + west_rev, description: \"new #{hex.tile.location_name} tile + E/W\" }\n else\n { revenue: revenue, description: \"new #{hex.tile.location_name} tile\" }\n end\n end", "def create_channel_stop_sell_log(channel_stop_sell)\n ChannelStopSellLog.create(:channel_stop_sell_id => channel_stop_sell.id, :stop_sell => channel_stop_sell.stop_sell)\n end", "def create\n @stopover = Stopover.new(params[:stopover])\n\n respond_to do |format|\n if @stopover.save\n format.html { redirect_to @stopover, notice: 'Stopover was successfully created.' }\n format.json { render json: @stopover, status: :created, location: @stopover }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stopover.errors, status: :unprocessable_entity }\n end\n end\n end", "def ground_stop(id)\n perform_get(\"/ground_stops/#{id}.xml\")\n end", "def depatures_by_route(route, stop_id)\n departures('departures/byroute/' + CGI.escape(route) + '/' + CGI.escape(stop_id))\n end", "def create\n @event = Event.new(event_params)\t\n # Set the stop time at the start time + length of service\n @event.stops_at = @event.starts_at + Service.find_by_id(@event.service_id).time_length.minutes\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event }\n else\n format.html { render action: 'new' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(data)\n @time = Time.at(data['dt'])\n @main = data['weather'][0]['main']\n @description = data['weather'][0]['description']\n @icon = \"https://openweathermap.org/img/w/#{data['weather'][0]['icon']}.png\"\n @emoji = OpenWeatherMap::Constants::CONDITION_CODE[data['weather'][0]['icon'].tr('n', 'd')]\n @temperature = data['main']['temp']\n @temp_min = data['main']['temp_min'].to_f\n @temp_max = data['main']['temp_max'].to_f\n @pressure = data['main']['pressure'].to_f\n @humidity = data['main']['humidity'].to_f\n @wind = {\n speed: data['wind']['speed'],\n direction: data['wind']['deg']\n }\n @clouds = data['clouds']['all'].to_f\n @rain = data['rain'].nil? ? nil : {\n one_hour: data['rain']['1h'],\n three_hours: data['rain']['3h']\n }\n @snow = data['snow'].nil? ? nil : {\n one_hour: data['snow']['1h'],\n three_hours: data['snow']['3h']\n }\n end", "def new\n @stop = Stop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stop }\n end\n end", "def create\n @stopword_list = StopwordList.new(params[:stopword_list])\n\n respond_to do |format|\n if @stopword_list.save\n format.html { redirect_to @stopword_list, notice: 'Stopword list was successfully created.' }\n format.json { render json: @stopword_list, status: :created, location: @stopword_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stopword_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @travel_datum = TravelDatum.new\n @travel_datum.start_time = Time.now.beginning_of_day + 9.hours\n @travel_datum.end_of_business_time = Time.now.beginning_of_day+17.hours\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @travel_datum }\n format.xml { render :xml => @travel_data }\n end\n end", "def handle_stop_sell(date_rate, rt, logs)\n if date_rate[1]['stop_sell']\n stop_sell = to_boolean(date_rate[1]['stop_sell'])\n existing_stop_sell = ChannelStopSell.find_by_date_and_property_id_and_pool_id_and_room_type_id_and_channel_id(date_rate[0], current_property.id, params[:pool_id], rt.id, @channel.id)\n\n if existing_stop_sell.blank?\n if stop_sell.blank? or !stop_sell\n # do nothing\n else\n channel_stop_sell = ChannelStopSell.new\n channel_stop_sell.date = date_rate[0]\n channel_stop_sell.stop_sell = true\n channel_stop_sell.room_type_id = rt.id\n channel_stop_sell.property = current_property\n channel_stop_sell.pool = @pool\n channel_stop_sell.channel = @channel\n\n channel_stop_sell.save\n\n logs << create_channel_stop_sell_log(channel_stop_sell)\n end\n else\n # existing object exist, just do update\n if stop_sell != existing_stop_sell.stop_sell\n existing_stop_sell.update_attribute(:stop_sell, stop_sell)\n\n logs << create_channel_stop_sell_log(existing_stop_sell)\n end\n end\n end\n end", "def index\n @stops = Stop.all\n end", "def index\n @stops = Stop.all\n end", "def index\n @stops = Stop.all\n end", "def initialize(data)\n @data = data['results']\n @success = data['ok']\n @last_update = data['lastUpdate']\n\n if @data.nil?\n @data = data['stationBeanList']\n @success = true\n @last_update = Time.now.to_i\n end\n\n # build the id_hash\n @id_hash ||= {}\n @data.each do |d|\n @id_hash[d.id] = d\n end\n end", "def upsert_stop_node_data(conn, stop, layer_id, node_id)\n sql = <<-SQL\n SELECT id\n FROM node_data\n WHERE\n layer_id = $1::integer\n AND node_id = $2::integer\n ;\n SQL\n\n result = conn.exec_params(sql, [layer_id, node_id])\n data = hash_to_hstore(conn, stop)\n modalities = get_modalities_for_stop(conn, stop)\n\n if result.cmd_tuples.zero?\n node_data_id = insert_stop_node_data(conn, stop, layer_id, node_id)\n else\n node_data_id = result[0].fetch('id')\n update_stop_node_data(conn, stop, node_data_id)\n end\n\n node_data_id\nend", "def get_stops\n @agency = params[:agency]\n @route = params[:route]\n @direction = params[:direction] ? \"~\" + params[:direction] : \"\"\n\n request_url = \"http://services.my511.org/Transit2.0/GetStopsForRoute.aspx?token=#{@@token}&routeIDF=#{@agency}~#{@route}#{@direction}\"\n request_url = request_url.gsub(/ /,\"%20\")\n p parse_request(request_url)\n @stops = search_for_key(parse_request(request_url), \"Stop\") || []\n\n @stops = [@stops] unless @stops.kind_of?(Array)\n respond_to do |format|\n format.js {}\n end\n end", "def stop_time\n\t\tif params[:commit] == \"now\"\n\t\t\tredirect_to root_path + obl_qs(:stop, {url: :referer})\n\t\telse \n\t\t\tstop = params[:time][:number] + params[:commit]\n\t\t\tredirect_to root_path + chg_qs(:stop, stop, {url: :referer})\n\t\tend\n\tend" ]
[ "0.6656736", "0.650241", "0.6382034", "0.62685996", "0.6268304", "0.6213005", "0.6146444", "0.61268073", "0.61259097", "0.60939354", "0.60435146", "0.60259885", "0.60218275", "0.5953063", "0.5927397", "0.59246105", "0.59229445", "0.59229445", "0.59097373", "0.59014356", "0.58824885", "0.5876193", "0.5876193", "0.5876193", "0.58718264", "0.5855213", "0.58142984", "0.5809845", "0.57904327", "0.5787093", "0.5780333", "0.5764743", "0.5666722", "0.56359607", "0.5634091", "0.5569528", "0.55125165", "0.54913545", "0.5480093", "0.5474429", "0.54519594", "0.54357314", "0.54284126", "0.54271126", "0.54247653", "0.5414918", "0.53695244", "0.53425765", "0.533731", "0.53246915", "0.53069884", "0.528422", "0.5281255", "0.5261808", "0.52379835", "0.5235994", "0.522998", "0.52210224", "0.52069956", "0.52022076", "0.51909137", "0.51771826", "0.5170769", "0.51585466", "0.5153522", "0.51513064", "0.5142522", "0.51043177", "0.5079195", "0.5076222", "0.50659436", "0.49949256", "0.49890044", "0.497868", "0.49739453", "0.49403775", "0.49381515", "0.49380335", "0.49345788", "0.49310565", "0.49237937", "0.49111217", "0.48813534", "0.48772684", "0.48711857", "0.48436806", "0.4832032", "0.48245868", "0.48235458", "0.4817996", "0.47878563", "0.4772267", "0.47698906", "0.47535786", "0.47535786", "0.47535786", "0.47203314", "0.47037485", "0.47021812", "0.47011387" ]
0.6591327
1
GET /sortiment/:id/dryck GET /sortiment/:id/dryck.json
def index @drinks = Drink.all @drink_types = DrinkType.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @disabilities = Disability.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @disabilities }\n end\n end", "def index\n @bottlings = handle_sorting(:bottling, :sku, :wine, :bottle_size)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bottlings }\n end\n end", "def index \n reviews=Review.all.sort \n render json: reviews\n end", "def index\n @laws = Law.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laws }\n end\n end", "def index\n \n # if params[:dress_id]\n # @dress = Dress.find(params[:dress_id])\n @ratings = Rating.all\n render json: @ratings, except:[:created_at, :updated_at] ,status: 200\n \n # else \n # @ratings= Rating.all\n # binding.pry \n # end\n end", "def getArrondissement\r\n \tvil = params[:id]\r\n \trender json: Arrondissement.where(vil_id: vil)\r\n end", "def index\n @knowledges = Knowledge.order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @knowledges }\n end\n end", "def show\n @wine = Wine.find(params[:id])\n @bottlings = Bottling.find_all_by_wine_id(params[:id]).sort_by! {|b| b.bottle_size[0..-3].to_i }\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wine }\n end\n end", "def get_non_bajaj_vehicles\n @bikes = Bike.where(non_bajaj: true).order(\"display_order\")\n \n render json: @bikes\n end", "def index\n @pricings = Pricing.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @pricings\n end", "def index\n @rides = Ride.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @rides\n end", "def my_bets\n @bets = Bet.where('owner = ? AND status != ? AND status != ?', params[:id], \"won\", \"lost\").to_a\n @bets.sort! {|x,y| x.id <=> y.id }\n render 'my-bets.json.jbuilder'\n end", "def index\n @wines = handle_sorting(:wine, :vintage, :name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wines }\n end\n end", "def index\n @arts = Art.all.all_with_comment_counts.order('updated_at DESC')\n # curl -H \"Accept: application/json\" http://localhost:3000/arts\n respond_to do |format|\n format.html {render}\n format.json {render json: @arts}\n end\n end", "def index\n @contato_produtos = ContatoProduto.all.sort! { |a,b| b.id <=> a.id }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contato_produtos }\n end\n end", "def index\n # TODO: replace sort_order with acts_as_votable\n @shifts = Shift.all.order(\"created_at desc\")\n\n respond_to do |format|\n format.html\n format.json { render json: @shifts }\n end\n\n end", "def index\n @hystory_zakazs = HystoryZakaz.order(:id)\n end", "def index\n \n if params[:trash_type]\n if params[:trash_type] == \"Wanted\"\n @trash = Trash.wanted.order(:created_at => :desc).page(params[:page]).per(20)\n else\n @trash = Trash.rid.order(:created_at => :desc).page(params[:page]).per(20)\n end\n else\n @trash = Trash.wanted.order(:created_at => :desc).page(params[:page]).per(20) \n end\n \n respond_to do |format|\n format.html { }\n format.json { render json: @trash }\n format.js\n end \n end", "def index\n @ingredients = Ingredient.order(sort_type + \" \" + sort_direction)\n @activeSort = sort_type\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ingredients }\n end\n end", "def index\n @drugs = Drug.all\n # @permitted_drugs = Drug.permitted.alphabetical.all\n # @prohibited_drugs = Drug.prohibited.alphabetical.all\n # @restricted_drugs = Drug.restricted.alphabetical.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drugs }\n end\n end", "def drinks\n top_drinks = Drink.top.limit(5)\n exclude_drink_ids = top_drinks.map(&:id)\n top_gin_drinks = Drink.top(Ingredient.gin_canonical_id, exclude_drink_ids).limit(5)\n exclude_drink_ids += top_gin_drinks.map(&:id)\n top_vodka_drinks = Drink.top(Ingredient.vodka_canonical_id, exclude_drink_ids).limit(5)\n exclude_drink_ids += top_vodka_drinks.map(&:id)\n top_margarita_drinks = Drink.top([Ingredient.triple_sec_canonical_id, Ingredient.tequila_canonical_id], exclude_drink_ids).limit(5)\n render json: {\n general: top_drinks,\n gin_drinks: top_gin_drinks,\n vodka_drinks: top_vodka_drinks,\n margaritas: top_margarita_drinks,\n }\n end", "def show\n @question_pairing_disability = QuestionPairingDisability.with_names({id: params[:id], paginate: false})\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @question_pairing_disability }\n end\n end", "def index \n misses = Miss.all.order(created_at: :desc)\n render json: misses \n end", "def index\n @treks = Trek.all\n @title = \"Trekking routes and destinations\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @treks }\n end\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_nddndcs = @notadedebito.renglon_nddndcs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_nddndcs }\n end\n end", "def index\n @reviews = Review.order(:place_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end", "def index\n @study_arms = @study.study_arms.ascend_by_id\n\n respond_to do |format|\n format.json { render :json => @study_arms.all.to_json(:only => [:id, :code]) }\n end\n end", "def review\n @t = T\n @t = @t.paginate :page => params[:page], :per_page => params[:per_page]\n @data = @t.meanings\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @t }\n end\n end", "def index\n @death_record_items = DeathRecordItem.all\n @death_record_items = DeathRecordItem.order(params[:sort])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @death_record_items }\n end\n end", "def index\n @disciplines = Discipline.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page =>params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @disciplines }\n end\n end", "def index\n render json: Question.all.order(:votes => :desc)\n end", "def index\n if params[:smart] == \"true\"\n if ducks_yesno[:ducks_yes] && ducks_yesno[:ducks_no]\n yes = ducks_yesno[:ducks_yes]\n no = ducks_yesno[:ducks_no]\n \tgifts = Gift.bests(yes,no)[0..19] \n\n\t\tbest_pertinence = 0\n\n\t\t# parcours tous les cannards, pour chaque cannard calcul la\n\t\t# la pertinence de celui-ci\n\t\tducks = Duck.where.not(id: yes).where.not(id: no)\n\t\tbest_duck = ducks[0]\n\t\tducks.each do |d|\n\t\t\tecart_quadra = 0\n\t\t\tecart_reel = 0\n\t\t\tassociations = d.associations\n\t\t\tgifts.each do |g|\n\t\t\t\ta = associations.where(gift: g).first;\n\t\t\t\tif a \n\t\t\t\t\tecart_quadra += (50-a.value)**2\n\t\t\t\t\tecart_reel += 50-a.value\n\t\t\t\tend\n\t\t\tend\n\t\t\tif ecart_reel == 0\n\t\t\t\tecart_reel =1\n\t\t\tend\n\t\t\tpertinence = ecart_quadra/ecart_reel.abs;\n\t\t\tif pertinence > best_pertinence \n\t\t\t\tbest_duck = d\n\t\t\t\tbest_pertinence = pertinence\n\t\t\tend\n\t\tend\n\t\t@ducks=[]\n\t\t@ducks[0] = best_duck\n else\n if params[:number]\n @ducks = Duck.order(\"RANDOM()\").limit(Integer(params[:number]))\n else\n @ducks = Duck.order(\"RANDOM()\").limit(1)\n end\n end\n else\n @ducks = Duck.all\n end\n \n end", "def index\n @drone_attacks = DroneAttack.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :layout => 'blank'}\n end\n end", "def index\n @tenures = Tenure.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @tenures\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end", "def index\n if params[:id].present?\n @objetos = Objeto.where(padreid: params[:id]).where(tipe: [1,2]).order(tipe: :asc).order(\"upvote-downvote DESC\")\n else\n @objetos = Objeto.where(padreid: nil).where(tipe: [1,2]).order(tipe: :asc).order(\"upvote-downvote DESC\")\n end\n\n end", "def index\n @kid_quotes = KidQuote.search(params[:search]).order(sort_column + \" \" + sort_direction).page(params[:page]).per(10)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kid_quotes }\n format.js # index.js.erb \n end\n end", "def index\n @ducks = Duck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ducks }\n end\n end", "def show\n @kf_sort_type = Kf::SortType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kf_sort_type }\n end\n end", "def show\n @hack = Hack.find(params[:id])\n @hacks = Hack.all\n @voters = Voter.all\n @departments = ['Analytics','Rails','WEB TEAM','Clients','Core Services','Infrastructure','Other','Product','UX']\n @vote_directions = Vote.select(\"id AS x,direction AS y\").order(\"created_at\").limit(40).to_json\n @vote_times = Vote.select(\"created_at\").order(\"created_at\").to_json\n\n respond_to do |format|\n format.html # show.html.erb}\n format.json { render json: @hack }\n end\n end", "def show\n @thought = Thought.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thought }\n end\n end", "def getQuartier\r\n \tarrondissement = params[:id]\r\n \trender json: Quartier.where(arrondissement_id: arrondissement)\r\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def index\n @bruschetta = Bruschettum.order(sort_column + \" \" + sort_direction)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bruschetta }\n end\n end", "def show\n @sinh_vien = SinhVien.where(ma_sinh_vien: params[:id]).first\n # Resque.enqueue(GvLogger, params[:id])\n if @sinh_vien and @sinh_vien.trucnhat\n respond_to do |format| \n format.json { render json: JSON.parse(@sinh_vien.trucnhat)[\"days\"].sort_by }\n end\n else\n respond_to do |format| \n format.json { render json: nil }\n end\n end\n end", "def index\n @wods = Wod.order(\"created_at DESC\")\n\n render json: @wods\n end", "def show\n @request = Request.find(params[:id])\n #@sorted_trips = @request.get_sorted_trips\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @request }\n end\n end", "def show\n @wanted = Wanted.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wanted }\n end\n end", "def show\n @cars = Car.sort_by(dealership_id: params[:id])\n render json: { cars: @cars }\n \n end", "def index\n @robot_designs = RobotDesign.order(sort_column + \" \" + sort_direction)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @robot_designs }\n end\n end", "def index\n @trucks = Truck.all\n\n render json: @trucks\n end", "def index\n @drafts = @compare.drafts.reorder('id')\n #order(\"id DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @drafts }\n end\n end", "def index\n @kids = Kid.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kids }\n end\n end", "def index\n #@arquivos = Arquivo.all\n\n residencial = current_user.apartamento.residencial\n @arquivos = Arquivo\n .where(:residencial_id => residencial.id)\n .order(\"created_at\")\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @arquivos }\n end\n end", "def index\n @dolgnosts = Dolgnost.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dolgnosts }\n end\n end", "def index\n @taxis = Taxi.where(:open_for_bidding => true).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxis }\n end\n end", "def index\n @posts = Post.all.where('tipo = ?','url').order('points DESC')\n Contribution.current_user = current_api_user\n render json: @posts.as_json(except: [:post_id, :contribution_id, :updated_at], :methods => [:author, :liked])\n end", "def index\n @recipes = Recipe.where(:original => true).order(\"created_at DESC\").page(params[:page])\n end", "def index\n params[:sort] ||= \"punto_servicio_id\"\n params[:direction] ||= \"asc\"\n @prestacions = Prestacion.order(params[:sort] + \" \" + params[:direction])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prestacions }\n end\n end", "def index\n @tunning_diagrams = TunningDiagram.accessible_by(current_ability).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunning_diagrams }\n format.xml { render xml: @tunning_diagrams }\n end\n end", "def index\n @trades = Trade\n .only(:created_at, :is_fair, :ash_pokemons, :brock_pokemons)\n respond_to do |format|\n format.json { render json: @trades }\n end\n end", "def index\n @himalayas ||= Himalaya.limit(10).order('id desc')\n @descuentos ||= Descuento.limit(10).order('id desc')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @himalayas }\n end\n end", "def index\n @movimentos = Movimento.where(nil) #Inicia Escopo\n @movimentos = @movimentos.data_competencia(params[:dataCompetenciaInicio]) if params[:dataCompetenciaInicio].present?\n @movimentos = @movimentos.data_competencia_final(params[:dataCompetenciaFinal]) if params[:dataCompetenciaFinal].present?\n @movimentos = @movimentos.pessoa(params[:pessoa]) if params[:pessoa].present?\n @movimentos = @movimentos.valor(params[:valor]) if params[:valor].present?\n @movimentos = @movimentos.receita(params[:receita]) if params[:receita].present?\n @movimentos = @movimentos.despesa(params[:despesa]) if params[:despesa].present?\n @movimentos = @movimentos.conta_id(params[:contaId]) if params[:contaId].present?\n @movimentos = @movimentos.descricao(params[:descricao]) if params[:descricao].present?\n \n @movimentos = @movimentos.paginate(:page => params[:page], :per_page => params[:per_page])\n respond_to do |format|\n format.html { render :index }\n format.json { render json: {movimentos: @movimentos.as_json(:include => [:conta, :pessoa, :nota], methods: [:favorecido, :contabancaria, :informacaonota]), total: @movimentos.total_entries}}\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 index\n @death_record_books = DeathRecordBook.all\n @death_record_books = DeathRecordBook.order(params[:sort])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @death_record_books }\n end\n end", "def index\n @votings = Voting.all.order(:id)\n end", "def show\n @vote = @retort.votes.find(params[:id])\n\n respond_to do |format|\n format.html do\n render :layout => false\n end\n format.xml { render :xml => @vote }\n end\n end", "def index\n \n respond_to do |format|\n format.html # index.html.erb\n format.json {\n @interviews = Interview.select(\"annotations, interviews.id, interviews.slug, storyteller_name\").where(\"is_demo = ? AND annotations != ?\", 0, \"\")\n render json: @interviews\n }\n end\n end", "def index\n \n @songs = Song.order 'id'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @songs }\n end\n end", "def index\n @banks = Bank.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banks }\n end\n end", "def index\n @votes = @retort.votes.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @votes }\n end\n end", "def index\n @dquestions = Dquestion.where(dtest_id: @dtest.id)\n #@dquestions = Dquestion.find_all_by_dtest_id(@dtest.id)\n\n #respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: [@dtest, @dquestion] }\n #end\n end", "def index\n @adversaires = Adversaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @adversaires }\n end\n end", "def index\n @bikes = Bike.all.order(\"display_order\")\n render json: @bikes.includes(:specifications) #each_serializer: Web::V1::BikeSerializer\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: SituacionRevistaDatatable.new(view_context, { query: SituacionRevistum.all.order(:codigo) }) }\n end\n end", "def index\n @dairy_plans = DairyPlan.where(:student_id => @student.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dairy_plans }\n end\n end", "def index\n @stationeryrequests = Stationeryrequest.order(\"id DESC\").all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stationeryrequests }\n end\n end", "def show\n @believer = Believer.find(params[:id])\n @believer = Believer.sorting_table(params, :name).all\n @believers = Believer.sorting_table(params, :name).all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @believer }\n end\n end", "def index\n if params[:conditions].present?\n @knowledges = Knowledge.where(params[:conditions]).paginate(:page => params[:page]).order('id DESC')\n else\n @knowledges = Knowledge.paginate(:page => params[:page]).order('id DESC')\n end\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), knowledges_path\n\n #fresh_when model's last recoder is newer\n if stale?(:etag => Knowledge.last)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @knowledge }\n end\n end\n end", "def index\n @interviews = Interview.paginate(:page => params[:page]).order(\"storyteller_name\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end", "def index\n @rinks = Rink.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def index\n @lids = Lid.order(\"lower(name) ASC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lids }\n end\n end", "def show\n @trick = Trick.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trick }\n end\n end", "def index\n # if params[:dairy_id]\n # @current_user.diary\n @milkings = Milking.all\n render :index, status: :created, location: v1_milking_url(@milkings)\n end", "def index\n @dinos = Dino.where(query_params)\n render json: @dinos\n end", "def index\n @technologies = Technology.all(:conditions => 'deleted_at IS NULL')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @technologies }\n end\n end", "def show\n @liquidacion = Liquidacion.find(params[:id])\n\n #Obtengo todos los conceptos de la liquidacion\n @concepto_liquidacion = ConceptoLiquidacion.select(\"*\")\n .joins('LEFT JOIN liquidacions ON liquidacions.id = concepto_liquidacions.liquidacion_id')\n .joins('RIGHT JOIN conceptos ON conceptos.id = concepto_liquidacions.concepto_id')\n .where(:liquidacion_id => @liquidacion.id)\n .order('conceptos.codigo_concepto')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @liquidacion }\n end\n end", "def index\n @ramais = Ramal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ramais }\n end\n end", "def show\n @articulo = Articulo.find(params[:id])\n @noticias = Articulo.where(\"tipo = 'noticia'\").order(\"created_at desc\")\n @title = @articulo.titulo\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end", "def index \n recipes = Recipe.all\n #render will return the object back in json format so that it can be used by the frontend\n render json: recipes, except: [:created_at, :updated_at]\n end", "def show\n @trecho = Trecho.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trecho }\n end\n end", "def index\n @cvis = Cvi.all(:order => \"cvi_number DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cvis }\n end\n end", "def show\n @stage_drymass = StageDrymass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stage_drymass }\n end\n end", "def index\n @patients = Patient.order(sort_column + \" \" + sort_direction)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @patients }\n format.xml #index.xml.builder\n end\n end", "def show\n @trucking = Trucking.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trucking }\n end\n end", "def index\n render json: { bookings: @site.bookings.order(datetime: :asc) }, status: 200\n end", "def index\n @sectors = Sector.all.order(\"created_at DESC\")\n render json: @sectors\n end", "def index\n reviews = Review.all\n render json: reviews\n end", "def index\n reviews = Review.all\n render json: reviews\n end", "def index\n @search = Variety.ransack(params[:q])\n @variety = Variety.new\n @varieties = @search.result.order(created_at: :desc).page(params[:page])\n respond_to do |format|\n format.html\n format.js\n end\n end", "def index\n @varieties = Variety.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @varieties }\n end\n end" ]
[ "0.59155554", "0.59108746", "0.5893164", "0.58219963", "0.5804669", "0.57647103", "0.57415265", "0.5740778", "0.5740269", "0.5728043", "0.5721069", "0.57041043", "0.56844324", "0.56776565", "0.5676699", "0.5674293", "0.5635764", "0.56254894", "0.56162107", "0.56125456", "0.56053144", "0.55891407", "0.55857885", "0.5585013", "0.5574868", "0.55683863", "0.55587673", "0.555693", "0.55558497", "0.55541664", "0.5553882", "0.5547405", "0.5546574", "0.5537222", "0.55348593", "0.55225956", "0.5503877", "0.54972637", "0.5494747", "0.548969", "0.54832655", "0.54755753", "0.5473728", "0.5472039", "0.54590386", "0.545792", "0.54577386", "0.54564375", "0.5454782", "0.545378", "0.544366", "0.5432871", "0.54314697", "0.54293305", "0.5426713", "0.54148006", "0.5411009", "0.5410382", "0.540701", "0.5398499", "0.53917956", "0.539175", "0.538901", "0.5387712", "0.53832614", "0.5383204", "0.5381942", "0.5378639", "0.53735393", "0.5373421", "0.5367713", "0.53598785", "0.53594583", "0.5357497", "0.5355462", "0.53554255", "0.5353201", "0.5349407", "0.53444624", "0.5337939", "0.5336225", "0.53345263", "0.5333269", "0.5331297", "0.53288376", "0.53265226", "0.5325528", "0.53248465", "0.5323937", "0.5320629", "0.53202647", "0.5312558", "0.53096026", "0.5307496", "0.5305512", "0.5303972", "0.5302961", "0.5300882", "0.5300882", "0.53001064", "0.5296825" ]
0.0
-1
GET /sortiment/:id/dryck/1 GET /sortiment/:id/dryck/1.json
def show unless @drink.label_url.present? api_info = brewery_labels @drink.label_url = api_info.labels.large if api_info && api_info.labels end @have_drank = cookies[@drink.slug] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getArrondissement\r\n \tvil = params[:id]\r\n \trender json: Arrondissement.where(vil_id: vil)\r\n end", "def index\n \n # if params[:dress_id]\n # @dress = Dress.find(params[:dress_id])\n @ratings = Rating.all\n render json: @ratings, except:[:created_at, :updated_at] ,status: 200\n \n # else \n # @ratings= Rating.all\n # binding.pry \n # end\n end", "def show\n @wine = Wine.find(params[:id])\n @bottlings = Bottling.find_all_by_wine_id(params[:id]).sort_by! {|b| b.bottle_size[0..-3].to_i }\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wine }\n end\n end", "def getQuartier\r\n \tarrondissement = params[:id]\r\n \trender json: Quartier.where(arrondissement_id: arrondissement)\r\n end", "def index\n @study_arms = @study.study_arms.ascend_by_id\n\n respond_to do |format|\n format.json { render :json => @study_arms.all.to_json(:only => [:id, :code]) }\n end\n end", "def index \n reviews=Review.all.sort \n render json: reviews\n end", "def index\n @rides = Ride.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @rides\n end", "def index\n @arts = Art.all.all_with_comment_counts.order('updated_at DESC')\n # curl -H \"Accept: application/json\" http://localhost:3000/arts\n respond_to do |format|\n format.html {render}\n format.json {render json: @arts}\n end\n end", "def index\n @knowledges = Knowledge.order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @knowledges }\n end\n end", "def index\n @contato_produtos = ContatoProduto.all.sort! { |a,b| b.id <=> a.id }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contato_produtos }\n end\n end", "def show\n @question_pairing_disability = QuestionPairingDisability.with_names({id: params[:id], paginate: false})\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @question_pairing_disability }\n end\n end", "def index\n @pricings = Pricing.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @pricings\n end", "def index\n @disabilities = Disability.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @disabilities }\n end\n end", "def show\n @sinh_vien = SinhVien.where(ma_sinh_vien: params[:id]).first\n # Resque.enqueue(GvLogger, params[:id])\n if @sinh_vien and @sinh_vien.trucnhat\n respond_to do |format| \n format.json { render json: JSON.parse(@sinh_vien.trucnhat)[\"days\"].sort_by }\n end\n else\n respond_to do |format| \n format.json { render json: nil }\n end\n end\n end", "def index\n if params[:id].present?\n @objetos = Objeto.where(padreid: params[:id]).where(tipe: [1,2]).order(tipe: :asc).order(\"upvote-downvote DESC\")\n else\n @objetos = Objeto.where(padreid: nil).where(tipe: [1,2]).order(tipe: :asc).order(\"upvote-downvote DESC\")\n end\n\n end", "def get\n @dish = Dish.find_by_id(params[:id]) || Dish.find_or_create_by_name(params[:name])\n respond_to do |format|\n format.json { render json: @dish.id }\n end\n end", "def show\n @kf_sort_type = Kf::SortType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kf_sort_type }\n end\n end", "def show\n @thought = Thought.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thought }\n end\n end", "def index\n @bottlings = handle_sorting(:bottling, :sku, :wine, :bottle_size)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bottlings }\n end\n end", "def index\n @laws = Law.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laws }\n end\n end", "def index\n @tenures = Tenure.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @tenures\n end", "def index\n \n if params[:trash_type]\n if params[:trash_type] == \"Wanted\"\n @trash = Trash.wanted.order(:created_at => :desc).page(params[:page]).per(20)\n else\n @trash = Trash.rid.order(:created_at => :desc).page(params[:page]).per(20)\n end\n else\n @trash = Trash.wanted.order(:created_at => :desc).page(params[:page]).per(20) \n end\n \n respond_to do |format|\n format.html { }\n format.json { render json: @trash }\n format.js\n end \n end", "def index\n @hystory_zakazs = HystoryZakaz.order(:id)\n end", "def show\n @wanted = Wanted.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wanted }\n end\n end", "def show\n @articulo = Articulo.find(params[:id])\n @noticias = Articulo.where(\"tipo = 'noticia'\").order(\"created_at desc\")\n @title = @articulo.titulo\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end", "def drinks\n top_drinks = Drink.top.limit(5)\n exclude_drink_ids = top_drinks.map(&:id)\n top_gin_drinks = Drink.top(Ingredient.gin_canonical_id, exclude_drink_ids).limit(5)\n exclude_drink_ids += top_gin_drinks.map(&:id)\n top_vodka_drinks = Drink.top(Ingredient.vodka_canonical_id, exclude_drink_ids).limit(5)\n exclude_drink_ids += top_vodka_drinks.map(&:id)\n top_margarita_drinks = Drink.top([Ingredient.triple_sec_canonical_id, Ingredient.tequila_canonical_id], exclude_drink_ids).limit(5)\n render json: {\n general: top_drinks,\n gin_drinks: top_gin_drinks,\n vodka_drinks: top_vodka_drinks,\n margaritas: top_margarita_drinks,\n }\n end", "def show\n @cars = Car.sort_by(dealership_id: params[:id])\n render json: { cars: @cars }\n \n end", "def index\n @ingredients = Ingredient.order(sort_type + \" \" + sort_direction)\n @activeSort = sort_type\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ingredients }\n end\n end", "def show\n redirect_to action: \"latest\"\n @davis = Davis.find(params[:id])\n\n #respond_to do |format|\n # format.html # show.html.erb\n # format.json { render json: @davis }\n #end\n end", "def show\n @hack = Hack.find(params[:id])\n @hacks = Hack.all\n @voters = Voter.all\n @departments = ['Analytics','Rails','WEB TEAM','Clients','Core Services','Infrastructure','Other','Product','UX']\n @vote_directions = Vote.select(\"id AS x,direction AS y\").order(\"created_at\").limit(40).to_json\n @vote_times = Vote.select(\"created_at\").order(\"created_at\").to_json\n\n respond_to do |format|\n format.html # show.html.erb}\n format.json { render json: @hack }\n end\n end", "def show\n @stage_drymass = StageDrymass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stage_drymass }\n end\n end", "def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end", "def index\n @movimentos = Movimento.where(nil) #Inicia Escopo\n @movimentos = @movimentos.data_competencia(params[:dataCompetenciaInicio]) if params[:dataCompetenciaInicio].present?\n @movimentos = @movimentos.data_competencia_final(params[:dataCompetenciaFinal]) if params[:dataCompetenciaFinal].present?\n @movimentos = @movimentos.pessoa(params[:pessoa]) if params[:pessoa].present?\n @movimentos = @movimentos.valor(params[:valor]) if params[:valor].present?\n @movimentos = @movimentos.receita(params[:receita]) if params[:receita].present?\n @movimentos = @movimentos.despesa(params[:despesa]) if params[:despesa].present?\n @movimentos = @movimentos.conta_id(params[:contaId]) if params[:contaId].present?\n @movimentos = @movimentos.descricao(params[:descricao]) if params[:descricao].present?\n \n @movimentos = @movimentos.paginate(:page => params[:page], :per_page => params[:per_page])\n respond_to do |format|\n format.html { render :index }\n format.json { render json: {movimentos: @movimentos.as_json(:include => [:conta, :pessoa, :nota], methods: [:favorecido, :contabancaria, :informacaonota]), total: @movimentos.total_entries}}\n end\n end", "def index\n # TODO: replace sort_order with acts_as_votable\n @shifts = Shift.all.order(\"created_at desc\")\n\n respond_to do |format|\n format.html\n format.json { render json: @shifts }\n end\n\n end", "def show\n puts params[:id]\n @file_versions = FileVersion.where(versioned_file_id: params[:id]) \n #@file_versions = FileVersion.find(:versioned_file_id => params[:versioned_file_id])\n render json: @file_versions\n end", "def index\n @treks = Trek.all\n @title = \"Trekking routes and destinations\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @treks }\n end\n end", "def index\n @disciplines = Discipline.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page =>params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @disciplines }\n end\n end", "def index\n #@arquivos = Arquivo.all\n\n residencial = current_user.apartamento.residencial\n @arquivos = Arquivo\n .where(:residencial_id => residencial.id)\n .order(\"created_at\")\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @arquivos }\n end\n end", "def review\n @t = T\n @t = @t.paginate :page => params[:page], :per_page => params[:per_page]\n @data = @t.meanings\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @t }\n end\n end", "def index \n misses = Miss.all.order(created_at: :desc)\n render json: misses \n end", "def show\n @request = Request.find(params[:id])\n #@sorted_trips = @request.get_sorted_trips\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @request }\n end\n end", "def show\n @ingredient = Ingredient.find_by_url_slug(params[:id])\n @ingredient = Ingredient.find(params[:id]) if @ingredient.nil?\n @recipes = @ingredient.recipes.order('created_at DESC')\n logger.debug @recipes.inspect\n respond_to do |format|\n format.html {render :layout => 'wall'}\n format.json { render json: @ingredient }\n end\n end", "def index\n \n respond_to do |format|\n format.html # index.html.erb\n format.json {\n @interviews = Interview.select(\"annotations, interviews.id, interviews.slug, storyteller_name\").where(\"is_demo = ? AND annotations != ?\", 0, \"\")\n render json: @interviews\n }\n end\n end", "def index\n @wines = handle_sorting(:wine, :vintage, :name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wines }\n end\n end", "def show\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dtpic }\n end\n end", "def index\n @reviews = Review.order(:place_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end", "def index\n @interviews = Interview.paginate(:page => params[:page]).order(\"storyteller_name\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end", "def show\n @liquidacion = Liquidacion.find(params[:id])\n\n #Obtengo todos los conceptos de la liquidacion\n @concepto_liquidacion = ConceptoLiquidacion.select(\"*\")\n .joins('LEFT JOIN liquidacions ON liquidacions.id = concepto_liquidacions.liquidacion_id')\n .joins('RIGHT JOIN conceptos ON conceptos.id = concepto_liquidacions.concepto_id')\n .where(:liquidacion_id => @liquidacion.id)\n .order('conceptos.codigo_concepto')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @liquidacion }\n end\n end", "def index\n @trips = Trip.desc.all\n @latest_trip = @trips.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end", "def index\n @wods = Wod.order(\"created_at DESC\")\n\n render json: @wods\n end", "def get_non_bajaj_vehicles\n @bikes = Bike.where(non_bajaj: true).order(\"display_order\")\n \n render json: @bikes\n end", "def my_bets\n @bets = Bet.where('owner = ? AND status != ? AND status != ?', params[:id], \"won\", \"lost\").to_a\n @bets.sort! {|x,y| x.id <=> y.id }\n render 'my-bets.json.jbuilder'\n end", "def index\n @drone_attacks = DroneAttack.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :layout => 'blank'}\n end\n end", "def show\n @trecho = Trecho.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trecho }\n end\n end", "def show\n @exercises = Exercise.where(\"chapter_id = ?\", params[:id]).order(:number)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chapter }\n end\n end", "def index\n @stationeryrequests = Stationeryrequest.order(\"id DESC\").all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stationeryrequests }\n end\n end", "def show\n @trick = Trick.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trick }\n end\n end", "def drink\n @drinks = Item.select {|k,v| k.product_type_id == 4 }\n \n respond_to do |format|\n #format.html # index.html.erb\n format.json { render json: @drinks, :only => [:id, :name, :description, :price, :time], :include => {:product_type => { :only => [:id, :name]}}}\n end\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_nddndcs = @notadedebito.renglon_nddndcs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_nddndcs }\n end\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end", "def show\n @vote = @retort.votes.find(params[:id])\n\n respond_to do |format|\n format.html do\n render :layout => false\n end\n format.xml { render :xml => @vote }\n end\n end", "def index\n if params[:smart] == \"true\"\n if ducks_yesno[:ducks_yes] && ducks_yesno[:ducks_no]\n yes = ducks_yesno[:ducks_yes]\n no = ducks_yesno[:ducks_no]\n \tgifts = Gift.bests(yes,no)[0..19] \n\n\t\tbest_pertinence = 0\n\n\t\t# parcours tous les cannards, pour chaque cannard calcul la\n\t\t# la pertinence de celui-ci\n\t\tducks = Duck.where.not(id: yes).where.not(id: no)\n\t\tbest_duck = ducks[0]\n\t\tducks.each do |d|\n\t\t\tecart_quadra = 0\n\t\t\tecart_reel = 0\n\t\t\tassociations = d.associations\n\t\t\tgifts.each do |g|\n\t\t\t\ta = associations.where(gift: g).first;\n\t\t\t\tif a \n\t\t\t\t\tecart_quadra += (50-a.value)**2\n\t\t\t\t\tecart_reel += 50-a.value\n\t\t\t\tend\n\t\t\tend\n\t\t\tif ecart_reel == 0\n\t\t\t\tecart_reel =1\n\t\t\tend\n\t\t\tpertinence = ecart_quadra/ecart_reel.abs;\n\t\t\tif pertinence > best_pertinence \n\t\t\t\tbest_duck = d\n\t\t\t\tbest_pertinence = pertinence\n\t\t\tend\n\t\tend\n\t\t@ducks=[]\n\t\t@ducks[0] = best_duck\n else\n if params[:number]\n @ducks = Duck.order(\"RANDOM()\").limit(Integer(params[:number]))\n else\n @ducks = Duck.order(\"RANDOM()\").limit(1)\n end\n end\n else\n @ducks = Duck.all\n end\n \n end", "def index\n @project_id = params[:project_id]\n if params[:status] == nil\n @stories = Story.where(:project_id => @project_id)\n @stories.sort! { |a,b| a.prioridad <=> b.prioridad }\n else\n\tif params[:status][:id]==\"\"\n\t @stories = Story.where(:project_id => @project_id)\n\t @stories.sort! { |a,b| a.prioridad <=> b.prioridad }\n \n\telse\n\t @statusid = params[:status][:id]\n @stories = Story.where(\"status_id = ? AND project_id = ?\", params[:status][:id], @project_id)\n\t @statusid = params[:status][:id]\n\t @stories.sort! { |a,b| a.prioridad <=> b.prioridad }\n \n end\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stories }\n format.json { render json: @statusid }\n end\n end", "def show\n @movimentacao_de_estoque = MovimentacaoDeEstoque.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movimentacao_de_estoque }\n end\n end", "def index\n @drugs = Drug.all\n # @permitted_drugs = Drug.permitted.alphabetical.all\n # @prohibited_drugs = Drug.prohibited.alphabetical.all\n # @restricted_drugs = Drug.restricted.alphabetical.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drugs }\n end\n end", "def index\n @himalayas ||= Himalaya.limit(10).order('id desc')\n @descuentos ||= Descuento.limit(10).order('id desc')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @himalayas }\n end\n end", "def index\n @categorias = Categoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @categorias }\n end\n end", "def show\n respond_with DisDuplicateTherapy.find(params[:id])\n end", "def show\n @irregular_verb = IrregularVerb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @irregular_verb }\n end\n end", "def index\n @posts = Post.all.where('tipo = ?','url').order('points DESC')\n Contribution.current_user = current_api_user\n render json: @posts.as_json(except: [:post_id, :contribution_id, :updated_at], :methods => [:author, :liked])\n end", "def index\n @articulos = Articulo.where(\"tipo = 'articulo'\").order(\"created_at desc\") \n @noticias = Articulo.where(\"tipo = 'noticia' and mostrar_carrusel='1'\").order(\"created_at desc\").limit(3)\n @articulos = @articulos.page(params[:page]).per_page(5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articulos }\n end\n end", "def index\n @death_record_items = DeathRecordItem.all\n @death_record_items = DeathRecordItem.order(params[:sort])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @death_record_items }\n end\n end", "def show\n # accept the params\n # go to the db and get the correct recipe for that param\n p params[:id]\n @recipe = Recipe.find_by(id: params[:id])\n @ingredients = @recipe.ingredients.split(\", \").map {|ingredient| ingredient.capitalize}\n # send this to the view\n # show that data to the user\n render 'show.json.jb'\n end", "def index\n @dairy_plans = DairyPlan.where(:student_id => @student.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dairy_plans }\n end\n end", "def show\n @arquivo = Arquivo.find(params[:id])\n @comentarios = Comentario.where(:comentavel_id => @arquivo.id, :comentavel_type => \"Arquivo\").order('created_at DESC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @arquivo }\n end\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def index\n @survey_id = params[:survey_id]\n @survey_questions = SurveyQuestion.rank(:order_by).where(survey_id: @survey_id)\n @study = Study.where(survey_id: params[:survey_id]).first\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @survey_questions }\n end\n end", "def index\n\n @items_designs = ItemsDesign.order(:item_id,:id).all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items_designs }\n end\n end", "def index\n @drafts = @compare.drafts.reorder('id')\n #order(\"id DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @drafts }\n end\n end", "def index\n render json: Question.all.order(:votes => :desc)\n end", "def index\n \n speclines = Specline.all.collect{|i| i.txt4_id}.uniq\n changes = Change.all.collect{|i| i.txt4_id}.uniq\n txt4_id_array = Txt4.all.collect{|i| i.id}\n \n unused_txt4_id_array = txt4_id_array - changes - speclines\n\n @txt4s = Txt4.where(:id => unused_txt4_id_array)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @txt4s }\n end\n end", "def tattoos\n render :nothing => true and return if params[:id].nil?\n\n @tattoo = Tattoo.find(params[:id])\n render :json => @tattoo.to_json(:include => [:artist, :assets])\n #render :json => @tattoo.to_json(:include => { :assets => { :only => [:id, :data_file_name] } })\n return\n end", "def show\n @side_dish = SideDish.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @side_dish }\n end\n end", "def index\n \n @interests = Interest.find(@interestsId)\n \n if params[:persona_id] == nil \n @interests = Interest.order(:name) \n end\n \n respond_to do |format|\n format.json { render :json => @interests }\n end\n end", "def show\n @dish = Dish.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dish }\n end\n end", "def index\n @ducks = Duck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ducks }\n end\n end", "def index\n if params[:conditions].present?\n @knowledges = Knowledge.where(params[:conditions]).paginate(:page => params[:page]).order('id DESC')\n else\n @knowledges = Knowledge.paginate(:page => params[:page]).order('id DESC')\n end\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), knowledges_path\n\n #fresh_when model's last recoder is newer\n if stale?(:etag => Knowledge.last)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @knowledge }\n end\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: SituacionRevistaDatatable.new(view_context, { query: SituacionRevistum.all.order(:codigo) }) }\n end\n end", "def show\n @click_thru = ClickThru.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @click_thru }\n end\n end", "def show\n @vodka = Vodka.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vodka }\n end\n end", "def index\n # @hold_dates = HoldDate.all(:order => 'created_at DESC').uniq\n @hold_dates = HoldDate.where(:id == true).order('id DESC').uniq\n @page_hold_dates = @hold_dates.paginate(:page => params[:page], :per_page => 30)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hold_dates }\n end\n end", "def index\n # Get trips for the trip type\n trips = Trip.all.where(trip_type: params[:trip_type] || 2)\n # (optional) if city_id params was provided\n trips = trips.joins(:city).where(\"cities.id = ?\", params[:city_id]) if params[:city_id]\n # (optional) if country_id params was provided\n trips = trips.joins(:city => :country).where(\"countries.id = ?\", params[:country_id]) if params[:country_id]\n # (optional) if sort params was provided\n if params[:sort]\n \n case params[:sort].downcase\n when 'popularity' # by number of bookings\n trips = trips.most_popular\n when 'rating' # by rating of reviews\n trips = trips.best_rated\n end\n\n end\n\n # Paginate\n trips = trips.page(params[:page] || 1).per(params[:per_page] || 20)\n\n render json: {\n trips: ActiveModelSerializers::SerializableResource.new(trips, each_serializer: TripSerializer),\n total: trips.total_count,\n page: trips.current_page,\n per_page: trips.limit_value\n }\n end", "def show\n #@stanza = Stanza.find(params[:id])\n #@stanza = Stanza.where(:stanzno=>params[:id])\n @stanza = Stanza.find_by_no(params[:id]) || not_found\n logger.info @stanza\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stanza }\n end\n end", "def index\n @recipes = Recipe.where(:original => true).order(\"created_at DESC\").page(params[:page])\n end", "def show\n @drone_attack = DroneAttack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :layout => 'blank' }\n end\n end", "def show\n @diemtrentuyen = Diemtrentuyen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diemtrentuyen }\n end\n end", "def json_index_items_designs_by_item_id\n\n respond_to do |format|\n if ItemsDesign.exists?(item_id:params[:item_id])\n @items_designs = ItemsDesign.where('item_id=?',params[:item_id]).order(\"id\")\n\n format.json { render json: @items_designs }\n else\n format.json { render json: 'not found item id' , status: :not_found }\n end\n end\n end", "def show\n @trucking = Trucking.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trucking }\n end\n end", "def index\n @cvis = Cvi.all(:order => \"cvi_number DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cvis }\n end\n end", "def show\n @current_page = 'recettes'\n\n @recette = Recette.includes(:photo_files).find(params[:id])\n @categories = Category.all\n\n @comments = Recette.find(params[:id]).comments.limit(3).order('id desc')\n @comment = Comment.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recette }\n end\n end", "def index\n params[:sort] ||= \"punto_servicio_id\"\n params[:direction] ||= \"asc\"\n @prestacions = Prestacion.order(params[:sort] + \" \" + params[:direction])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prestacions }\n end\n end" ]
[ "0.5948088", "0.58100957", "0.5797564", "0.5760678", "0.570273", "0.56906235", "0.5672995", "0.56567407", "0.56471133", "0.5645233", "0.56432503", "0.56384975", "0.56256354", "0.56036913", "0.5594356", "0.55795455", "0.55710655", "0.55687726", "0.556784", "0.556532", "0.55498356", "0.55386233", "0.5535501", "0.5531794", "0.55315644", "0.55311584", "0.55277306", "0.55222523", "0.55194825", "0.5513306", "0.55104625", "0.55101717", "0.550887", "0.5503867", "0.5502291", "0.5491093", "0.54890233", "0.5488795", "0.54864484", "0.5486269", "0.54862106", "0.5485028", "0.54819053", "0.54762846", "0.5468008", "0.54620916", "0.54611534", "0.5459951", "0.54568744", "0.54531384", "0.54520833", "0.54507834", "0.54471457", "0.5443702", "0.54391456", "0.5438554", "0.5434814", "0.54284704", "0.54226446", "0.54206246", "0.5411355", "0.54106855", "0.5408942", "0.54086953", "0.5401501", "0.5400354", "0.5397481", "0.5395554", "0.53930646", "0.53922105", "0.53866804", "0.53831726", "0.5382852", "0.53795147", "0.537913", "0.53747094", "0.53726166", "0.5370442", "0.53672516", "0.53653705", "0.53643256", "0.53632706", "0.53589386", "0.53540725", "0.53515625", "0.53497714", "0.53494644", "0.5348017", "0.53455126", "0.53445965", "0.53424835", "0.534143", "0.5339892", "0.533977", "0.5338967", "0.53345484", "0.5333379", "0.5329136", "0.5328413", "0.5322374", "0.53199756" ]
0.0
-1
POST /sortiment/:id/dryck POST /sortiment/:id/dryck.json
def create @drink = Drink.new(drink_params) respond_to do |format| if @drink.save format.html { redirect_to new_drink_path, notice: 'Drycken skapades.' } format.json { render :show, status: :created, location: @drink } else format.html { render :new } format.json { render json: @drink.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_thought(n_dink)\n\t#format thought\n\tputs n_dink\n\t#n_dink[\"duedate\"] = ;\n\tn_dink[\"timestamp\"] = Time.now.getutc\n\tn_dink[\"id\"] = (Random.rand() * 10000).to_i\n\t#read json\n\tfile = File.read(\"./public/history.json\")\n\tdata_hash = JSON.parse(file)\n\tnew_data = []\n\tfor dink in data_hash\n\t\tnew_data.push(dink)\n\tend\n\tnew_data.push(n_dink)\n\tnew_data = new_data.sort_by { |hash| hash['duedate'].tr('-','').to_i }\n\tFile.open(\"./public/history.json\",\"w\") do |file|\n\t\tfile.write(new_data.to_json)\n\tend\n\tnew_data\nend", "def create\n @gtw_sortir = GtwSortir.new(gtw_sortir_params)\n\n respond_to do |format|\n if @gtw_sortir.save\n format.html { redirect_to @gtw_sortir, notice: 'Gtw sortir was successfully created.' }\n format.json { render :show, status: :created, location: @gtw_sortir }\n else\n format.html { render :new }\n format.json { render json: @gtw_sortir.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n if params[:smart] == \"true\"\n if ducks_yesno[:ducks_yes] && ducks_yesno[:ducks_no]\n yes = ducks_yesno[:ducks_yes]\n no = ducks_yesno[:ducks_no]\n \tgifts = Gift.bests(yes,no)[0..19] \n\n\t\tbest_pertinence = 0\n\n\t\t# parcours tous les cannards, pour chaque cannard calcul la\n\t\t# la pertinence de celui-ci\n\t\tducks = Duck.where.not(id: yes).where.not(id: no)\n\t\tbest_duck = ducks[0]\n\t\tducks.each do |d|\n\t\t\tecart_quadra = 0\n\t\t\tecart_reel = 0\n\t\t\tassociations = d.associations\n\t\t\tgifts.each do |g|\n\t\t\t\ta = associations.where(gift: g).first;\n\t\t\t\tif a \n\t\t\t\t\tecart_quadra += (50-a.value)**2\n\t\t\t\t\tecart_reel += 50-a.value\n\t\t\t\tend\n\t\t\tend\n\t\t\tif ecart_reel == 0\n\t\t\t\tecart_reel =1\n\t\t\tend\n\t\t\tpertinence = ecart_quadra/ecart_reel.abs;\n\t\t\tif pertinence > best_pertinence \n\t\t\t\tbest_duck = d\n\t\t\t\tbest_pertinence = pertinence\n\t\t\tend\n\t\tend\n\t\t@ducks=[]\n\t\t@ducks[0] = best_duck\n else\n if params[:number]\n @ducks = Duck.order(\"RANDOM()\").limit(Integer(params[:number]))\n else\n @ducks = Duck.order(\"RANDOM()\").limit(1)\n end\n end\n else\n @ducks = Duck.all\n end\n \n end", "def create\n render json: Dish.create(dish_params)\n end", "def create\n # {\"id\":\"\",\"status_id\":\"1\",\"name\":\"aaaaa\",\"created_at\":\"\",\"updated_at\":\"\",\"tel_1\":\"34344545\",\"tel_2\":\"56676778\",\n # \"dop\":\"ddd\",\"info_type_id\":\"1\",\"info_source_id\":\"1\",\"contact_id\":\"0\",\"published\":\"1\",\n # \"haves\":[{\"obj_id\":\"2\",\"room\":\"1\",\"price_estimate\":\"\",\"price_want\":\"\",\n # \"torg\":0,\"floor\":\"2\",\"floor_house\":\"9\",\"rayon_id\":\"0\",\n # \"street_id\":\"\",\"house_n\":\"\",\"flat_n\":\"\",\"orientir\":\"\",\n # \"s_all\":\"\",\"s_live\":\"\",\"s_kux\":\"\",\"state_id\":\"0\",\n # \"year\":\"\",\"tel_1\":\"\",\"dop\":\"\",\"obmen_want\":1,\"sell_want\":0,\"rent_want\":0},\n # {\"obj_id\":\"2\",\"room\":\"1\",\"price_estimate\":\"\",\"price_want\":\"\",\"torg\":0,\n # \"floor\":\"1\",\"floor_house\":\"5\",\"rayon_id\":\"0\",\"street_id\":\"\",\"house_n\":\"\",\n # \"flat_n\":\"\",\"orientir\":\"\",\"s_all\":\"\",\"s_live\":\"\",\"s_kux\":\"\",\"state_id\":\"0\",\n # \"year\":\"\",\"tel_1\":\"\",\"dop\":\"\",\"obmen_want\":1,\"sell_want\":0,\"rent_want\":0}\n # ],\n # \"wants\":[{\"variant\":\"1\",\n # \"wishlist\":[\n # {\"field\":\"obj_id\",\"cond\":\"=\",\"value\":\"2\"},\n # {\"field\":\"room\",\"cond\":\"=\",\"value\":\"3\"}\n # ]\n # },\n # {\"variant\":\"1\",\n # \"wishlist\":[\n # {\"field\":\"obj_id\",\"cond\":\"=\",\"value\":\"2\"},\n # {\"field\":\"room\",\"cond\":\"=\",\"value\":\"1\"}\n # ]\n # }\n # ]\n # }\n\n @zayavka_params=params[\"zayavka\"]\n @haves=params[\"haves\"]\n @wants=params[\"wants\"]\n #render :text => \"out=\"+@haves.inspect\n #return\n\n @zayavka = Zayavka.new(@zayavka_params)\n\n top_variant_id=0\n respond_to do |format|\n if @zayavka.save\n #---save have--------------\n if not @haves.empty?\n @haves.each_with_index do |item,index|\n ##item['id'] = 0\n item['room'] = item['room'] ==\"\"?0:item['room'] #---check room input\n item['tel_1'] = item['tel_1'].to_s+((@zayavka['tel_1'].blank?)?\"\":@zayavka['tel_1'].to_s)+((@zayavka['tel_2'].blank?)?\"\":@zayavka['tel_2'].to_s)\n item['zayavka_id'] = @zayavka.id\n item['top_variant_id']= top_variant_id\n item['variant'] = index+1\n item['variant_cnt'] = @haves.length\n @have_rec = Have.new (item)\n\n if @have_rec.save\n #render :text => \"have_rec out=\"+@have_rec.inspect\n #return\n top_variant_id=@have_rec.id if index==0\n if not @have_rec.update_attributes(:top_variant_id=>top_variant_id)\n format.json { render json: @have_rec.errors, status: :unprocessable_entity }\n end\n else\n format.json { render json: @have_rec.errors, status: :unprocessable_entity }\n end\n\n end\n end\n #---save want-----------------\n if @wants.empty?\n return\n end\n @wants.each_with_index do |item,index|\n #--get wants_params from POST\n ##render :text => \"want variant=\"+variant+\" wishlist= \"+item['wishlist']\n ##return\n want_obj_id,want_room ,want_rayon_id, want_price_want=0,0,0,0\n item['wishlist'].each_with_index do |wish_list_item,wi|\n want_obj_id = wish_list_item['value'] if wish_list_item['field']==\"obj_id\"\n want_room = wish_list_item['value'] if wish_list_item['field']==\"room\"\n want_rayon_id = wish_list_item['value'] if wish_list_item['field']==\"rayon_id\"\n want_price_want = wish_list_item['value'] if wish_list_item['field']==\"price_want\"\n\n end\n @want_rec=Want.new({:zayavka_id=>@zayavka.id,\n :obj_id=>want_obj_id,\n :room=>want_room,\n :rayon_id=>want_rayon_id,\n :price_want=>want_price_want,\n :tel_1=>@zayavka[\"tel_1\"],\n :tel_2=>@zayavka[\"tel_2\"]})\n if @want_rec.save\n #----wishlist uppend---\n variant=item['variant']\n w_list=item['wishlist']\n w_list.each do |row|\n @wish_list_rec=WishList.new({:want_id=>@want_rec.id,:field_name=>row['field'],:field_cond=>row['cond'],:field_value=>row['value'],:variant=>variant})\n if not @wish_list_rec.save\n format.json { render json: @wish_list_rec.errors, status: :unprocessable_entity }\n end\n end\n\n else\n format.json { render json: @want_rec.errors, status: :unprocessable_entity }\n end\n\n end\n # format.html { redirect_to @zayavka, notice: 'Zayavka was successfully created.' }\n format.json { render json: @zayavka, status: :created, location: @zayavka }\n else\n # format.html { render action: \"new\" }\n format.json { render json: @zayavka.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sentiment = Sentiment.new(sentiment_params)\n\n respond_to do |format|\n if @sentiment.save\n format.html { redirect_to @sentiment, notice: 'Sentiment was successfully created.' }\n format.json { render :show, status: :created, location: @sentiment }\n else\n format.html { render :new }\n format.json { render json: @sentiment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:post][:repost_id]\n #Adding if clicking repost, deleting if unclicking repost\n repost_id = (params[:post][:repost_id]).to_i\n repost_exist = current_user.posts.all.select do |post|\n if post.repost_id == repost_id\n post\n end\n end\n if repost_exist.length > 0\n Post.destroy(repost_exist.first.id)\n else\n @post = Post.new(params[:post])\n @post.user_id = current_user.id\n @post.save\n end\n else\n @post = Post.new(params[:post])\n sentiment_data_json = Sentimentalizer.analyze(params[:post][:content])\n sentiment_data = JSON.parse(sentiment_data_json)\n sentiment_smiley = sentiment_data[\"sentiment\"]\n if sentiment_smiley == \":)\"\n @post.sentiment = true\n else\n @post.sentiment = false\n end\n @post.sentiment_prob = sentiment_data[\"probability\"]*100\n @post.user_id = current_user.id\n @post.save\n end\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Post was successfully created.' }\n format.json { render json: @posts, status: :created, location: @post }\n end\n end", "def create\n @djoque = Djoque.new(djoque_params)\n @djoque.djoker = current_djoker\n respond_to do |format|\n if @djoque.save\n format.html { redirect_to @djoque, notice: \"Votre Djoque à bien été créée :p\" }\n format.json { render :show, status: :created, location: @djoque }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @djoque.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dis_duplicate_therapy = DisDuplicateTherapy.new(dis_duplicate_therapy_params)\n\n respond_to do |format|\n if @dis_duplicate_therapy.save\n format.html { redirect_to @dis_duplicate_therapy, notice: 'Dis duplicate therapy was successfully created.' }\n format.json { render :show, status: :created, location: @dis_duplicate_therapy }\n else\n format.html { render :new }\n format.json { render json: @dis_duplicate_therapy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trivium = Trivia.new(trivium_params)\n\n respond_to do |format|\n if @trivium.save\n format.html { redirect_to @trivium, notice: 'Trivia was successfully created.' }\n format.json { render :show, status: :created, location: @trivium }\n else\n format.html { render :new }\n format.json { render json: @trivium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params.permit(:intitule, :estObligatoire, :nombreDeCaractere, :ordre, :sondage_id)\n ajout = QuestionOuverteService.instance.creerQuestionOuverte(params[:intitule], params[:estObligatoire], params[:nombreDeCaractere], params[:ordre], params[:sondage_id])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end", "def create\n redirect_to action: \"latest\"\n #@davis = Davis.new(davi_params)\n\n #respond_to do |format|\n # if @davis.save\n # format.html { redirect_to @davis, notice: 'Davis was successfully created.' }\n # format.json { render json: @davis, status: :created, location: @davis }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @davis.errors, status: :unprocessable_entity }\n # end\n #end\n end", "def create\n @kf_sort = Kf::Sort.new(params[:kf_sort])\n\n respond_to do |format|\n if @kf_sort.save\n if @kf_sort.father_id != 0\n format.html { redirect_to \"/kf/sorts/#{params[:kf_sort][:father_id]}\" , notice: 'Sort was successfully created.' }\n else\n format.html { redirect_to kf_sorts_url , notice: 'Sort was successfully created.' }\n end\n format.json { render json: @kf_sort, status: :created, location: @kf_sort }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kf_sort.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @diagnoz = Diagnoz.new(params[:diagnoz])\n @woman = Woman.find(params[:woman_id])\n @woman.diagnozs << @diagnoz\n respond_to do |format|\n if @diagnoz.save\n params[:diamkhs].each do |p|\n @diamkh = Diamkh.new\n @diamkh.mkh_id = p\n @diamkh.diagnoz_id = @diagnoz.id\n @diamkh.save\n end\n format.html { redirect_to [@woman,@diagnoz], notice: 'Diagnoz was successfully created.' }\n format.json { render json: @diagnoz, status: :created, location: @diagnoz }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diagnoz.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @stage_drymass = StageDrymass.new(params[:stage_drymass])\n\n respond_to do |format|\n if @stage_drymass.save\n format.html { redirect_to @stage_drymass, notice: 'Stage drymass was successfully created.' }\n format.json { render json: @stage_drymass, status: :created, location: @stage_drymass }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stage_drymass.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movimentacao = Movimentacao.new(movimentacao_params)\n @movimentacao.tipo = params[:tipo].upcase\n @armazenamento = Armazenamento.where(nome: movimentacao_params[:armazenamento_id].downcase).first\n @movimentacao.data_movimentacao = params[:data].to_date + 3.hours\n @produto = Produto.where(nome: movimentacao_params[:produto_id].downcase).first\n if @produto.present?\n @movimentacao.produto_id = @produto.id\n else\n @produto = Produto.create({nome:movimentacao_params[:produto_id].downcase})\n @produto.save\n @movimentacao.produto_id = @produto.id\n end\n if @armazenamento.present?\n\n @movimentacao.armazenamento_id = @armazenamento.id\n else\n @armazenamento = Armazenamento.create({nome:movimentacao_params[:armazenamento_id].downcase})\n @armazenamento.save\n @movimentacao.armazenamento_id = @armazenamento.id\n end\n\n respond_to do |format|\n if @movimentacao.save\n format.html { redirect_to @movimentacao, notice: \"Movimentacao was successfully created.\" }\n format.json { render :show, status: :created, location: @movimentacao }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @movimentacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sorteio = Sorteio.new(sorteio_params)\n\n respond_to do |format|\n if @sorteio.save\n flash[:notice] = 'Salvo com sucesso'\n format.html { redirect_to @sorteio }\n format.json { render :show, status: :created, location: @sorteio }\n else\n format.html { render :new }\n format.json { render json: @sorteio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\treview = Review.create(:user_id=>params[:review][:user_id], :note_id=>params[:review][:note_id], :status=>params[:review][:status])\n\t\treview.save!\n\n render json: []\n\tend", "def create\n @vik = Vik.new(vik_params)\n\n respond_to do |format|\n if @vik.save\n format.html { redirect_to @vik, notice: 'Vik was successfully created.' }\n format.json { render :show, status: :created, location: @vik }\n else\n format.html { render :new }\n format.json { render json: @vik.errors, status: :unprocessable_entity }\n end\n end\n end", "def down\n @review = Review.find(params[:id])\n @vote = @review.votes.build(params[:vote])\n @vote.user = current_user\n @vote.point = -1\n\n @paths = @review.file\n @line = @review.line\n @project = @review.project\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to line_project_path(@project, 'line', @paths, @line), notice: 'Vote was successfully created.' }\n # format.js { @reviews = @project.reviews_by_line(@paths, @line).paginate(page: params[:page], per_page: 20) }\n format.js { @reviews = Review.with_project(@project).with_file(@paths).with_line(@line).paginate(page: params[:page], per_page: 20) }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tag_dish = TagDish.new(tag_dish_params)\n\n respond_to do |format|\n if @tag_dish.save\n format.html { redirect_to @tag_dish, notice: 'Tag dish was successfully created.' }\n format.json { render :show, status: :created, location: @tag_dish }\n else\n format.html { render :new }\n format.json { render json: @tag_dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @current_quastion = Quastion.find(params[:quastion_id])\n @thought = @current_quastion.thoughts.build(params[:thought])\n @thoughts = @current_quastion.thoughts\n @thoughts_newest = @current_quastion.thoughts.last(20)\n @thoughts_top20 = @current_quastion.thoughts.order('rate desc').limit(20)\n if user_signed_in?\n @thought.user_id = current_user.id\n end\n \n\n respond_to do |format|\n if @thought.save\n format.html { redirect_to quastion_path(@current_quastion), notice: 'Thought was successfully created.' }\n format.json { render json: @thought, status: :created, location: @thought }\n\tformat.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @thought.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sorteado = Sorteado.new(sorteado_params)\n\n respond_to do |format|\n if @sorteado.save\n format.html { redirect_to @sorteado, notice: 'Sorteado was successfully created.' }\n format.json { render :show, status: :created, location: @sorteado }\n else\n format.html { render :new }\n format.json { render json: @sorteado.errors, status: :unprocessable_entity }\n end\n end\n end", "def review\n @t = T\n @t = @t.paginate :page => params[:page], :per_page => params[:per_page]\n @data = @t.meanings\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @t }\n end\n end", "def create\n @sortie = Sortie.new(params[:sortie])\n\n respond_to do |format|\n if @sortie.save\n format.html { redirect_to(@sortie, :notice => 'Sortie was successfully created.') }\n format.xml { render :xml => @sortie, :status => :created, :location => @sortie }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sortie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_cardsort\n\t\t@cardsort = Cardsort.new(params[:cardsort])\n\t\t@cardsort.save\n\t\trespond_to do |form|\n\t\t\tform.js {}\n\t\tend\n\tend", "def create\n @wynthought = Wynthought.new(wynthought_params)\n\n respond_to do |format|\n if @wynthought.save\n format.html { redirect_to :back, notice: 'Wynthought was successfully created.' }\n format.json { render :show, status: :created, location: @wynthought }\n else\n format.html { render :new }\n format.json { render json: @wynthought.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @diet_dish = DietDish.new(diet_dish_params)\n\n respond_to do |format|\n if @diet_dish.save\n format.html { redirect_to @diet_dish, notice: 'Diet dish was successfully created.' }\n format.json { render action: 'show', status: :created, location: @diet_dish }\n else\n format.html { render action: 'new' }\n format.json { render json: @diet_dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dischargue = Dischargue.new(dischargue_params)\n @trucks = Truck.all.select { | t | t.liters_load > 0 }\n @stations = Station.all.select { | s | (s.max_liters - s.loaded_liters) > 0 }\n\n @dischargue.load_id = Truck.find(params[:truck_id]).available_load.id\n\n respond_to do |format|\n if @dischargue.save\n format.html { redirect_to @dischargue, notice: 'Dischargue was successfully created.' }\n format.json { render :show, status: :created, location: @dischargue }\n else\n format.html { render :new }\n format.json { render json: @dischargue.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movimentacao = Movimentacao.new(movimentacao_params)\n\n respond_to do |format|\n if @movimentacao.save\n format.html { redirect_to @movimentacao, notice: 'Movimentacao was successfully created.' }\n format.json { render :show, status: :created, location: @movimentacao }\n else\n format.html { render :new }\n format.json { render json: @movimentacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def gtw_sortir_params\n params.require(:gtw_sortir).permit(:kegiatan, :tanggal, :manifest_id, :bagging_id, :droppoint_asal, :kg_gtw, :awb_gtw, :kg_e3, :awb_e3, :kg_selisih_e3, :awb_selisih_e3, :fresh_paket, :agent_id, :droppoint_tujuan, :tanggal_dp, :awb_dp, :kg_dp, :awb_selisih_dp, :kg_selisih_dp, :gtw_team_kerja, :gtw_team_shift, :description, :tanggal_approve, :user_approve, :user_add, :user_edit, :ip_address, :flag)\n end", "def create\n @isd_tariff = IsdTariff.new(isd_tariff_params)\n\n respond_to do |format|\n if @isd_tariff.save\n format.html { redirect_to @isd_tariff, notice: 'Isd tariff was successfully created.' }\n format.json { render :show, status: :created, location: @isd_tariff }\n else\n format.html { render :new }\n format.json { render json: @isd_tariff.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dosing = Dosing.new(dosing_params)\n @dosing.user_id = current_user.id\n\n respond_to do |format|\n if @dosing.save\n new_quantity = Stock.where(:user_id => current_user.id, :drug_id => @dosing.drug_id).order(\"updated_at DESC\").first.quantity_available - 1\n @stock = Stock.new(user_id: current_user.id, quantity_available: new_quantity, drug_id: @dosing.drug_id)\n @stock.save\n \n format.html { redirect_to @dosing, notice: 'Dosing was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dosing }\n else\n format.html { render action: 'new' }\n format.json { render json: @dosing.errors, status: :unprocessable_entity }\n end\n end\n end", "def my_bets\n @bets = Bet.where('owner = ? AND status != ? AND status != ?', params[:id], \"won\", \"lost\").to_a\n @bets.sort! {|x,y| x.id <=> y.id }\n render 'my-bets.json.jbuilder'\n end", "def create\n @trek = Trek.new(params[:trek])\n\n respond_to do |format|\n if @trek.save\n format.html { redirect_to @trek, notice: 'Trek was successfully created.' }\n format.json { render json: @trek, status: :created, location: @trek }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end", "def submit\n\t\tCardsort.save_results(params[:id], params[:cards], params[:cardsort_id], params[:reviewer_id])\n\t\trespond_to do |form|\n\t\t\tform.js {}\n\t\tend\n\tend", "def create\n @tardy = Tardy.new(params[:tardy])\n\n respond_to do |format|\n if @tardy.save\n format.html { redirect_to @tardy, notice: 'Tardy was successfully created.' }\n format.json { render json: @tardy, status: :created, location: @tardy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tardy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n content = \"朝食は\" + params[:my_dairy][:question1] + \"\\n\" + \"昼食は\" + params[:my_dairy][:question2] + \"\\n\" + \"夕食は\" + params[:my_dairy][:question3]\n @my_dairy = MyDairy.new(content: content)\n\n respond_to do |format|\n if @my_dairy.save\n format.html { redirect_to @my_dairy, notice: 'My dairy was successfully created.' }\n format.json { render :show, status: :created, location: @my_dairy }\n else\n format.html { render :new }\n format.json { render json: @my_dairy.errors, status: :unprocessable_entity }\n end\n end\n end", "def decide\n @ds = DigitalStatus.find(params[:id])\n @ds.update_attributes(decided: params[:decided], decided_manually: true)\n flash[:notice] = \"Updated Digital Status for #{@ds.physical_object.mdpi_barcode} - chose #{@ds.decided}\"\n render 'index'\n end", "def create\n @dish = Dish.new(dish_params)\n\n respond_to do |format|\n if @dish.save\n format.html { redirect_to @dish, notice: 'Блюдо создано.' }\n format.json { render :show, status: :created, location: @dish }\n else\n format.html { render :new }\n format.json { render json: @dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def djoque_params\n params.require(:djoque).permit(:djoke, :date, :like)\n end", "def index\n @bottlings = handle_sorting(:bottling, :sku, :wine, :bottle_size)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bottlings }\n end\n end", "def sort\n book_no = params[:sort][:book_no]\n isbn = params[:sort][:isbn]\n flg_no_isbn = params[:sort][:flg_no_isbn]\n # check for an existing fulfilled, or dispatched record\n #ibtrs = Ibtr.find_all_by_book_no_and_state(book_no, [:Dispatched,:Fulfilled], :order => 'state desc, updated_at desc')\n #@ibtr = ibtrs.size == 0 ? nil : ibtrs[0]\n @ibtr = Ibtr.sort_1_jun.find_by_book_no_and_state(book_no, [:Dispatched,:Fulfilled])\n ib = IbtSort.new\n ib.book_no = book_no\n ib.isbn = isbn\n ib.flg_no_isbn = flg_no_isbn\n\n respond_to do |format|\n unless @ibtr.nil?\n @ibtr.d_user = current_user.id\n \n if @ibtr.state = :Fulfilled\n @ibtr.dispatch!\n end\n ib.ibtr_id = @ibtr.id\n ib.save!\n \n flash[:notice] = \"book dispatched to #{@ibtr.card_id} of branch #{@ibtr.branch_id}\"\n format.html { redirect_to @ibtr }\n format.xml # dispatch.xml.erb\n else\n good = Good.find_by_book_no(book_no) #to do: to add date restriction\n if good.nil? \n status = :precondition_failed\n else\n status = :not_found\n ib.consignment_id = good.consignment_id\n end\n ib.save\n format.html { render :action => \"lookup\" }\n format.xml { render :nothing => true, :status => status }\n end\n end \n end", "def create \n authorize! :manage, LopMonHocSinhVien\n msv = params[:lop_mon_hoc_sinh_vien][:ma_sinh_vien]\n @sv = SinhVien.where(ma_sinh_vien: msv).first\n @lop_mon_hoc_sinh_vien = @lop_mon_hoc.lop_mon_hoc_sinh_viens.build(ma_sinh_vien: params[:lop_mon_hoc_sinh_vien][:ma_sinh_vien])\n @lop_mon_hoc_sinh_vien.ma_mon_hoc = @lop_mon_hoc.ma_mon_hoc\n @lop_mon_hoc_sinh_vien.ten_mon_hoc = @lop_mon_hoc.ten_mon_hoc\n @lop_mon_hoc_sinh_vien.ma_lop_hanh_chinh = @sv.lop_hc\n @lop_mon_hoc_sinh_vien.ma_lop = @lop_mon_hoc.ma_lop\n @lop_mon_hoc_sinh_vien.ma_lop_ghep = @lop_mon_hoc.ma_lop\n hodem = @sv.ho_dem.split(\" \").to_a\n dem = hodem.last\n ho = hodem.first\n @lop_mon_hoc_sinh_vien.ho = ho \n @lop_mon_hoc_sinh_vien.ho_dem = dem\n respond_to do |format|\n if @sv \n @tt = @sv.check_conflict(@lop_mon_hoc) \n if @tt\n format.js {render :conflict}\n else \n if params[:checksv]\n format.js {render :checksv}\n elsif params[:submit]\n if @lop_mon_hoc_sinh_vien.save!\n format.js\n format.html { flash[:success] = \"Created OK\";\n render :index, :layout => (request.headers['X-PJAX'] ? false : true) }\n format.json { render json: @lop_mon_hoc_sinh_vien, status: :created, location: @lop_mon_hoc_sinh_vien }\n end\n end\n end\n else\n format.js\n format.html { render action: \"new\" }\n format.json { render json: @lop_mon_hoc_sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unwanted = Unwanted.new(unwanted_params)\n\n respond_to do |format|\n if @unwanted.save\n format.html { redirect_to @unwanted, notice: 'Unwanted was successfully created.' }\n format.json { render :show, status: :created, location: @unwanted }\n else\n format.html { render :new }\n format.json { render json: @unwanted.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n if params[:id].present?\n @objetos = Objeto.where(padreid: params[:id]).where(tipe: [1,2]).order(tipe: :asc).order(\"upvote-downvote DESC\")\n else\n @objetos = Objeto.where(padreid: nil).where(tipe: [1,2]).order(tipe: :asc).order(\"upvote-downvote DESC\")\n end\n\n end", "def create\n @person = Individual.find_by(id: current_user.meta_id)\n Rails.logger.info \">>>>>>>>>>>>>>>>>>> #{@person.id} <<<<<<<<<<<<<<<<<<\"\n @deck = @person.decks.new(deck_params)\n @deck.individual = Individual.find_by(id: current_user.meta_id)\n @decks = @person.decks.all\n respond_to do |format|\n if @deck.save\n format.js\n else\n Rails.logger.info \"FAILEDFAILEDFAILEDFAILEDFAILEDFAILEDFAILEDFAILED\"\n end\n end\n end", "def create\n @vestimentum = Vestimentum.new(vestimentum_params)\n\n respond_to do |format|\n if @vestimentum.save\n format.html { redirect_to @vestimentum, notice: 'Vestimentum was successfully created.' }\n format.json { render :show, status: :created, location: @vestimentum }\n else\n format.html { render :new }\n format.json { render json: @vestimentum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @recipe = Recipe.new(recipe_params)\n @recipe.uuid = SecureRandom.uuid\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to @recipe.objective}\n format.json { render :show, status: :created, location: @recipe.objective }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @kf_diary = Kf::Diary.new(params[:kf_diary])\n\n respond_to do |format|\n if @kf_diary.save\n format.html { redirect_to kf_diaries_url({:page => params[:page]}), notice: 'Diary was successfully created.' }\n format.json { render json: @kf_diary, status: :created, location: @kf_diary }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kf_diary.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trecho = Trecho.new(params[:trecho])\n\n respond_to do |format|\n if @trecho.save\n format.html { redirect_to @trecho, notice: 'Trecho was successfully created.' }\n format.json { render json: @trecho, status: :created, location: @trecho }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trecho.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ink_varnish = InkVarnish.new(params[:ink_varnish])\n\n respond_to do |format|\n if @ink_varnish.save\n format.html { redirect_to @ink_varnish, notice: 'Ink Varnish was successfully created.' }\n format.json { render json: @ink_varnish, status: :created, location: @ink_varnish }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ink_varnish.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n \n # if params[:dress_id]\n # @dress = Dress.find(params[:dress_id])\n @ratings = Rating.all\n render json: @ratings, except:[:created_at, :updated_at] ,status: 200\n \n # else \n # @ratings= Rating.all\n # binding.pry \n # end\n end", "def create\n @injhas_special_biryani_dish = InjhasSpecialBiryaniDish.new(injhas_special_biryani_dish_params)\n\n respond_to do |format|\n if @injhas_special_biryani_dish.save\n format.html { redirect_to @injhas_special_biryani_dish, notice: 'Injhas special biryani dish was successfully created.' }\n format.json { render :show, status: :created, location: @injhas_special_biryani_dish }\n else\n format.html { render :new }\n format.json { render json: @injhas_special_biryani_dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @recipe = current_user.recipes.new(params[:recipe])\n @user = current_user\n @dish = Dish.find(@recipe.dish_id)\n @winner = Recipe.where(\"dish_id = ? AND king = ?\", @recipe.dish_id, true).first\n\n respond_to do |format|\n if @recipe.save\n RecipeMailer.create_recipe(@user, @recipe, @winner, @dish).deliver\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render json: @recipe, status: :created, location: @recipe }\n else\n format.html { render action: \"new\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @daw_retiro = DawRetiro.new(daw_retiro_params)\n\n respond_to do |format|\n if @daw_retiro.save\n format.html { redirect_to @daw_retiro, notice: 'Daw retiro was successfully created.' }\n format.json { render :show, status: :created, location: @daw_retiro }\n else\n format.html { render :new }\n format.json { render json: @daw_retiro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @kwasny = Kwasny.new(kwasny_params)\n\n respond_to do |format|\n if @kwasny.save\n format.html { redirect_to @kwasny, notice: 'Kwasny was successfully created.' }\n format.json { render action: 'show', status: :created, location: @kwasny }\n else\n format.html { render action: 'new' }\n format.json { render json: @kwasny.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @switt = Switt.new(switt_params)\n\n respond_to do |format|\n if verify_recaptcha(model: @switt) && @switt.save\n format.html { redirect_to @switt, notice: 'Switt was successfully created.' }\n format.json { render :show, status: :created, location: @switt }\n else\n format.html { render :new }\n format.json { render json: @switt.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @nap = Nap.new(nap_params)\n\n respond_to do |format|\n if @nap.save\n format.html { redirect_to @nap, notice: 'Nap was successfully created.' }\n format.json { render :show, status: :created, location: @nap }\n else\n format.html { render :new }\n format.json { render json: @nap.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vote = Vote.new vote_params\n @vote.user = current_user\n if @vote.save\n @vote.votable.create_trophy_if_warranted\n end\n respond_with @vote\n end", "def create\n @bowl = Bowl.new(params[:bowl])\n \n # set the current user's id and the creation time for this bowl\n @bowl.user_id = session[:user].userid.to_i\n @bowl.created = Time.now\n \n respond_to do |format|\n if @bowl.save\n\n Rails.logger.info \"Adding contents for bowl\"\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 created.' }\n format.json { render :json => @bowl, :status => :created, :location => @bowl }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @drink = Drink.new(drink_params)\n\n respond_to do |format|\n if @drink.save\n format.html { redirect_to @drink, notice: 'Drink was successfully created.' }\n format.json { render :show, status: :created, location: @drink }\n else\n format.html { render :new }\n format.json { render json: @drink.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prepared_spell = PreparedSpell.new(prepared_spell_params)\n\n respond_to do |format|\n if @prepared_spell.save\n format.html { redirect_to @prepared_spell, notice: 'Prepared spell was successfully created.' }\n format.json { render :show, status: :created, location: @prepared_spell }\n else\n format.html { render :new }\n format.json { render json: @prepared_spell.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @recipe = Recipe.new(recipe_params)\n\n respond_to do |format|\n if @recipe.save\n count = 1\n complete_directions = \"\"\n params[\"directions\"].each do |direction|\n complete_directions += direction + \"\\n\"\n count += 1\n end\n @recipe.directions = complete_directions\n params[\"ingredients\"].each_with_index do |ingredient, index|\n found = false\n Ingredient.all.each do |db_ingredient|\n if db_ingredient.name == ingredient\n @ingredient = db_ingredient\n Recipeingredient.create({:ingredient_id => @ingredient.id, :recipe_id => @recipe.id, :amount => params[\"amounts\"][index]})\n found = true\n end\n end\n if found == false\n @ingredient = Ingredient.create({:name => ingredient})\n Recipeingredient.create({:ingredient_id => @ingredient.id, :recipe_id => @recipe.id, :amount => params[\"amounts\"][index]})\n end\n end\n Userrecipe.create({:contribution_id => @recipe.id, :user_id => current_user.id})\n if params[\"tags\"] != nil\n params[\"tags\"].each do |tag|\n @tag = Tag.find_by_name(tag)\n Recipetag.create({:recipe_id => @recipe.id,:tag_id => @tag.id})\n end\n end\n @recipe.serves = params[\"serves\"]\n @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @razdel = Razdel.new(razdel_params)\n\n respond_to do |format|\n if @razdel.save\n format.html { redirect_to @razdel, notice: 'Razdel was successfully created.' }\n format.json { render :show, status: :created, location: @razdel }\n else\n format.html { render :new }\n format.json { render json: @razdel.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @knowledges = Knowledge.order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @knowledges }\n end\n end", "def create\n respond_to do |format|\n aux= params[:item_pautum][:questao_id]\n if aux.size > 1\n for x in aux\n if x == \"\"\n break#a ultima posição do array e um \"\" e isso não é um id por tanto da erro entao esse if resolve isso\n end\n\n @questao=Questao.find(x) #aqui eupego a pessoa com o id q ta no x\n @item_pautum = ItemPautum.new(item_pautum_params)\n @pautum = Pautum.find(@item_pautum.pautum) \n if ItemPautum.search(@questao.id, @pautum.id) == [] #com esse if eu evito que se convoque a mesma pessoa 2 vezes\n @item_pautum.questao=@questao# passo o objeto questao para item pauta\n @item_pautum.pautum=@pautum# passo o objeto pauta para item pauta\n if Ponto.buscarPonto(@item_pautum.questao.id).size >=1\n @item_pautum.save\n end\n end\n end\n\n format.html { redirect_to @pautum, notice: 'Questões alocadas com sucesso.' }\n format.json { render :show, status: :created, location: @pautum }\n else\n\n\n format.html { redirect_to pautum_path(@item_pautum.pautum), notice: 'Desculpe mas,você não selecionou as questões.' }\n end\n end\n end", "def create\n @jam = Jam.new(params[:jam])\n @jam.up_votes = 0\n @jam.down_votes = 0\n respond_to do |format|\n if @jam.save\n format.html { redirect_to @jam, notice: 'Jam was successfully created.' }\n format.js \n format.json { render json: @jam, status: :created, location: @jam }\n else\n format.html { render action: \"new\" }\n format.js \n format.json { render json: @jam.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @duck = Duck.new(params[:duck])\n\n respond_to do |format|\n if @duck.save\n format.html { redirect_to @duck, notice: 'Duck was successfully created.' }\n format.json { render json: @duck, status: :created, location: @duck }\n else\n format.html { render action: \"new\" }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @idea_crowdrating = IdeaCrowdrating.new(idea_crowdrating_params)\n\n respond_to do |format|\n if @idea_crowdrating.save\n format.html { redirect_to idea_crowdratings_path(:idea_id => @idea_crowdrating.idea_id), notice: (I18n.t :act_create) }\n format.json { render :show, status: :created, location: @idea_crowdrating }\n else\n format.html { render :new }\n format.json { render json: @idea_crowdrating.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dtest = Dtest.new(params[:dtest])\n\n respond_to do |format|\n if @dtest.save\n format.html { redirect_to @dtest, notice: t(:notise_test) }\n format.json { render json: @dtest, status: :created, location: @dtest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dtest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @recipe = Recipe.new(recipe_params)\n\n respond_to do |format|\n if @recipe.save\n @recipes = ordered_recipes\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n format.js { render :create }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n format.js { render :new }\n end\n end\n end", "def create\n @side_dish = SideDish.new(params[:side_dish])\n\n respond_to do |format|\n if @side_dish.save\n format.html { redirect_to @side_dish, notice: 'Side dish was successfully created.' }\n format.json { render json: @side_dish, status: :created, location: @side_dish }\n else\n format.html { render action: \"new\" }\n format.json { render json: @side_dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @learner = Learner.new(learner_params)\n\n respond_to do |format|\n if @learner.save\n format.html { head :created, content_type: \"text/html\" }\n format.json { head :created, location: @order }\n else\n format.html { head :bad_request, content_type: \"text/html\" }\n format.json { head :bad_request }\n end\n end\n end", "def create\n @zamowieny = Zamowieny.new(params[:zamowieny])\n \n\n respond_to do |format|\n if(@zamowieny.Ilosc.nil?)\n format.html { redirect_to(leks_url , :notice => 'Prosze wprowadzic ilosc leku.') }\n elsif(@zamowieny.Ilosc < 10 or @zamowieny.Ilosc > Lek.find(@zamowieny.lek_id).Ilosc )\n format.html { redirect_to(leks_url , :notice => 'Ilosc leku musi byc wieksza od 10 i mniejsza od ilosc leku w magazynie.') }\n elsif @zamowieny.save\n l = Lek.find(@zamowieny.lek_id)\n l.Ilosc = l.Ilosc - @zamowieny.Ilosc\n l.save\n format.html { redirect_to(@zamowieny, :notice => 'Zamowienie was successfully created.') }\n format.xml { render :xml => @zamowieny, :status => :created, :location => @zamowieny }\n \n else\n format.html { render :action => \"index\" }\n format.xml { render :xml => @zamowieny.errors, :status => :unprocessable_entity }\n end\n \n end\n \n end", "def create\n @movimentacao_de_estoque = MovimentacaoDeEstoque.new(params[:movimentacao_de_estoque])\n\n respond_to do |format|\n if @movimentacao_de_estoque.save\n format.html { redirect_to @movimentacao_de_estoque, notice: 'Movimentacao de estoque was successfully created.' }\n format.json { render json: @movimentacao_de_estoque, status: :created, location: @movimentacao_de_estoque }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movimentacao_de_estoque.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @review_of_dish = ReviewOfDish.new(params[:review_of_dish])\n\n respond_to do |format|\n if @review_of_dish.save\n format.html { redirect_to(@review_of_dish, :notice => 'Review of dish was successfully created.') }\n format.xml { render :xml => @review_of_dish, :status => :created, :location => @review_of_dish }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @review_of_dish.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @bike = Bike.new(bike_params)\n @bike.compare_vehicles = params[:bike][:compare_vehicles]\n\n if @bike.save\n audit(@bike, current_user)\n render json: @bike, status: :created #serializer: Web::V1::BikeSerializer\n else\n render json: @bike.errors, status: :unprocessable_entity\n end\n end", "def create\n @pedidos = Pedido.find(:all,:conditions=> {:status => [0], :user_id => current_user.id})\n if @pedidos[0].imagen_pedidos.count < 3\n @imagen_pedido = ImagenPedido.new(params[:imagen_pedido])\n @imagen_pedido.pedido_id = @pedidos[0].id\n respond_to do |format|\n if @imagen_pedido.save\n format.html { redirect_to imagen_pedidos_path, notice: 'La imagen fue subida satisfactoriamente.' }\n format.json { render json: @imagen_pedido, status: :created, location: @imagen_pedido }\n else\n format.html { render action: \"new\" }\n format.json { render json: @imagen_pedido.errors, status: :unprocessable_entity }\n end\n end\n else\n #moviendo el estado a 1: Listo para verificacion\n @pedidos[0].status = 1\n @pedidos[0].save\n redirect_to pedidos_path, notice: 'El pedido ha sido enviado\nsatisfactoriamente.'\n end\n end", "def create\n p_id_treatment = params[:treatment][:id_treatment].to_i\n p_name = params[:treatment][:name]\n p_type = params[:type]\n p_dosis = params[:treatment][:dosis]\n p_total = params[:treatment][:total].to_i\n p_secondary_effects = params[:treatment][:secondary_effects]\n p_days = params[:treatment][:days].to_i\n\n # verificar\n \n @treatment = Treatment.new(\n id_treatment: p_id_treatment,\n name: p_name,\n type: p_type,\n dosis: p_dosis,\n total: p_total,\n secondary_effects: p_secondary_effects,\n days: p_days \n )\n\n respond_to do |format|\n if @treatment.save\n redirect_to controller: \"doctors\", notice: \"OK\" and return\n else\n redirect_to controller: \"doctors\", notice: \"Unsuccessful...\" and return\n end\n end\n end", "def flag_infected () \n\n flag = JSON.parse(request.raw_post) #infected survivor survivor_flagged.json\n $reported_id = flag['is_infected']\n @reporting_survivor = Survivor.find(params[:id]) # reporting survivor on curl file flag_infected function\n @flagged_survivor = Survivor.find(flag['is_infected'])\n \n if(flag['is_infected'] == @reporting_survivor.id)\n render json: {\"message\": \"A survivor can't flag himself, that is nonsense!\"}, status: 422\n else\n if(@reporting_survivor.infected? == true)\n render json: {\"message\": \"Zombie doesen't flag people!\"}, status: 422\n end\n if($reporters.empty?)\n $reporters.push(@reporting_survivor.id)\n else \n if($reporters[0] == @reporting_survivor.id || $reporters[1] == @reporting_survivor.id || $reporters[2] == @reporting_survivor.id)\n render json: {\"message\": \"This survivor already reported!\"}, status: 422 \n else \n if($reported_id != flag['is_infected'])\n $reporters.clear\n $reporters.push(@reporting_survivor.id)\n else\n $reporters.push(@reporting_survivor.id)\n puts($reporters)\n if($reporters.length == 3)\n $reporters.clear\n @flagged_survivor.update_attribute(:infected?, true)\n @flagged_survivor.inventory.destroy\n render json: {\"message\": \" Survivor #{@flagged_survivor.name} is a zombie!\"}\n else\n render json: {\"message\": \" #{$reporters.length} Survivors flagged this survivor #{@reported_id}!\"}\n end\n end\n end\n end\n end\n end", "def create\n @book = Book.new(book_params)\n resort_orders\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dish = @cafeteria.dishes.new(dish_params)\n\n respond_to do |format|\n if @dish.save\n format.html { redirect_to @cafeteria, notice: 'El plato se ha creado.' }\n format.json { render :show, status: :created, location: @dish }\n else\n format.html { redirect_to @cafeteria, alert: 'No se pudo crear el plato.' }\n format.json { render json: @dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def downvote\n @paldemic_file.num_downvotes +=1\n respond_to do |format|\n if(@paldemic_file.save)\n format.html { redirect_to paldemic_files_url, notice: 'Down Vote tallied :)' }\n format.json { head :no_content }\n else\n format.html { render :new }\n format.json { render json: @paldemic_file.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def create\n @drug_test = DrugTest.new(params[:drug_test])\n @test_types = params[:test_types]\n @test_types_all = []\n @test_types.each do |id| \n @test_types_all +=[TestType.find_by_id(id)]\n end\n @drug_test.test_types=@test_types_all\n respond_to do |format|\n \n if @drug_test.save\n format.html { redirect_to @drug_test, notice: 'Teste de droga foi criado com sucesso.' }\n format.json { render json: @drug_test, status: :created, location: @drug_test }\n else\n format.html { render action: \"new\" }\n format.json { render json: @drug_test.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bookjudge = Bookjudge.new(bookjudge_params)\n\n\n ndl_result_hash = judge_by_ndl @bookjudge\n ndl_result = ndl_result_hash[:result]\n yunica_result = judge_by_yunica @bookjudge\n\n\n #結果生成\n #judge_result\n # 2 ? NDLにないし他にもない 存在しない本?\n # 1 O NDLにないが他の場所にある\n # 0 X NDLにある\n if ndl_result #ndlにあった\n @bookjudge.judge_result = 0\n elsif !ndl_result && yunica_result #ndlにはない 他の図書館にある\n @bookjudge.judge_result = 1\n else\n @bookjudge.judge_result = 2\n end\n\n title = \"\"\n title = ndl_result_hash[:title] if ndl_result_hash[:title]\n\n option_str = \"NDLの結果: \" + title + \" -> \" + ndl_result.to_s + \"\"\n option_str += \"ゆにかねっとの結果: -> \" + yunica_result.to_s + \"\"\n\n #返却\n respond_to do |format|\n if @bookjudge.judge_result == 1 && @bookjudge.save\n format.html { redirect_to @bookjudge, notice: ('やった! 国会図書館に納本されていないみたいです!' + option_str) }\n format.json { render :show, status: :created, location: @bookjudge }\n elsif @bookjudge.judge_result == 2\n format.html { redirect_to @bookjudge, notice: ('すみません、うまく検索できませんでした。もしかしたら存在しない本かもしれません。' + option_str) }\n #format.html { render :new }\n format.json { render json: @bookjudge.errors, status: :unprocessable_entity }\n else\n format.html { redirect_to @bookjudge, notice: ('残念、もう国会図書館に所蔵されているようです。' + option_str) }\n #format.html { render :new }\n format.json { render json: @bookjudge.errors, status: :unprocessable_entity }\n end\n end\n end", "def index \n reviews=Review.all.sort \n render json: reviews\n end", "def create\n @oddzialy = Oddzialy.new(oddzialy_params)\n\n respond_to do |format|\n if @oddzialy.save\n format.html { redirect_to @oddzialy, notice: 'Oddzialy was successfully created.' }\n format.json { render :show, status: :created, location: @oddzialy }\n else\n format.html { render :new }\n format.json { render json: @oddzialy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @question = Question.new(question_params)\n @question.zavrseno = \"N\"\n @question.user = @current_user\n @question.uposlenik = User.find(params[:uposlenik_id])\n respond_to do |format|\n if @question.save\n format.json { render json: @question, status: :created, location: api_question_url(@question) }\n else\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n bikes = Bike.all\n bikes.each do |bike|\n if bike.next_date_inspected == Time.now.in_time_zone\n bike.passed_inspection = false\n end\n end\n create_checkout_values\n respond_to do |format|\n if @checked_out.save\n create_bike_values\n UserMailer.check_out_email(@checked_out.user).deliver\n format.html { redirect_to home_check_out_path, notice: \"The bike was successfully checked out by #{@checked_out.user.email}.\" }\n format.json { render action: 'show', status: :created, location: @checked_out }\n else\n format.html { redirect_to home_check_out_path, :flash => @checked_out.errors }\n format.json { render json: @checked_out.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @drafts = @compare.drafts.reorder('id')\n #order(\"id DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @drafts }\n end\n end", "def create\n @dang_vien = DangVien.new(dang_vien_params)\n\n respond_to do |format|\n if @dang_vien.save\n format.html { redirect_to @dang_vien, notice: 'Dang vien was successfully created.' }\n format.json { render :show, status: :created, location: @dang_vien }\n else\n format.html { render :new }\n format.json { render json: @dang_vien.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @draught = Draught.new(params[:draught])\n\n respond_to do |format|\n if @draught.save\n format.html { redirect_to(@draught, :notice => 'Draught was successfully created.') }\n format.xml { render :xml => @draught, :status => :created, :location => @draught }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @draught.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @diary = Diary.create!(params[:diary])\n respond_to do |format|\n format.html { redirect_to diaries_url }\n format.js\n end\n end", "def create\n @kf_sort_type = Kf::SortType.new(params[:kf_sort_type])\n\n respond_to do |format|\n if @kf_sort_type.save\n format.html { redirect_to kf_sort_types_url({:page => params[:page]}), notice: 'Sort type was successfully created.' }\n format.json { render json: @kf_sort_type, status: :created, location: @kf_sort_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kf_sort_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trick = Trick.new(params[:trick])\n\n respond_to do |format|\n if @trick.save\n format.html { redirect_to @trick, notice: 'Trick was successfully created.' }\n format.json { render json: @trick, status: :created, location: @trick }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trick.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vodka = Vodka.new(params[:vodka])\n\n respond_to do |format|\n if @vodka.save\n format.html { redirect_to @vodka, notice: 'Vodka was successfully created.' }\n format.json { render json: @vodka, status: :created, location: @vodka }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vodka.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @overall = Draft.count + 1\n\n @team = Team.where(city_abr: params[:name]).take\n @teamID = @team.id\n @team.taken = true\n @team.save\n\n @draft = Draft.new(:round => params[:round], :pick => params[:pick], :overall_pick => @overall, :user_id => params[:userID], :team_id => @teamID)\n\n @draft.save\n\n\n\n respond_to do |format|\n format.js { redirect_to drafts_path}\n end\n end", "def drill_params\n params.require(:drill).permit(:question, solutions_attributes: [:id, :solution, :_destroy])\n end", "def create\n @c_rodinny_stav = CRodinnyStav.new(c_rodinny_stav_params)\n\n respond_to do |format|\n if @c_rodinny_stav.save\n format.html { redirect_to @c_rodinny_stav, notice: 'C rodinny stav was successfully created.' }\n format.json { render action: 'show', status: :created, location: @c_rodinny_stav }\n else\n format.html { render action: 'new' }\n format.json { render json: @c_rodinny_stav.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.54693776", "0.5303369", "0.51821494", "0.5172421", "0.5161261", "0.5032387", "0.5021262", "0.5004437", "0.4977543", "0.49628145", "0.49267727", "0.4900093", "0.489163", "0.48808828", "0.4870154", "0.48601368", "0.48500934", "0.48475096", "0.48472092", "0.48457596", "0.48410183", "0.4826567", "0.48231164", "0.48211613", "0.48209152", "0.48138055", "0.4813366", "0.48065248", "0.48028454", "0.48017094", "0.47980297", "0.4790558", "0.4790014", "0.47899687", "0.47893006", "0.47730973", "0.47722247", "0.47693124", "0.47687128", "0.47608513", "0.47573614", "0.4756686", "0.4756328", "0.4750949", "0.47496808", "0.47492236", "0.47490132", "0.47471464", "0.47462374", "0.47442123", "0.47364783", "0.47340932", "0.4729528", "0.47290826", "0.47287118", "0.47147292", "0.4712576", "0.4710781", "0.47064972", "0.47056228", "0.4698206", "0.4695822", "0.46941042", "0.46873185", "0.46868378", "0.46863377", "0.4684128", "0.46809795", "0.46761253", "0.46743825", "0.46742433", "0.46713385", "0.4670976", "0.46687993", "0.46605146", "0.46588722", "0.46573782", "0.4653474", "0.46533942", "0.46521723", "0.465095", "0.4648363", "0.46478054", "0.4646812", "0.4646657", "0.46442086", "0.46440554", "0.46439096", "0.4640695", "0.46376434", "0.4636377", "0.4635821", "0.46337998", "0.4633623", "0.4633136", "0.46320766", "0.46302205", "0.46296093", "0.4627615", "0.46255472" ]
0.5241454
2
PATCH/PUT /sortiment/:id/dryck/1 PATCH/PUT /sortiment/:id/dryck/1.json
def update respond_to do |format| if @drink.update(drink_params) format.html { redirect_to edit_drink_path(@drink), notice: 'Drycken uppdaterades.' } format.json { render :show, status: :ok, location: @drink } else format.html { render :edit } format.json { render json: @drink.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 @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 @stage_drymass = StageDrymass.find(params[:id])\n\n respond_to do |format|\n if @stage_drymass.update_attributes(params[:stage_drymass])\n format.html { redirect_to @stage_drymass, notice: 'Stage drymass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stage_drymass.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @admin_interview = Interview.find(params[:id])\n\n respond_to do |format|\n if @admin_interview.update_attributes(params[:interview])\n format.html { redirect_to [:admin, @admin_interview], notice: 'Entrevista atualizada com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: [:admin, @admin_interview.erros], status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t\t\t\n\t\t\t\ttparams = params.require(:testimony).permit :quote,:author,:sort,:created_at,:updated_at\n\n\t\t\t\t@testimony = Testimony.find params[:id]\n\n\t\t\t\tif @testimony.update(tparams)\n\n\t\t\t\t\trender json: nil,status: 200\n\n\t\t\t\telse\n\n\t\t\t\t\trender json: nil,status: 422\n\n\t\t\t\tend\n\n\t\t\tend", "def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trick = Trick.find(params[:id])\n\n respond_to do |format|\n if @trick.update_attributes(params[:trick])\n format.html { redirect_to @trick, notice: 'Trick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trick.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kata.update(kata_params)\n format.html { redirect_to @kata, notice: 'Kata was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kata.errors, status: :unprocessable_entity }\n end\n end\n end", "def restobooking\n @buchung = Buchung.find(params[:id])\n @buchung.status='B' \n \n respond_to do |format|\n if @buchung.update_attributes(params[:buchung])\n format.html { redirect_to @buchung, notice: 'Buchung wurde erfolgreich geaendert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buchung.errors, status: :unprocessable_entity }\n end\n end \n end", "def update\n @tariff = Tariff.find params[:id]\n\n respond_to do |format|\n if @tariff.update(tariff_params)\n format.html { redirect_to @tariff, notice: 'Tariff was successfully updated.' }\n format.json { respond_with_bip(@tariff) }\n else\n format.html { render :edit }\n format.json { respond_with_bip(@tariff) }\n end\n end\n end", "def update\n @kolegij = Kolegij.find(params[:id])\n\n respond_to do |format|\n if @kolegij.update_attributes(params[:kolegij])\n format.html { redirect_to @kolegij, notice: 'Kolegij was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kolegij.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interview = Interview.find_by_slug(params[:id])\n\n respond_to do |format|\n if @interview.update_attributes(params[:interview])\n format.html { redirect_to admin_interviews_path, notice: 'Interview was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n if @indicacao.update_attributes(params[:indicacao])\n format.html { redirect_to @indicacao, notice: 'A Indicação do Condutor foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indicacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by(id: params[:id])\n suggested_pathway.name = params[:name]\n suggested_pathway.year = params[:year]\n suggested_pathway.course_id = params[:course_id]\n suggested_pathway.data = params[:data]\n suggested_pathway.save\n render json: suggested_pathway\n end", "def update\n respond_to do |format|\n if @stuck.update(stuck_params)\n format.html { redirect_to @stuck, notice: 'Stuck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stuck.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sentiment.update(sentiment_params)\n format.html { redirect_to @sentiment, notice: 'Sentiment was successfully updated.' }\n format.json { render :show, status: :ok, location: @sentiment }\n else\n format.html { render :edit }\n format.json { render json: @sentiment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @thought = Thought.find(params[:id])\n\n respond_to do |format|\n if @thought.update_attributes(params[:thought])\n format.html { redirect_to @thought, notice: 'Thought was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thought.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n redirect_to action: \"latest\"\n @davis = Davis.find(params[:id])\n\n #respond_to do |format|\n # if @davis.update_attributes(davi_params)\n # format.html { redirect_to @davis, notice: 'Davis was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @davis.errors, status: :unprocessable_entity }\n # end\n #end\n end", "def update\n @animal = Animal.find(params[:id])\n @species = ['Lion', 'Koala', 'Panda']\n @zoo = Zoo.find(params[:zoo_id])\n\n respond_to do |format|\n\n if @animal.update_attributes(params[:animal])\n format.html { redirect_to zoo_animal_path(params[:zoo_id],@animal.id),\n notice: 'animal was successfully updated.' }\n format.json { head :no_content }\n else\n\n format.html { render action: \"edit\"}\n format.json { render json: @animal.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @diet_dish.update(diet_dish_params)\n format.html { redirect_to @diet_dish, notice: 'Diet dish was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @diet_dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @dishtype.update(dishtype_params)\n format.html { redirect_to @dishtype, notice: 'Dishtype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dishtype.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @variety = Variety.find(params[:id])\n\n respond_to do |format|\n if @variety.update_attributes(params[:variety])\n format.html { redirect_to varieties_path, notice: \"#{@variety.name} fue editada exitosamente.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @variety.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trek = Trek.find(params[:id])\n\n respond_to do |format|\n if @trek.update_attributes(params[:trek])\n format.html { redirect_to @trek, notice: 'Trek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @lyric.update(lyric_params)\n format.html { redirect_to @lyric, notice: 'Lyric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lyric.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n if @articulo.update_attributes(params[:articulo])\n format.html { redirect_to @articulo, notice: 'Articulo se ha actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \t\t@interested = Interested.find(params[:id])\n\n \t\trespond_to do |format|\n \t\t\tif @interested.update_attributes(params[:interested])\n \t\t\tformat.html { redirect_to @interested, notice: 'Interested was sucessfully updated.' }\n \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: @interested.error, status: :unprocessable_entity }\n \t\t\tend\n \t\tend\n \tend", "def update\n respond_to do |format|\n if @varience.update(varience_params)\n format.html { redirect_to @varience, notice: 'Varience was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @varience.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trecho = Trecho.find(params[:id])\n\n respond_to do |format|\n if @trecho.update_attributes(params[:trecho])\n format.html { redirect_to @trecho, notice: 'Trecho was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trecho.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @lyric = Lyric.find(params[:id])\n\n respond_to do |format|\n if @lyric.update_attributes(params[:lyric])\n format.html { redirect_to @lyric, notice: 'Lyric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lyric.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kitty = Kitty.find(params[:id])\n\n respond_to do |format|\n if @kitty.update_attributes(params[:kitty])\n format.html { redirect_to @kitty, notice: 'Kitty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kitty.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @dokter = Dokter.find(params[:id])\n\n respond_to do |format|\n if @dokter.update_attributes(params[:dokter])\n format.html { redirect_to(:action => \"index\", :notice => UPDATE_MSG) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @dokter.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @rayon = Rayon.find(params[:id])\n\n respond_to do |format|\n if @rayon.update_attributes(params[:rayon])\n format.html { redirect_to @rayon, notice: 'Rayon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rayon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @vodka = Vodka.find(params[:id])\n\n respond_to do |format|\n if @vodka.update_attributes(params[:vodka])\n format.html { redirect_to @vodka, notice: 'Vodka was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vodka.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kraj = Kraj.find(params[:id])\n\n respond_to do |format|\n if @kraj.update_attributes(params[:kraj])\n format.html { redirect_to @kraj, notice: 'Kraj was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kraj.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @dish_mixture.update(dish_mixture_params)\n format.html { redirect_to @dish_mixture, notice: 'Dish mixture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dish_mixture.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 @interested = Interested.find(params[:id])\n\n respond_to do |format|\n if @interested.update_attributes(params[:interested])\n format.html { redirect_to @interested, notice: 'Interested was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interested.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @idea_crowdrating.update(idea_crowdrating_params)\n format.html { redirect_to idea_crowdratings_path(:idea_id => @idea_crowdrating.idea_id), notice: (I18n.t :act_update) }\n format.json { render :show, status: :ok, location: @idea_crowdrating }\n else\n format.html { render :edit }\n format.json { render json: @idea_crowdrating.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n if @safra_verdoso.update_attributes(params[:safra_verdoso])\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @safra_verdoso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sklad = Sklad.find(params[:id])\n\n respond_to do |format|\n if @sklad.update_attributes(params[:sklad])\n format.html { redirect_to @sklad, notice: 'Sklad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sklad.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.html { redirect_to @interest, :notice => 'Интересот е успешно ажуриран.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @giang_vien = GiangVien.find(params[:id])\n\n respond_to do |format|\n if @giang_vien.update_attributes(params[:giang_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @giang_vien.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @dis_duplicate_therapy.update(dis_duplicate_therapy_params)\n format.html { redirect_to @dis_duplicate_therapy, notice: 'Dis duplicate therapy was successfully updated.' }\n format.json { render :show, status: :ok, location: @dis_duplicate_therapy }\n else\n format.html { render :edit }\n format.json { render json: @dis_duplicate_therapy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @verb = Verb.find(params[:id])\n\n if @verb.update(verb_params)\n head :no_content\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @duck.update_attributes(params[:duck])\n format.html { redirect_to @duck, notice: 'Duck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @voluntario = Voluntario.find(params[:id])\n params[:voluntario].delete :inclusoes\n\n respond_to do |format|\n if @voluntario.update_attributes(params[:voluntario])\n format.html { redirect_to(@voluntario, :notice => 'Voluntário atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @voluntario.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @irregular_verb = IrregularVerb.find(params[:id])\n\n respond_to do |format|\n if @irregular_verb.update_attributes(params[:irregular_verb])\n format.html { redirect_to @irregular_verb, notice: 'Irregular verb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @irregular_verb.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @koti = Koti.find(params[:id])\n\n respond_to do |format|\n if @koti.update_attributes(params[:koti])\n format.html { redirect_to @koti, notice: 'Koti was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @koti.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @diet.update(diet_params)\n head :no_content, status: 204\n else\n render json: @diet.errors, status: 422\n end\n end", "def update\n @interesting = Interesting.find(params[:id])\n\n respond_to do |format|\n if @interesting.update_attributes(params[:interesting])\n format.html { redirect_to @interesting, notice: 'Interesting was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interesting.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @objet = Objet.find(params[:id])\n\n respond_to do |format|\n if @objet.update_attributes(params[:objet])\n format.html { redirect_to @objet, notice: 'The found item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @objet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @adaptive_thought.update(adaptive_thought_params)\n format.html { redirect_to @adaptive_thought, notice: 'Adaptive thought was successfully updated.' }\n format.json { render :show, status: :ok, location: @adaptive_thought }\n else\n format.html { render :edit }\n format.json { render json: @adaptive_thought.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kodomo.update(kodomo_params)\n format.html { redirect_to @kodomo, notice: 'Kodomo was successfully updated.' }\n format.json { render :show, status: :ok, location: @kodomo }\n else\n format.html { render :edit }\n format.json { render json: @kodomo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @order.status == \"preparing\"\n format.json { render text: '', status: 409 }\n else\n if @order.update(order_params)\n @drink = Drink.where(drink: @order.drink).first\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n response_json = {drink: @drink.drink, cost: @drink.cost, additions: @order.additions, _links: { next: {profile: \"http://#{my_address}:3000/payment\", href: \"http://#{my_address}:3000/payments/order/#{@order.id}\", enctype: 'application/json'}}}\n format.json { render text: response_json, status: :created, location: @order }\n \n else\n format.html { render action: 'edit' }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def update\n @wanted = Wanted.find(params[:id])\n\n respond_to do |format|\n if @wanted.update_attributes(params[:wanted])\n format.html { redirect_to @wanted, notice: 'Wanted was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @wanted.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kontakty = Kontakty.find(params[:id])\n\n respond_to do |format|\n if @kontakty.update_attributes(params[:kontakty])\n flash[:notice] = 'Kontakty was successfully updated.'\n format.html { redirect_to(@kontakty) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @kontakty.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @draft = Draft.find(params[:id])\n\n respond_to do |format|\n if @draft.update_attributes(params[:draft])\n format.html { redirect_to @draft, flash: { success: 'Черновик был успешно обновлён'} }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @draft.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @vestimenta = Vestimenta.find(params[:id])\n\n respond_to do |format|\n if @vestimenta.update_attributes(params[:vestimenta])\n flash[:notice] = 'Vestimenta actualizado correctamente.'\n format.html { redirect_to(@vestimenta) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vestimenta.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n # respond_to do |format|\n # if @kitchen.update_attributes(post_params)\n # format.html { redirect_to @kitchen, notice: 'Kitchen was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: 'edit' }\n # format.json { render json: @kitchen.errors, status :unprocessable_entity }\n # end\n # end\n end", "def update\n @before_intership = BeforeIntership.find(params[:id])\n\n respond_to do |format|\n if @before_intership.update_attributes(params[:before_intership])\n format.html { redirect_to @before_intership, notice: 'Before intership was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @before_intership.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kitten = Kitten.find(params[:id])\n\n respond_to do |format|\n if @kitten.update_attributes(params[:kitten])\n format.html { redirect_to @kitten, notice: 'Kitten was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kitten.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n @therapist_consent = TherapistConsent.find(params[:id])\n respond_to do |format|\n format.html { render action: 'edit' }\n format.json { render :status => 200, :json => { action: 'edit', therapist_consent: @therapist_consent}}\n end\n end", "def update\n respond_to do |format|\n if @tenki.update(tenki_params)\n format.html { redirect_to @tenki, notice: 'Tenki was successfully updated.' }\n format.json { render :show, status: :ok, location: @tenki }\n else\n format.html { render :edit }\n format.json { render json: @tenki.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @isd_tariff.update(isd_tariff_params)\n format.html { redirect_to @isd_tariff, notice: 'Isd tariff was successfully updated.' }\n format.json { render :show, status: :ok, location: @isd_tariff }\n else\n format.html { render :edit }\n format.json { render json: @isd_tariff.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end", "def update\n @livestock = Livestock.find(params[:id])\n\n respond_to do |format|\n if @livestock.update_attributes(params[:livestock])\n format.html { redirect_to @livestock, notice: 'Livestock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @livestock.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bubble_tea = BubbleTea.find(params[:id])\n\n if @bubble_tea.update(bubble_tea_params)\n render json: @bubble_tea\n else\n render plain: \"Failed to update drink information\"\n end\n end", "def update\n @tack = Tack.find(params[:id])\n\n if @tack.update(tack_params)\n head :no_content\n else\n render json: @tack.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @status.update(isshared: params[:isshared])\n format.json { head :no_content }\n else\n format.json {\n render json: @status.errors,\n status: :unprocessable_entity\n }\n end\n end\n end", "def update\n @movimentacao_de_estoque = MovimentacaoDeEstoque.find(params[:id])\n\n respond_to do |format|\n if @movimentacao_de_estoque.update_attributes(params[:movimentacao_de_estoque])\n format.html { redirect_to @movimentacao_de_estoque, notice: 'Movimentacao de estoque was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movimentacao_de_estoque.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @oct.update(oct_params)\n format.html { redirect_to @oct, notice: 'Oct was successfully updated.' }\n format.json { render :show, status: :ok, location: @oct }\n else\n format.html { render :edit }\n format.json { render json: @oct.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tottle.update(tottle_params)\n format.html { redirect_to @tottle, notice: 'Tottle was successfully updated.' }\n format.json { render :show, status: :ok, location: @tottle }\n else\n format.html { render :edit }\n format.json { render json: @tottle.errors, status: :unprocessable_entity }\n end\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 @plate = Plate.find(params[:id])\n\n if @plate.update(params[:plate])\n head :no_content\n else\n render json: @plate.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n liner = Liner.find_by(liner_reference: liner_params[\"liner_reference\"])\n original_thickness = liner.original_thickness.to_i\n current_thickness = liner_params[\"current_thickness\"].to_i\n thickness_loss_per_day = original_thickness - current_thickness\n liner_params[\"thickness_loss_per_day\"] = thickness_loss_per_day\n if @liner.update(liner_params)\n format.html { redirect_to @liner, notice: 'Liner was successfully updated.' }\n format.json { render :show, status: :ok, location: @liner }\n else\n format.html { render :edit }\n format.json { render json: @liner.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @review = Review.find(params[:id])\n @review.update(review_params)\n render json: @review\n end", "def update\n @testmonial = Testmonial.find(params[:id])\n\n if @testmonial.update(testmonial_params)\n head :no_content\n else\n render json: @testmonial.errors, status: :unprocessable_entity\n end\n end", "def update\n standard_update(Interest, params[:id], interest_params)\n end", "def update\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n if @articulo.update_attributes(params[:articulo])\n format.html { redirect_to @articulo, notice: 'Articulo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if params[:kid][:id]\n @kid = Kid.find(params[:kid][:id])\n else\n @kid = Kid.find_by_user_id_and_local_id(params[:kid][:user_id],params[:kid][:local_id])\n end\n params[:kid].delete(:user_id)\n params[:kid].delete(:id)\n if @kid.update_attributes(params[:kid])\n render json: @kid\n else\n render json: @kid.errors, status: :unprocessable_entity\n end\n end", "def update\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n if @indicativo.update_attributes(params[:indicativo])\n format.html { redirect_to @indicativo, notice: 'Indicativo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indicativo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @api_noun = Api::Noun.find(params[:id])\n\n respond_to do |format|\n if @api_noun.update_attributes(params[:api_noun])\n format.html { redirect_to @api_noun, notice: 'Noun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_noun.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @marcas = @truck.get_marcas() \n @modelos = @truck.get_modelos()\n @tipo_unidad = @truck.get_tipos()\n @config = @truck.get_config()\n @clase = @truck.get_clase()\n @color = @truck.get_color()\n\n\n respond_to do |format|\n if @truck.update(truck_params)\n format.html { redirect_to @truck, notice: 'Truck was successfully updated.' }\n format.json { render :show, status: :ok, location: @truck }\n else\n format.html { render :edit }\n format.json { render json: @truck.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @deck = Deck.find(params[:id])\n @deck.update(title: params[:title])\n render \"update.json.jbuilder\", status: :ok\n end", "def update\n respond_to do |format|\n if @unwanted.update(unwanted_params)\n format.html { redirect_to @unwanted, notice: 'Unwanted was successfully updated.' }\n format.json { render :show, status: :ok, location: @unwanted }\n else\n format.html { render :edit }\n format.json { render json: @unwanted.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @compound = Compound.find(params[:id])\n\n respond_to do |format|\n if @compound.update_attributes(params[:compound])\n format.html { redirect_to @compound, notice: 'Compound was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compound.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @therapist = Therapist.find(params[:id])\n\n respond_to do |format|\n if @therapist.update_attributes(params[:therapist])\n format.html { redirect_to @therapist, notice: 'Therapist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @therapist.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @side_dish = SideDish.find(params[:id])\n\n respond_to do |format|\n if @side_dish.update_attributes(params[:side_dish])\n format.html { redirect_to @side_dish, notice: 'Side dish was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @side_dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kwasny.update(kwasny_params)\n format.html { redirect_to @kwasny, notice: 'Kwasny was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kwasny.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @krish.update(krish_params)\n format.html { redirect_to @krish, notice: 'Krish was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @krish.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @chronicle.update(chronicle_params)\n format.html { redirect_to @chronicle, notice: t('flash_message.notice.successfully_updated', model: Chronicle.model_name.human) }\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 respond_to do |format|\n if @thought.update(thought_params)\n format.html { redirect_to @thought, notice: 'Thought was successfully updated.' }\n format.json { render :show, status: :ok, location: @thought }\n else\n format.html { render :edit }\n format.json { render json: @thought.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if verify_recaptcha(model: @switt) && @switt.update(switt_params)\n format.html { redirect_to @switt, notice: 'Switt was successfully updated.' }\n format.json { render :show, status: :ok, location: @switt }\n else\n format.html { render :edit }\n format.json { render json: @switt.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cookbook.update(cookbook_params)\n format.html { redirect_to cookbook_path(@cookbook), notice: 'Cookbook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rent = Rent.find(params[:id])\n\n if params[:rent][:delete]\n @rent.kunstvoorwerp.update_attribute('status', 0)\n @rent.delete\n redirect_to :action => 'index'\n else\n if params[:rent][:done]\n @rent.kunstvoorwerp.update_attribute('status', 2)\n end\n if params[:rent][:revert]\n @rent.kunstvoorwerp.update_attribute('status', 0)\n end\n @rent.status = params[:rent][:status]\n @rent.save\n end\n end", "def update\n @ink_varnish = InkVarnish.find(params[:id])\n\n respond_to do |format|\n if @ink_varnish.update_attributes(params[:ink_varnish])\n format.html { redirect_to @ink_varnish, notice: 'Ink varnish was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ink_varnish.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @side_effect = SideEffect.find(params[:id])\n\n respond_to do |format|\n if @side_effect.update_attributes(params[:side_effect])\n format.html { redirect_to @side_effect, notice: 'Side effect was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @side_effect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kid.update(kid_params)\n format.html { redirect_to @kid, notice: t('kid_updated') }\n format.json { render :show, status: :ok, location: @kid }\n else\n format.html { render :edit }\n format.json { render json: @kid.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n h = {\n cuerpo: noticium_params[:cuerpo],\n bajada: noticium_params[:bajada],\n titular: noticium_params[:titular]\n }\n if @noticium.update(h)\n format.html { redirect_to @noticium, notice: 'Noticium was successfully updated.' }\n format.json { render :show, status: :ok, location: @noticium }\n else\n format.html { render :edit }\n format.json { render json: @noticium.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.60671705", "0.60479087", "0.5979313", "0.5972023", "0.58599126", "0.5814795", "0.5778354", "0.5774378", "0.57658", "0.5759956", "0.5755549", "0.5747105", "0.5746886", "0.5742375", "0.57225597", "0.57224756", "0.5711658", "0.5706211", "0.5694221", "0.5688826", "0.5685677", "0.5683434", "0.5677268", "0.5676673", "0.56712073", "0.5667962", "0.56641114", "0.5663828", "0.56627965", "0.5658455", "0.56566393", "0.5654066", "0.56508917", "0.56479186", "0.56300354", "0.5626655", "0.5624907", "0.56235135", "0.5623146", "0.5619953", "0.5619824", "0.5619385", "0.5619215", "0.56189317", "0.56165916", "0.5615771", "0.561512", "0.5613356", "0.56083715", "0.5608161", "0.56073844", "0.56021684", "0.56016976", "0.5601043", "0.55942565", "0.5593062", "0.55927914", "0.55925596", "0.5592106", "0.55846226", "0.55842495", "0.5581526", "0.5580618", "0.5575016", "0.55747706", "0.55733794", "0.55729073", "0.557043", "0.5566646", "0.5565964", "0.5564181", "0.5563325", "0.5562135", "0.5557597", "0.5556985", "0.5555542", "0.555525", "0.5553094", "0.5552297", "0.55521244", "0.5550048", "0.5548921", "0.5546222", "0.55431634", "0.5543133", "0.5539342", "0.55369127", "0.5536831", "0.55368066", "0.5534312", "0.5529856", "0.55290645", "0.55204636", "0.5519705", "0.5518404", "0.55136067", "0.5510758", "0.55091757", "0.5507662", "0.5507271" ]
0.56658995
26
DELETE /sortiment/:id/dryck/1 DELETE /sortiment/:id/dryck/1.json
def destroy @drink.destroy respond_to do |format| format.html { redirect_to drinks_url, notice: 'Drink was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n render_json_auto @survey.delete_filter(params[:id].to_i) and return\n end", "def destroy\n @stage_drymass = StageDrymass.find(params[:id])\n @stage_drymass.destroy\n\n respond_to do |format|\n format.html { redirect_to stage_drymasses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dynamique = Dynamique.find(params[:id])\n @dynamique.destroy\n\n respond_to do |format|\n format.html { redirect_to dynamiques_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @diemtrentuyen = Diemtrentuyen.find(params[:id])\n @diemtrentuyen.destroy\n\n respond_to do |format|\n format.html { redirect_to diemtrentuyens_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @diet_dish.destroy\n respond_to do |format|\n format.html { redirect_to diet_dishes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades3 = Humanidades3.find(params[:id])\n @humanidades3.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades3s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n redirect_to action: \"latest\"\n @davis = Davis.find(params[:id])\n @davis.destroy\n\n #respond_to do |format|\n # format.html { redirect_to davis_url }\n # format.json { head :no_content }\n #end\n end", "def destroy\n @movimentacao_de_estoque = MovimentacaoDeEstoque.find(params[:id])\n @movimentacao_de_estoque.destroy\n\n respond_to do |format|\n format.html { redirect_to movimentacao_de_estoques_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rayon = Rayon.find(params[:id])\n @rayon.destroy\n\n respond_to do |format|\n format.html { redirect_to rayons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vende = Vende.find([params[:id1],params[:id2],params[:id3]])\n @vende.destroy\n respond_to do |format|\n format.html { redirect_to vende_index_path, notice: 'A compra foi removida com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sklad = Sklad.find(params[:id])\n @sklad.destroy\n\n respond_to do |format|\n format.html { redirect_to sklads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @giang_vien = GiangVien.find(params[:id])\n @giang_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sinh_vien = SinhVien.find(params[:id])\n @sinh_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @trecho = Trecho.find(params[:id])\n @trecho.destroy\n\n respond_to do |format|\n format.html { redirect_to trechos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @jedi = Jedi.find(params[:id])\n @jedi.destroy\n\n respond_to do |format|\n format.html { redirect_to jedis_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @nguoi_dung = NguoiDung.find(params[:id])\n @nguoi_dung.destroy\n\n respond_to do |format|\n format.html { redirect_to nguoi_dungs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @status_ativ = StatusAtiv.find(params[:id])\n @status_ativ.destroy\n\n respond_to do |format|\n format.html { redirect_to status_ativs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dato = Dato.find(params[:id])\n @dato.destroy\n\n respond_to do |format|\n format.html { redirect_to datos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vestimenta = Vestimenta.find(params[:id])\n @vestimenta.destroy\n\n respond_to do |format|\n format.html { redirect_to(vestimentas_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @vodka = Vodka.find(params[:id])\n @vodka.destroy\n\n respond_to do |format|\n format.html { redirect_to vodkas_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dish = Dish.find(params[:id])\n @dish.destroy\n\n respond_to do |format|\n format.html { redirect_to my_page_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @indicativo = Indicativo.find(params[:id])\n @indicativo.destroy\n\n respond_to do |format|\n format.html { redirect_to indicativos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @hydrant = Hydrant.find(params[:id])\n @hydrant.destroy\n\n respond_to do |format|\n format.html { redirect_to(hydrants_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @safra_verdoso = SafraVerdoso.find(params[:id])\n @safra_verdoso.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n end\n end", "def destroy\n @retroalimentacion = Retroalimentacion.find(params[:id])\n @retroalimentacion.destroy\n\n respond_to do |format|\n format.html { redirect_to retroalimentacions_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @diagnoz = Diagnoz.find(params[:id])\n @diagnoz.destroy\n\n respond_to do |format|\n format.html { redirect_to diagnozs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @c_rodinny_stav.destroy\n respond_to do |format|\n format.html { redirect_to c_rodinny_stavs_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete\n render json: Like.delete(params[\"id\"])\n end", "def destroy\n @ink_varnish = InkVarnish.find(params[:id])\n @ink_varnish.destroy\n\n respond_to do |format|\n format.html { redirect_to ink_varnishes_url }\n format.json { head :ok }\n end\n end", "def destroy\n @admin_interview = Interview.find(params[:id])\n @admin_interview.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_interviews_url }\n format.json { head :no_content }\n end\n end", "def DeleteView id\n \n APICall(path: \"views/#{id}.json\",method: 'DELETE')\n \n end", "def destroy\n @objet = Objet.find(params[:id])\n @objet.destroy\n\n respond_to do |format|\n format.html { redirect_to objets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @kata.destroy\n respond_to do |format|\n format.html { redirect_to katas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @visarequest = Visarequest.find(params[:id])\n @visarequest.destroy\n\n respond_to do |format|\n format.html { redirect_to(visarequests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @objet = Objet.find(params[:id])\n @objet.destroy\n respond_to do |format|\n format.html { redirect_to objets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sotrudniki = Sotrudniki.find(params[:id])\n @sotrudniki.destroy\n\n respond_to do |format|\n format.html { redirect_to sotrudnikis_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 @articulo = Articulo.find(params[:id])\n @articulo.destroy\n\n respond_to do |format|\n format.html { redirect_to articulos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @articulo = Articulo.find(params[:id])\n @articulo.destroy\n\n respond_to do |format|\n format.html { redirect_to articulos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @articulo = Articulo.find(params[:id])\n @articulo.destroy\n\n respond_to do |format|\n format.html { redirect_to articulos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @kolegij = Kolegij.find(params[:id])\n @kolegij.destroy\n\n respond_to do |format|\n format.html { redirect_to kolegijs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dish_mixture.destroy\n respond_to do |format|\n format.html { redirect_to dish_mixtures_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trek = Trek.find(params[:id])\n @trek.destroy\n\n respond_to do |format|\n format.html { redirect_to treks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interview = Interview.find_by_slug(params[:id])\n @interview.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_interviews_path, notice: 'Interview was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ramal = Ramal.find(params[:id])\n @ramal.destroy\n\n respond_to do |format|\n format.html { redirect_to ramais_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @click_thru = ClickThru.find(params[:id])\n @click_thru.destroy\n\n respond_to do |format|\n format.html { redirect_to click_thrus_url }\n format.json { head :no_content }\n end\n end", "def delete_from_entzumena\n headline = Headline.where({:source_item_type => params[:source_item_type], :source_item_id => params[:source_item_id]}).first\n if headline.destroy\n render :json => true, :status => 200\n else\n render :json => false, :status => :error\n end\n end", "def destroy\n @articuloind = Articuloind.find(params[:id])\n @articuloind.destroy\n\n respond_to do |format|\n format.html { redirect_to articuloinds_url }\n #format.json { head :ok }\n end\n end", "def destroy\n @sivic_discipulo.destroy\n respond_to do |format|\n format.html { redirect_to sivic_discipulos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dis_duplicate_therapy.destroy\n respond_to do |format|\n format.html { redirect_to dis_duplicate_therapies_url, notice: 'Dis duplicate therapy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @indicacao = Indicacao.find(params[:id])\n @indicacao.destroy\n\n respond_to do |format|\n format.html { redirect_to indicacoes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @injhas_special_biryani_dish.destroy\n respond_to do |format|\n format.html { redirect_to injhas_special_biryani_dishes_url, notice: 'Injhas special biryani dish was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kisalli = Kisalli.find_by_key(params[:id])\n @kisalli.destroy\n\n respond_to do |format|\n format.html { redirect_to kisallis_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @three60.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_good_url(@good, anchor: \"three60\") }\n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades2 = Humanidades2.find(params[:id])\n @humanidades2.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades2s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @equipe = Equipe.find(params[:equipe_id])\n @adversaire = Adversaire.find(params[:id])\n @adversaire.destroy\n\n respond_to do |format|\n format.html { redirect_to @equipe }\n format.json { head :no_content }\n end\n end", "def destroy\n @koti = Koti.find(params[:id])\n @koti.destroy\n\n respond_to do |format|\n format.html { redirect_to kotis_url }\n format.json { head :no_content }\n end\n end", "def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n head 204\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end \n end", "def destroy\n @kanri_daicho.destroy\n respond_to do |format|\n format.html { redirect_to kanri_daichos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_ndd_articulo = @notadedebito.renglon_ndd_articulos.find(params[:id]).destroy\n\n respond_to do |format|\n format.html { head :ok }\n #format.json { head :ok }\n end\n end", "def destroy\n @movimentacao.destroy\n respond_to do |format|\n format.html { redirect_to movimentacaos_url, notice: \"Movimentação Apagada com Sucesso.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @sentiment.destroy\n respond_to do |format|\n format.html { redirect_to sentiments_url, notice: 'Sentiment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n head :no_content\n end", "def destroy\n @tattoo = Tattoo.find(params[:id])\n @tattoo.destroy\n\n respond_to do |format|\n format.html { redirect_to tattoos_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @sivic_rede.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_redes_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @zayavka = Zayavka.find(params[:id])\n @zayavka.destroy\n\n respond_to do |format|\n format.html { redirect_to zayavkas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @three.destroy\n respond_to do |format|\n format.html { redirect_to threes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @status_animal = StatusAnimal.find(params[:id])\n @status_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to status_animais_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @recinto = Recinto.find(params[:id])\n @recinto.destroy\n\n respond_to do |format|\n format.html { redirect_to recintos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interesting = Interesting.find(params[:id])\n @interesting.destroy\n\n respond_to do |format|\n format.html { redirect_to interestings_url }\n format.json { head :ok }\n end\n end", "def destroy\n @detalle = Detalle.find(params[:id])\n @detalle.destroy\n\n respond_to do |format|\n format.html { redirect_to detalles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if @diet.destroy\n head :no_content, status: 200\n else\n render json: @diet.errors, status: 405\n end\n end", "def destroy\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n @agronomiaquimica.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiaquimicas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @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 @therapist = Therapist.find(params[:id])\n @therapist.destroy\n\n respond_to do |format|\n format.html { redirect_to therapists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @kf_diary = Kf::Diary.find(params[:id])\n @kf_diary.destroy\n\n respond_to do |format|\n format.html { redirect_to kf_diaries_url({:page => params[:page]}) }\n format.json { head :no_content }\n end\n end", "def destroy\n \n @lancamentorapido = Lancamentorapido.find(params[:id])\n @lancamentorapido.destroy \n\n respond_to do |format|\n format.html { redirect_to lancamentorapidos_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @nudge.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @kontakty = Kontakty.find(params[:id])\n @kontakty.destroy\n\n respond_to do |format|\n format.html { redirect_to(kontakties_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @tangent.destroy\n respond_to do |format|\n format.html { redirect_to tangents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @zakaz = Zakaz.find(params[:id])\n @zakaz.destroy\n\n respond_to do |format|\n format.html { redirect_to zakazs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @criterion_detail.destroy\n respond_to do |format|\n format.html { redirect_to criterion_criterion_details_path, notice: 'تم حذف المقياس بنجاح' }\n format.json { head :no_content }\n end\n end", "def destroy\n @atr = Atr.find(params[:id])\n @atr.destroy\n\n respond_to do |format|\n format.html { redirect_to atrs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @prepagada = Prepagada.find(params[:id])\n @prepagada.destroy\n\n respond_to do |format|\n format.html { redirect_to prepagadas_url }\n format.json { head :no_content }\n end\n end", "def delete_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by_id(params[:pathway_id])\n suggested_pathway.destroy\n render json: suggested_pathway\n end", "def destroy\n @tgl_row = TglRow.find(params[:id])\n @tgl_row.destroy\n\n respond_to do |format|\n format.html { redirect_to tgl_rows_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dart = Dart.find(params[:id])\n @dart.destroy\n\n respond_to do |format|\n format.html { redirect_to darts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trek.destroy\n respond_to do |format|\n format.html { redirect_to treks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @notadecredito = Notadecredito.find(params[:notadecredito_id])\n @renglon_ndc_articulo = @notadecredito.renglon_ndc_articulos.find(params[:id]).destroy\n\n respond_to do |format|\n format.html { head :ok }\n #format.json { head :ok }\n end\n end", "def destroy\n @idea_crowdrating_idea_id = @idea_crowdrating.idea_id\n @idea_crowdrating.destroy\n respond_to do |format|\n format.html { redirect_to idea_crowdratings_path(:idea_id => @idea_crowdrating_idea_id), notice: (I18n.t :act_delete) }\n format.json { head :no_content }\n end\n end", "def destroy\n @routine_interview = RoutineInterview.find(params[:id])\n @routine_interview.destroy\n\n respond_to do |format|\n format.html { redirect_to routine_interviews_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @varience.destroy\n respond_to do |format|\n format.html { redirect_to variences_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7065158", "0.6997197", "0.6952644", "0.6896922", "0.6869125", "0.6864023", "0.6841059", "0.68388104", "0.6832834", "0.68295366", "0.6821671", "0.68204147", "0.681717", "0.6815881", "0.6808531", "0.67973346", "0.6792132", "0.6771393", "0.676624", "0.67648923", "0.67548066", "0.6754479", "0.6754445", "0.67511696", "0.67376596", "0.67367786", "0.6730791", "0.67300767", "0.67270964", "0.67260057", "0.6724451", "0.6724159", "0.67204374", "0.67176044", "0.671498", "0.671199", "0.67110443", "0.6707153", "0.6702246", "0.6697081", "0.6695753", "0.6695648", "0.66932744", "0.6692988", "0.6692988", "0.6692988", "0.6692621", "0.6691028", "0.6690759", "0.668994", "0.66890824", "0.66886276", "0.66879386", "0.6686172", "0.668481", "0.66841894", "0.6683155", "0.66818357", "0.6681259", "0.6680318", "0.6674419", "0.6673703", "0.6663624", "0.6660519", "0.6658781", "0.665878", "0.6656738", "0.66516006", "0.66515654", "0.6650697", "0.6649758", "0.6648526", "0.66474074", "0.6647159", "0.6646629", "0.664322", "0.6642586", "0.66406995", "0.6635081", "0.6634591", "0.663354", "0.66330665", "0.66309553", "0.6629865", "0.6629564", "0.6626973", "0.66259164", "0.6623559", "0.6621231", "0.6620961", "0.66204715", "0.66186297", "0.66180867", "0.6618054", "0.66179204", "0.6616932", "0.66166085", "0.6613022", "0.6611906", "0.6609124", "0.6608073" ]
0.0
-1
get the ten first hits from the breweryDB
def db_list beername = params[:name] @beer_info = BREWERY.search.beers(q: beername, withBreweries: 'Y').first(10) @beers_with_breweries = [] @beerlist = @beer_info.map do |drink| drink_object(drink) end render json: @beerlist end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topTenBooks\n\t\t@requests = requests.order('count desc').limit(10)\n\tend", "def retrieve_for_index(index)\n page = (index / 10) + 1\n populate_results(API.search(@query, page))\n end", "def first(n=1)\n query(@sql + ' LIMIT ' + n.to_s, cache: false)\n end", "def top_ten\n Rails.cache.fetch('top_ten_resp', expires_in: 1.minutes) do\n conn = Faraday.new(url: @base_url) do |faraday|\n faraday.adapter(Faraday.default_adapter)\n end\n\n resp = conn.get do |req|\n req.url '/v1/cryptocurrency/listings/latest'\n req.headers['X-CMC_PRO_API_KEY'] = @api_key\n req.params['start'] = 1\n req.params['limit'] = 10\n req.params['convert'] = 'USD'\n req.params['sort'] = 'market_cap'\n req.params['sort_dir'] = 'desc'\n end\n\n raise 'Cannot parse response body' unless resp.body\n\n resp.body\n end\n end", "def search_bing\n search_results = bing_search.first_50\n #set_reports\n return search_results\n end", "def index\n @records = Record.all.order('count desc').take(100)\n end", "def next_ten_hosts(db)\r\n\t\tarray1 = []\r\n\t\tarray1 << db.execute(\"SELECT name FROM playgroups WHERE id<=10\")\r\n\t\tputs \"Next ten hosts are...\"\r\n\t\tarray1[0].each do |i|\r\n\t\t\tputs i \r\n\t\t\tputs \"--------------\"\r\n\t\tend\r\n\tend", "def recommendations(url,num=5)\n url = url_host_path(url)\n uid = REDIS[\"id:#{url}\"]\n results = REDIS.zrevrangebyscore(\"recos:#{uid}\", '+inf', '-inf', {:withscores => true} )\n \n recos = results[0...num].map do |x| uid,score = x[0],x[1]\n { :title=>REDIS[\"title:#{uid}\"], :url=>REDIS[\"url:#{uid}\"], :score=>score }\n end\n \n return recos\nend", "def getTweet(index)\n @client = MongoClient.new('localhost', 27017)\n @db = @client['undergrad_research']\n @coll = @db['tweets']\n items = @coll.find({}, {limit:1, skip:index})\n end", "def next_query\n @start += 1000\n\n {\n start: @start - 1000,\n rows: 1000,\n q: @q,\n fq: @fq,\n def_type: @def_type,\n fl: 'uid,fulltext_url',\n facet: false\n }\n end", "def get_scores\r\n items_db = DYNAMODB.scan(table_name: TABLE_NAME).items\r\n items_hash = make_result_list(items_db)\r\n items = items_hash.sort_by { |hash| hash['score'] }\r\n make_response(HttpStatus::OK, items.reverse().first(10))\r\nend", "def get_recipes\n query = 'SELECT recipes.name, recipes.id FROM recipes LIMIT 20 OFFSET \"#{offset}'\n results= db_connection do |conn|\n conn.exec(query)\n end\n @results = results.sort_by {|result| result['name']}\nend", "def index\n @entries = Entry.all.first(100)\n end", "def all_tweets_with_limit n\n\t\t\n\t\tsdb = AWS::SimpleDB.new(access_key_id: $aws_access, secret_access_key: $aws_secret)\n\n\t\tdomain = sdb.domains['cspp51050-final']\n\t\tresults = domain.items.limit(n)\n\n\t\tconvert_sdb_to_objects results\n\n\tend", "def scan(table_name, last_key = nil)\n params = {\n table_name: table_name,\n limit: 20,\n }\n if !last_key.nil?\n params.merge!(exclusive_start_key: last_key)\n end\n\n response = $client.scan(params)\n puts \"SCAN Response\" + response.to_s\n return {\n results: response.items,\n last_key: response.last_evaluated_key,\n }\nend", "def capped_records(database, collection, conditions, last = Time.now)\n db = @connection.db(database)\n coll = db.collection(collection)\n conditions = conditions.merge({\"timestamp\" => {\"$lt\" => last}})\n coll.find(conditions).sort([[\"$natural\", \"-1\"]]).limit(50)\n end", "def index\n from_param = (params[:p].to_i * 10)\n @recipes = RecipeApi.search(params[:query], from_param )\n end", "def first **args\n query( **( { order: \"@rid\" , limit: 1 }.merge args)).execute(reduce: true)\n\tend", "def index\n @recent_objects = Serial.order(updated_at: :desc).limit(10)\n end", "def index\n @companies = Company.all.first(50000)\n end", "def fetch_results(token)\n options = { with_scores: true }\n if !complete_word?(token) && word.length < 3\n options[:limit] = [0, 50] # use a limit\n end\n values = redis.zrevrangebyscore(\n scored_set(token),\n \"inf\", 0, # max and min\n options\n )\n values.select { |result| within_constraints?(result.first) }\n end", "def top10(url)\n\t\tlista=recorre(url)\n\t\tfor i in 1..10\n\t\t\tdatos(lista[i][0])\n\t\tend\n\tend", "def load_blog_list\n resp = $ddb_client.scan({\n table_name: BLOGS_TABLE\n })\n\n p \"Scanned BlogTables ... found #{resp.length} blogs\"\n { items: resp.items, count: resp.count }\nend", "def search_from_fresh( query, page )\n @search_data = {}\n @search_results = []\n \n index_search_status = search_from_fresh_index( query, page )\n \n if @index.current_results_total === 0\n @search_data = nil\n else\n dataset_search_status = search_from_fresh_datasets()\n end\n \n if @index.ordered_results.size > 0\n @search_results = paged_results()\n end\n \n if index_search_status and dataset_search_status\n obj_to_cache = {\n :search_data => @search_data,\n :current_page => @index.current_page,\n :current_results_total => @index.current_results_total,\n :ordered_results => @index.ordered_results\n }\n @cache.write( \"query:#{query}-page:#{page}\", obj_to_cache.to_json, :expires_in => 3.hours )\n end\n end", "def range_records(database, collection, conditions, first = Time.now, last = Time.now, limit = 2000)\n db = @connection.db(database)\n coll = db.collection(collection)\n conditions = conditions.merge({\"timestamp\" => {\"$lte\" => last, \"$gte\" => first}})\n\n baseQuery = coll.find(conditions).sort([[\"$natural\", \"-1\"]]).limit(limit)\n end", "def playing_with(num=10)\n return [] if not page_id or page_id==0\n \nsql = <<-SQL\n select terms.*\n from terms, matches matches1,matches matches2 \n where terms.id=matches2.term_id \n and matches2.page_id=matches1.page_id \n and matches1.date_for_sorting = matches2.date_for_sorting\n and matches1.id=#{id}\n and matches2.id<>#{id}\n and matches2.status='notified'\n group by terms.text\n limit #{num}\n SQL\n terms = Term.find_by_sql(sql) \n Term.uniques(terms)\n end", "def quick_search( query, page=nil )\n # Calculate the start page\n start_doc = 0\n if page and ( Integer(page) > 1 )\n start_doc = ( Integer(page) - 1 ) * @docs_per_page\n end\n \n data = index_request(\n {\n \"q\" => query,\n \"sort\" => @sort_results_by,\n \"start\" => start_doc,\n \"rows\" => @docs_per_page\n }\n )\n return data[\"response\"][\"docs\"]\n end", "def page_size\n 10\n end", "def index\n params[:q] = Batch.fix_params(params[:q]) if params[:q]\n @q = Batch.page(params[:page]).search(params[:q])\n # @q.range_selector_cont ||= \"Last 13 Weeks\"\n @q.sorts = \"date_collected desc\" if @q.sorts.empty?\n @range = params[:q][:range_selector_cont] if params[:q]\n @batches = @q.result(:distinct => true)\n end", "def test_get_index_paging\n page_size = 10\n mark = 0\n begin\n uri = URI.parse '/api2/index' \n uri.query = Rack::Utils.build_query(\n :email => CGI.escape(@email),\n :auth => @token,\n :length => page_size,\n :mark => mark\n )\n \n get uri.to_s\n response = JSON.parse(last_response.body)\n mark = response['mark'].to_i\n end while response['mark']\n end", "def posts_from(num, size)\n post.order('num asc').limit(size).where('num >= ?', num)\n end", "def page (page = 1)\n\t \tdiff = (page - 1) * 10\n\t \tall.offset(diff).limit(10)\n\t end", "def index\n \n @search = Bookable.where(\"start_time >= ?\", Time.now).search(params[:q])\n @bookables = @search.result\n @most_expensive = Bookable.order('price DESC').first\n @today_date = Date.today\n \n\n end", "def search_all_results(query)\n results = []\n\n page = 1\n\n loop do\n hits = search(query, page)\n\n results.concat(hits['results'])\n\n if hits['last_page'] == page || hits['last_page'] == 0\n break\n else\n page += 1\n end\n end\n\n results\n end", "def search()\n @query_status = Query.for_queue(@queue)\n unless @query && @query_status\n return\n end\n\n total = 0\n results = []\n page = 1\n\n @last_twid = @query_status.last_twid\n\n loop do\n # App.log.info(\"last_twid: \" + @last_twid.to_s)\n results = fetch_page(page).select{|result| result.id.to_i > @last_twid }\n results.each{|result| add_to_queue(result)}\n total += results.size\n # unless results.size > 0\n update_query_status(total)\n break\n # end\n # page += 1\n end \n end", "def get_all(query_options={}, current_page=1, limit=15) # :yields: rows,page,next_page_flag\n opts = @default_query_options.merge(query_options)\n page = current_page.to_i\n page = 1 if page < 1\n while true\n opts[\"skip\"] = limit * (page - 1)\n opts[\"limit\"] = limit + 1\n uri = gen_view_uri(opts)\n $stderr.puts \"[debug] get_all() uri=#{uri}\" if @debug\n \n rows = YALTools::YaJsonRows.new(@couch, @dbname)\n json = @couch.get(uri)\n i=0\n next_row = nil\n next_page_flag = false\n json.has_key?(\"rows\") and yield_rows(json[\"rows\"]) do |r|\n if i == limit\n next_page_flag = true\n else\n rows << r\n end\n i += 1\n end\n break if rows.length == 0\n yield [rows, page, next_page_flag]\n break if next_page_flag == false\n page += 1\n end\n end", "def get_all_items(solr_params)\n solr_params['rows'] = 1000000\n end", "def take(num=1)\n if num > 1\n rows = connection.execute <<-SQL\n SELECT #{columns.join \",\"} FROM #{table}\n ORDER BY random()\n LIMIT #{num};\n SQL\n\n rows_to_array(rows)\n else\n take_one\n end\n end", "def index\n @carriers = Carrier.limit(50)\n @q = Carrier.where(id: -1).search(params[:query]) \n end", "def execute_query(options)\n results = solr_select(options)\n Chef::Log.debug(\"Bulk loading from #{@database}:\\n#{results.inspect}\") \n objects = if results[\"response\"][\"docs\"].length > 0\n bulk_objects = @couchdb.bulk_get( results[\"response\"][\"docs\"].collect { |d| d[ID_KEY] } )\n Chef::Log.debug(\"bulk get of objects: #{bulk_objects.inspect}\")\n bulk_objects\n else\n []\n end\n [ objects, results[\"response\"][\"start\"], results[\"response\"][\"numFound\"], results[\"responseHeader\"] ] \n end", "def index\n @jyankens = Jyanken.order(id: :desc).first(10)\n end", "def get_top100_urls(keyword)\n hash = get(keyword)\n struct = JSON.parse(hash.to_json, object_class: OpenStruct)\n\n urls = []\n struct.data.each { |i| urls << i.url }\n urls\n end", "def topn_by_downloads (keyinfo, n)\n topn_by_downloads = keyinfo.sort_by{ |x| x[:total_downloads] }.reverse.slice(0 .. n-1)\n top_table topn_by_downloads\nend", "def index\n #code to produce 9 random records pulled from http://blog.endpoint.com/2016/05/randomized-queries-in-ruby-on-rails.html?m=1\n desired_records = 9\n count= desired_records * 3\n offset = rand([School.count - count, 1].max)\n set = School.limit(count).offset(offset).pluck(:id)\n @schools = School.includes(:reviews).find(set.sample(desired_records)).paginate(page: params[:page], per_page:10)#includes uses eager loading to solve the N + ! queries problem, reducing number of\n\n\n end", "def index\n @tweet_dbs = TweetDb.all.sort({\"retweet\":-1})\n end", "def get_all_objects(class_name, count)\n per_page = 1000\n objects = []\n times = [(count/per_page.to_f).ceil, 10].min\n 0.upto(times) do |offset|\n query = Parse::Query.new(class_name)\n query.limit = per_page\n query.skip = offset * per_page\n objects << query.get\n end\n objects.flatten(1)\n end", "def index\n @last5ratings = Rating.last5\n @ratings = Rating.includes(:beer, :user).all\n \n TestJob.perform_async\n \n #Rails.cache.write('brewery top 3', Brewery.top(3), expires_in: 15.minutes)\n @top_breweries = brewery.top(3)\n #Rails.cache.write('beers top 3', Beer.top(3), expires_in: 15.minutes)\n @top_beers = beer.top(3)\n #Rails.cache.write('style top 3', Style.top(3), expires_in: 15.minutes)\n @top_styles = style.top(3)\n @most_active = User.most_active(3)\n end", "def index \n @urls = Url.all.order(hit_count: :desc)\n end", "def index\n @drink_histories = DrinkHistory.first(100)\n end", "def query\n resp = {:records => []}\n status_key = STATUS[rand(STATUS.length)]\n ss = Spooge.find_on_redis(:status,status_key)\n resp[:record_count] = ss.length\n ss.each do |s|\n resp[:records] << s\n end \n render :json => resp\n end", "def search(dbpath, querystring, offset: 0, pagesize: 10)\n # offset - defines starting point within result set\n # pagesize - defines number of records to retrieve\n\n # Open the database we're going to search.\n db = Xapian::Database.new(dbpath)\n\n # Set up a QueryParser with a stemmer and suitable prefixes\n queryparser = Xapian::QueryParser.new\n queryparser.stemmer = Xapian::Stem.new('en')\n queryparser.stemming_strategy = Xapian::QueryParser::STEM_SOME\n queryparser.add_prefix('title', 'S')\n queryparser.add_prefix('description', 'XD')\n # and add in range processors\n queryparser.add_rangeprocessor(PopulationRangeProcessor.new(3, 500_000, 50_000_000))\n # Start of date example code\n queryparser.add_rangeprocessor(Xapian::DateRangeProcessor.new(2, Xapian::RP_DATE_PREFER_MDY, 1860))\n queryparser.add_rangeprocessor(Xapian::NumberRangeProcessor.new(1))\n # End of date example code\n # And parse the query\n query = queryparser.parse_query(querystring)\n\n # Use an Enquire object on the database to run the query\n enquire = Xapian::Enquire.new(db)\n enquire.query = query\n\n # And print out something about each match\n matches = []\n enquire.mset(offset, pagesize).matches.each do |match|\n fields = JSON.parse(match.document.data)\n printf \"%<rank>i: #%<docid>3.3i %<name>s %<date>s\\n Population %<pop>s\\n\",\n rank: match.rank + 1,\n docid: match.docid,\n name: fields['name'],\n date: format_date(fields['admitted'].to_s),\n pop: format_numeral(fields['population'].to_i)\n matches << match.docid\n end\n log_matches(querystring, offset, pagesize, matches)\nend", "def dianping_search_shops(keywords,limit_query_pages)\n shops = []\n query_link = \"#{$DIANPING_SHOP_SEARCH_PATH_START_PAGE}#{URI.escape(keywords)}\"\n pages = DianpingPageParser.number_of_pages(query_link)\n \n puts pages\n \n max_page_to_crawl = (limit_query_pages.to_int < pages) ? limit_query_pages.to_int : pages\n \n (1..max_page_to_crawl).each { | page | shops << DianpingPageParser.shops_in_page(File.join(query_link, \"p#{page}\")) }\n \n return shops\nend", "def index\n # start_day = DateTime.now.prev_month\n # populars = Like.where(\"created_at > ?\", start_day).group(:feed_id).order(\"count_feed_id desc\").count(:feed_id)\n \n search_start_time = (DateTime.now - 1).utc\n populars = Like.where(\"created_at > ?\", search_start_time).group(:feed_id).order(\"count_feed_id desc\").count(:feed_id)\n \n feed_ids = populars.keys\n # @populars = Feed.find(feed_ids)\n @populars = Feed.where(id: feed_ids).where(\"created_at > ?\", search_start_time)\n end", "def query_hash_range(key, start, count, step_size, ts_index, ts_size = 2)\n hash = make_redis_hash(start, count, step_size, ts_index, ts_size)\n\n ckey = convert_keys(key)\n node = @root[ckey]\n\n keys = hash.to_a.sort_by { |it| it[0] }\n mres = @redis.pipelined do\n keys.each do |key, values|\n node[key].hmget(*values)\n end\n end\n\n mres.flatten.collect(&:to_i)\n end", "def auto_by_boosted_keywords\n\n rows = 10\n page = params[ :page ] ||= 1\n\n @entry = Class.const_get( params[ :entry_type ].camelcase ).find( params[ :entry_id ] )\n\n query = \"\"\n str = @entry.boost_keywords\n\n #debugger\n if str\n query = str.gsub( /,/, \" \" )\n else\n render :text => \"<p><b>This entry has no boost keywords associated with it. Please add some using the link above.</b></p>\"\n return\n end\n\n @items = @entry.auto_search :highlight => true\n \n# # solr uses start / offset, and will paginate uses page. we convert those\n# # paging params here.\n# # determine the start and offset based on page and number of total result docs.\n# if page.to_i == 1\n# start = 0\n# else\n# start = ( page.to_i - 1 ) * rows.to_i\n# end\n#\n# path = \"/solr/select?q=#{CGI.escape(query)}\"\n# path += \"&fq=%2Bmaxwell_document_type:item\"\n# path += \"&start=#{start}&rows=#{rows}\"\n# path += \"&qf=item_title^100+search_keywords^100+mlt_content^100\"\n# path += \"&ps=100&qs=100\"\n# path += \"&mm=1&qt=dismax&wt=ruby\"\n# path += \"&hl=true&hl.requireFieldMatch=true\"\n#\n# #path += \"&echoParams=all\"\n#\n# # our response comes back as a modified JSON result set, already set up for\n# # east eval into a ruby data structure.\n# RAILS_DEFAULT_LOGGER.info \"Path: #{path}\"\n# @response, @data = @@HTTP.get( path )\n# @solr_result = eval( @data )\n#\n# RAILS_DEFAULT_LOGGER.info \"Response: #{@response}\"\n# RAILS_DEFAULT_LOGGER.info \"Response: #{@data}\"\n#\n# total_results = @solr_result[ 'response' ][ 'numFound' ]\n# if total_results.to_i > 0\n# @fake_result = WillPaginate::Collection.new( page, rows, total_results )\n# ids = Array.new\n# @solr_result[ 'response' ][ 'docs' ].each { |d| ids << d[ 'item_id' ] }\n#\n# # remember that we are just doing an id search, so we need to be explicit about\n# # the sort order.\n# @items = Item.find( :all, :conditions => \"items.id IN ( #{ids.join( ',' )} )\", :include => [ :source ] )\n# end\n\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 find_every(options = {})\n query = {:limit => 100}.merge(options)\n \n feedkey = Wakoopa.feedkey\n if feedkey\n query.merge!(:key => feedkey)\n end\n \n Wakoopa::Request.get(self, :query => query)\n end", "def get_top_news(start=0,count=TopNewsPerPage)\n numitems = $r.zcard(\"news.top\")\n news_ids = $r.zrevrange(\"news.top\",start,start+(count-1))\n result = get_news_by_id(news_ids,:update_rank => true)\n # Sort by rank before returning, since we adjusted ranks during iteration.\n return result.sort_by(&:rank), numitems\nend", "def test_search_with_many_results\n internal = @service.indexes.fetch(\"_internal\")\n internal.refresh()\n if internal.fetch(\"totalEventCount\").to_i < 150\n fail(\"Need at 150 events in index _internal for this test.\")\n end\n\n job = @service.jobs.create(\"search index=_internal | head 150\")\n while !job.is_done?()\n sleep(0.1)\n end\n\n stream = job.results(:count => 0)\n results = Splunk::ResultsReader.new(stream)\n count = 0\n results.each do |event|\n count += 1\n end\n assert_equal(150, count)\n\n stream = job.preview(:count => 0)\n results = Splunk::ResultsReader.new(stream)\n count = 0\n results.each do |event|\n count += 1\n end\n assert_equal(150, count)\n end", "def fetch_with_limit\n start_result = 10\n start_result.step(RESULTS_LIMIT, 10) do |number|\n response = get_subdomains!(number)\n break unless response.items_present?\n end\n end", "def list(count=10)\n @database.documents['rows'].map {|doc| doc['id'] }\n end", "def low_risks_by_host(limit=10)\n\t\t\t\t\t#select(\"items.*\").select(\"count(*) as count_all\").joins(:host).where(\"plugin_id != 1\").where(:severity => 1).group(:host_id).order(\"count_all DESC\").limit(limit)\n\t\t\t\t\tItem.joins(:host).where.not(plugin_id: 1).where(:severity => 1).where(:rollup_finding => false).group(:host_id).order(Arel.sql('COUNT(*) DESC')).limit(limit)\n\t\t\t\tend", "def next\n DBLRuby::Search.new(\n search: search,\n limit: limit,\n offset: limit + offset,\n sort: sort,\n fields: fields\n )\n end", "def top_10 (matches)\n matches.sort_by! { |match| match['score'] }.reverse[:10]\nend", "def set_top_10_related_sub_reddits\n @top_10_related_sub_reddits = RelatedSubReddit\n .order(weight: :desc)\n .limit(20)\n .all\n .to_a\n .each_slice(2).map(&:last)\n end", "def get_results(query, conditions, order)\n query_call = \"select * from #{domain} \"\n query_call << \"where #{conditions.compact.join(' and ')}\" if conditions.length > 0\n query_call << \" #{order}\"\n if query.limit!=nil\n query_limit = query.limit\n query_call << \" limit #{query.limit}\" \n else\n #on large items force the max limit\n query_limit = 999999999 #TODO hack for query.limit being nil\n #query_call << \" limit 2500\" #this doesn't work with continuation keys as it halts at the limit passed not just a limit per query.\n end\n results = sdb.select(query_call)\n \n sdb_continuation_key = results[:next_token]\n while (sdb_continuation_key!=nil && results[:items].length < query_limit)do\n old_results = results\n results = sdb.select(query_call, sdb_continuation_key)\n results[:items] = old_results[:items] + results[:items]\n sdb_continuation_key = results[:next_token]\n end\n\n results = results[:items][0...query_limit]\n end", "def get_scores\n items = DYNAMODB.scan(table_name: TABLE).items\n sort_items_by_descending_scores_and_ascending_timestamp(items)\n make_result_list(items)\nend", "def top_hits_agg(size: 100, &block)\r\n agg = { agg: { top_hits: { size: size } } }\r\n base_agg(agg, block)\r\n end", "def read(count = limit)\n docs = redis.lrange(name, 0, count - 1)\n docs.collect { |json| entry_from_json(json) }\n end", "def index\n #@db_job_freqs = DbJobFreq.all\n @db_job_freqs = DbJobFreq.order(\"name asc\").paginate :page => params[:page], :per_page => 25\n end", "def query_hits(hit)\n query = 1\n while data.has_key?(\"h#{hit}_q#{query}\")\n query_hit(hit, query)\n query += 1 \n end\n \n @query_hits[hit]\n end", "def search_and_fetch_jobs\n feed = RSS::Parser.parse(open(target_url_with_query))\n feed.items.take(10)\n end", "def index\n #@db_repl_freqs = DbReplFreq.all\n @db_repl_freqs = DbReplFreq.order(\"name asc\").paginate :page => params[:page], :per_page => 25\n end", "def index\n @counters = Counter.last(5)\n end", "def get_entries_by_page(page_number)\n key = ENTRIES_CACHE_KEY_PREFIX + page_number.to_s\n cached_response = REDIS.get(key)\n\n # decompress and return the cached response if it's already in redis\n if cached_response != nil\n return JSON.parse(gunzip(cached_response))\n end\n\n # otherwise, fetch and cache it\n resp = HTTParty.get(FORM_URL_BASE + \"entries.json\", query: {\n pageSize: PAGE_SIZE,\n pageStart: PAGE_SIZE * page_number,\n }, basic_auth: WUFOO_AUTH)\n\n # make sure we got a good response\n throw \"Wufoo response error: #{resp.code}\" if resp.code != 200\n\n # cache the response value\n entries = []\n REDIS.multi do\n entries = resp[\"Entries\"] || entries\n\n # compress the entry data with GZip to increase the amount we can store in\n # our free Redis instance. it seems to compress _extremely_ well, down to 4%\n # of its original size in one instance!\n data = JSON.generate(entries)\n REDIS.set(key, gzip(data))\n\n # if the page was not full, expire the key after a short time so we'll\n # re-fetch the page in the future to check for new entries. this also\n # protects against constantly re-polling for the latest page.\n if entries.length < PAGE_SIZE\n REDIS.expire(key, PARTIAL_PAGE_CACHE_TIME)\n else\n # expire full pages after a while too, to ensure that we have relatively\n # up-to-date data at all times.\n REDIS.expire(key, FULL_PAGE_CACHE_TIME)\n end\n end\n\n entries\nend", "def index\n @boooks = Boook.page(params[:page]).per(5)\n end", "def first(options = {})\n search(options.merge(:limit => true))\n end", "def first(&block)\n args = limit(1).include_docs.query\n\n end", "def index\n all_blogs = Blog.all\n @recent_blogs = []\n i = 0\n if (all_blogs.length > 0) then\n i = all_blogs.last().id\n end\n\n while (@recent_blogs.length < 6 && i >= 1)\n if (Blog.exists?(i)) then\n @recent_blogs << Blog.find(i)\n end\n i -= 1\n end\n end", "def last_n_entries(user_id, days_request)\n id = user_id\n number = days_request\n results = $BP.execute(\n \"SELECT * FROM (SELECT * FROM bloodpressure WHERE user_id = (?)ORDER BY bp_id DESC LIMIT (?))\n ORDER BY bp_id ASC\", [id, number])\n puts \"Last #{number} entries:\"\n puts \"---------------------------------\"\n puts\n results.each do |entry|\n puts \"#{entry['date']} SYS: #{entry['systolic']} DIA: #{entry['diastolic']}\"\n end\n puts\n puts \"---------------------------------\"\n puts\nend", "def index\n @results = @search.result.paginate(page: params[:page], per_page: 9).order(created_at: :desc)\n end", "def get_latest_news(start=0,count=LatestNewsPerPage)\n numitems = $r.zcard(\"news.cron\")\n news_ids = $r.zrevrange(\"news.cron\",start,start+(count-1))\n return get_news_by_id(news_ids,:update_rank => true),numitems\nend", "def index \n @documents = Document.catalogs_search( @catalog.documents , params[:query]).order('title asc').page(params[:page]).per(24) \n end", "def first_page(ip)\n\t# query for ip list\n\tquery_url = BASE_DOMAIN + QUERY_VAR + ip\n\tdoc = open(query_url){|f| Hpricot(f)}\n\tcount = doc.search('//*[@id=\"count\"]').inner_text.gsub(' results','').to_i\n\t#pages = h.search('//*[@id=\"results_container\"]/div[2]/ul/li[2]/a')\n\tpagination = doc.search('//*[@id=\"results_container\"]/div[2]/ul/li/a')\n\treturn [doc,count,pagination]\nend", "def cursor_get_more_test(read=:primary)\n insert_docs\n 10.times do\n cursor = @coll.find({}, :read => read)\n cursor.next\n port = cursor.instance_variable_get(:@pool).port\n assert cursor.alive?\n while cursor.has_next?\n cursor.next\n assert_equal port, cursor.instance_variable_get(:@pool).port\n end\n assert !cursor.alive?\n cursor.close #cursor is already closed\n end\n end", "def index\n @total = Cookbook.count\n @cookbooks = Cookbook.order('name ASC').limit(@items).offset(@start)\n end", "def fetch(cursor: -1, count: 50, **options)\n cursor, count = cursor.to_i, count.to_i\n window = count + 2 # Fetch extra two elements for concrete next/prev links\n\n if cursor >= 0\n page = @scope.where(@cursor_key => -Float::INFINITY..cursor).limit(window)\n else\n cursor = cursor == -1 ? 0 : cursor.abs\n page = @scope.where(@cursor_key => cursor..Float::INFINITY).limit(window)\n end\n\n # Ensure result set is in correct order\n page = page.order(@cursor_key => :desc)\n\n Page.new(page, cursor, count: count)\n end", "def index\n @scores = Score.all.order(created_at: :desc).paginate(:page => params[:page], :per_page => 25)\n end", "def index\n # @entries = Entry.all\n @search.sorts = ['term desc', 'created_at desc'] if @search.sorts.empty?\n @search_term = params[:q]\n @entries = @search\n .result(distinct: true)\n .includes(:definitions)\n .page(params[:page])\n .per(params[:per_page])\n\n\n 1\n end", "def collect1 pages\n id = 'joshuabaer'\n results = []\n 1.upto pages do |page|\n results += http_get id, page\n end\n results\nend", "def recent_observations(num = 5)\n observations.find(:all, :limit => num, :order => \"created_at DESC\")\n end", "def scrape\n\n\t\tcustomer_api = Bigcommerce::Customer\n\t\tcustomer_count = customer_api.count.count\n\n\t\t#Bigcommerce api gives 50 items at once\n\t\tlimit = 50\n\t\tcustomer_pages = (customer_count/limit) + 1\n\n\t\tpage_number = 1\n\n\t\t# Loop through pages - each with 50 items\n\t\tcustomer_pages.times do \n\n\t\t\tcustomers = customer_api.all(page: page_number)\n\n\t\t\tcustomers.each do |c|\n\n\t\t\t\tinsert_sql(c, 1)\n\t\t\t\t\n\t\t\tend\n\n\t\t\tpage_number += 1\n\t\tend\n\n\tend", "def index\n @call_histories = CallHistory.all.page(params[:page]).per(20).order(\"id DESC\")\n end", "def fetch_all(qps=DEFAULT_QUERIES_PER_SECOND)\n response = execute\n items = response['items']\n\n while response['current_page'] < response['total_pages']\n self.page = response['current_page'] + 1\n response = execute\n items = items + response['items']\n \n sleep(1.0/DEFAULT_QUERIES_PER_SECOND)\n end\n\n return items\n end", "def index\n @documents = Document.all.order(intake_code: :desc).page(params[:page]).per(8)\n end", "def index\n @packages = Package.last(10)\n end", "def chrome_search(search, limit=5)\n searchword = \"%#{search}%\"\n urls = Url.where(\"title LIKE :search\", {:search => searchword})\n\n # get newest hit\n time_urls = Array.new\n urls.each do |u|\n time = 0\n u.visits.each do |v|\n vtime = v.visit_time.to_i\n time = vtime if time < vtime\n end\n time_urls << [time, u.title, u.url]\n end\n\n # get most recent hits\n time_urls.sort! {|x, y| y[0] <=> x[0]}\n return time_urls[0..limit-1].map {|x| [ \"GC: #{x[1]}\", x[2]] }\nend", "def solr_cursor_page_body(cursor_mark)\n retries = 0\n req = {}\n cn_fields = \"#{facet_field},title_display,title_vern_display,author_display,author_s,id,pub_created_vern_display,pub_created_display,holdings_1display\"\n loop do\n cn_request = \"#{core_url}select?q=*%3A*&fl=#{cn_fields}&wt=json&indent=true&defType=edismax&facet=false&sort=id%20asc&rows=#{rows}&cursorMark=#{cursor_mark}\"\n resp = conn.get cn_request.to_s\n req = JSON.parse(resp.body)\n break if req['response']\n Rails.logger.error \"Call number browse generation failed at iteration with cursor mark #{cursor_mark}. Response from solr was: #{resp}\"\n raise SolrResponseError if retries >= 2\n retries += 1\n end\n req\n end", "def index\n @slowlogexts = Slowlogext.get_all(params[:page])\n end", "def findTopMovies(actor, top_number=100) \r\n movie_array = []\r\n\r\n actor.film_actor_hash.each_key {|key| movie_array.push(key)}\r\n\r\n return movie_array.take(top_number)\r\nend", "def get_surrounding_docs(callnumber,direction,start,rows, location=\"\")\n if callnumber.nil?\n return nil\n end\n @location = location.gsub('&','%26')\n base_solr_url = Blacklight.connection_config[:url].gsub(/\\/solr\\/.*/,'/solr')\n dbclnt = HTTPClient.new\n solrResponseFull = []\n return_array = []\n callno = callnumber.gsub(\"\\\\\",\" \").gsub('\"',' ')\n params = {\n :wt => 'json',\n :fq => location,\n :fl => '*',\n :start => start.to_s,\n :rows => rows.to_s\n }\n uri = ''\n if direction == \"reverse\"\n params[:q] = '[* TO \"' + callno + '\"]'\n uri = URI(base_solr_url + \"/\" + @@browse_index_callnumber + \"/reverse\")\n else\n params[:q] = '[\"' + callno +'\" TO *]'\n uri = URI(base_solr_url + \"/\" + @@browse_index_callnumber + \"/browse\")\n end\n uri.query = URI.encode_www_form(params)\n solrResultString = dbclnt.get_content( uri )\n if !solrResultString.nil?\n y = solrResultString\n solrResponseFull = JSON.parse(y)\n solrResponseFull[\"response\"][\"docs\"].each do |doc|\n tmp_hash = get_document_details(doc)\n return_array.push(tmp_hash)\n end\n else\n return_array = nil\n end\n return return_array\n end" ]
[ "0.6203957", "0.61502975", "0.60688925", "0.603724", "0.59218013", "0.5807932", "0.5802249", "0.5774838", "0.5739761", "0.57225984", "0.57061094", "0.569189", "0.5655257", "0.5605034", "0.5594972", "0.553642", "0.5521013", "0.5520722", "0.5511041", "0.5468716", "0.54476935", "0.54410183", "0.5422861", "0.54191715", "0.53940135", "0.5390821", "0.5387844", "0.53572625", "0.53525585", "0.5348702", "0.5342807", "0.5336534", "0.5332404", "0.5316115", "0.531405", "0.5310527", "0.5310134", "0.5303033", "0.5301799", "0.5298304", "0.5282125", "0.5278397", "0.5278044", "0.52739316", "0.5270455", "0.52685505", "0.5266397", "0.5264653", "0.52643996", "0.5251601", "0.52430147", "0.52403146", "0.52398014", "0.52309227", "0.52261275", "0.5226052", "0.5221777", "0.5220178", "0.52152133", "0.52108425", "0.52013874", "0.51977855", "0.51943666", "0.519413", "0.51876885", "0.5186821", "0.5184653", "0.5181551", "0.5172764", "0.5171898", "0.5170948", "0.51694316", "0.5168471", "0.51648295", "0.5151445", "0.51505005", "0.514175", "0.5138643", "0.51375264", "0.5137425", "0.5136722", "0.5135989", "0.5135521", "0.5134018", "0.5133413", "0.51318437", "0.51211816", "0.5118987", "0.5115911", "0.51124734", "0.5110034", "0.51084566", "0.510798", "0.51019573", "0.5095889", "0.50956005", "0.50924", "0.50862694", "0.5080517", "0.5080479", "0.5076909" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_drink @drink = Drink.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 drink_params permitted = [:name, :brewery, :country, :percentage, :price, :drink_type_id, :description, :instock, :label_url] params.require(:drink).permit(*permitted) 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
Set up all the steps for processing, including validating the spreadsheet_id, and pulling all the values we'll be operating on
def initialize(spreadsheet_id) # Initialize the API @service = Google::Apis::SheetsV4::SheetsService.new @service.client_options.application_name = APPLICATION_NAME @service.authorization = authorize # Prints the names and majors of students in a sample spreadsheet: # https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit # spreadsheet_id = "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms" # range = "Insert your updates here!A3:E" range = "'Published factchecks'!A:Q" response = @service.get_spreadsheet_values spreadsheet_id, range puts "No data found." if response.values.empty? @spreadsheet_id = spreadsheet_id @values = response.values end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process\n uploaded_workbook = Spreadsheet.open self.path\n @records_matched = 0\n @records_updated = 0\n @records_failed = 0\n @failed_queries = 0\n @skipped_records = 0\n\n product_sheet = uploaded_workbook.worksheet(0)\n perform(product_sheet)\n\n if not uploaded_workbook.worksheet(1).nil?\n variant_sheet = uploaded_workbook.worksheet(1)\n perform(variant_sheet)\n end\nend", "def validate\n puts \"Validating input file #{@filename}...\\n\\n\"\n # Generates sheet object\n @sheet = spreadsheet\n # Check that all required headers are present\n validate_header\n # Parse data columns based on headers\n @rows = @sheet.parse(sequence: 'sequence', root: 'root', druid: 'druid').drop(1)\n # Hash\n @root_sequence = {}\n # Array to hold errors\n @errors = []\n check_empty_and_integer\n check_sequence\n # If no errors, returns sheet object\n puts \"Validation successful\\n\\n\"\n @sheet\n end", "def import_spreadsheet\n @project = Yogo::Project.get(params[:id])\n @total_steps = 3\n\n case params[:step]\n when '2'\n file = copy_uploaded_file(params[:spreadsheet])\n session[:import_file] = file\n contents = FasterCSV.read(file)\n @headers = contents[0]\n @rows = contents.length - 1\n @measurements = params[:measurements].keys.map{|k| @project.data_collections.get k }\n @import_step = 2\n when '3'\n @measurements, @example, @sheet_rows = {}, {}, 0\n params['measurements'].each do |m_id, parameters|\n m = @project.data_collections.get m_id\n m_hash = {}\n m_hash['measurement'] = [m.measurement_schema.id, parameters.delete('measurement')]\n m_hash['parameters'] = []\n parameters.each do |p_id, header|\n p = m.schema.get p_id\n m_hash['parameters'] << [p, header]\n end\n @measurements[m] = m_hash\n @measurements[m]['count'] = 0\n @measurements[m]['example'] = {}\n end\n\n FasterCSV.foreach(session[:import_file], :headers => true) do |row|\n @headers ||= row.headers\n \n @measurements.each do |m, v|\n if @measurements[m]['example'].empty?\n @headers.each { |h| @measurements[m]['example'][h] = [] } \n end\n unless row[v['measurement'][1]].blank?\n if @measurements[m]['count'] < 5\n row.each { |h, v| @measurements[m]['example'][h] << v }\n end\n @measurements[m]['count'] += 1 \n end\n end\n @sheet_rows += 1\n end\n session_hash = {}\n @measurements.each do |m,v|\n session_hash[m.id] = {\n 'parameters' => v['parameters'].map{|p| [p[0].id, p[1]] }, \n 'measurement' => v['measurement']\n }\n end\n session[:measurements] = session_hash\n @import_step = 3\n when '4'\n @measurements = {}\n session[:measurements].each do |m_id,v|\n m = @project.data_collections.get(m_id)\n @measurements[m] = v\n end\n @measurements.each do |m,v|\n @measurements[m]['initial'] = m.items.all.count\n if params['replace_data'] && (params['replace_data'][m.id.to_s] == 'DELETE')\n m.items.all.destroy\n end\n @measurements[m]['deleted'] = @measurements[m]['initial'] - m.items.all.count\n @measurements[m]['added'] = 0\n @measurements[m]['errors'] = []\n end\n FasterCSV.foreach(session[:import_file], :headers => true) do |row|\n @headers ||= row.headers\n @measurements.each do |m, v|\n values = {}\n unless row[v['measurement'][1]].blank?\n fields = {}\n m.schema.each{|s| fields[s.id.to_s] = s.to_s.intern }\n v['parameters'].each do |p,h|\n values[fields[p.to_s]] = row[h]\n end\n values[fields[v['measurement'][0].to_s]] = row[v['measurement'][1]]\n d = m.data_model.new(values)\n if d.valid?\n d.save\n else\n @measurements[m]['errors'] << d.errors.full_messages.join(\", \")\n end\n @measurements[m]['added'] += 1\n end\n end\n end\n @measurements.each_key{|m| @measurements[m]['total'] = m.items.all.count }\n @import_step = 4\n else\n @import_step = 1\n end\n\n render(\"import_spreadsheet_#{@import_step}\")\n end", "def process\n progressbar = ProgressBar.create(title: \"Rows\", total: @values.count, format: \"%B | %c/%u | %p% | %E \")\n rows = [[\"Valid Original URL?\", \"Valid Article URL?\"]]\n @values.each_with_index do |row, index|\n next if index == 0\n valid_original_url = validate_url(row[9]) ? \"\" : \"DIRTY\"\n valid_article_url = validate_url(row[10]) ? \"\" : \"DIRTY\"\n rows << [valid_original_url, valid_article_url]\n progressbar.increment\n end\n\n update_sheet(rows)\n end", "def goal_sheet_input\n goal_ranges.each do |range|\n @range = range\n @goal_sheet = @xlsx.sheet(@range).parse(header_search: [])\n create_goals\n end\n end", "def perform(*args)\n\n file_upload_id = args[0]\n row_start = args[1]\n row_end = args[2]\n validate_only = args[3]\n\n file_upload = FileUpload.find_by_id(file_upload_id)\n\n if file_upload.blank?\n Rails.logger.error(\"[Workers::ProcessEmployeeRows] Invalid file upload id - #{file_upload_id}\")\n return\n end\n\n company_id = file_upload.attachable_id\n\n rows = CSV.parse(file_upload.data_file.download, headers: true)\n process_rows = rows[row_start..(row_end - 1)]\n\n total_rows = process_rows.count\n valid_rows = []\n errors = []\n row_count = row_start\n policies = []\n emails = []\n existing_emails = []\n\n #Process employee table data\n process_rows.each_with_index do |row, index|\n name = row[\"Employee Name\"].to_s.strip\n email = row[\"Email\"].to_s.strip\n phone = row[\"Phone\"].to_s.strip\n emails << email\n\n employee_obj = Employee.new(name: name, email: email, phone: phone, company_id: company_id)\n\n if employee_obj.valid?\n valid_rows << employee_obj unless validate_only\n else\n errors << \"Row #{row_count + 1} Error: #{employee_obj.errors.full_messages}\"\n end\n\n row_count += 1\n\n #Bulk insert when INSERT threshold is reached or last row is in process\n if valid_rows.present? && (valid_rows.count == Employee::BULK_INSERT_SIZE || index == total_rows - 1)\n #Bulk SQL insert. No need for model validation. And ignore(don't raise exception) on duplicate emails\n Employee.import valid_rows, validate: false, on_duplicate_key_ignore: true\n valid_rows = []\n end\n\n #To validate existing emails in sheet\n if validate_only && emails.present? && (emails.count == Employee::BULK_INSERT_SIZE || index == total_rows - 1)\n existing_emails << Employee.where(email: emails).pluck(:email)\n end\n\n policies << row[\"Assigned Policies\"].to_s.split(\"|\").map(&:strip)\n end\n\n existing_emails = existing_emails.flatten\n if existing_emails.present?\n errors << \"Error: Emails #{existing_emails.join(\", \")} already exist in system\"\n end\n\n #Redis is used to temporary write the errors raised by several jobs fired for processing millions of rows\n LocalCache.pipelined {\n errors.each {|error| LocalCache.lpush(\"emp_batch_#{file_upload_id}_errors\", error)}\n }\n\n unless validate_only\n #Process employee policy data\n policies = policies.flatten.uniq\n policies_hash = Policy.where(name: policies).pluck(:name, :id).to_h\n process_rows.each_slice(Employee::BULK_INSERT_SIZE) do |batch|\n email_batch = batch.map{|m| m[\"Email\"]}\n emails_id_hash = Employee.where(email: email_batch).pluck(:email, :id).to_h\n\n insert_rows = []\n\n batch.each do |row|\n row[\"Assigned Policies\"].to_s.split(\"|\").map(&:strip).each do |policy|\n insert_rows << EmployeePolicy.new(\n employee_id: emails_id_hash[row[\"Email\"]],\n policy_id: policies_hash[policy]\n ) if emails_id_hash[row[\"Email\"]].present?\n end\n end\n\n #Bulk inser employee policies\n EmployeePolicy.import insert_rows, validate: false\n\n end\n end\n\n #Sidekiq Pro provides Batch processing which provides workflow(dependent job execution).\n #Since we are using the free version of sidekiq, created the custom logic of dependent job processing.\n # LOGIC:: Maintain a counter of rows processed in the Redis and update counter in transaction\n # when set of rows for that job gets processed. When the counter reaches to the total rows,\n # process the dependent job(reporting manager linking)\n redis_key = \"emp_batch_#{file_upload_id}\"\n loop do\n LocalCache.watch(redis_key)\n old_value = LocalCache.get(redis_key).to_i\n new_value = old_value + Employee::BULK_IMPORT_BATCH\n res = LocalCache.multi do |multi|\n multi.set(redis_key, new_value)\n end\n\n if res.present?\n LocalCache.unwatch\n break\n end\n end\n\n #When all rows of csv are processed, process the dependent job(reporting manager linking)\n if LocalCache.get(redis_key).to_i >= rows.count\n LocalCache.del(\"redis_key\")\n ProcessEmployeeManager.perform_async(file_upload_id, validate_only)\n end\n\n end", "def loadstudentsUpdates\n @flagDbUpdateRun = false\n if params.has_key?('flagDbUpdate')\n if params['flagDbUpdate'] == 'run'\n @flagDbUpdateRun = true\n end\n end\n logger.debug \"@flagDbUpdateRun: \" + @flagDbUpdateRun.inspect\n #service = googleauthorisation(request)\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n #spreadsheet_id = '1CbtBqeHyYb9jRmROCgItS2eEaYSwzOMpQZdUWLMvjng'\n spreadsheet_id = current_user[:ssurl].match(/spreadsheets\\/d\\/(.*?)\\//)[1]\n sheet_name = current_user[:sstab]\n\n #---------------------- Read the spreadsheet --------------------\n logger.debug 'about to read spreadsheet'\n startrow = 1\n # first get the 3 columns - Student's Name + Year, Focus, study percentages\n #This is now all that we get\n range = sheet_name + \"!A#{startrow}:U\"\n response = service.get_spreadsheet_values(spreadsheet_id, range)\n @students_raw = Array.new(response.values.length){Array.new(11)}\n #logger.debug \"students: \" + @students_raw.inspect\n basecolumncount = 1 #index for loading array - 0 contains spreadsheet row number\n rowcount = 0\t\t\t \n response.values.each do |r|\n #logger.debug \"============ row #{rowcount} ================\"\n #logger.debug \"row: \" + r.inspect\n colcount = 0\n @students_raw[rowcount][0] = rowcount + startrow\n r.each do |c|\n #logger.debug \"============ cell value for column #{colcount} ================\"\n \t #logger.debug \"cell value: \" + c.inspect\n \t @students_raw[rowcount][basecolumncount + colcount] = c\n \t\t colcount = colcount + 1\n end\n rowcount = rowcount + 1\n end\n #------------------------ Verify spreadsheet --------------------\n sheetheader = @students_raw[0]\n flagHeaderOK = true\n expectedheader = [1, \"ID\", \"Given Name\", \"Family Name\", \"MERGE\",\n \"Preferred Name\", \"UPDATE NAME\", \"Initials\", \"Sex\", \"UPDATE SEX\",\n \"Comment\", \"UPDATE COMMENT\", \"Status\", \"UPDATE STATUS\",\n \"Year\", \"UPDATE YEAR\", \"Study Percentages\",\n \"UPDATE STUDY PERCENTAGES\", \"Email\", \"Phone\",\n \"Inv Code\", \"Day Code\"]\n \n headermessage = \"Failed headers: \"\n expectedheader.each_with_index do |o, i|\n if o != sheetheader[i]\n flagHeaderOK = false \n headermessage += \"#{i.to_s} => expected (#{o}) got (#{sheetheader[i]}) \"\n end\n end\n if flagHeaderOK == false\n @students = Array.new\n @students[0] = Hash.new\n @students[0]['message'] = \"spreadsheet error - header is not correct. \" +\n \"You have selected the wrong spreadsheet or \" +\n \"you have not set it up correctly.\"\n @students[1] = Hash.new\n @students[1]['message'] = \"Correct headers are: \" + expectedheader.inspect \n @students[2] = Hash.new\n @students[2]['message'] = headermessage \n return\n end\n #---------------------- Scan spreadsheet rows --------------------\n # now build a student hash of field names with field values\n @students = Array.new\n @studentsIndexById = Hash.new\n @students_raw.each_with_index do |s, j|\n #logger.debug \"j:: \" + j.inspect\n next if j == 0 # don't want the header\n #break if j > 4 # DEBUG ONLY\n i = j-1\n @students[i] = Hash.new\n @students[i]['row'] = s[0]\n if s[1] == \"\" # no record in the db according to the spreadsheet\n # Will need to be created. Need main values as opposed to\n # update primary values (ignore spreadsheet 'update' values).\n @students[i]['pname'] = s[5]\n @students[i]['sex'] = s[8]\n @students[i]['comment'] = s[10]\n @students[i]['status'] = s[12]\n @students[i]['year'] = s[14]\n @students[i]['study'] = s[16]\n else # we only want to update the database\n # this loads the update columns only and only if spreadsheet has content.\n @students[i]['id'] = s[1].to_i # already know it is there\n @students[i]['oldpname'] = s[5] if s[5] && s[5].match(/\\w+/)\n @students[i]['pname'] = s[6] if s[6] && s[6].match(/\\w+/) \n @students[i]['sex'] = s[9] if s[9] && s[9].match(/\\w+/) \n @students[i]['comment'] = s[11] if s[11] && s[11].match(/\\w+/) \n @students[i]['status'] = s[13] if s[13] && s[13].match(/\\w+/) \n @students[i]['year'] = s[15] if s[15] && s[15].match(/\\w+/)\n @students[i]['study'] = s[17] if s[17] && s[17].match(/\\w+/)\n # possibly a merge is required\n @students[i]['merge'] = s[4] if s[4].match(/\\w+/)\n end\n # need to store message for display to the user.\n @students[i]['message'] = \"\"\n # Build index to be used for finding merged entries.\n @studentsIndexById[@students[i]['id']] = @students[i] if @students[i].has_key?('id') \n end\n #logger.debug \"students: \" + @students.inspect\n # --------------- Check ids match pnames in dbvs spreadsheet -------------\n @allDbStudents = Student.all\n @allDbStudentsIndex = Hash.new\n @allDbStudents.each do |a|\n @allDbStudentsIndex[a.id] = a\n end\n idErrors = \"\"\n flagIdOK = true\n @students.each do |s|\n if s.has_key?('id') && s.has_key?('oldpname')\n unless @allDbStudentsIndex.has_key?(s['id']) # this spreadsheet id not in the database\n flagIdOK = false\n idErrors += \"Failed spreadsheet id not in database row #{s['row']} - #{s['id']} \"\n next\n end\n if s['oldpname'] != @allDbStudentsIndex[s['id']].pname # Still possibly OK\n # May have already been updated with new pname on previous run\n if s.has_key?('pname') # potentially still OK - check updated pname\n if s['pname'] != @allDbStudentsIndex[s['id']].pname # not OK unless merged \n flagIdOK = false\n idErrors += \"Failed id check row #{s['row']} db: #{@allDbStudentsIndex[s['id']].pname} - update pname #{s['pname']}\"\n end\n elsif s.has_key?('merge') # potentially still OK - check if merged\n m = s['merge'].match(/^Merge.+?(\\d+)$/)\n if m[1] # ensure relevenant info\n merge_into_id = m[1].to_i\n unless @studentsIndexById.has_key?(merge_into_id) # merge in entry not present\n flagIdOK = false\n idErrors += \"Failed id check - merged_into row not present row #{s['row']} db: #{@allDbStudentsIndex[s['id']].pname} - #{s['oldpname']} -> merged \"\n else\n mergedPname = \"zzzMERGED \" + @studentsIndexById[merge_into_id]['oldpname']\n if mergedPname != @allDbStudentsIndex[s['id']].pname # not OK unless merged \n flagIdOK = false\n idErrors += \"Failed id check - not previously merged either row #{s['row']} db: #{@allDbStudentsIndex[s['id']].pname} - #{s['oldpname']} -> merged \"\n end\n end\n else\n flagIdOK = false\n idErrors += \"Failed id check row on merged pname not present #{s['row']} db: #{@allDbStudentsIndex[s['id']].pname} - #{s['oldpname']} \"\n end\n else\n flagIdOK = false\n idErrors += \"Failed id check row #{s['row']} db: #{@allDbStudentsIndex[s['id']].pname} - #{s['oldpname']} \"\n end\n end\n end\n end\n if flagIdOK == false\n @students = Array.new\n @students[0] = Hash.new\n @students[0]['message'] = \"spreadsheet error - ids do not match with pnames. \" +\n \"You have selected the wrong spreadsheet or \" +\n \"you have downloaded the wrong database.\"\n @students[1] = Hash.new\n @students[1]['message'] = idErrors \n return\n end\n #\n # --------------- Now to work through database creation or update -------------\n #@students is a hash of all records from the spreadsheets\n @students.each_with_index do |s, i|\n #logger.debug \"i: \" + i.inspect + \" s[id]: \" + s['id'].inspect\n #break if i > 1 # DEBUGGING ONLY\n # --------------- create record -------------\n if s['id'] == nil || s['id'] == \"\" # not yet created according to the spreadsheet\n logger.debug \"creating a record\"\n # better check to see if it has been created in a previous run\n if @students[i].has_key?('pname') # pname field is mandatory\n @checkstudents = Student.where(pname: @students[i]['pname'])\n if @checkstudents.count == 0 # confirmed not in database as spreadsheet expects\n # simply do nothing and let update proceed.\n else\n @students[i]['message'] += \"ERROR - record already in the database - row #{(i+1).to_s}\" \n next # ERROR - record already in the database\n end\n else # no pname value - ABORT this record!!!\n @students[i]['message'] += \"no pname provided to allow db record creation - row #{(i+1).to_s}\" \n next # ERROR in spreadsheet - cannot do any more with this\n end\n # All OK for record creation\n @student = Student.new(pname: @students[i]['pname'])\n @student.comment = @students[i]['comment'] if @students[i].has_key?('comment')\n @student.status = @students[i]['status'] if @students[i].has_key?('status')\n @student.year = @students[i]['year'] if @students[i].has_key?('year')\n @student.study = @students[i]['study'] if @students[i].has_key?('study')\n @student.sex = @students[i]['sex'] if @students[i].has_key?('sex')\n #logger.debug \"create student #{i.to_s}: \" + @student.inspect\n if @flagDbUpdateRun\n logger.debug \"update option selected - creating record\"\n if @student.save\n @students[i]['message'] = \"OK - Record created - row #{i.to_s}\" + @students[i]['message']\n logger.debug \"saved changes to \" + @students[i]['message']\n else\n @students[i]['message'] += \"ERROR - row #{i.to_s} - problem saving changes to db for \" + @students[i]['message']\n logger.debug \"problem saving changes to db for \" + @students[i]['message']\n end\n else\n @students[i]['message'] = \"OK - Record created - row #{i.to_s}\" + @students[i]['message']\n end\n else # spreadsheet says record should be in th database\n # --------------- update record -------------\n #logger.debug \"updating the database\"\n @student = Student.find(s['id']) # get the record & update\n if @student # record exists - now to update\n if s['pname'] && @student.pname != s['pname']\n @students[i]['message'] += \"#update pname:\" + @student.pname.inspect + \"=>\" + s['pname']\n @student.pname = s['pname']\n end\n if s['comment'] && @student.comment != s['comment']\n @students[i]['message'] += \"#update comment:\" + @student.comment.inspect + \"=>\" + s['comment']\n @student.comment = s['comment']\n end\n if s['status'] && @student.status != s['status']\n @students[i]['message'] += \"#update status:\" + @student.status.inspect + \"=>\" + s['status']\n @student.status = s['status']\n end\n if s['year'] && @student.year != s['year']\n @students[i]['message'] += \"#update year:\" + @student.year.inspect + \"=>\" + s['year']\n @student.year = s['year']\n end\n if s['study'] && @student.study != s['study']\n @students[i]['message'] += \"#update study:\" + @student.study.inspect + \"=>\" + s['study']\n @student.study = s['study']\n end\n if s['sex'] && @student.sex != s['sex']\n @students[i]['message'] += \"#update sex:\" + @student.sex.inspect + \"=>\" + s['sex']\n @student.sex = s['sex']\n end\n if @students[i]['message'].length > 0\n #logger.debug \"saved changes row #{(i+1).to_s} \" + @students[i]['message']\n logger.debug \"update student #{i.to_s}: \" + @student.inspect\n if @flagDbUpdateRun\n logger.debug \"update option selected - updating record\"\n if @student.save\n #logger.debug \"OK - saved changes to \" + @students[i]['message']\n @students[i]['message'] = \"OK record updated - row #{i.to_s} \" + @students[i]['message']\n else\n logger.debug \"ERROR - row #{i.to_s} - problem saving changes to db for \" + @students[i]['message']\n end\n end\n else\n @students[i]['message'] = \"INFO no updates required as record is already correct - row #{i.to_s}\" + @students[i]['message']\n end\n else # record not in database - which was expected.\n @students[i]['message'] += \"ERROR - no record found for this entry - row #{(i+1).to_s}\" \n # ABORT this record.\n end\n end\n end\n #--------------------------------------merge------------------------------\n # Merge requires:\n # 1. check both records exist\n # 2. find all roles for the student record being merged\n # 3. Update the student numbers in these to reference the merged_into student\n # 4. Set status of merged student to \"inactive\"\n # 5. Prepend comment to this student \"MERGED into student id xxx pname yyy\"\n # 6. Set pname to \"zzzMERGED \" + pname.\n #---------------------------------------------------------------------=--\n count_merges = 0\n @students.each_with_index do |s, i|\n #logger.debug \"i: \" + i.to_s + \" => \" + s.inspect\n if s.has_key?('merge') # merge requested\n count_merges += 1 # count the number of merges encounted in the spreadsheet\n #break if count_merges > 1 # DEBUGGING ONLY\n next if s['id'] == 0 # Not a record in the database accordingto the spreadsheet. \n merge_id = s['id'] # record to be merged\n #logger.debug \"merge_id: \" + merge_id.inspect + s['merge'].inspect\n m = s['merge'].match(/^Merge.+?(\\d+)$/)\n if m[1] # ensure relevenant info\n merge_into_id = m[1]\n else\n @students[i]['message'] += \" \\nError - requesting merge but merge info invalid\"\n return\n end\n # now check both records exist\n @student_merge = Student.find(merge_id)\n @students[i]['message'] += \"Error - merge record not in db\" unless @student_merge\n @student_merge_into = Student.find(merge_into_id)\n @students[i]['message'] += \"Error - merge_into record not in db\" unless @student_merge_into\n # find all the relevant roles\n @roles = Role.where(student_id: @student_merge)\n # Now check to see if the merge has already been done\n if @student_merge.pname.match(/^zzzMERGED/)\n @students[i]['message'] = \"INFO - already merged.\" + @students[i]['message'] + \" \"\n next\n end\n logger.debug \"Number of roles found for \" + @student_merge.pname + \" :\" + @roles.count.to_s\n # update the student_id in these roles to now reference merge_into\n @roles.each{|o| o.student_id = @student_merge_into.id}\n # Set merged student with status, comment and pname\n @student_merge.status = \"inactive\"\n @student_merge.comment = \"MERGED into student (#{@student_merge_into.id.to_s})\" +\n \" #{@student_merge_into.pname} \" + \n @student_merge_into.comment \n @student_merge.pname = \"zzzMERGED \" + @student_merge_into.pname\n # ensure each student stuff is done as a set.\n if @flagDbUpdateRun\n logger.debug \"update option selected - merging record\"\n begin\n Role.transaction do\n @roles.each do |myrole|\n myrole.save!\n end\n @student_merge.save!\n end\n rescue ActiveRecord::RecordInvalid => exception\n logger.debug \"Transaction failed row #{i._to_s} rollback exception: \" + exception.inspect\n @students[i]['message'] = \"ERROR - Transaction failed!!!\" + exception.inspect + @students[i]['message'] + \" \"\n next\n end\n end\n @students[i]['message'] = \" OK Record Merged. \" + @students[i]['message'] + \" \"\n end\n end\n end", "def import_master\n begin\n if request.post?\n raise \"Please attach an excel file for import master tables\" if params[:import_file].blank? \n status = \"\"\n set_original_path(params[:import_file]) \n data = Roo::Spreadsheet.open(@original_path) \n data.each_with_pagename do |name, sheet|\n table_name = name.downcase\n case table_name\n when \"bill_footer_setting\" \n status = FooterSetting.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"bill_group\" \n status = BillGroup.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"combooffer\" \n status = ComboOffer.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"creditcard_master\" \n status = CreditCard.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"cust_detail\"\n status = Customer.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"item_groups\" \n status = ItemGroup.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"item_groups_kot_print\" \n status = ItemGroupsKotPrint.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"item_sub_group\" \n status = ItemSubGroup.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"items\" \n status = Item.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"table_master\"\n status = Table.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"settings\" \n status = Setting.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"remarksmaster\"\n status = RemarkMaster.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"table_section\" \n status = TableSection.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"tax\"\n status = Tax.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"user_validation\" \n status = StaffSubMenuSetting.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"usermainmenu\" \n status = StaffMenuSetting.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"waiter\" \n status = Waiter.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"outlet_master\" \n status = Outlet.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"combopackage\" \n status = ComboPackage.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"user_master\" \n status = Staff.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"strtable\" \n status = Company.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"happyhour\" \n status = HappyHour.checked_attributes(sheet)\n raise status[1] if status [0] == false \n end \n end \n \n begin\n data.default_sheet = \"Outlet_Master\"\n status = Outlet.import(data, current_location)\n rescue Exception => e \n end \n raise status[1] if status [0] == false\n begin\n data.default_sheet = \"ComboPackage\"\n status = ComboPackage.import(data, current_location)\n rescue Exception => e \n end \n raise status[1] if status [0] == false \n begin\n data.default_sheet = \"Table_Section\"\n status = TableSection.import(data, current_location)\n rescue Exception => e \n end \n raise status[1] if status [0] == false \n begin\n data.default_sheet = \"User_Master\"\n status = Staff.import(data, current_location)\n rescue Exception => e \n end \n raise status[1] if status [0] == false\n \n data.each_with_pagename do |name, sheet|\n table_name = name.downcase\n case table_name\n when \"bill_footer_setting\"\n status = FooterSetting.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"bill_group\" \n status = BillGroup.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"combooffer\"\n status = ComboOffer.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"creditcard_master\"\n status = CreditCard.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"cust_detail\"\n status = Customer.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"item_groups\"\n status = ItemGroup.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"item_groups_kot_print\"\n status = ItemGroupsKotPrint.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"item_sub_group\" \n status = ItemSubGroup.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"items\"\n status = Item.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"table_master\"\n status = Table.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"settings\"\n status = Setting.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"remarksmaster\"\n status = RemarkMaster.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false\n when \"tax\"\n status = Tax.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"user_validation\" \n status = StaffSubMenuSetting.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"usermainmenu\" \n status = StaffMenuSetting.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"waiter\" \n status = Waiter.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"strtable\" \n status = Company.import(sheet, current_client) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"happyhour\" \n status = HappyHour.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n end \n end\n flash[:notice] = \"Master data is imported successfully.\"\n redirect_to client_path\n end\n rescue Exception => e\n flash.now[:info] = e.message\n render :import_master\n end\n end", "def loadtest2\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n#-----------------------------------------------------------------\n# Create a new spreadsheet -works and tested\n #request_body = Google::Apis::SheetsV4::Spreadsheet.new\n #response = service.create_spreadsheet(request_body)\n #ss = response\n #spreadsheet_id = ss.spreadsheet_id\n#-----------------------------------------------------------------\n\n\n#-----------------------------------------------------------------\n# Use an existing previously created spreadsheet\n# Only need the id to make use of this.\n spreadsheet_id = '1VHNfTl0Qxok1ZgBD2Rwby-dqxihgSspA0InqS5dTXNI'\n#-----------------------------------------------------------------\n sheet_name = \"Sheet1\"\n\n# ************ update spreadsheet title ************************\n# https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate \n spreadsheet_title = \"Testing Updates from BIT Server\"\n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n myussp = {\"properties\": {\"title\": spreadsheet_title}, \"fields\": \"*\" }\n request_body.requests = [{\"update_spreadsheet_properties\": myussp }]\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n\n\n\n\n# ************ delete all cells (rows) in a sheet ****************************\n# https://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/SheetsV4/Request#delete_range-instance_method \n \tgridrange = {\n \t sheet_id: 0,\n \t start_row_index: 0,\n# \t end_row_index: 1,\n \t start_column_index: 0,\n# \t end_column_index: 2\n \t }\n requests = []\n requests.push(\n {\n delete_range:{\n range: gridrange,\n shift_dimension: \"ROWS\"\n }\n }\n )\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n\n# ************ update values using update_spreadsheet_value ****************************\n# doco: https://www.rubydoc.info/github/google/google-api-ruby-client/Google%2FApis%2FSheetsV4%2FSheetsService%3Aupdate_spreadsheet_value \n range = \"#{sheet_name}!A1:B1\"\n request_body = Google::Apis::SheetsV4::ValueRange.new\n request_body.values = [[\"update_spreadsheet_value\",\"test data - this row will get a background colour\"]]\n request_body.major_dimension = \"ROWS\"\n result = service.update_spreadsheet_value(spreadsheet_id, range, request_body, \n {value_input_option: 'USER_ENTERED'})\n logger.debug \"update_spreadsheet_value completed\"\n\n# ************ update values using update_spreadsheet_value ****************************\n range = \"#{sheet_name}!A2:B3\"\n mydata = [\n {\n range: range,\n majorDimension: 'ROWS',\n values: [\n [\"spreadsheet_values_batchUpdate\", \"test data\"],\n [\"spreadsheet_values_batchUpdate\", \"third row\"]\n ]\n }\n ]\n request_body = Google::Apis::SheetsV4::BatchUpdateValuesRequest.new\n request_body.value_input_option = 'USER_ENTERED'\n request_body.data = mydata\n result = service.batch_update_values(spreadsheet_id, request_body, {})\n\n# ******** update background colours using batch_update_spreadsheet ********\n \tgridrange = {\n \t sheet_id: 0,\n \t start_row_index: 0,\n \t end_row_index: 1,\n \t start_column_index: 0,\n \t end_column_index: 2\n \t }\n requests = []\n requests.push(\n {\n repeat_cell: {\n \t range: gridrange,\n cell:\n {\n \t user_entered_format:\n \t {\n \t\t text_format: {bold: true},\n \t\t background_color:\n \t\t {\n \t\t\t red: 0.0,\n \t\t\t green: 1.0,\n \t\t\t blue: 0.0\n \t\t }\n \t }\n \t },\n fields: \"user_entered_format(background_color, text_format.bold)\"\n }\n }\n )\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n\n# ******** autorezise columns using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/rowcolumn \n requests = []\n requests.push(\n {\n auto_resize_dimensions: {\n dimensions:\n {\n \t dimension: \"COLUMNS\",\n \t sheet_id: 0,\n end_index: 2,\n \t start_index: 0\n \t },\n }\n }\n )\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n\n# ******** adjust columns width using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/rowcolumn \n requests = []\n requests.push(\n {\n update_dimension_properties: {\n range:\n {\n \t dimension: \"COLUMNS\",\n \t sheet_id: 0,\n end_index: 2,\n \t start_index: 0\n \t },\n \t properties: {\n \t pixel_size: 160\n \t },\n \t fields: \"pixelSize\"\n }\n }\n )\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n\n end", "def extract_data_from_worksheets\n worksheets do |name, xml_filename|\n \n extract ExtractValues, xml_filename, [name, 'Values']\n apply_rewrite RewriteValuesToAst, [name, 'Values']\n \n extract ExtractSimpleFormulae, xml_filename, [name, 'Formulae (simple)']\n apply_rewrite RewriteFormulaeToAst, [name, 'Formulae (simple)']\n\n extract ExtractSharedFormulae, xml_filename, [name, 'Formulae (shared)']\n apply_rewrite RewriteFormulaeToAst, [name, 'Formulae (shared)']\n\n extract ExtractSharedFormulaeTargets, xml_filename, [name, 'Formulae (shared targets)']\n\n extract ExtractArrayFormulae, xml_filename, [name, 'Formulae (array)']\n apply_rewrite RewriteFormulaeToAst, [name, 'Formulae (array)']\n \n extract_tables_for_worksheet(name,xml_filename)\n end\n end", "def upload_and_validate\n begin\n pedigree = Pedigree.find(params[:pedigree][:id])\n rescue\n flash[:error] = \"Pedigree must be selected\"\n render :action => \"upload\" and return\n end\n\n condition = ''\n if (params[:condition] && params[:condition][:id] && !params[:condition][:id].empty?) then\n begin\n condition = Condition.find(params[:condition][:id])\n #rescue\n # flash[:error] = \"Condition must be selected params: #{params[:condition].inspect}\"\n # render :action => \"upload\" and return\n end\n end\n\n spreadsheet_type = ''\n begin\n if params[:spreadsheet][:type] \n spreadsheet_type = params[:spreadsheet][:type]\n else\n flash[:error] = \"Spreadsheet type must be selected\"\n render :action => \"upload\" and return\n end\n rescue\n flash[:error] = \"Spreadsheet type must be selected\"\n render :action => \"upload\" and return\n end\n\n test_file = params[:excel_file]\n file = Tempfile.new(test_file.original_filename)\n file.write(test_file.read.force_encoding(\"UTF-8\"))\n begin\n book = Spreadsheet.open file.path\n rescue\n flash[:error] = \"File provided is not a valid Excel spreadsheet (.xls) file. Excel 2007 spreadsheets (.xlsx) files are not supported.\"\n render :action => \"upload\" and return\n end\n sheet1 = book.worksheet 0\n\n if spreadsheet_type == 'fgg manifest' then\n ret_code, @people, @samples, @relationships, @memberships, @diagnoses, @acquisitions, @errors, @aliases, @phenotypes = process_fgg_manifest(sheet1, pedigree, condition)\n else\n flash[:error] = \"Spreadsheet type not understood. Try this action again.\"\n render :action => \"upload\" and return\n end\n\n if ret_code == 0 then\n # render should already have been called in the process_XXXX method\n return\n end\n \n # need to add people, samples, relationships - don't track errors\n rc = 0\n @trans_id = Time.now.to_i + Random.rand(1000000)\n # temp objects are processed in order, so be careful of what order you write them\n\n # person needs to be written first\n rc = write_temp_object(@trans_id, \"person\",@people,1) unless @people.nil? or @people.empty?\n flash[:error] = \"Write temporary objects failed. Please contact system administrator.\" if (rc == 0)\n# logger.debug(\"rc for people #{@people.inspect} is #{rc.inspect}\")\n\n # sample must be written next\n rc = write_temp_object(@trans_id, \"sample\",@samples,2) unless @samples.nil? or @samples.empty?\n flash[:error] = \"Write temporary objects failed. Please contact system administrator.\" if (rc == 0)\n# logger.debug(\"rc for samples #{@samples.inspect} is #{rc.inspect}\")\n\n # rest are arbitrary\n rc = write_temp_object(@trans_id, \"membership\",@memberships,3) unless @memberships.nil? or @memberships.empty?\n flash[:error] = \"Write temporary objects failed. Please contact system administrator.\" if (rc == 0)\n# logger.debug(\"rc for memberships #{@memberships.inspect} is #{rc.inspect}\")\n\n rc = write_temp_object(@trans_id, \"acquisition\",@acquisitions,4) unless @acquisitions.nil? or @acquisitions.empty?\n flash[:error] = \"Write temporary objects failed. Please contact system administrator.\" if (rc == 0)\n# logger.debug(\"rc for acquisitions #{@acquisitions.inspect} is #{rc.inspect}\")\n\n rc = write_temp_object(@trans_id, \"diagnosis\",@diagnoses,5) unless @diagnoses.nil? or @diagnoses.empty?\n flash[:error] = \"Write temporary objects failed. Please contact system administrator.\" if (rc == 0)\n# logger.debug(\"rc for diagnosis #{@diagnoses.inspect} is #{rc.inspect}\")\n\n rc = write_temp_object(@trans_id, \"relationship\",@relationships,6) unless @relationships.nil? or @relationships.empty?\n flash[:error] = \"Write temporary objects failed. Please contact system administrator.\" if (rc == 0)\n# logger.debug(\"rc for relationship #{@relationships.inspect} is #{rc.inspect}\")\n\n rc = write_temp_object(@trans_id, \"aliases\",@aliases,7) unless @aliases.nil? or @aliases.empty?\n flash[:error] = \"Write temporary objects failed. Please contact system administrator.\" if (rc == 0)\n logger.debug(\"rc for alias #{@aliases.inspect} is #{rc.inspect}\")\n\n rc = write_temp_object(@trans_id, \"phenotypes\",@phenotypes,8) unless @phenotypes.nil? or @phenotypes.empty?\n flash[:error] = \"Write temporary objects failed. Please contact system administrator.\" if (rc == 0)\n logger.debug(\"rc for phenotype #{@phenotypes.inspect} is #{rc.inspect}\")\n\n respond_to do |format|\n format.html #upload_and_validate.html.erb\n format.xml { head :ok }\n end\n\n end", "def loadschedule\n logger.debug \"in loadschedule\"\n # log levels are: :debug, :info, :warn, :error, :fatal, and :unknown, corresponding to the log level numbers from 0 up to 5\n #logger.fatal \"1.log level\" + Rails.logger.level.inspect\n #service = googleauthorisation(request)\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n #spreadsheet_id = '1CbtBqeHyYb9jRmROCgItS2eEaYSwzOMpQZdUWLMvjng'\n #sheet_name = 'WEEK 1'\n spreadsheet_id = current_user[:ssurl].match(/spreadsheets\\/d\\/(.*?)\\//)[1]\n sheet_name = current_user[:sstab]\n colsPerSite = 7\n # first get sites from the first row\n range = \"#{sheet_name}!A3:AP3\"\n holdRailsLoggerLevel = Rails.logger.level\n Rails.logger.level = 1 \n response = service.get_spreadsheet_values(spreadsheet_id, range)\n Rails.logger.level = holdRailsLoggerLevel \n # extract the key for this week e.g. T3W1\n myrow = response.values[0]\n week = myrow[0] # this key is used over and over\n # pick up the sites\n sites = Hash.new() # array holding all sites\n # index = site name\n # col_start = first column for site\n myrow.map.with_index do |v, i|\n sites[v[/\\w+/]] = {\"col_start\" => i-1} if v != \"\" && v != week\n end\n\n #this function converts spreadsheet indices to column name\n # examples: e[0] => A; e[30] => AE \n e=->n{a=?A;n.times{a.next!};a} \n \n #---------------------------------------------\n # We now need to work through the sites by day\n # and tutorial slots\n # We will load a spreadsheet site at a time\n #sites # array holding all sites\n # index = site name\n # col_start = first column for site\n #days # array of rows numbers starting the day\n #slottimes # array of row number starting each slot\n # index = row number, values = ssdate\n # and datetime = datetime of the slot\n # @schedule array holds all the info required for updating \n # the database and displaying the results\n @schedule = Array.new()\n #These arrays and hashes are used within the sites loop\n #They get cloned and cleared during iterations\n onCall = Array.new()\n onSetup = Array.new()\n requiredSlot = Hash.new()\n thisLesson = Hash.new()\n flagProcessingLessons = false # need to detect date to start\n # @allColours is used in the view\n # It is used to show all colors used in the google schedule\n # Analysis tool.\n @allColours = Hash.new()\n # work through our sites, reading spreadsheet for each\n # and extract the slots, lessons, tutors and students\n # We also get the lesson notes.\n # At the beginning of each day, we get the on call and\n # setup info\n sites.each do |si, sv| # site name, {col_start}\n mystartcol = e[sv[\"col_start\"]]\n myendcol = e[sv[\"col_start\"] + colsPerSite - 1]\n #myendcoldates = e[sv[\"col_start\"] + 1] \n # ****************** temp seeting during development\n # restrict output for testing and development\n #range = \"#{sheet_name}!#{mystartcol}3:#{myendcol}60\"\n #rangedates = \"#{sheet_name}!#{mystartcol}3:#{mystartcol}60\"\n # becomes for production\n range = \"#{sheet_name}!#{mystartcol}3:#{myendcol}\"\n rangedates = \"#{sheet_name}!#{mystartcol}3:#{mystartcol}\"\n Rails.logger.level = 1 \n response = service.get_spreadsheet(\n spreadsheet_id,\n ranges: range,\n fields: \"sheets(data.rowData.values\" + \n \"(formattedValue,effectiveFormat.backgroundColor))\"\n )\n \n responsedates = service.get_spreadsheet_values(\n spreadsheet_id,\n rangedates,\n {value_render_option: 'UNFORMATTED_VALUE',\n date_time_render_option: 'SERIAL_NUMBER'\n }\n )\n \n Rails.logger.level = holdRailsLoggerLevel\n # Now scan each row read from the spreadsheet in turn\n logger.debug \"processing data from spreadsheet by rows.\"\n response.sheets[0].data[0].row_data.map.with_index do |r, ri|\n # r = value[] - contains info for ss cell - content & colour,\n # ri = row index\n #\n # FOR ANALYSIS ONLY - not for loading database\n # To analyse all the colours used in the spreadsheet,\n # we store all background colours from relevant cells.\n # Show them at the end to see if some are not what they\n # should be - manual inspection.\n # use: cell_background_color = getformat.call(column_index)\n storecolours = lambda{|j| \n cf = nil\n if r.values[j]\n if r.values[j].effective_format\n cf = r.values[j].effective_format.background_color\n end\n end\n # store all colours and keep count of how often\n # also, keep location of first occurance\n if cf != nil\n #col = [cf.red,cf.green,cf.blue]\n col = colourToArray(cf)\n @allColours[col] ? \n @allColours[col][2] += 1 :\n @allColours[col] = [e[j + sv[\"col_start\"]],3+ri,1]\n end\n }\n # Now start processing the row content\n c0 = getvalue(r.values[0])\n if c0 == week # e.g. T3W1 - first row of the day \n storecolours.call(1)\n next\n end\n if c0 == \"ON CALL\" # we are on \"ON CALL\" row\n storecolours.call(1)\n for i in 1..7 do # keep everything on this row\n cv = getvalue(r.values[i])\n onCall.push(cv) if cv != \"\"\n end\n next\n end\n if c0 == \"SETUP\" # we are on \"ON CALL\" row e.g. T3W1\n storecolours.call(1)\n for i in 1..7 do # keep everything on row\n cv = getvalue(r.values[i])\n onSetup.push(cv) if cv != \"\"\n end\n next\n end\n # look for date row - first row for slot e.g 7/18/2016\n if c0.match(/(\\d+)\\/(\\d+)\\/(\\d+)/)\n cf1 = getformat(r.values[1])\n # If this cell with day/time content is black,\n # then this slot is not used.\n # just skip - any onCall or onSetup already found will be\n # put into the first valid slot.\n if colourToStatus(cf1)['colour'].downcase != 'white'\n flagProcessingLessons = false\n next\n else\n flagProcessingLessons = true\n end\n # we are now working with a valid slot\n unless requiredSlot.empty?\n @schedule.push(requiredSlot.clone)\n requiredSlot.clear\n end\n #now get the matching date from the responsedates array\n mydateserialnumber = responsedates.values[ri][0]\n \n begin\n mydate = Date.new(1899, 12, 30) + mydateserialnumber \n c1 = getvalue(r.values[1])\n n = c1.match(/(\\w+)\\s+(\\d+)\\:*(\\d{2})/im) # MONDAY 330 xxxxxxx\n # Note: add 12 to hours as these are afternoon sessions.\n # Check for ligimate dates\n myhour = n[2].to_i\n mymin = n[3].to_i\n #dt1 = DateTime.new(mydate.year, mydate.month, mydate.day,\n # 1, 1)\n #dt2 = DateTime.new(2000, 1, 1,\n # myhour + 12, mymin)\n dt = DateTime.new(mydate.year, mydate.month, mydate.day,\n myhour + 12, mymin)\n rescue \n\n errorSite = si\n #errorRow = ri + 3\n myerror = \"Load Schedule - data processing error: \" +\n \" found in site: \" + errorSite +\n \" c0: \" + c0.inspect +\n \" c1: \" + c1.inspect +\n \" mydateserialnumber: \" + mydateserialnumber.inspect +\n \" error message: \" + $!.inspect\n logger.debug myerror\n flash[:notice] = myerror\n render action: :load\n return\n end\n requiredSlot[\"timeslot\"] = dt # adjust from am to pm.\n requiredSlot[\"location\"] = si\n logger.debug \"working with \" + si.inspect + ' ' + dt.inspect\n # Now that we have a slot created, check if this has been\n # the first one for the day. i.e. there are on call and setup events\n # If so, we make them into a lesson and add them to the slot.\n # Delete them when done.\n if(!onCall.empty? || !onSetup.empty?)\n requiredSlot[\"onCall\"] = onCall.clone unless onCall.empty?\n requiredSlot[\"onSetup\"] = onSetup.clone unless onSetup.empty?\n onCall.clear\n onSetup.clear\n end\n next\n end\n # any other rows are now standard lesson rows\n # If no date row yet detected or\n # this is not a valid slot (black background on date row)\n # we ignore\n next if flagProcessingLessons == false\n # Now do normal lession processing.\n c1 = getvalue(r.values[1]) # tutor\n c2 = getvalue(r.values[2]) # student 1\n c4 = getvalue(r.values[4]) # student 2\n c6 = getvalue(r.values[6]) # lesson comment\n cf1 = getformat(r.values[1])\n cf2 = getformat(r.values[2])\n cf4 = getformat(r.values[4])\n # store colours for cells of interest\n [1,2,3,4,5,6].each do |j|\n storecolours.call(j)\n end\n thisLesson[\"tutor\"] = [c1,cf1] if c1 != \"\"\n if c2 != \"\" || c4 != \"\" #student/s present\n thisLesson[\"students\"] = Array.new()\n thisLesson[\"students\"].push([c2,cf2]) if c2 != \"\"\n thisLesson[\"students\"].push([c4,cf4]) if c4 != \"\"\n end\n thisLesson[\"comment\"] = c6 if c6 != \"\"\n requiredSlot[\"lessons\"] = Array.new() unless requiredSlot[\"lessons\"]\n requiredSlot[\"lessons\"].push(thisLesson.clone) unless thisLesson.empty?\n thisLesson.clear\n end\n # at end of last loop - need to keep if valid slot\n unless requiredSlot.empty?\n @schedule.push(requiredSlot.clone)\n requiredSlot.clear\n end\n #break # during dev only - only doing one site\n end\n # cache the tutors and students for laters processing by the utilities.\n @tutors = Tutor.all\n @students = Student.all\n \n # Now start the database updates using the info in @schedule\n # Note:\n # my... = the info extracted from @schedule\n # this... = the database record \n \n # slot info\n @schedule.each do |r|\n # These are initialise on a row by row basis\n r[\"slot_updates\"] = \"\"\n r[\"onCallupdates\"] = \"\"\n r[\"onSetupupdates\"] = \"\"\n r[\"commentupdates\"] = \"\"\n # Process the slot\n mylocation = r[\"location\"]\n mytimeslot = r[\"timeslot\"] \n thisslot = Slot.where(location: mylocation, timeslot: mytimeslot).first\n unless thisslot # none exist\n thisslot = Slot.new(timeslot: mytimeslot, location: mylocation)\n if thisslot.save\n r[\"slot_updates\"] = \"slot created\"\n else\n r[\"slot_updates\"] = \"slot creation failed\"\n end\n else\n r[\"slot_updates\"] = \"slot exists - no change\"\n end\n # Now load lessons (create or update)\n # first up is the \"On Call\"\n # these will have a lesson status of \"oncall\"\n # [\"DAVID O\\n| E12 M12 S10 |\"]\n if(mylesson = r[\"onCall\"])\n logger.debug \"mylesson - r onCall: \" + mylesson.inspect\n mytutornamecontent = findTutorNameComment(mylesson, @tutors)\n # check if there was a tutor found.\n # If not, then we add any comments to the lesson comments.\n lessoncomment = \"\"\n if mytutornamecontent[0] == nil\n lessoncomment = mylesson[0]\n elsif mytutornamecontent[0][\"name\"] == \"\" && \n mytutornamecontent[0][\"comment\"].strip != \"\"\n lessoncomment = mytutornamecontent[0][\"comment\"]\n end\n if lessoncomment != \"\" ||\n (\n mytutornamecontent[0] != nil &&\n mytutornamecontent[0][\"name\"] != \"\"\n )\n # something to put in lesson so ensure it exists - create if necessary\n thislesson = Lesson.where(slot_id: thisslot.id, status: \"onCall\").first\n unless thislesson\n thislesson = Lesson.new(slot_id: thisslot.id,\n status: \"onCall\",\n comments: lessoncomment)\n if thislesson.save\n r[\"onCallupdates\"] += \"|lesson created #{thislesson.id}|\"\n else\n r[\"onCallupdates\"] += \"|lesson creation failed|\"\n end\n end\n end\n # Now load in the tutors - if any\n mytutornamecontent.each do |te|\n logger.debug \"mytutornameconent - te: \" + te.inspect\n # need tutor record - know it exists if found here\n if te['name']\n # create a tutrole record if not already there\n thistutor = Tutor.where(pname: te['name']).first # know it exists\n mytutorcomment = te['comment']\n # determine if this tutrole already exists\n thistutrole = Tutrole.where(lesson_id: thislesson.id,\n tutor_id: thistutor.id\n ).first\n if thistutrole # already there\n if thistutrole.comment == mytutorcomment &&\n thistutrole.status == \"\" &&\n thistutrole.kind == \"onCall\"\n r[\"onCallupdates\"] += \"|no change|\"\n else\n if thistutrole.comment != mytutorcomment\n thistutrole.update(comment: mytutorcomment)\n end\n if thistutrole.status != \"\"\n thistutrole.update(status: \"\")\n end\n if thistutrole.kind != \"onSetup\"\n thistutrole.update(kind: \"onSetup\")\n end\n if thistutrole.save\n r[\"onCallupdates\"] += \"|updated tutrole|\"\n else\n r[\"onCallupdates\"] += \"|update failed|\"\n end\n end\n else # need to be created\n thistutrole = Tutrole.new(lesson_id: thislesson.id,\n tutor_id: thistutor.id,\n comment: mytutorcomment,\n status: \"\",\n kind: \"onCall\")\n if thistutrole.save\n r[\"onCallupdates\"] += \"|tutrole created #{thistutrole.id}|\"\n else\n r[\"onCallupdates\"] += \"|tutrole creation failed|\"\n end\n end\n end\n end\n end\n # second up is the \"Setup\"\n # these will have a lesson status of \"onsetup\"\n # [\"DAVID O\\n| E12 M12 S10 |\"]\n if(mylesson = r[\"onSetup\"])\n mytutornamecontent = findTutorNameComment(mylesson, @tutors)\n # check if there was a tutor found.\n # If not, then we add any comments to the lesson comments.\n lessoncomment = \"\"\n if mytutornamecontent[0][\"name\"] == \"\" && \n mytutornamecontent[0][\"comment\"].strip != \"\"\n lessoncomment = mytutornamecontent[0][\"comment\"]\n end\n if mytutornamecontent[0][\"name\"] != \"\" || \n lessoncomment != \"\"\n # something to put in lesson so ensure it exists - create if necessary\n thislesson = Lesson.where(slot_id: thisslot.id, status: \"onSetup\").first\n unless thislesson\n thislesson = Lesson.new(slot_id: thisslot.id,\n status: \"onSetup\",\n comments: lessoncomment)\n if thislesson.save\n r[\"onSetupupdates\"] += \"|created lession #{thislesson.id}|\"\n else\n r[\"onSetupupdates\"] += \"|create lession failed|\"\n end\n end\n end\n # Now load in the tutors - if any\n mytutornamecontent.each do |te|\n # need tutor record - know it exists if found here\n if te['name']\n # create a tutrole record if not already there\n thistutor = Tutor.where(pname: te['name']).first # know it exists\n mytutorcomment = te['comment']\n # determine if this tutrole already exists\n thistutrole = Tutrole.where(lesson_id: thislesson.id,\n tutor_id: thistutor.id\n ).first\n if thistutrole # already there\n if thistutrole.comment == mytutorcomment &&\n thistutrole.status == \"\" &&\n thistutrole.kind == \"onSetup\"\n r[\"onSetupupdates\"] += \"|no change #{thistutrole.id}|\"\n else\n if thistutrole.comment != mytutorcomment\n thistutrole.update(comment: mytutorcomment)\n end\n if thistutrole.status != \"\"\n thistutrole.update(status: \"\")\n end\n if thistutrole.kind != \"onSetup\"\n thistutrole.update(kind: \"onSetup\")\n end\n if thistutrole.save\n r[\"onSetupupdates\"] += \"|updated tutrole #{thistutrole.id}|\"\n else\n r[\"onSetupupdates\"] += \"|update failed|\"\n end\n end\n else # need to be created\n thistutrole = Tutrole.new(lesson_id: thislesson.id,\n tutor_id: thistutor.id,\n comment: mytutorcomment,\n status: \"\",\n kind: \"onSetup\")\n if thistutrole.save\n r[\"onSetupupdates\"] += \"|tutrole created #{thistutrole.id}|\"\n else\n r[\"onSetupupdates\"] += \"|tutrole creation failed|\"\n end\n end # if thistutrole\n end\n end\n end # end onSetup \n # third is standard lessons\n # these will have a lesson status of that depends on colour\n # which gets mapped into a status\n # [\"DAVID O\\n| E12 M12 S10 |\"]\n # mylessons = \n #[{tutor =>[name, colour], \n # students=>[[name, colour],[name, colour]],\n # comment => \"\"\n # }, ...{}... ]\n #\n #\n #{\"tutor\"=>[\"ALLYSON B\\n| M12 S12 E10 |\",\n # #<Google::Apis::SheetsV4::Color:0x00000003ef3c80 \n # @blue=0.95686275, @green=0.7607843, @red=0.6431373>],\n # \"students\"=>[\n # [\"Mia Askew 4\", \n # #<Google::Apis::SheetsV4::Color:0x00000003edeab0 \n # @blue=0.972549, @green=0.85490197, @red=0.7882353>],\n # [\"Emily Lomas 6\", \n # #<Google::Apis::SheetsV4::Color:0x00000003eb06d8 \n # @blue=0.827451, @green=0.91764706, @red=0.8509804>]],\n # \"comment\"=>\"Emilija away\"\n #}\n #\n\n # first we need to see if there are already lessons\n # for this tutor in this slot (except Setup & oncall)\n # Check procedure\n # 1. Get all lessons from database in this slot\n # 2. From the database for these lessons, we cache\n # a) all the tutroles (tutors) \n # b) all the roles (students)\n # Tutroles query excludes status \"onSetup\" & \"onCall\"\n # Note: tutroles hold: sessin_id, tutor_id, status, comment\n # 3. Loop through each lesson from the spreadsheet and check\n # Note: if tutor in ss, but not found in database, then add\n # as a comment; same for students\n # a) if tutor or student in the ss for this lesson has either\n # a tutor or student in the database, then that is the \n # lesson to use, ELSE we create a new lesson.\n # This is then the lesson we use for the following steps\n # b) for my tutor in ss, is there a tutrole with this tutor\n # If so, update the tutrole with tutor comments (if changed)\n # If not,\n # i) create a lesson in this slot\n # ii) create a tutrole record linking lesson and tutor\n # Note 1: This lesson is then used for the students.\n # If a student is found in a different lesson in this\n # slot, then they are moved into this lesson.\n # Note 2: there could be tutrole records in db that are not in ss.\n # ---------------------------------------------------------------------\n # Step 1: get all the lessons in this slot\n thislessons = Lesson.where(slot_id: thisslot.id)\n # Step 2: get all the tutrole records for this slot\n # and all the role records for this slot\n alltutroles = Tutrole.where(lesson_id: thislessons.ids).\n where.not(kind: ['onSetup', 'onCall'])\n allroles = Role.where(lesson_id: thislessons.ids)\n # Step 3:\n if(mylessons = r[\"lessons\"]) # this is all the standard\n # ss lessons in this slot\n mylessons.each do |mysess| # treat lesson by lesson from ss\n # process each ss lesson row\n thislesson = nil # ensure all reset\n mylessoncomment = \"\"\n mylessonstatus = \"standard\" # default unless over-ridden\n #\n # Process Tutors, then students, then comments\n # A sesson can have only comments without tutors & students\n #\n # Step 3a - check if tutors present\n # if so, this is the lesson to hang onto.\n # Will check later if the students are in the same lesson.\n flagtutorpresent = flagstudentpresent = FALSE\n #\n # Process tutor\n #\n mytutor = mysess[\"tutor\"] # only process if tutor exists\n # mytutor[0] is ss name string,\n # mytutor[1] is colour\n # mytutor[2] will record the view feedback\n mytutorcomment = \"\" # provide full version in comment\n tutroleupdates = \"\" # feedback for display in view\n if mytutor \n mytutorcomment = mytutor[0]\n mytutornamecontent = findTutorNameComment(mytutor[0], @tutors) \n mytutorstatus = colourToStatus(mytutor[1])[\"tutor-status\"]\n mytutorkind = colourToStatus(mytutor[1])[\"tutor-kind\"]\n if mytutorkind == 'BFL'\n mylessonstatus = 'on_BFL'\n end\n if mytutornamecontent.empty? || # no database names found for this tutor\n mytutornamecontent[0]['name'] == \"\"\n # put ss name cell content into lesson comment\n mylessoncomment += mytutor[0] \n else\n flagtutorpresent = TRUE\n # We have this tutor\n # Find all the tutroles this tutor - this will link\n # to all the lessons this tutor is in.\n # thisslot is the slot we are current populating\n thistutor = Tutor.where(pname: mytutornamecontent[0][\"name\"]).first\n thistutroles = alltutroles.where(tutor_id: thistutor.id)\n if thistutroles.empty? # none there, so create one\n # Step 4ai: Create a new lesson containing\n thislesson = Lesson.new(slot_id: thisslot.id,\n status: mylessonstatus)\n if thislesson.save\n tutroleupdates += \"|lesson created #{thislesson.id}|\"\n else\n tutroleupdates += \"|lesson creation failed\"\n end\n thistutrole = Tutrole.new(lesson_id: thislesson.id,\n tutor_id: thistutor.id,\n comment: mytutorcomment,\n status: mytutorstatus,\n kind: mytutorkind)\n if thistutrole.save\n tutroleupdates += \"|tutrole created #{thistutrole.id}|\"\n else\n tutroleupdates += \"|tutrole creation failed|\"\n end\n else # already exist\n thistutroles.each do |thistutrole1|\n # get the lesson they are in\n thislesson = Lesson.find(thistutrole1.lesson_id)\n if thislesson[:status] != mylessonstatus\n thislesson[:status] = mylessonstatus\n if thislesson.save\n tutroleupdates += \"|updated lesson status #{thislesson.id}|\"\n else \n tutroleupdates += \"|lesson status update failed|\"\n end\n end\n if thistutrole1.comment == mytutorcomment &&\n thistutrole1.status == mytutorstatus &&\n thistutrole1.kind == mytutorkind\n tutroleupdates += \"|no change #{thistutrole1.id}|\"\n else\n if thistutrole1.comment != mytutorcomment\n #thistutrole1.update(comment: mytutorcomment)\n thistutrole1.comment = mytutorcomment end\n if thistutrole1.status != mytutorstatus\n #thistutrole1.update(status: mytutorstatus)\n thistutrole1.status = mytutorstatus\n end\n if thistutrole1.kind != mytutorkind\n #thistutrole1.update(status: mytutorkind)\n thistutrole1.status = mytutorkind\n end\n if thistutrole1.save\n tutroleupdates += \"|updated tutrole #{thistutrole1.id}|\"\n else\n tutroleupdates += \"|update failed|\"\n end\n end\n end # thistutroles.each \n end # if thistutroles.emepty?\n mytutor[2] = tutroleupdates\n end\n end\n #\n # Process students\n #\n mystudents = mysess[\"students\"]\n unless mystudents == nil || mystudents.empty? # there are students in ss\n mystudents.each do |mystudent| # precess each student\n roleupdates = \"\" # records changes to display in view\n mystudentcomment = \"\"\n mystudentstatus = colourToStatus(mystudent[1])[\"student-status\"]\n mystudentkind = colourToStatus(mystudent[1])[\"student-kind\"]\n mystudentnamecontent = findStudentNameComment(mystudent[0], @students) \n if mystudentnamecontent.empty? || # no database names found for this student\n mystudentnamecontent[0]['name'] == \"\"\n # put ss name string into lesson comment\n mylessoncomment += mystudent[0] \n else\n flagstudentpresent = TRUE # we have students\n thisstudent = Student.where(pname: mystudentnamecontent[0][\"name\"]).first\n #logger.debug \"thisstudent: \" + thisstudent.inspect\n thisroles = allroles.where(student_id: thisstudent.id)\n # CHECK if there is already a lesson from the tutor processing \n # Step 4ai: Create a new lesson ONLY if necessary\n unless thislesson\n thislesson = Lesson.new(slot_id: thisslot.id,\n status: mylessonstatus)\n if thislesson.save\n roleupdates += \"|created lesson #{thislesson.id}|\"\n else\n roleupdates += \"|lesson creation failed|\"\n end\n end\n if thisroles.empty? # none there, so create one\n thisrole = Role.new(lesson_id: thislesson.id,\n student_id: thisstudent.id,\n comment: mystudentcomment,\n status: mystudentstatus,\n kind: mystudentkind)\n if thisrole.save\n roleupdates += \"|role created #{thisrole.id}|\"\n else\n roleupdates += \"|role creation failed|\"\n end\n else # already exist\n thisroles.each do |thisrole1|\n # An additional check for students\n # If a student is allocated to a different tutor\n # in the db, then we will move them to this tutor\n # as per the spreadsheet.\n # Note that a student cannot be in a lesson twice.\n if thislesson.id != thisrole1.lesson_id\n # move this student - update the role\n # student can only be in one lesson for a given slot.\n if thisrole1.update(lesson_id: thislesson.id)\n roleupdates += \"|role move updated #{thisrole1.id}|\"\n else\n roleupdates += \"|role move failed|\"\n end\n end\n if thisrole1.comment == mystudentcomment &&\n thisrole1.status == mystudentstatus &&\n thisrole1.kind == mystudentkind\n roleupdates += \"|no change #{thisrole1.id}|\"\n else\n if thisrole1.comment != mystudentcomment\n #thisrole1.update(comment: mystudentcomment)\n thisrole1.comment = mystudentcomment\n end\n if thisrole1.status != mystudentstatus\n #thisrole1.update(status: mystudentstatus)\n thisrole1.status = mystudentstatus\n end\n if thisrole1.kind != mystudentkind\n #thisrole1.update(status: mystudentkind)\n thisrole1.kind = mystudentkind\n end\n if thisrole1.save\n #r[\"roleupdates\"] += \"|role updated #{thisrole1.id}|\"\n roleupdates += \"|role updated #{thisrole1.id}|\"\n else\n #r[\"roleupdates\"] += \"|role update failed #{thisrole1.id}|\"\n roleupdates += \"|role update failed #{thisrole1.id}|\"\n end\n end\n end # thisroles.each \n end # if thisroles.emepty?\n end\n mystudent[2]= roleupdates\n end\n end\n #\n # Process comments\n #\n if mysess[\"comment\"]\n mycomments = mysess[\"comment\"].strip\n mylessoncomment += mycomments if mycomments != \"\"\n end\n # process comments - my have been generated elsewhere (failed tutor\n # and student finds, etc. so still need to be stored away \n if mylessoncomment != \"\" # some lesson comments exist\n # if no lesson exists to place the comments\n # then we need to build one.\n unless thislesson\n # let's see if there is a lesson with this comment\n # looking through the lessons for this slot that do\n # not have a tutor or student\n # Need the sesson that have no tutor or student - already done\n allcommentonlylessons = thislessons -\n thislessons.joins(:tutors, :students).distinct\n # now to see if this comment is in one of these\n allcommentonlylessons.each do |thiscommentlesson|\n if thiscommentlesson.comments == mylessoncomment\n thislesson = thiscommentlesson\n break\n end\n end\n end\n # see if we now have identified a lesson for this comment\n # create one if necessary\n #r[\"commentupdates\"] = \"\"\n unless thislesson\n thislesson = Lesson.new(slot_id: thisslot.id,\n status: 'standard')\n if thislesson.save\n r[\"commentupdates\"] += \"|created session for comments #{thislesson.id}|\"\n else\n r[\"commentupdates\"] += \"|created session for comments failed|\"\n end\n end\n if mylessoncomment == thislesson.comments\n r[\"commentupdates\"] += \"|no change #{thislesson.id}|\"\n else\n thislesson.update(comments: mylessoncomment)\n if thislesson.save\n r[\"commentupdates\"] += \"|updated lesson comment #{thislesson.id}|\"\n else\n r[\"commentupdates\"] += \"|lesson comment update failed #{thislesson.id}|\"\n end \n end\n end\n end\n end\n end\n end", "def process\n # Load each row element\n 2.upto(@rows).each do |row_index|\n ActiveRecord::Base.transaction do\n begin\n load_data row: @spreadsheet.row(row_index)\n\n rescue => e\n add_error message: e.message, backtrace: e.backtrace, row_index: row_index, data: @spreadsheet.row(row_index)\n\n raise ActiveRecord::Rollback\n end\n end\n end\n end", "def validate_sheet!(sheet)\n super\n # establish our sheet lookups so we don't do this each cell assignment\n @cell_type[sheet] ||= {}\n @formula[sheet] ||= {}\n @cell[sheet] ||= {}\n @fonts[sheet] ||= {}\n end", "def run\n parse do\n self.current_sheet.processing!\n ss = Roo::Spreadsheet.open(self.new_file_path)\n current_uploader = Uploader.find(self.uploader_id)\n total_count = ss.last_row - 1\n current_uploader.update_total_row(total_count)\n case current_uploader.category\n when Uploader::TYPES[:default]\n upload_indicator(ss, current_uploader)\n when Uploader::TYPES[:indicator_2_0]\n upload_health_care_indicators(ss, current_uploader)\n when Uploader::TYPES[:resources]\n upload_resources(ss, current_uploader)\n when Uploader::TYPES[:indicator_map_color]\n upload_indicators_map_color(ss, current_uploader)\n else\n upload_description_template(ss, current_uploader)\n end\n end\n self.current_sheet.completed!\n end", "def process!\n if valid?\n # get the csv rows as an array of hashes\n setup_data\n raw_csv_data = compute_csv_data\n # remove duplicate rows in the csv file (by email or name)\n prefilterted_csv_data = prefilter_csv_data raw_csv_data\n # remove the rows that match emails in the database\n new_data = filter_data_through_db prefilterted_csv_data\n\n # crate a new users\n resolved_data = create_new_user_records new_data\n end\n @rejected_user_data\n end", "def upload_validate_student\n student_file = params[:excel_file]\n file = ExcelUploader.new\n file.store!(student_file)\n book = Spreadsheet.open \"#{file.store_path}\"\n sheet1 = book.worksheet 0\n @students = []\n @errors = Hash.new\n @counter = 0\n\n sheet1.each 1 do |row|\n @counter+=1\n cur_student = Student.new\n # Populate Fields\n cur_student.ser_no = row[0]\n cur_student.district = row[1]\n cur_student.taluka = row[2]\n cur_student.vp_id = row[3]\n cur_student.first_name = row[4]\n cur_student.father_name = row[5]\n cur_student.pmt_full_address = row[6]\n cur_student.cur_full_address = row[7]\n cur_student.primary_phone = row[8]\n cur_student.additional_phone = row[9]\n cur_student.father_occupation = row[10]\n cur_student.mother_occupation = row[11]\n cur_student.total_family_income = row[12]\n # Gender format changes\n if ((row[13] == \"B\") || (row[13] == \"Boy\") || (row[13] == \"M\") || (row[13] == \"Male\"))\n cur_student.gender = \"Boy\"\n elsif ((row[13] == \"G\") || (row[13] == \"Girl\") || (row[13] == \"F\") || (row[13] == \"Female\"))\n cur_student.gender = \"Girl\"\n else\n cur_student.gender = row[13]\n end\n\n # AreaType format changes\n if ((row[14] == \"R\") || (row[14] == \"Rural\"))\n cur_student.area_type = \"Rural\"\n elsif ((row[14] == \"U\") || (row[14] == \"Urban\"))\n cur_student.area_type = \"Urban\"\n else\n cur_student.area_type = row[14]\n end\n\n cur_student.caste = row[15]\n cur_student.studied_medium = row[16]\n cur_student.cet_rank = row[17]\n cur_student.sslc_percentage = row[18]\n cur_student.exam_ticket_number = row[19]\n cur_student.account_number = row[20]\n cur_student.atm_number = row[21]\n cur_student.house_visited_by = row[22]\n cur_student.last_year_donor = row[23]\n cur_student.present_year_donor = row[24]\n cur_student.comments = row[25]\n\t\t\t# For passing validations\n\t\t\tcur_student.last_name = \".\"\n\n\t\t\t# Check validity\n if cur_student.valid?\n @students << cur_student\n # Save the data to DB on success validation for each entry\n cur_student.save\n else\n @errors[\"#{@counter+1}\"] = cur_student.errors\n end\n end\n file.remove!\n end", "def perform(xlsx_file)\n Solution.destroy_all\n\n xlsx = Roo::Spreadsheet.open(xlsx_file)\n xlsx.default_sheet = xlsx.sheets[1]\n\n (3..xlsx.last_row).each do |row|\n record = xlsx.row(row)\n\n # attributes with _ are pending\n solution = Solution.create(\n number: record[0],\n # _sector: record[1],\n # _subsector: record[2],\n title: record[3],\n description: record[4],\n solution_of: solution_of_helper(record[5]),\n guiding_public_policies: record[6],\n technical_references: record[7],\n examples_of_municipal_application: record[8],\n applicable_regions: applicable_regions_helper(record[9]),\n applicable_population_ranges: applicable_population_ranges_helper(record[10]),\n fundamental_sector: fundamental_sector_helper(record[11]),\n impact_on_emissions: impact_on_emissions_helper(record[12]),\n action_category: record[13],\n sustainable_development_goals: sustainable_development_goals_helper(record[14]),\n environmental_cobenefits: record[15],\n social_cobenefits: record[16],\n economic_cobenefits: record[17],\n sphere: sphere_helper(record[18]),\n municipal_operating_mode: record[19],\n alignment_with_ndc: record[20],\n necessary_investment: record[21],\n financing: record[22],\n key_actors: record[23],\n challenges: record[24],\n implementation_time: record[25]\n )\n end\n end", "def validate_input()\n#open up inputs.json\n IO.foreach(\"./inputs/inputs.json\"){ |line|\n #puts line;\n #right now all the json inputs comes in one line\n @metaJsonInput = @metaJsonInput + line;\n }\n jsonObj = JSON.parse(@metaJsonInput)\n @annotationsPermHash[\"uri\"] = jsonObj[\"uri\"];\n\n mail_address = jsonObj[\"mail_address\"];\n @annotationsPermHash[\"mail_address\"] = mail_address;\n if (mail_address == nil)then\n @annotationsPermHash[\"mail_address\"] = 'jlin@systemsbiology.org';\n end\n\n #if file does not exist, create error message and logged and return\n filename = jsonObj[\"filename\"];\n @annotationsPermHash[\"file\"] = filename;\n #if file is not defined, then create error message and logged, exit program\n if (filename == nil) then\n puts \"filename is null, set error to error log and exit program\"\n errorLogFile = File.open(\"./logs/validation_error.log\", \"w\")\n errorLogFile.write(\"Fatal error: Input Filename does not exist, program exiting(-1)\")\n errorLogFile.close\n exit(-1)\n end\n method = jsonObj[\"method\"];\n findex = filename.index(\".xls\")\n if (findex != nil && findex > 1) then\n @annotationsWarningHash[\"xls_warning\"] = \"Converting xls to csv\";\n @xlsInFile = \"./inputs/\" + filename;\n convertXsl();\n csv_filename = filename.sub('.xls', '_xls_.csv'); \n if (filename.index('xlsx') != nil) then\n #puts \"xls file\" + ARGV[0]\n csv_filename = filename.sub('.xlsx', '_xlsx_.csv'); # \"Array[0] + '.csv';\n end\n @annotationsPermHash[\"file\"] = csv_filename;\n end\n #puts method;\n @annotationsPermHash[\"method\"] = method;\n #if method is not defined or not one of the possible options, then go with PWM\n if ( (method == nil) || ( (method.downcase != 'ml') && (method.downcase != 'pwm') && (method.downcase != 'mom') ) ) then\n #puts \"method is null, set default\"\n @annotationsPermHash[\"method\"] = 'PWM';\n @annotationsWarningHash[\"method_warning\"] = \"No (existing) method to estimate GPD parameters is selected, default set to PWM\";\n end\n\n mode = jsonObj[\"mode\"];\n @annotationsPermHash[\"mode\"] = mode;\n #if method is not defined or not one of the possible options, then go with PWM\n if ( (mode == nil) || ( (mode.downcase != 'pv') && (mode.downcase != 'sam') && (mode.downcase != 'gsea') ) ) then\n mode = 'PV';\n @annotationsPermHash[\"mode\"] = 'PV';\n @annotationsWarningHash[\"mode_warning\"] = \"Empty or invalid mode value found, default set to PV\";\n end\n \n if (mode.downcase == 'gsea' || mode.downcase == 'sam') then\n resptype = jsonObj[\"resptype\"];\n @annotationsPermHash[\"resptype\"] = resptype;\n if ( (resptype == nil) || ( (resptype.downcase != 'quantitative') && (resptype.downcase != 'two class unpaired') && (resptype.downcase != 'survival') && (resptype.downcase != 'multiclass') && (resptype.downcase != 'two class paired') ) ) then\n \t @annotationsPermHash[\"resptype\"] = 'Two class unpaired';\n \t @annotationsWarningHash[\"resp_warning\"] = \"Empty or invalid resptype value found, default set to Two class unpaired\";\n \t end\n\n nperms = jsonObj[\"nperms\"];\n @annotationsPermHash[\"nperms\"] = nperms;\n if (nperms == nil || (is_a_number?(nperms) == false ))then\n \t\t@annotationsPermHash[\"nperms\"] = '1000';\n \t\t@annotationsWarningHash[\"nperms_warning\"] = \"NPerms variable does not exist or value is not one of the possible values, default set to 1000\";\n end\n if (mode.downcase == 'gsea') then\n \t\tgsa_method = jsonObj[\"gsa_method\"];\n \t\t@annotationsPermHash[\"gsa_method\"] = gsa_method;\n \t\tif ( (gsa_method == nil) || ( (gsa_method.downcase != 'maxmean') && (gsa_method.downcase != 'mean') && (gsa_method.downcase != 'absmean') ) ) then\n \t\t\t@annotationsPermHash[\"gsa_method\"] = 'maxmean';\n \t\t@annotationsWarningHash[\"gsa_method_warning\"] = \"Invalid gsa_method value found, default set to maxmean\";\n \t\tend\n\t\tgsfile = jsonObj[\"gsfile\"];\n \t\t@annotationsPermHash[\"gsfile\"] = gsfile;\n \t\tif (gsfile == nil) then\n \t\t\tputs \"GS filename is null, set error to error log and exit program\"\n \t\t\terrorLogFile = File.open(\"./logs/validation_error.log\", \"w\")\n \t\t\terrorLogFile.write(\"Fatal error: GSEA Mode, gene set file does not exist, program exiting(-1)\")\n \t\t\terrorLogFile.close\n \t\t\texit(-1)\n \t\tend\n end\n end\n rseed = jsonObj[\"rseed\"];\n @annotationsPermHash[\"rseed\"] = rseed;\n if (rseed == nil || (is_a_number?(rseed) == false ))then\n @annotationsPermHash[\"rseed\"] = '0';\n @annotationsWarningHash[\"rseed_warning\"] = \"Empty or random seed variable does not exist or value is not one of the possible values, default set to 0\";\n end\n\n\t \n cc_chk = jsonObj[\"cc_chk\"];\n @annotationsPermHash[\"cc_chk\"] = cc_chk;\n if (cc_chk == nil) then\n @annotationsPermHash[\"cc_chk\"] = 'false';\n cc_chk = 'false';\n else\n if ((cc_chk.downcase != 'true') && (cc_chk.downcase != 'false') && (cc_chk.downcase != 'on'))then\n @annotationsPermHash[\"cc_chk\"] = 'false';\n cc_chk = 'false';\n @annotationsWarningHash[\"cc_chk_warning\"] = \"Convergence criterium variable does not exist or value is not one of the possible values, default set to false\";\n end\n end\n\n if (cc_chk.downcase == 'on') then\n @annotationsPermHash[\"cc_chk\"] = 'true';\n end\n\n ci_chk = jsonObj[\"ci_chk\"];\n @annotationsPermHash[\"ci_chk\"] = ci_chk;\n if (ci_chk == nil) then\n @annotationsPermHash[\"ci_chk\"] = 'true';\n ci_chk = 'true';\n else\n if ((ci_chk.downcase != 'true') && (ci_chk.downcase != 'false') && (ci_chk.downcase != 'on')) then\n @annotationsPermHash[\"ci_chk\"] = 'true';\n ci_chk = 'true';\n @annotationsWarningHash[\"ci_chk_warning\"] = \"Confidence interval computation variable does not exist or value is not one of the possible values, dfault set to true\";\n end\n end\n \n if (ci_chk.downcase == 'on') then\n @annotationsPermHash[\"ci_chk\"] = 'true';\n end\n\n civ = jsonObj[\"ci\"];\n @annotationsPermHash[\"ci\"] = civ;\n if (civ == nil || (is_a_number?(civ) == false ))then\n @annotationsPermHash[\"ci\"] = '95';\n @annotationsWarningHash[\"ci_warning\"] = \"Confidence interval variable does not exist or value is not one of the possible values, default set to 95\";\n end\n if (is_a_number?(civ) == true) then\n if (civ.to_i < 1 || civ.to_i > 99) then\n @annotationsPermHash[\"ci\"] = '95'; @annotationsWarningHash[\"ci_warning\"] = \"Confidence interval variable does not exist or value is not one of the possible values,\n default set to 95\";\n end\n end\n\n oopt_chk = jsonObj[\"oopt_chk\"];\n @annotationsPermHash[\"oopt_chk\"] = oopt_chk;\n if (oopt_chk == nil) then\n oopt_chk = 'false';\n @annotationsPermHash[\"oopt_chk\"] = 'false';\n else\n if ((oopt_chk.downcase != 'true') && (oopt_chk.downcase != 'false') && (oopt_chk.downcase != 'on'))then\n \toopt_chk = 'false';\n \t@annotationsPermHash[\"oopt_chk\"] = 'false';\n \t@annotationsWarningHash[\"oopt_chk_warning\"] = \"Optimal order preserving transform variable does not exist or value is not one of the possible values, default set to false\";\n end\n end\n\n if (oopt_chk.downcase == 'on') then\n @annotationsPermHash[\"oopt_chk\"] = 'true';\n end\n\n\n warningLogFile = File.open(\"./logs/validation_warning.log\", \"w\")\n @annotationsWarningHash.each { |key, value| warningLogFile.write(key + ' = ' + value + \"\\n\") }\n warningLogFile.close\n generateCustom()\n end", "def upload_validate_donor\n donor_file = params[:excel_file]\n file = ExcelUploader.new\n file.store!(donor_file)\n book = Spreadsheet.open \"#{file.store_path}\"\n sheet1 = book.worksheet 0\n @donors = []\n @errors = Hash.new\n @counter = 0\n\n sheet1.each 1 do |row|\n @counter+=1\n cur_donor = Donor.new\n # Populate Fields\n cur_donor.ser_no = row[0]\n cur_donor.title = row[1]\n cur_donor.first_name = row[2]\n\n # Last Name formatting\n if row[3].blank?\n cur_donor.last_name = \".\"\n else\n cur_donor.last_name = row[3]\n end\n\n # Gender format changes\n if ((row[4] == \"B\") || (row[4] == \"Boy\") || (row[4] == \"M\") || (row[4] == \"Male\"))\n cur_donor.gender = \"Male\"\n elsif ((row[4] == \"G\") || (row[4] == \"Girl\") || (row[4] == \"F\") || (row[4] == \"Female\"))\n cur_donor.gender = \"Female\"\n else\n cur_donor.gender = row[4]\n end\n\n cur_donor.email = row[5]\n cur_donor.address_first_line = row[6]\n cur_donor.address_second_line = row[7]\n cur_donor.address_landmark = row[8]\n cur_donor.district = row[9]\n cur_donor.city = row[10]\n cur_donor.state = row[11]\n cur_donor.country = row[12]\n cur_donor.pincode = row[13]\n cur_donor.phone = row[14].to_s\n cur_donor.mobile = row[15].to_s.to_s\n cur_donor.donor_type = row[16]\n cur_donor.comment = row[17]\n\n if cur_donor.valid?\n @donors << cur_donor\n # Save the data to DB on success validation for each entry\n cur_donor.save\n else\n @errors[\"#{@counter+1}\"] = cur_donor.errors\n end\n end\n file.remove!\n end", "def loadtutors\n #service = googleauthorisation(request)\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n spreadsheet_id = current_user[:ssurl].match(/spreadsheets\\/d\\/(.*?)\\//)[1]\n #spreadsheet_id = '1CbtBqeHyYb9jRmROCgItS2eEaYSwzOMpQZdUWLMvjng'\n logger.debug 'about to read spreadsheet - service ' + service.inspect\n # Need some new code to cater for variation in the spreadsheet columns.\n # Will build an array with 'column names' = 'column numbers'\n # This can then be used to identify columns by name rather than numbers.\n #\n #this function converts spreadsheet indices to column name\n # examples: e[0] => A; e[30] => AE \n e=->n{a=?A;n.times{a.next!};a} \n columnmap = Hash.new # {'column name' => 'column number'}\n range = \"TUTORS!A3:LU3\"\n response = service.get_spreadsheet_values(spreadsheet_id, range)\n headerrow = response.values[0]\n logger.debug \"response: \" + headerrow.inspect\n headerrow.each_with_index do |value, index| \n columnmap[value] = index\n end\n logger.debug \"columnmap: \" + columnmap.inspect\n #readcolumns = Array.new\n\n # pname: t[1],\n # subjects: t[2],\n # phone: t[3],\n # email: t[4],\n # sname: t[5],\n # comment: t[6],\n \n # Derived fields\n # status: \"active\" unless prefixed with zz..\n # firstaid: \"yes\" if name has suffix +\n # firstsesson: \"yes\" if name has suffix *\n\n readcolumns = [ 'NAME + INITIAL',\n 'SUBJECTS',\n 'MOBILE',\n 'EMAIL',\n 'SURNAME',\n 'NOTES'\n ]\n colerrors = \"\"\n readcolumns.each_with_index do |k, index|\n unless columnmap[k] \n colerrors += k + ':'\n end \n end\n # ensure we can read all the required spreadsheet column\n # if not, terminate and provide a user message\n unless colerrors.length == 0 # anything put into error string\n colerrors = \"Load Tutors - not all columns are findable: \" + colerrors\n redirect_to load_path, notice: colerrors\n return\n end\n # have everything we need, load the tutors from the spreadsheet\n # placing info into @tutors.\n startrow = 4 # row where the loaded data starts \n flagFirstPass = 1\n readcolumns.each_with_index do |k, index|\n columnid = e[columnmap[k]]\n range = \"TUTORS!#{columnid}#{startrow}:#{columnid}\"\n response = service.get_spreadsheet_values(spreadsheet_id, range)\n if flagFirstPass == 1\n @tutors = Array.new(response.values.length){Array.new(9)}\n for rowcount in 0..response.values.count-1 \n \t @tutors[rowcount][0] = rowcount + startrow\n end\n flagFirstPass = 0\n end\n #rowcount = 0\n #response.values.each do |r|\n #for rowcount in 0..response.values.count \n response.values.each_with_index do |c, rowindex|\n \t @tutors[rowindex ][index + 1] = c[0]\n \t #bc = v.effective_format.background_color\n \t #logger.debug \"background color: red=\" + bc.red.to_s +\n \t # \" green=\" + bc.green.to_s +\n \t\t # \" blue=\" + bc.blue.to_s\n end \n end\n\n #logger.debug \"tutors: \" + @tutors.inspect\n # Now to update the database\n loopcount = 0\n @tutors.each do |t| # step through all tutors from the spreadsheet\n t[7] = \"\"\n pname = t[1]\n logger.debug \"pname: \" + pname.inspect\n if pname == \"\" || pname == nil\n t[7] = t[7] + \"invalid pname - do nothing\"\n next\n end\n # determine status from name content - been marked by leading z...\n thisstatus = \"active\"\n if m = pname.match(/(^z+)(.+)$/) # removing leading z.. (inactive entries)\n pname = m[2].strip\n thisstatus = \"inactive\"\n #t[1] = pname\n end\n # look for + (firstaid:) * (firstsession) at end of pname \n # (first aid trained or first session trained)\n thisfirstaid = 'no'\n thisfirstlesson = 'no'\n if m = pname.match(/([+* ]+)$/)\n thisfirstaid = (m[1].include?('+') ? 'yes' : 'no')\n thisfirstlesson = (m[1].include?('*') ? 'yes' : 'no')\n pname = pname.gsub($1, '') unless $1.strip.length == 0\n end\n pname = pname.strip\n \n db_tutor = Tutor.find_by pname: pname\n if(db_tutor) # already in the database\n flagupdate = 0 # detect if any fields change\n updatetext = \"\"\n if db_tutor.comment != t[6]\n db_tutor.comment = t[6]\n flagupdate = 1\n updatetext = updatetext + \" - comment\" \n end\n if db_tutor.sname != t[5]\n db_tutor.sname = t[5]\n flagupdate = 1\n updatetext = updatetext + \" - sname\" \n end\n if db_tutor.email != t[4]\n db_tutor.email = t[4]\n flagupdate = 1\n updatetext = updatetext + \" - email\" \n end\n if db_tutor.phone != t[3]\n db_tutor.phone = t[3]\n flagupdate = 1\n updatetext = updatetext + \" - phone\" \n end\n if db_tutor.subjects != t[2]\n db_tutor.subjects = t[2]\n flagupdate = 1\n updatetext = updatetext + \" - subjects\" \n end\n if db_tutor.status != thisstatus \n db_tutor.status = thisstatus\n flagupdate = 1\n updatetext = updatetext + \" - status\" \n end\n if db_tutor.firstaid != thisfirstaid \n db_tutor.firstaid = thisfirstaid\n flagupdate = 1\n updatetext = updatetext + \" - firstaid\" \n end\n if db_tutor.firstlesson != thisfirstlesson\n db_tutor.firstlesson = thisfirstlesson\n flagupdate = 1\n updatetext = updatetext + \" - firstlesson\" \n end\n logger.debug \"flagupdate: \" + flagupdate.inspect + \" db_tutor: \" + db_tutor.inspect\n if flagupdate == 1 # something changed - need to save\n if db_tutor.save\n logger.debug \"db_tutor saved changes successfully\"\n t[7] = t[7] + \"updated\" + updatetext \n else\n logger.debug \"db_tutor saving failed - \" + @db_tutor.errors\n t[7] = t[7] + \"failed to create\"\n end\n else\n t[7] = t[7] + \"no changes\"\n end\n else\n # This tutor is not in the database - so need to add it.\n @db_tutor = Tutor.new(\n pname: pname,\n subjects: t[2],\n phone: t[3],\n email: t[4],\n sname: t[5],\n comment: t[6],\n status: thisstatus,\n firstlesson: thisfirstlesson,\n firstaid: thisfirstaid\n )\n #if pname =~ /^zz/ # the way they show inactive tutors\n #if t[1] =~ /^zz/ # the way they show inactive tutors\n # @db_tutor.status = \"inactive\"\n #end\n logger.debug \"new - db_tutor: \" + @db_tutor.inspect\n if @db_tutor.save\n logger.debug \"db_tutor saved successfully\"\n t[7] = t[7] + \"created\" \n else\n logger.debug \"db_tutor saving failed - \" + @db_tutor.errors.inspect\n t[7] = t[7] + \"failed to create\"\n end\n end\n #exit\n if loopcount > 5\n #break\n end\n loopcount += 1\n end\n #exit\n end", "def fill_timesheet\n rows = []\n last_date = nil\n filled_in = false\n\n parse_timesheet.each do |data|\n department = data[6]\n employee_id = data[7]\n date = Date.parse(CGI.unescape(data[1])).strftime('%m/%d/%Y')\n\n # skip days with data already filled (like holidays)\n if data[0].to_i > 0 or (filled_in and date == last_date) then\n filled_in = true\n last_date = date\n next\n end\n\n filled_in = false\n\n start, finish = starting_and_ending_timestamp date, last_date\n\n rows << [\n '0', '', 'False', 'True', 'False', 'False', 'False',\n \"#{date} 12:00:00 AM\",\n start, '',\n finish,\n '8', '',\n department,\n employee_id,\n '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',\n '', '', '', 'EDIT', '', '', '', '', '2', '', '0', 'False'\n ]\n\n # This reset is for the timestamp calculations.\n last_date = date\n end\n\n @page = @page.form('Form1') { |form|\n ## FIXME: Fill out this form\n form['hdnRETURNDATA'] = rows.map { |row|\n row.map { |value|\n CGI.escape(value)\n }.join('~~')\n }.join('~||~')\n\n form['__EVENTTARGET'] = 'TG:btnSubmitTop'\n form['__PageDirty'] = 'True'\n }.submit\n end", "def readWorkbook\n # open the speadsheet\n workbook = Roo::Spreadsheet.open(params[:file], extension: :xlsx)\n\n workbook.default_sheet = 'Rating'\n\n @policy.name= workbook.cell('C',3)\n @policy.quoted_by= workbook.cell('B',1)\n #@policy.date= workbook.cell('B',2)\n @policy.effective_date= workbook.cell('F',7)\n @policy.expiration_date= workbook.cell('J',7)\n\n @policy.dba= workbook.cell('B',4),\n @policy.business_type= workbook.cell('L',5)\n @policy.mortgagee= workbook.cell('S',3)\n\n @policy.street= workbook.cell('C',5)\n @policy.city= workbook.cell('B',6)\n @policy.state= workbook.cell('G',6)\n @policy.zip= workbook.cell('K',6).to_i.to_s\n\n # Property\n @policy.property.schedule_rating_pct= workbook.cell('J',36)\n @policy.property.premium_subtotal= workbook.cell('J',35)\n @policy.property.premium_total= workbook.cell('M',41)\n\n @policy.property.locations.destroy_all # no duplicates\n # First location (locations.first)\n #locationFields = {\n @policy.property.locations.create!(\n number: 1, premium: workbook.cell('N',33),\n co_ins: workbook.cell('L',14), co_ins_factor: workbook.cell('L',15),\n ded: workbook.cell('B',15), ded_factor: workbook.cell('G',15),\n\n street: workbook.cell('C',10), city: workbook.cell('B',11),\n state: workbook.cell('G',11), zip: workbook.cell('K',11).to_i.to_s,\n\n business_type: workbook.cell('L',10), coverage_type: workbook.cell('D',12),\n protection_class: workbook.cell('L',12), updates: workbook.cell('K',13),\n year_built: workbook.cell('B',13).to_i.to_s, construction_type: workbook.cell('H',13),\n stories: workbook.cell('E',13).to_i, square_feet: workbook.cell('B',14).to_i,\n parking_lot: workbook.cell('H',14).to_i,\n\n #food_limit: workbook.cell('F',17),\n food_rate: workbook.cell('H',17),\n food_premium: workbook.cell('J',17),\n\n theft_limit: workbook.cell('F',18),\n #theft_rate: workbook.cell('H',18),\n theft_premium: workbook.cell('J',18),\n\n #enhc_limit: workbook.cell('F',19),\n enhc_rate: workbook.cell('H',19),\n enhc_premium: workbook.cell('J',19),\n\n #mech_limit: workbook.cell('F',20),\n #mech_rate: workbook.cell('H',20),\n mech_premium: workbook.cell('J',20)\n )\n #if (!@policy.property.locations.where(number:1).exists?)\n #@policy.property.locations.create!(locationFields)\n\n for i in 23..29 do\n @policy.property.locations.first.exposures.create!(\n name: (workbook.cell('A',i) || \"\"),\n valuation: (workbook.cell('D',i) || \"\"),\n limit: (workbook.cell('F',i) || 0),\n rate: (workbook.cell('H',i) || 0),\n ded_factor: (workbook.cell('J',i) || 0),\n co_ins_factor: (workbook.cell('L',i) || 0),\n premium: (workbook.cell('O',i) || 0)\n )\n end\n #else\n #@policy.property.locations.first.update(locationFields)\n #end\n\n # Earnings should have all 0s\n @policy.property.locations.first.exposures.third.update(valuation: 0,\n ded_factor: 0, co_ins_factor: 0 )\n\n # Second location (locations.second) (optional)\n if (workbook.cell('T',10) != nil)\n @policy.property.locations.create!(\n number: 2, premium: workbook.cell('AE',33), co_ins: workbook.cell('AC',14),\n co_ins_factor: workbook.cell('AC',15), ded: workbook.cell('S',15),\n ded_factor: workbook.cell('X',15),\n\n street: workbook.cell('T',10), city: workbook.cell('S',11),\n state: workbook.cell('X',11), zip: workbook.cell('AB',11).to_i.to_s,\n\n business_type: workbook.cell('AC',10), coverage_type: workbook.cell('U',12),\n protection_class: workbook.cell('AC',12), updates: workbook.cell('AB',13),\n year_built: workbook.cell('S',13), construction_type: workbook.cell('Y',13),\n stories: workbook.cell('V',13).to_i, square_feet: workbook.cell('S',14).to_i,\n parking_lot: workbook.cell('Y',14).to_i,\n\n #food_limit: workbook.cell('W',17),\n food_rate: workbook.cell('Y',17),\n food_premium: workbook.cell('AA',17),\n\n theft_limit: workbook.cell('W',18),\n #theft_rate: workbook.cell('Y',18),\n theft_premium: workbook.cell('AA',18),\n\n #enhc_limit: workbook.cell('W',19),\n enhc_rate: workbook.cell('Y',19),\n enhc_premium: workbook.cell('AA',19),\n\n #mech_limit: workbook.cell('W',20),\n #mech_rate: workbook.cell('Y',20),\n mech_premium: workbook.cell('AA',20)\n )\n\n for i in 23..29 do\n @policy.property.locations.second.exposures.create!(\n name: (workbook.cell('R',i) || \"\"),\n valuation: (workbook.cell('U',i) || \"\"),\n limit: (workbook.cell('W',i) || 0),\n rate: (workbook.cell('Y',i) || 0),\n ded_factor: (workbook.cell('AA',i) || 0),\n co_ins_factor: (workbook.cell('AC',i) || 0),\n premium: (workbook.cell('AF',i) || 0)\n )\n end\n\n # Earnings should have all 0s\n @policy.property.locations.second.exposures.third.update(valuation: 0,\n ded_factor: 0, co_ins_factor: 0 )\n end\n\n # Crime\n @policy.crime.premium_total= workbook.cell('M',62)\n @policy.crime.premium_subtotal= workbook.cell('J',56)\n @policy.crime.schedule_rating= workbook.cell('J',57)\n @policy.crime.burglar_alarm= workbook.cell('F',44)\n @policy.crime.exclude_safe= workbook.cell('F',45)\n @policy.crime.ded= workbook.cell('K',44)\n\n @policy.crime.exposures.destroy_all # no duplications\n\n for i in 47..51 do\n @policy.crime.exposures.create!(\n name: workbook.cell('A',i), limit: workbook.cell('F',i),\n premium: workbook.cell('K',i)\n )\n end\n\n @policy.gl.exposure_gls.destroy_all # no duplications\n\n for i in 76..84 do\n if (workbook.cell('A',i) != nil)\n @policy.gl.exposure_gls.create!(\n name: \"exposure_#{i-75}\",\n loc_number: workbook.cell('A',i),\n description: workbook.cell('C',i),\n cov: workbook.cell('B',i),\n code: workbook.cell('H',i),\n premium_basis: workbook.cell('I',i),\n sales_type: workbook.cell('K',i),\n base_rate: workbook.cell('M',i),\n ilf: workbook.cell('O',i),\n premium: workbook.cell('Q',i)\n )\n end\n end\n\n @policy.gl.gas_premium= workbook.cell('M',88)\n @policy.gl.rate= workbook.cell('J',88)\n @policy.gl.water_gas_tank= workbook.cell('F',88)\n @policy.gl.add_ins_number= workbook.cell('F',87)\n @policy.gl.territory= workbook.cell('B',65).to_i\n @policy.gl.comments= (workbook.cell('B',99) || \"none\")\n\n @policy.gl.gen_agg= workbook.cell('F',67)\n @policy.gl.products_completed_operations= workbook.cell('F',68)\n @policy.gl.personal_advertising_injury= workbook.cell('F',69)\n @policy.gl.each_occurence= workbook.cell('F',70)\n @policy.gl.fire_damage= workbook.cell('F',71)\n @policy.gl.medical_expense= workbook.cell('F',72)\n\n if (workbook.cell('A',89) == nil)\n # General Liability\n @policy.gl.premium_total= workbook.cell('N',99)\n @policy.gl.premium_subtotal= workbook.cell('Q',89)\n @policy.gl.schedule_rating= workbook.cell('Q',91)\n @policy.gl.multi_loc_factor= workbook.cell('Q',90)\n\n # Commerical Auto\n @policy.auto.premium_total= workbook.cell('N',107)\n @policy.auto.locations= workbook.cell('K',102)\n @policy.auto.hired_auto= workbook.cell('F',103)\n @policy.auto.hired_auto_premium= workbook.cell('Q',103)\n\n @policy.package_premium_total= workbook.cell('N',109)\n else\n # General Liability\n @policy.gl.premium_total= workbook.cell('N',101)\n @policy.gl.premium_subtotal= workbook.cell('Q',91)\n @policy.gl.schedule_rating= workbook.cell('Q',93)\n @policy.gl.multi_loc_factor= workbook.cell('Q',92)\n\n # Commerical Auto\n @policy.auto.premium_total= workbook.cell('N',109)\n @policy.auto.locations= workbook.cell('K',104)\n @policy.auto.hired_auto= workbook.cell('F',105)\n @policy.auto.hired_auto_premium= workbook.cell('Q',105)\n\n @policy.package_premium_total= workbook.cell('N',111)\n end\n end", "def parse_ri_goals_xls(path_to_xls)\n spreadsheet = Spreadsheet.open path_to_xls\n sheet = spreadsheet.worksheet 'Science'\n domain_regex = @domains.keys.join(\"|\")\n regex = /(#{domain_regex})(\\d+)\\(([K|0-9]\\s*[-|#{EMDASH}]\\s*[K|0-9]+)\\)\\s*[-|#{EMDASH}]\\s*([0-9]+)([a-b])(.+)/\n sheet.each do |row| \n if (row[1])\n begin\n matches = (row[1]).match(regex) # we are only after column #2\n if (matches) # PS3(9-11)-10b Comparing and contrasting electromagnetic waves to mechanical waves.\n (domain_key,someNumber,grade_span,target_number,expectaton_ordinal,description) = matches.captures\n if (domain_key)\n if (domain_key !=\"PS\") # we already have all of these\n expectation = RiGse::Expectation.new(:description => description, :ordinal => expectaton_ordinal)\n expectation.save\n end\n end\n end\n rescue\n logger.warn \"problem reading #{row} / #{sheet}\"\n end\n end\n end\n end", "def initialize(spreadsheetkey,user=nil,password=nil)\n @filename = spreadsheetkey\n @spreadsheetkey = spreadsheetkey\n @user = user\n @password = password\n unless user\n user = ENV['GOOGLE_MAIL']\n end\n unless password\n password = ENV['GOOGLE_PASSWORD']\n end\n @cell = Hash.new {|h,k| h[k]=Hash.new}\n @cell_type = Hash.new {|h,k| h[k]=Hash.new}\n @formula = Hash.new\n @first_row = Hash.new\n @last_row = Hash.new\n @first_column = Hash.new\n @last_column = Hash.new\n @cells_read = Hash.new\n @header_line = 1\n @date_format = '%d/%m/%Y'\n @datetime_format = '%d/%m/%Y %H:%M:%S' \n @time_format = '%H:%M:%S'\n @gs = GData::Spreadsheet.new(spreadsheetkey)\n @gs.authenticate(user, password) unless user.empty? || password.empty?\n @sheetlist = @gs.sheetlist\n @default_sheet = self.sheets.first\n end", "def create\n # Create the spreadsheet file in /tmp and write the file's contents to it\n filename = \"#{DateTime.now.strftime(\"%Y%m%d%H%M%S\")}_sheet.xls\"\n data = params[:file].read\n spreadsheet_file = File.new(\"#{RAILS_ROOT}/tmp/#{filename}\", 'w+')\n spreadsheet_file.write(data)\n spreadsheet_file.close\n \n begin\n # Create a new instance of DatabaseUpdate for this spreadsheet. \n # NOTE: All the work of running the update on the database is handled\n # inside the DatabaseUpdate class on its first instantiation. i.e., upon create.\n @dbup = DatabaseUpdate.create(:spreadsheet_path => spreadsheet_file.path)\n redirect_to @dbup\n rescue CallLogExceptions::InvalidSpreadsheetError\n # DatabaseUpdate has thrown an error related to the format of the spreadsheet. Alert the user.\n flash[:error] = \"<strong>The spreadsheet you provided is not in the anticipated format.</strong><br/>Please correct the sheet and try again.\"\n redirect_to home_url(Person.find(session[:user_id]))\n end\n end", "def init()\n\n p \"=======================\"\n p \"Iniciando o script...\"\n\n #\n # First Step\n # => Open file\n ############################\n data = Roo::Spreadsheet.open('./data/exemplo-curto.xlsx')\n p \"Abrindo o arquivo\"\n persons = organize_data(data)\n # validation\n # => verify if a valid email\n ############################\n #p \"validando os emails...\"\n #emails = validate_emails(data)\n #valid_emails = emails['validos']\n #invalid_emails = emails['invalidos']\n\n\n p \"OK\"\n #export_to_csv(\"emails_validos\", valid_emails)\n #export_to_xlsx(\"emails_validos\", valid_emails)\n #export_to_csv(\"emails_invalidos\", invalid_emails)\n #export_to_xlsx(\"emails_invalidos\", invalid_emails)\n #\n # Second Step\n # => organize for atributes\n # 1. UF\n # 2. DT_NASCIMENTO\n # 3. IF\n # 4. ESCOLARIDADE\n ##########################\n uf_mails = organize_to_uf (persons)\n uf_mails.each do | key, est |\n if est.length == 0 then\n p \"vazio #{key} \"\n else\n export_to_csv(key, est)\n export_to_xlsx(key, est)\n end\n\n end\n\n dt_nascimento_mails = organize_to_dt_nasc(persons)\n dt_nascimento_mails.each do | key, value |\n if value.length == 0 then\n p \"empty: #{key} \"\n else\n export_to_csv(key, value)\n export_to_xlsx(key, value)\n end\n\n end\n\n if_mails = organize_to_if (persons)\n if_mails.each do | key, value |\n if value.length == 0 then\n p \"empty: #{key} \"\n else\n export_to_csv(key, value)\n export_to_xlsx(key, value)\n end\n end\n\n escolaridade_mails = organize_to_escolaridade (persons)\n escolaridade_mails.each do | key, value |\n if value.length == 0 then\n p \"empty: #{key} \"\n else\n export_to_csv(key, value)\n export_to_xlsx(key, value)\n end\n end\n #\n # Third Step\n # => Export to xlsx\n ##########################\n p \"exportando arquivo\"\n #export_table(valid_emails)\n p \"Ok\"\n p \"FINALIZANDO\"\n\n end", "def op_defect_import\n spreadsheet = open_spreadsheet(params[:file])\n # header parsing - header는 반드시 1 라인에 있어야 함\n header = spreadsheet.row(1)\n import_data_list = []\n \n # Routing | Defect Code\n (2..spreadsheet.last_row).each do |i|\n row = spreadsheet.row(i)\n raise Hatio::Exception::MisConfigured, (I18n.translate 'error.empty_not_allowed') + ' - Routing' if(!row[0] || row[0].empty?)\n raise Hatio::Exception::MisConfigured, (I18n.translate 'error.empty_not_allowed') + ' - Scrap Code' if(!row[1] || row[1].empty?)\n \n opId = \"#{@domain.id}-#{row[0].strip}\"\n defectCodeId = \"#{@domain.id}-#{row[1].strip}\"\n \n # 존재 하는지 체크 \n raise Hatio::Exception::MisConfigured, (I18n.translate 'error.operation_not_exist') + ' - Routing (' + row[0] + ')' unless(Operation.find_by_id(opId))\n raise Hatio::Exception::MisConfigured, (I18n.translate 'error.defect_code_not_exist') + ' - Scrap Code (' + row[1] + ')' unless(DefectCode.find_by_id(defectCodeId))\n \n row_data = {'operation_id' => opId, 'defect_code_id' => defectCodeId}\n import_data_list.push(row_data)\n end\n \n OperationsDefects.transaction do\n import_data_list.each do |import_data|\n op_defect = OperationsDefects.new(import_data)\n op_defect_cnt = OperationsDefects.where(\"operation_id = ? and defect_code_id = ?\", op_defect.operation_id, op_defect.defect_code_id).count\n begin\n op_defect.save! if(op_defect_cnt == 0)\n rescue ::Exception => e\n debug_print \"Duplicated : #{op_defect.operation_id}, #{op_defect.defect_code_id}\"\n end\n end unless(import_data_list.empty?)\n end\n \n @result = {\"success\" => true, \"message\" => \"Success\"}\n respond_to do |format|\n format.xml { render :xml => @result } \n format.json { render :json => @result }\n end\n end", "def post_process(sheet)\n # Do nothing\n end", "def perform\n validate_data_from_requests\n end", "def execute()\n # Initialize Results variables\n\tstatus=\"\"\n\terror_code=\"\"\n\tresults_message=\"\"\n\t\n\t#get service item template ID\n\ttemplateId = get_template_id(@parameters['customer_survey_instance_id'])\n\t\n\t# Retrieve the CSV file\n csvfile = get_attachment(@parameters['customer_survey_instance_id'],@parameters['csv_file'], templateId)\n\t\n\t\n\t\t\n\t\tif status!=\"Error\"\n\t\t\t# csvfile is an ARSmodels attachment type. The base64_content contains the actual file content.\n\t\t\tfile = Base64.decode64(csvfile.base64_content)\n\t\t\trecords = CSV.parse(file)\n\t\t\t\n\t\t\t\n\t\t\t#puts \"Field Names Provided: #{@field_names.inspect}\" if @debug_logging_enabled\n\t\t\tputs \"CSV: #{records.inspect}\" if @debug_logging_enabled\n\t\t\t\n\t\t\tcount = 0\n\t\t\t@field_names = []\n\t\t\tcolumn_count = 0\n\t\t\t\n\t\t\trecords.each do |record|\n\n\t\t\t\tcolumn_num = 0\n\t\t\t\t@field_values = {}\n\t\t\t\t\n\t\t\t\tif count == 0 \n\t\t\t\t\tcolumn_count = record.length\n\t\t\t\t\t@field_names = record\n\t\t\t\telse\n\t\t\t\t\tif record.length < column_count\n\t\t\t\t\t raise(\"Too few data columns for record #{rowcount}.\\nData: #{record.inspect}\")\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\twhile column_num < column_count\n\t\t\t\t\t\t# Add field_values\n\t\t\t\t\t\t@field_values[@field_names[column_num]]=record[column_num]\n\n\t\t\t\t\t\t# Increment column number\n\t\t\t\t\t\tcolumn_num += 1\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tputs(\"Working on row: #{@field_values.inspect}\") if @debug_logging_enabled\n\t\t\t\t\t\n\t\t\t\t\tentry = get_remedy_form(@parameters['form']).create_entry!(\n\t\t\t\t\t:field_values => @field_values,\n\t\t\t\t\t:fields => []\n\t\t\t\t\t)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tcount = count + 1\n\t\t\tend\n\t\t\t\n\t\t\tcount = count -1\n\t\t\tstatus=\"Success\"\n\t\t\tresults_message += \"#{count} records created.\"\n\t\tend\n\n\n\n\n # Build the results xml that will be returned by this handler.\n results = <<-RESULTS\n <results>\n <result name=\"Status\">#{status}</result>\n\t <result name=\"Error Code\">#{error_code}</result>\n\t <result name=\"Result Message\">#{results_message}</result>\n </results>\n RESULTS\n puts(\"Results: \\n#{results}\") if @debug_logging_enabled\n\n # Return the results String\n return results\n end", "def perform\n set_token(@data['token'])\n set_stake_currencies(@data['stake_currencies'])\n set_all_stake_currencies(@data['all_stake_currencies']) if @data['all_stake_currencies'].present?\n set_price_points(@data['price_points'])\n set_manager(@data['manager']) if @data['manager'].present?\n set_client(@data['client']) if @data['client'].present?\n set_client_manager(@data['client_manager'])\n set_contract_details(@data['contract_details'])\n set_gas_price(@data['gas_price'])\n set_auxiliary_addresses(@data['auxiliary_addresses'])\n set_origin_addresses(@data['origin_addresses'])\n set_workflow(@data['workflow'])\n set_workflow_current_step(@data['workflow_current_step'])\n set_sign_messages(@data['sign_messages'])\n set_workflow_payload(@data['workflow_payload'])\n set_sub_env_payload(@data['sub_env_payloads']) if @data['sub_env_payloads'].present?\n set_developer_page_addresses(@data['developer_page_addresses']) if @data['developer_page_addresses'].present?\n set_api_keys(@data['api_keys']) if @data['api_keys'].present?\n set_email_already_sent_flag(@data['email_already_sent_flag']) if @data['email_already_sent_flag'].present?\n set_webhook_enabled_flag(@data['webhook_enabled_flag']) if @data['webhook_enabled_flag'].present?\n set_dashboard_details(@data['dashboard_details']) if @data['dashboard_details'].present?\n set_graph_urls(@data['graph_urls']) if @data['graph_urls'].present?\n set_test_economy_details(@data['test_economy_details']) if @data['test_economy_details'].present?\n set_min_balances(@data['min_balances']) if @data['min_balances'].present?\n set_webhook_secrets(@data['webhook_secrets']) if @data['webhook_secrets'].present?\n end", "def loadtest\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n #service = googleauthorisation(request)\n spreadsheet_id = '10dXs-AT-UiFV1OGv2DOZIVYHEp81QSchFbIKZkrNiC8'\n sheet_name = 'New Sheet Name'\n range = \"#{sheet_name}!A7:C33\"\n holdRailsLoggerLevel = Rails.logger.level\n Rails.logger.level = 1 \n response = service.get_spreadsheet(\n spreadsheet_id,\n ranges: range,\n fields: \"sheets(data.rowData.values\" + \n \"(formattedValue,effectiveFormat.backgroundColor))\"\n )\n Rails.logger.level = holdRailsLoggerLevel\n # Now scan each row read from the spreadsheet in turn\n\n @output = Array.new()\n rowarray = Array.new()\n cellcontentarray = Array.new(3)\n response.sheets[0].data[0].row_data.map.with_index do |r, ri| # value[], row index\n # Now start processing the row content\n r.values.map.with_index do |mycell, cellindex|\n c0 = getvalue(mycell)\n cellcontentarray[0] = c0\n \n cf0 = getformat(mycell)\n cellcontentarray[1] = showcolour(cf0)\n cellcontentarray[2] = cf0\n\n logger.debug \"c0: \" + c0.inspect\n logger.debug \"cf0: \" + showcolour(cf0)\n logger.debug \"\"\n \n rowarray[cellindex] = cellcontentarray.clone\n end\n @output[ri] = rowarray.clone\n end\n logger.debug \"@output: \" + @output.inspect\n \n # Test some helpers\n logger.debug \"------testing in controller-------------\"\n [\n \"Joshua Kerr\",\n \"Alexandra (Alex) Cosgrove 12\",\n \"Aanya Daga 4 (male)\",\n \"Riley Howatson 1 (female)\",\n \"Amelia Clark (kindy)\",\n \"Amelia Clark (kindy) (female)\",\n \"Amelia Clark kindy (female)\",\n \"Amelia Clark kindy female\",\n \"Amelia Clark 1 (female)\",\n \"Bill Clark 1 (male)\",\n \"Amelia Clark 1 female\",\n \"Elisha Stojanovski K\",\n \"Bella Parsonage Phelan 8\",\n \"Billy Johnson K (female)\"\n ].each do |a|\n b = getStudentNameYearSex(a)\n logger.debug \"name: \" + a + \"\\n\" + b.inspect \n end\n end", "def temporary_fetch\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=2114410807&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 1)\n\n # Assessment 2\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=1657164873&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 2)\n\n # Assessment 3\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=1278939598&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 3)\n\n # Assessment 4\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=397189839&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 4)\n\n # Assessment 5\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=13824931&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 5)\n\n return Item.list\nend", "def loadstudents2\n #service = googleauthorisation(request)\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n #spreadsheet_id = '1CbtBqeHyYb9jRmROCgItS2eEaYSwzOMpQZdUWLMvjng'\n spreadsheet_id = current_user[:ssurl].match(/spreadsheets\\/d\\/(.*?)\\//)[1]\n logger.debug 'about to read spreadsheet'\n startrow = 3\n # first get the 3 columns - Student's Name + Year, Focus, study percentages\n #This is now all that we get\n range = \"STUDENTS!A#{startrow}:C\"\n response = service.get_spreadsheet_values(spreadsheet_id, range)\n @students = Array.new(response.values.length){Array.new(11)}\n #logger.debug \"students: \" + @students.inspect\n basecolumncount = 1 #index for loading array - 0 contains spreadsheet row number\n rowcount = 0\t\t\t \n response.values.each do |r|\n #logger.debug \"============ row #{rowcount} ================\"\n #logger.debug \"row: \" + r.inspect\n colcount = 0\n @students[rowcount][0] = rowcount + startrow\n r.each do |c|\n #logger.debug \"============ cell value for column #{colcount} ================\"\n \t #logger.debug \"cell value: \" + c.inspect\n \t @students[rowcount][basecolumncount + colcount] = c\n \t\t colcount = colcount + 1\n end\n rowcount = rowcount + 1\n end\n #logger.debug \"students: \" + @students.inspect\n\n # Now to update the database\n loopcount = 0 # limit output during testing\n @students.each do |t| # step through all ss students\n pnameyear = t[1]\n logger.debug \"pnameyear: \" + pnameyear.inspect\n if pnameyear == \"\" || pnameyear == nil\n t[10] = \"invalid pnameyear - do nothing\"\n next\n end\n #pnameyear[/^zz/] == nil ? status = \"active\" : status = \"inactive\"\n name_year_sex = getStudentNameYearSex(pnameyear)\n pname = name_year_sex[0]\n year = name_year_sex[1]\n sex = name_year_sex[2]\n status = name_year_sex[3]\n logger.debug \"pname: \" + pname + \" : \" + year + \" : \" +\n sex.inspect + \" : \" + status\n\n # check if alrady an entry in the database\n # if so, update it. else create a new record.\n db_student = Student.find_by pname: pname\n if(db_student) # already in the database\n flagupdate = 0 # detect if any fields change\n updatetext = \"\"\n # first get the 4 columns - 1. Student's Name + Year, 2. Focus,\n # 3. study percentages, 4. email\n # now get the 5. perferences and 6. invcode\n # now get the 7. daycode, 8. term 4, 9. daycode\n if db_student.year != year\n db_student.year = year\n flagupdate = 1\n updatetext = updatetext + \" - year\" \n end\n if sex\n if db_student.sex != sex\n db_student.sex = sex\n flagupdate = 1\n updatetext = updatetext + \" - sex\"\n end\n end\n if db_student.comment != t[2]\n db_student.comment = t[2]\n flagupdate = 1\n updatetext = updatetext + \" - comment\" \n end\n if db_student.study != t[3]\n db_student.study = t[3]\n flagupdate = 1\n updatetext = updatetext + \" - study percentages\" \n end\n if db_student.status != status\n db_student.status = status\n flagupdate = 1\n updatetext = updatetext + \" - status\" \n end\n logger.debug \"flagupdate: \" + flagupdate.inspect + \" db_student: \" + db_student.inspect\n if flagupdate == 1 # something changed - need to save\n if db_student.save\n logger.debug \"db_student saved changes successfully\"\n t[10] = \"updated #{db_student.id} \" + updatetext \n else\n logger.debug \"db_student saving failed - \" + @db_student.errors\n t[10] = \"failed to update\"\n end\n else\n t[10] = \"no changes\"\n end\n else\n # This Student is not in the database - so need to add it.\n #\n # first get the 4 columns - 1. Student's Name + Year, 2. Focus,\n # 3. study percentages, 4. email\n # now get the 5. perferences and 6. invcode\n # now get the 7. daycode, 8. term 4, 9. daycode\n @db_student = Student.new(\n pname: pname,\n year: year,\n comment: t[2],\n study: t[3],\n status: status\n )\n logger.debug \"new - db_student: \" + @db_student.inspect\n if @db_student.save\n logger.debug \"db_student saved successfully\"\n t[10] = \"created #{@db_student.id}\" \n else\n logger.debug \"db_student saving failed - \" + @db_student.errors.inspect\n t[10] = \"failed to create\"\n end\n end\n #exit\n if loopcount > 2\n #break\n end\n loopcount += 1\n end\n end", "def initialize(filepath, current_user, relation)\n\n # Open the new file & get the attributes row from it\n @relation = relation\n @import_file = Roo::Spreadsheet.open(filepath, extension: :xlsx)\n @excel_attributes_raw = @import_file.sheet(0).row(1)\n @excel_attributes = @excel_attributes_raw.map{ |el| el.downcase.gsub(\" \", \"_\") }\n\n # validate attributes row\n @invalid_rows = false\n @valid_attributes_from_db = getAllValidAttributes\n @mandatory_attributes_from_db = getAllMandatoryAttributes(current_user)\n \n # get valid and invalid attributes based on name\n getValidAndInvalidAttributes\n\n # valid attributes found and all mandatory attributes are there\n if checkAttributeRequirements\n # get valid listings from excel\n getValidListingsFromExcel\n\n # handle title and shipment to countries\n handleTitle\n handleCountries\n handleUSPs\n\n # check if there exists a value for mandatory attributes\n checkListingAttributeRequirements\n\n # handle listings which have to be updated\n listingsToUpdate current_user\n end\n end", "def perform\n\n set_user(@data['user'])\n\n set_client_token(@data['client_token'])\n\n set_oracle_price_points(@data['oracle_price_points'])\n\n set_pending_critical_interactions(@data['pending_critical_interactions']) if @data['pending_critical_interactions'].present?\n\n set_client_token_planner(@data['client_token_planner']) if @data['client_token_planner'].present?\n\n set_chain_interaction_params(@data['chain_interaction_params']) if @data['chain_interaction_params'].present?\n\n set_client_balances(@data['client_balances']) if @data['client_balances'].present?\n\n set_token_supply_details(@data['token_supply_details']) if @data['token_supply_details'].present?\n\n set_client_stats(@data['client_stats']) if @data['client_stats'].present?\n\n set_api_console_data(@data['api_console_data']) if @data['api_console_data'].present?\n\n set_client_bt_addresses_data(@data['client_bt_addresses']) if @data['client_bt_addresses'].present?\n\n end", "def main_build_loop\n @import = Import.find_or_create_by(name: IMPORT_NAME) \n @import.metadata ||= {} \n handle_projects_and_users(@data, @import)\n raise '$project_id or $user_id not set.' if $project_id.nil? || $user_id.nil?\n handle_namespaces(@data, @import)\n handle_preparation_types(@data, @import)\n handle_controlled_vocabulary(@data, @import)\n\n handle_people(@data, @import) ## !created as new\n\n handle_taxa(@data, @import)\n\n checkpoint_save(@import) if ENV['no_transaction']\n\n # !! The following can not be loaded from the database they are always created anew.\n handle_collecting_events(@data, @import)\n handle_specimens(@data, @import)\n\n # handle_users(@data, @import)\n\n @import.save!\n puts \"\\n\\n !! Success \\n\\n\"\n end", "def parse_xlsx\n 2.upto(@spreadsheet.last_row).each do |row_index|\n row = info_hash(row_index)\n \n unless row.nil?\n @data[row[:name]] ||= {\n code: row[:code],\n worlds: [],\n areas: [],\n positions: []\n }\n\n @data[row[:name]][:worlds] << row[:world] if !row[:world].blank? && !@data[row[:name]][:worlds].include?(row[:world])\n @data[row[:name]][:areas] << row[:area] if !row[:area].blank? && !@data[row[:name]][:areas].include?(row[:area])\n @data[row[:name]][:positions] << row[:position] if !row[:position].blank? && !@data[row[:name]][:positions].include?(row[:position])\n end\n end\n end", "def str1_upload_xls\n @title=\"Import Users\"\n Spreadsheet.client_encoding='UTF-8'\n if params[:file].present?\n book=Spreadsheet.open params[:file].tempfile\n sheet1=book.worksheet 0\n sheet1.each 1 do |row|\n @store = Businessnew.new(:address=>row[3], :category=>row[10], :city=>row[4], :id=>row[0],\n :latitude=>row[9], :longitude=>row[8], :name=>row[1], :phone=>row[7],\n :postal_code=>row[6].split(\" \").join(''), :state=>row[5], :url=>row[2])\n if @store.present?\n @store.save\n end\n end\n end\n redirect_to '/'\n end", "def set_spreadsheet\n @spreadsheet = Spreadsheet.find(params[:id])\n end", "def getValidListingsFromExcel\n # get all values the rows below the attribute row\n parse_args = {}\n @excel_attributes_raw.each{ |x_attr| parse_args[x_attr.to_sym] = x_attr }\n @listing_data = @import_file.parse(parse_args)\n\n # transform excel data\n data = []\n @listing_data.each_with_index do |row, j| \n data << {}\n\n row.each do |field|\n if j == 0\n data[j][field[0].to_s.downcase.gsub(\" \", \"_\").to_sym] = field[1].downcase.gsub(\" \", \"_\")\n else\n if field[1].class.to_s == \"String\"\n da = field[1].gsub(\"<html>\", \"\").gsub(\"</html>\", \"\")\n else\n da = field[1]\n end\n data[j][field[0].to_s.downcase.gsub(\" \", \"_\").to_sym] = da\n end\n end\n end\n @listing_data = data\n\n # delete columns which are not valid\n @listing_data[0].each_with_index do |header_row_element, index|\n unless @valid_attributes.map{|el| el[:name]}.include?(header_row_element[1])\n @listing_data.each_with_index do |data_rows, ii|\n data_rows.delete(header_row_element[0]) if ii > 0\n end\n @listing_data[0].delete(header_row_element[0])\n end\n end\n end", "def googleroster\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n#-----------------------------------------------------------------\n# Create a new spreadsheet -works and tested\n #request_body = Google::Apis::SheetsV4::Spreadsheet.new\n #response = service.create_spreadsheet(request_body)\n #ss = response\n #spreadsheet_id = ss.spreadsheet_id\n#-----------------------------------------------------------------\n\n#-----------------------------------------------------------------\n# Use an existing previously created spreadsheet\n# Only need the id to make use of this.\n #spreadsheet_id = '1VHNfTl0Qxok1ZgBD2Rwby-dqxihgSspA0InqS5dTXNI'\n spreadsheet_id = '1mfS0V2IRS1x18otIta1kOdfFvRMu6NltEe-edn7MZMc'\n#-----------------------------------------------------------------\n\n#-----------------------------------------------------------------\n# Use the spreadsheet configured in user profiles\n# = Roster Google Spreadsheet URL \n spreadsheet_id = current_user[:rosterssurl].match(/spreadsheets\\/d\\/(.*?)\\//)[1]\n\n # Get URL of spreadsheet\n response = service.get_spreadsheet(spreadsheet_id)\n @spreadsheet_url = response.spreadsheet_url\n\n # Sheet we are working on.\n sheet_name = \"Sheet1\"\n sheet_id = 0\n\n #this function converts spreadsheet indices to column name\n # examples: e[0] => A; e[30] => AE \n e =->n{a=?A;n.times{a.next!};a} \n\n# ************ update spreadsheet title ************************\n# https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate\n spreadsheet_title = \"Google Roster\" \n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n myussp = {\"properties\": {\"title\": spreadsheet_title}, \"fields\": \"*\" }\n request_body.requests = [{\"update_spreadsheet_properties\": myussp }]\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n\n# ************ add sheet ************************\n googleAddSheet = lambda{ |mytitle, mysheetproperties|\n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n myas = {\"properties\": {\"title\": mytitle}}\n request_body.requests = [{\"add_sheet\": myas }]\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n mysheetproperties.push({'index' => result.replies[0].add_sheet.properties.index,\n 'sheet_id' => result.replies[0].add_sheet.properties.sheet_id,\n 'title' => result.replies[0].add_sheet.properties.title})\n }\n \n# ************ delete sheets ************************\n googleSheetDelete = lambda{\n result = service.get_spreadsheet(spreadsheet_id)\n mysheets = result.sheets\n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n mysheets.each_with_index do |o, i|\n next if i == 0\n request_body.requests == nil ?\n request_body.requests = [{\"delete_sheet\": {\"sheet_id\": o.properties.sheet_id}}] :\n request_body.requests.push({\"delete_sheet\": {\"sheet_id\": o.properties.sheet_id}})\n end\n unless request_body.requests == nil\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n end\n }\n\n# ************ get spreadsheet properties ************************\n googleSheetProperties = lambda{\n result = service.get_spreadsheet(spreadsheet_id)\n mysheets = result.sheets\n mysheetproperties = mysheets.map{|p| {'index' => p.properties.index, \n 'sheet_id' => p.properties.sheet_id,\n 'title' => p.properties.title } }\n \n }\n\n# ************ update sheet title ************************\n# https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate\n googleSetSheetTitle = lambda{ |mytitle|\n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n myusp = {\"properties\": {\"title\": mytitle }, \"fields\": \"title\" }\n request_body.requests = [{\"update_sheet_properties\": myusp }]\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n }\n\n# ************ delete all cells (rows) in a sheet ****************************\n# https://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/SheetsV4/Request#delete_range-instance_method \n googleClearSheet = lambda{|passed_sheet_id|\n requests = [{ delete_range:{\n range: {sheet_id: passed_sheet_id, start_row_index: 0, start_column_index: 0 },\n shift_dimension: \"ROWS\"}}]\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n }\n \n\n# ******** set vertical alignment using batch_update_spreadsheet ********\n # googleVertAlignAll.call(palign \"TOP | MIDDLE | BOTTOM\")\n googleVertAlignAll = lambda{ |passed_sheet_id, palign|\n requests = [{repeat_cell: {\n \t range: {sheet_id: passed_sheet_id,\n \t start_row_index: 0,\n \t start_column_index: 0\n \t },\n cell: {user_entered_format: {vertical_alignment: palign} },\n fields: \"user_entered_format(vertical_alignment)\"\n }\n }]\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n }\n\n# ****************** calls batch_update_spreadsheet ******************\n # googlebatchdataitem.call(passed_items [googlebackgroundcolouritem, ...])\n googleBatchUpdate = lambda{|passeditems|\n if passeditems.count > 0\n body = {requests: passeditems}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n end\n }\n\n# ******** update background colours using batch_update_spreadsheet ********\n # googleBGColourItem.call(rowStart, colStart, numberOfRows, numberOfCols,\n # colour[red_value, geen_value, blue_value])\n googleBGColourItem = lambda{|passed_sheet_id, rs, cs, nr, nc, pcolour|\n {repeat_cell: {\n \t range: {sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t end_row_index: rs - 1 + nr,\n \t start_column_index: cs - 1,\n \t end_column_index: cs - 1 + nc},\n cell:{user_entered_format:\n \t {background_color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}}},\n fields: \"user_entered_format(background_color)\"}}}\n \n# ******** set vertical alignment using batch_update_spreadsheet ********\n # googleVertAlign.call(rowStart, colStart, numberOfRows, numberOfCols,\n # palign \"TOP | MIDDLE | BOTTOM\")\n googleVertAlign = lambda{|passed_sheet_id, rs, cs, nr, nc, palign|\n pad = 5\n result = {repeat_cell: {\n \t range: {sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t start_column_index: cs - 1 },\n cell:{user_entered_format: {vertical_alignment: palign,\n padding: {\n top: pad,\n right: pad,\n bottom: pad,\n left: pad\n }\n } \n },\n fields: \"user_entered_format(vertical_alignment,padding)\"\n }\n }\n if nr != nil then\n result[:repeat_cell][:range][:end_row_index] = rs - 1 + nr \n end\n if nc != nil then\n result[:repeat_cell][:range][:end_column_index] = cs - 1 + nc \n end\n return result\n }\n\n# ******** set wrap text using batch_update_spreadsheet ********\n # googleWrapText.call(rowStart, colStart, numberOfRows, numberOfCols,\n # wrap \"OVERFLOW_CELL | LEGACY_WRAP | CLIP | WRAP\")\n googleWrapText = lambda{|passed_sheet_id, rs, cs, nr, nc, pwrap|\n result = {repeat_cell: {\n \t range: {sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t start_column_index: cs - 1 },\n cell:{user_entered_format: {wrap_strategy: pwrap} },\n fields: \"user_entered_format(wrap_strategy)\"\n }\n }\n if nr != nil then\n result[:repeat_cell][:range][:end_row_index] = rs - 1 + nr \n end\n if nc != nil then\n result[:repeat_cell][:range][:end_column_index] = cs - 1 + nc \n end\n return result\n }\n\n# ******** update borders using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/formatting\n # googleBorder.call(sheet_id, rowStart, colStart, numberOfRows, numberOfCols,\n # {left: color, right: .., top: .., bottom: ..}, width)\n googleBorder = lambda{|passed_sheet_id, rs, cs, nr, nc, pcolour, passedStyle |\n {\n update_borders: {\n \t range: { sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t end_row_index: rs - 1 + nr,\n \t start_column_index: cs - 1,\n \t end_column_index: cs - 1 + nc },\n top: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}},\n left: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}},\n right: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}},\n bottom: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}},\n }\n }\n }\n\n# ******** update borders using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/formatting\n # googleBorder.call(sheet_id, rowStart, colStart, numberOfRows, numberOfCols,\n # {left: color, right: .., top: .., bottom: ..}, width)\n googleRightBorder = lambda{|passed_sheet_id, rs, cs, nr, nc, pcolour, passedStyle |\n {\n update_borders: {\n \t range: { sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t end_row_index: rs - 1 + nr,\n \t start_column_index: cs - 1,\n \t end_column_index: cs - 1 + nc },\n right: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}}\n }\n }\n }\n\n# ******** adjust columns width using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/rowcolumn \n\n # googlecolwidthitem.call(colStart, numberOfCols,\n # width_pixels)\n googleColWidthItem = lambda{|passed_sheet_id, cs, nc, passedpw|\n {\n update_dimension_properties: {\n range: { dimension: \"COLUMNS\",\n \t sheet_id: passed_sheet_id,\n \t start_index: cs - 1,\n end_index: cs - 1 + nc },\n \t properties: { pixel_size: passedpw },\n \t fields: \"pixelSize\"\n }\n }\n }\n\n# ******** autoresize columns using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/rowcolumn \n\n # googlecolautowidthitem.call(passed_sheet_id, colStart, numberOfCols)\n googleColAutowidthItem = lambda{|passed_sheet_id, cs, nc|\n {\n auto_resize_dimensions: { dimensions: { dimension: \"COLUMNS\",\n \t sheet_id: passed_sheet_id,\n \t start_index: cs - 1,\n end_index: cs - 1 + nc }\n }\n }\n }\n \n# ******** merge cells using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/formatting \n # googleMergeCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols)\n googleMergeCells = lambda{|passed_sheet_id, rs, nr, cs, nc|\n {\n merge_cells: { range: { sheet_id: passed_sheet_id,\n start_row_index: rs - 1,\n end_row_index: rs - 1 + nr,\n start_column_index: cs - 1,\n end_column_index: cs - 1 + nc },\n merge_type: \"MERGE_ALL\"\n }\n }\n }\n\n# ******** format header cells using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/formatting \n # googlefomratCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols, fontSize)\n googleFormatCells = lambda{|passed_sheet_id, rs, nr, cs, nc, fs|\n {\n repeat_cell: { range: { sheet_id: passed_sheet_id,\n start_row_index: rs - 1,\n end_row_index: rs - 1 + nr,\n start_column_index: cs - 1,\n end_column_index: cs - 1 + nc },\n cell: { user_entered_format: {\n horizontal_alignment: \"CENTER\",\n text_format: {\n font_size: fs,\n bold: true\n }\n }\n },\n fields: \"userEnteredFormat(textFormat, horizontalAlignment)\"\n }\n }\n }\n\n# ************ update values using update_spreadsheet_value ****************************\n# doco: https://www.rubydoc.info/github/google/google-api-ruby-client/Google%2FApis%2FSheetsV4%2FSheetsService%3Aupdate_spreadsheet_value \n# call using\n\n# googlevalues.call(rowStartIndex, columnStartIndex, numberOfRows, numberOfColumns, values[[]])\n# Indexes start at 1 for both rows and columns\n googleValues = lambda{|rs, cs, nr, nc, values| \n range = \"#{sheet_name}!\" + e[cs - 1] + rs.to_s + \":\" +\n e[cs + nc - 1] + (rs + nr).to_s\n request_body = Google::Apis::SheetsV4::ValueRange.new\n request_body.values = values\n request_body.major_dimension = \"ROWS\"\n service.update_spreadsheet_value(spreadsheet_id, range, request_body, \n {value_input_option: 'USER_ENTERED'})\n }\n \n# ************ update values using batch_update_values ****************************\n # googlebatchdataitem.call(rowStart, colStart, numberOfRows, numberOfCols,\n # values[[]])\n googleBatchDataItem = lambda{|passed_sheet_name, rs, cs, nr, nc, values|\n range = \"#{passed_sheet_name}!\" + e[cs - 1] + rs.to_s + \":\" +\n e[cs + nc - 1] + (rs + nr).to_s\n {\n range: range,\n majorDimension: 'ROWS',\n values: values\n }\n }\n\n# ************ execute batch update of values - [data items] ****************************\n # googlebatchdataitem.call(spreadsheet_id, \n # passed in batch data [gppg;ebatcjdataote, ...])\n googleBatchDataUpdate = lambda{|ss_id, dataitems |\n if dataitems.count > 0\n request_body = Google::Apis::SheetsV4::BatchUpdateValuesRequest.new\n request_body.value_input_option = 'USER_ENTERED'\n request_body.data = dataitems\n service.batch_update_values(ss_id, request_body, {})\n end\n }\n\n# ************ text format run using batch_update_values ****************************\n # googlebatchTextFormatRunItem.call(rowStart, colStart, \n # text, breakPointToChangeFormat[])\n googleTextFormatRun = lambda{|passed_sheet_id, rs, cs, myText, myBreaks|\n result = \n {\n update_cells: {\n \t start: {sheet_id: passed_sheet_id,\n \t row_index: rs - 1,\n \t column_index: cs - 1\n \t },\n rows: [ \n { values: [ \n {\n user_entered_value: {\n string_value: myText\n },\n user_entered_format: {\n text_format: {\n fontFamily: \"Arial\"\n }\n },\n text_format_runs: [\n {\n start_index: myBreaks[0],\n format: {\n bold: true,\n font_size: 10\n }\n }\n ]\n }\n ]\n }\n \n ],\n fields: \"userEnteredValue, userEnteredFormat.textFormat.bold, textFormatRuns.format.(bold, fontSize, fontFamily)\"\n }\n }\n if myBreaks[1] < myText.length then\n secondRun = {\n start_index: myBreaks[1],\n format: {\n bold: false,\n font_size: 10\n }\n }\n result[:update_cells][:rows][0][:values][0][:text_format_runs].push(secondRun)\n end\n return result\n }\n \n \n# ************ batch update of data items ****************************\n # googlebatchdataitem.call(spreadsheet_id, \n # passed in batch data [gppg;ebatcjdataote, ...])\n googleBatchDataUpdate = lambda{|ss_id, dataitems |\n if dataitems.count > 0\n request_body = Google::Apis::SheetsV4::BatchUpdateValuesRequest.new\n request_body.value_input_option = 'USER_ENTERED'\n request_body.data = dataitems\n service.batch_update_values(ss_id, request_body, {})\n end\n }\n\n#-------- To test or not to test ------------------------------\ntesting = false # true or false\nif testing then\n\n#--------------------- Test Data -------------------------------\n# Clear the sheet\n googleClearSheet.call(sheet_id)\n \n# Some test formatting\n batchitems = []\n\n batchitems.push(googleBGColourItem.call(sheet_id, 1,1,1,2,[0,1,0]))\n batchitems.push(googleBGColourItem.call(sheet_id, 6,1,1,2,[1,0,0]))\n batchitems.push(googleBGColourItem.call(sheet_id, 7,1,1,2,[0,0,1]))\n\n batchitems.push(googleBorder.call(sheet_id, 2,1,2,2, [0,0,0], \"SOLID_MEDIUM\"))\n \n batchitems.push(googleVertAlign.call(sheet_id,2,1,2,2, \"TOP\"))\n\n batchitems.push(googleWrapText.call(sheet_id, 2,1,2,2, \"WRAP\"))\n\n batchitems.push(googleColWidthItem.call(sheet_id, 1,3,160))\n \n googleBatchUpdate.call(batchitems) \n\n# Some test cellvalues - individual update\n myvalues = [[\"update_spreadsheet_value\",\"test data - this row will get a background colour\"]]\n googleValues.call(1, 1, 1, 2, myvalues)\n\n# Some test value data - batch update\n mydata = []\n mydata.push(googleBatchDataItem.call(sheet_name,2,1,2,2,\n [\n [\"spreadsheet_values_batchUpdate\", \"test data\"],\n [\"spreadsheet_values_batchUpdate\", \"third row\"]\n ])\n )\n mydata.push(googleBatchDataItem.call(sheet_name,6,1,2,2,\n [\n [\"spreadsheet_values_batchUpdate2\", \"test data\"],\n [\"spreadsheet_values_batchUpdate2\", \"seventh row\"]\n ])\n )\n googleBatchDataUpdate.call(spreadsheet_id, mydata)\n\n #Note: need to do values first so autoformat works.\n batchitems = [] # reset\n batchitems.push(googleColAutowidthItem.call(sheet_id, 1, 1))\n googleBatchUpdate.call(batchitems) \n \n logger.debug \"about to try out googleTextFormatRun\"\n batchitems = []\n batchitems.push(googleTextFormatRun.call(sheet_id, 10,2, \"123456789\\n1234567890123456789\", [0,10]))\n googleBatchUpdate.call(batchitems) \n logger.debug \"done googleTextFormatRun\"\n\nelse # Not to test.\n\n# let does some processing - writing rosters to google sheets.\n #@sf = 5 # number of significant figures in dom ids for lesson,tutor, etc.\n\n #mystartdate = current_user.daystart\n #myenddate = current_user.daystart + current_user.daydur.days\n @options = Hash.new\n #@options[:startdate] = current_user.daystart\n #@options[:enddate] = current_user.daystart + current_user.daydur.days\n @options[:startdate] = current_user.rosterstart\n @options[:enddate] = current_user.rosterstart + current_user.rosterdays.days\n \n #*****************************************************************\n # Set these to control what is displayed in the roster\n \n @tutorstatusforroster = [\"scheduled\", \"dealt\", \"confirmed\", \"attended\"]\n @studentstatusforroster = [\"scheduled\", \"dealt\", \"attended\"]\n \n #*****************************************************************\n \n # call the library in controllers/concerns/calendarutilities.rb\n #@cal = calendar_read_display2(@sf, mystartdate, myenddate)\n #calendar_read_display1f(sf, mystartdate, myenddate, options)\n \n # @tutors and @students are used by the cal\n @tutors = Tutor\n .where.not(status: \"inactive\")\n .order('pname')\n @students = Student\n .where.not(status: \"inactive\")\n .order('pname')\n \n #@cal = calendar_read_display1f(@sf, mystartdate, myenddate, {})\n #@cal = calendar_read_display1f(@sf, @options)\n @cal = calendar_read_display1f(@options)\n # Clear the first sheet - the rest are deleted.\n googleClearSheet.call(sheet_id)\n #googleVertAlignAll.call(\"TOP\")\n\n # kinds will govern the background colours for tutors and students.\n kindcolours = Hash.new\n=begin\n kindcolours = {\n 'tutor-kind-training' => [244, 164, 96],\n 'tutor-kind-called' => [135, 206, 250],\n 'tutor-kind-standard' => [0, 250, 154],\n 'tutor-kind-relief' => [245, 222, 179],\n 'tutor-kind-BFL' => [255, 255, 0],\n 'tutor-kind-onCall' => [0, 255, 255],\n 'tutor-kind-onSetup' => [234, 209, 220],\n 'student-kind-free' => [0, 255, 0],\n 'student-kind-first' => [182, 215, 168],\n 'student-kind-catchup' => [173, 216, 230],\n 'student-kind-fortnightly' => [70, 130, 180], \n 'student-kind-onetoone' => [250, 128, 114],\n 'student-kind-standard' => [0, 250, 154],\n 'tutor-kind-' => [255, 255, 255],\n 'tutor-student-' => [255, 255, 255]\n }\n=end\n kindcolours.default = [255, 255, 255] # result if called with missing key\n \n # clear unused sheets & get sheet properties\n googleSheetDelete.call\n # sets mysheetproperties = [{'index', 'sheet_id', 'title'}, ..]\n mysheetproperties = googleSheetProperties.call \n\n # will increment to 1 on stepping into loops => 1..n\n # Note: both rows and column indexes spreadsheets start at 1\n # Following counters used to track loactions in the spreadsheet\n timeData = ''\n baseSiteRow = 1 \n baseSlotRowInSite = 1\n baseLessonRowInSlot = 0\n currentTutorRowInLesson = 0\n currentStudentRowInLesson = 0\n currentStudentInLesson = 0\n maxPersonRowInAnySlot = 0\n maxPersonRowInAnySlot = 0\n currentCol = 1\n currentRow = 1\n baseSiteRow = 1 # first site \n baseSiteRowAll = 1 # for the 'all' tab \n locationindex = 0 # index into the sites\n \n # to compress or not - remove unused days\n @compress = false # can be true or false\n\n # have an all tab in google sheets to show all sites in that page\n # this is for tutors to seach for their name across all sites.\n # We still have a separate tab for each site\n googleSetSheetTitle.call(\"All\")\n mysheetproperties[locationindex]['title'] = \"All\"\n sheet_name_all = mysheetproperties[locationindex]['title']\n sheet_id_all = mysheetproperties[locationindex]['sheet_id']\n ###----------------------------------------------------------------------\n ###------------------- step through the sites ---------------------------\n ###----------------------------------------------------------------------\n @cal.each do |location, calLocation| # step through sites\n if @compress # remove days with no valid slot for this site\n usedColumns = calLocation[0][0][\"days\"].keys\n usedColumnsIndex = [0]\n for i in 1..(calLocation[0].length-1)\n if usedColumns.include?(calLocation[0][i][\"value\"]) then\n usedColumnsIndex.push(i)\n end\n end \n end\n\n mydata = [] # google batch data writter at end of processing a site\n myformat = []\n\n # make separate sheet entry for each site\n baseSiteRow = 1 # reset when new sheet for each site.\n # baseSiteRowAll continues across all sites.\n if locationindex == 0 # set up the all tab - contains all sites\n # googleSetSheetTitle.call(location)\n # mysheetproperties[locationindex]['title'] = location\n # General formatting for the 'all' sheet - done once\n myformat.push(googleVertAlign.call(sheet_id_all, 1, 1, nil, nil, \"TOP\"))\n myformat.push(googleWrapText.call(sheet_id_all, 1, 1, nil, nil, \"WRAP\"))\n myformat.push(googleColWidthItem.call(sheet_id_all, 1,100,200))\n myformat.push(googleColWidthItem.call(sheet_id_all, 1,1,0))\n end\n # now have a sheet for each site.\n mysheetproperties = googleAddSheet.call(location, mysheetproperties) # add a sheet\n # mysheets = result.sheets\n # mysheetproperties = mysheets.map{|o| {'index' => o.properties.index, \n # 'sheet_id' => o.properties.sheet_id,\n # 'title' => o.properties.title } }\n locationindex += 1\n sheet_name = mysheetproperties[locationindex]['title']\n sheet_id = mysheetproperties[locationindex]['sheet_id']\n\n # This function formats a lesson row\n # myformal and mydata are global to this google roster function\n # we are passing in values to ensure they are in the correct context.\n formatLesson = lambda { |baseLessonRowInSlot, baseSlotRowInSite, baseSiteRow, baseSiteRowAll, currentCol, maxPersonRowInLesson|\n borderRowStart = baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow\n borderRowStartAll = baseLessonRowInSlot + baseSlotRowInSite + baseSiteRowAll\n borderColStart = currentCol\n borderRows = maxPersonRowInLesson\n borderCols = 4 # one tutor col and 2 student cols + lesson commment col.\n # merge the cells within the comment section of a single session\n # googleMergeCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols)\n myformat.push(googleMergeCells.call(sheet_id, borderRowStart, borderRows,\n borderColStart + borderCols - 1, 1))\n myformat.push(googleMergeCells.call(sheet_id_all, borderRowStartAll, borderRows,\n borderColStart + borderCols - 1, 1))\n myformat.push(googleBorder.call(sheet_id, borderRowStart, borderColStart, borderRows, borderCols, [0, 0, 0], \"SOLID_MEDIUM\"))\n myformat.push(googleBorder.call(sheet_id_all, borderRowStartAll, borderColStart, borderRows, borderCols, [0, 0, 0], \"SOLID_MEDIUM\"))\n myformat.push(googleRightBorder.call(sheet_id, borderRowStart, borderColStart, borderRows, 1, [0, 0, 0], \"SOLID\"))\n myformat.push(googleRightBorder.call(sheet_id_all, borderRowStartAll, borderColStart, borderRows, 1, [0, 0, 0], \"SOLID\"))\n myformat.push(googleRightBorder.call(sheet_id, borderRowStart, borderColStart+2, borderRows, 1, [0, 0, 0], \"SOLID\"))\n myformat.push(googleRightBorder.call(sheet_id_all, borderRowStartAll, borderColStart+2, borderRows, 1, [0, 0, 0], \"SOLID\"))\n myformat.push(googleWrapText.call(sheet_id, borderRowStart, borderColStart, borderRows, borderCols, \"WRAP\"))\n myformat.push(googleWrapText.call(sheet_id_all, borderRowStartAll, borderColStart, borderRows, borderCols, \"WRAP\"))\n # want to put timeslot time (timeData) in first column of each lesson row.\n for i in borderRowStart..borderRowStart+borderRows-1 do\n mydata.push(googleBatchDataItem.call(sheet_name, i,1,1,1,[[timeData]]))\n end\n for i in borderRowStartAll..borderRowStartAll+borderRows-1 do\n mydata.push(googleBatchDataItem.call(sheet_name_all,i,1,1,1,[[timeData]]))\n end\n }\n #------------- end of lambda function: formatLesson ---------\n\n ### correction ###render flexibledisplay\n \n # General formatting for each site sheet\n myformat.push(googleVertAlign.call(sheet_id, 1, 1, nil, nil, \"TOP\"))\n myformat.push(googleWrapText.call(sheet_id, 1, 1, nil, nil, \"WRAP\"))\n myformat.push(googleColWidthItem.call(sheet_id, 1,100,350))\n myformat.push(googleColWidthItem.call(sheet_id, 1,1,0))\n\n #<table id=site-<%= location %> >\n baseSlotRowInSite = 0 # first slot\n currentRow = baseSlotRowInSite + baseSiteRow\n currentRowAll = baseSlotRowInSite + baseSiteRowAll\n ###----------------------------------------------------------------------\n ###-- step through each time period for this site e.g. 3:30, 4:30, etc. - \n ###-- (entry 0 = title info: 1. site 2. populated days by date) \n ###----------------------------------------------------------------------\n calLocation.each do |rows| # step through slots containing multiple days (fist row is actually a header row!)\n timeData = rows[0][\"value\"] \n #<tr>\n maxPersonRowInAnySlot = 0 # initialised to 1 to step a row even if no tutor or student found.\n currentCol = 1\n ###--------------------------------------------------------------------\n ###------- step through each day for this time period -----------------\n ### (entry 0 = time of lesson)\n ###--------------------------------------------------------------------\n rows.each_with_index do |cells, cellIndex| # step through each day (first column is head column - for time slots!)\n if @compress \n unless usedColumnsIndex.include?(cellIndex) then\n next\n end \n end\n awaystudents = \"\"\n ###-------------------------------------------------------------------------------------------\n ###------------------- step through each lesson in this slot ---------------------------------\n ###-------------------------------------------------------------------------------------------\n if cells.key?(\"values\") then # lessons for this day in this slot \n if cells[\"values\"].respond_to?(:each) then # check we have lessons?\n # This is a slot with lessons, do I need to output a title.\n #byebug\n # First column for each day needs to have the width set\n # googlecolwidthitem.call(sheet_id, colStart, numberOfCols, width_pixels)\n myformat.push(googleColWidthItem.call(sheet_id, currentCol, 1, 130))\n myformat.push(googleColWidthItem.call(sheet_id_all, currentCol, 1, 130))\n myformat.push(googleColWidthItem.call(sheet_id, currentCol+3, 1, 200))\n myformat.push(googleColWidthItem.call(sheet_id_all, currentCol+3, 1, 200))\n title = calLocation[0][0]['value'] + # site name\n calLocation[0][cellIndex]['datetime'].strftime(\" %A %e/%-m/%y \") + # date\n rows[0]['value'] # sesson time \n mydata.push(googleBatchDataItem.call(sheet_name,\n baseSiteRow + baseSlotRowInSite - 1, \n currentCol,1,1,[[title]]))\n mydata.push(googleBatchDataItem.call(sheet_name_all,\n baseSiteRowAll + baseSlotRowInSite - 1,\n currentCol,1,1,[[title]]))\n # googleMergeCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols)\n myformat.push(googleMergeCells.call(sheet_id, baseSiteRow + baseSlotRowInSite - 1, 1,\n currentCol, 4))\n myformat.push(googleMergeCells.call(sheet_id_all, baseSiteRowAll + baseSlotRowInSite - 1, 1,\n currentCol, 4))\n # Format the header line (merged cells)\n # googlefomratCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols, fontSize)\n myformat.push(googleFormatCells.call(sheet_id, baseSiteRow + baseSlotRowInSite - 1, 1,\n currentCol, 4, 16))\n myformat.push(googleFormatCells.call(sheet_id_all, baseSiteRowAll + baseSlotRowInSite - 1, 1,\n currentCol, 4, 16))\n baseLessonRowInSlot = 0 # index of first lesson in this slot for this day\n cells[\"values\"].sort_by {|obj| [valueOrderStatus(obj),valueOrder(obj)] }.each do |entry| # step thru sorted lessons\n next if (entry.status != nil && [\"global\", \"park\"].include?(entry.status))\n currentTutorRowInLesson = 0\n if entry.tutors.respond_to?(:each) then\n entry.tutors.sort_by {|obj| obj.pname }.each do |tutor|\n if tutor then\n thistutrole = tutor.tutroles.where(lesson_id: entry.id).first\n if @tutorstatusforroster.include?(thistutrole.status) then # tutors of interest\n currentRow = currentTutorRowInLesson + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow\n currentRowAll = currentTutorRowInLesson + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRowAll\n #<div class=\"tutorname tutorinline <%= set_class_status(tutor, entry) %>\">tutor: <%= tutor.pname %></div>\n tutorData = tutor.pname\n tutorDataAll = tutor.pname\n formatBreakPoints = []\n formatBreakPointsAll = []\n formatBreakPoints.push(0)\n formatBreakPointsAll.push(0)\n formatBreakPoints.push(tutor.pname.length)\n formatBreakPointsAll.push(tutor.pname.length)\n # tutor.subjects\n mysubjects = tutor.subjects\n mysubjects = mysubjects ? mysubjects : \"\"\n # thistutrole.comment\n # tutor.comment\n # Status: thistutrole.status Kind: thistutrole.kind\n mykind = thistutrole.kind\n mykind = mykind ? mykind : \"\"\n # don't diaplay subjects or kind for tutors on setup\n unless (entry.status == 'onSetup' && mykind == 'onSetup') ||\n (entry.status == 'onCall' && mykind == 'onCall')\n tutorData += ((mysubjects == \"\") ? \"\" : (\"\\n\" + mysubjects)) \n tutorData += ((mykind == \"\") ? \"\" : (\"\\n\" + mykind)) unless [\"standard\"].include?(mykind)\n tutorDataAll += ((mykind == \"\") ? \"\" : (\"\\n\" + mykind)) unless [\"standard\"].include?(mykind)\n end\n if thistutrole.comment != nil && thistutrole.comment != \"\"\n tutorData += \"\\n\" + thistutrole.comment\n end\n mycolour = kindcolours['tutor-kind-' + mykind]\n mycolour = mycolour.map {|p| p/255.0} \n myformat.push(googleTextFormatRun.call(sheet_id, currentRow, currentCol,\n tutorData, formatBreakPoints))\n myformat.push(googleTextFormatRun.call(sheet_id_all, currentRowAll, currentCol,\n tutorDataAll, formatBreakPointsAll))\n ###myformat.push(googleBGColourItem.call(sheet_id, currentRow, currentCol, 1, 1, mycolour))\n ###myformat.push(googleBGColourItem.call(sheet_id_all, currentRowAll, currentCol, 1, 1, mycolour))\n currentTutorRowInLesson += 1\n end # tutors of interest\n end\n #break\n end\n # keep track of the largest count of tutors or students in lesson.\n maxPersonRowInAnySlot = maxPersonRowInAnySlot > currentTutorRowInLesson + baseLessonRowInSlot ?\n maxPersonRowInAnySlot : currentTutorRowInLesson + baseLessonRowInSlot\n end\n currentStudentRowInLesson = 0\n currentStudentInLesson = 0\n studentLessonComments = \"\"\n if entry.students.respond_to?(:each) then\n entry.students.each do |student|\n if student then\n logger.debug \"student: \" + student.pname\n thisrole = student.roles.where(lesson_id: entry.id).first\n #logger.debug \"thisrole: \" + thisrole.inspect\n if ['away', 'awaycourtesy', 'bye', 'absent'].include?(thisrole.status) then \n displayname = student.pname + \" (\" + thisrole.status + \")\"\n awaystudents += awaystudents.length > 0 ? \"\\n\" + displayname : displayname\n end\n if @studentstatusforroster.include?(thisrole.status) then # students of interest\n #logger.debug \"*************processing student: \" + student.pname\n #logger.debug \"currentStudentInLesson: \" + currentStudentInLesson.inspect\n #logger.debug \"currentStudentRowInLesson + baseLessonRowInSlot + baseSlotRowInSite: \" +\n # currentStudentRowInLesson.to_s + \", \" + baseLessonRowInSlot.to_s + \", \" + baseSlotRowInSite.to_s\n currentRow = currentStudentRowInLesson + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow\n currentRowAll = currentStudentRowInLesson + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRowAll\n #<div class=\"studentname studentinline <%= set_class_status(student, entry) %>\">student: <%= student.pname %></div>\n #logger.debug \"DataItem parameters: \" + currentRow.to_s + \", \" + currentCol.to_s + \", 1, 1, \" + student.pname \n formatBreakPoints = []\n formatBreakPoints.push(0)\n studentData = student.pname\n studentSex = student.sex == nil ? \"\" :\n (student.sex.downcase.include?(\"female\") ? \"(F) \" : (student.sex.downcase.include?(\"male\") ? \"(M) \" : \"\"))\n studentData += \" \" + studentSex\n #logger.debug \"student.pname: \" + student.pname \n #logger.debug \"lesson_id: \" + entry.id.to_s\n #formatBreakPoints.push(student.pname.length)\n #studentSubjects = \" Yr: \" + (student.year == nil ? \" \" : student.year.rjust(3)) +\n # \" | \" + (student.study == nil ? \"\" : student.study)\n #studentYear = \" Yr:\" + (student.year == nil ? student.year.rjust(3))\n studentYear = \" Yr:\" + (student.year == nil ? \"\" : student.year)\n studentSubjects = student.study == nil ? \"\" : student.study\n studentData += studentYear\n studentDataAll = studentData\n formatBreakPointsAll = formatBreakPoints\n studentData += \"\\n\" + studentSubjects\n formatBreakPoints.push(studentData.length)\n # thisrole.comment\n # student.comment\n # Status: thisrole.status Kind: thisrole.kind\n mykind = thisrole.kind\n mykind = mykind ? mykind : \"\"\n studentData += \" (\" + mykind + \")\" unless [\"standard\"].include?(mykind)\n if thisrole.comment != nil && thisrole.comment != \"\"\n studentLessonComments += student.pname + \":\\n\" + thisrole.comment + \"\\n\"\n #studentData += \"\\n\" + thisrole.comment\n end\n if student.comment != nil && student.comment != \"\"\n studentData += \"\\n\" + student.comment\n end\n mycolour = kindcolours['student-kind-' + mykind]\n mycolour = mycolour.map {|p| p/255.0}\n #myformat.push(googleTextFormatRun.call(sheet_id, currentRow, currentCol + 1,\n # studentData, formatBreakPoints))\n colOffset = 1 + (currentStudentInLesson % 2)\n myformat.push(googleTextFormatRun.call(sheet_id, currentRow, currentCol + colOffset,\n studentData, formatBreakPoints))\n myformat.push(googleTextFormatRun.call(sheet_id_all, currentRowAll, currentCol + colOffset,\n studentDataAll, formatBreakPointsAll))\n ###myformat.push(googleBGColourItem.call(sheet_id, currentRow, currentCol + colOffset, 1, 1, mycolour))\n ###myformat.push(googleBGColourItem.call(sheet_id_all, currentRowAll, currentCol + colOffset, 1, 1, mycolour))\n \n #byebug \n currentStudentRowInLesson += 1 if (currentStudentInLesson % 2) == 1 # odd\n currentStudentInLesson += 1\n end # students of interest\n end\n end\n # Need to get correct count of rows (rounding up is necessary)\n # derive currentStudentRowInLesson from the currentStudentInLesson\n currentStudentRowInLesson = (currentStudentInLesson % 2) == 0 ? \n currentStudentInLesson / 2 : (currentStudentInLesson / 2) + 1 \n \n # keep track of the largest count of tutors or students in lesson.\n maxPersonRowInAnySlot = maxPersonRowInAnySlot > currentStudentRowInLesson + baseLessonRowInSlot ?\n maxPersonRowInAnySlot : currentStudentRowInLesson + baseLessonRowInSlot\n end\n maxPersonRowInLesson = currentTutorRowInLesson > currentStudentRowInLesson ? \n currentTutorRowInLesson : currentStudentRowInLesson \n # put a border around this lesson if there were lessons with people\n if maxPersonRowInLesson > 0 then\n # put in lesson comments if there were tutors or students.\n #<div class=\"lessoncommenttext\"><% if entry.comments != nil && entry.comments != \"\" %><%= entry.comments %><% end %></div>\n #<div class=\"lessonstatusinfo\"><% if entry.status != nil && entry.status != \"\" %>Status: <%= entry.status %> <% end %></div>\n mylessoncomment = ''\n if entry.status != nil && entry.status != ''\n unless [\"standard\", \"routine\", \"flexible\"].include?(entry.status) # if this is a standard lesson \n mylessoncomment = entry.status + \"\\n\" # don't show the lesson status (kind)\n end\n end\n mylessoncommentAll = mylessoncomment\n if entry.comments != nil && entry.comments != \"\"\n mylessoncomment += entry.comments\n end\n mylessoncomment += studentLessonComments\n if mylessoncomment.length > 0\n mylessoncomment = mylessoncomment.sub(/\\n$/, '') # remove trailing new line\n mydata.push(googleBatchDataItem.call(sheet_name, currentRow, currentCol+3,1,1,[[mylessoncomment]]))\n mydata.push(googleBatchDataItem.call(sheet_name_all,currentRowAll,currentCol+3,1,1,[[mylessoncommentAll]]))\n end\n # ----- formatting of the lesson row within the slot ---------\n formatLesson.call(baseLessonRowInSlot, baseSlotRowInSite, baseSiteRow, baseSiteRowAll, currentCol, maxPersonRowInLesson)\n end\n ###baseLessonRowInSlot += maxPersonRowInLesson\n baseLessonRowInSlot += maxPersonRowInLesson\n #currentRow = maxPersonRowInAnySlot + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow # next empty row \n end # end looping sorted lessons within a day/slot\n end # responds to cell[\"values\"]\n elsif cells.key?(\"value\") then # just holds cell info (not lessons) to be shown\n currentRow = baseSlotRowInSite + baseSiteRow\n currentRowAll = baseSlotRowInSite + baseSiteRowAll\n #timeData = cells[\"value\"].to_s #if currentCol == 1 &&\n # cells[\"value\"] != nil # pick up the time\n #mydata.push(googleBatchDataItem.call(sheet_name, currentRow, currentCol,1,1,[[cells[\"value\"].to_s]]))\n #mydata.push(googleBatchDataItem.call(sheet_name_all,currentRowAll,currentCol,1,1,[[cells[\"value\"].to_s]]))\n end\n # Now add a dummy row at end of slot to show students who are away\n if awaystudents.length > 0\n currentRow = baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow\n currentRowAll = baseLessonRowInSlot + baseSlotRowInSite + baseSiteRowAll\n mydata.push(googleBatchDataItem.call(sheet_name, currentRow, currentCol,1,1,[[\"Students Away\"]]))\n mydata.push(googleBatchDataItem.call(sheet_name_all, currentRowAll, currentCol,1,1,[[\"Students Away\"]]))\n myformat.push(googleFormatCells.call(sheet_id, currentRow, 1, currentCol, 1, 10))\n myformat.push(googleFormatCells.call(sheet_id_all, currentRowAll, 1, currentCol, 1, 10))\n mydata.push(googleBatchDataItem.call(sheet_name, currentRow, currentCol + 1,1,1,[[awaystudents]]))\n mydata.push(googleBatchDataItem.call(sheet_name_all, currentRowAll, currentCol + 1,1,1,[[awaystudents]]))\n maxPersonRowInLesson = 1\n formatLesson.call(baseLessonRowInSlot, baseSlotRowInSite, baseSiteRow,\n baseSiteRowAll, currentCol, maxPersonRowInLesson) # apply the standard formatting\n baseLessonRowInSlot += 1 # add another row for this\n # update tracking of the largest count of tutors or students in lesson.\n maxPersonRowInAnySlot = maxPersonRowInAnySlot > currentStudentRowInLesson + baseLessonRowInSlot ?\n maxPersonRowInAnySlot : currentStudentRowInLesson + baseLessonRowInSlot\n maxPersonRowInAnySlot = maxPersonRowInAnySlot > currentTutorRowInLesson + baseLessonRowInSlot ?\n maxPersonRowInAnySlot : currentTutorRowInLesson + baseLessonRowInSlot\n end\n #</td>\n currentCol += currentCol == 1 ? 1 : 4 # first column is title, rest have adjacent tutors & students.\n end # end looping days within slots\n #</tr>\n #byebug\n baseSlotRowInSite += maxPersonRowInAnySlot # set ready for next slot (row of days)\n if baseLessonRowInSlot == 0 && maxPersonRowInAnySlot == 0 then\n baseSlotRowInSite += 1 # cater for when no lessons with tutors or students of interest\n end\n # Add an extra row between slots - except the first title slot\n # Jasmine wanted no rows between slots so reduced from 2 to 1.\n baseSlotRowInSite += 1 unless baseSlotRowInSite == 1\n end # end looping slots\n holdRailsLoggerLevel = Rails.logger.level\n Rails.logger.level = 1 \n googleBatchDataUpdate.call(spreadsheet_id, mydata)\n googleBatchUpdate.call(myformat) \n Rails.logger.level = holdRailsLoggerLevel\n\n #</table>\n baseSiteRow += baseSlotRowInSite + 1 # +1 adds blank row between sites\n baseSiteRowAll += baseSlotRowInSite + 1 # +1 adds blank row between sites\n #<br>\n end # end looping sites\nend # end of testing option.\n ### correction ###return # return without rendering.\n end", "def importation\n Dir.mkdir(importation_route) unless File.exists?(importation_route)\n spreadsheet = Dir.glob(\"#{importation_route}/*\")[0]\n xlsx = Roo::Spreadsheet.open(spreadsheet)\n\n xlsx.each_with_pagename do |name, sheet|\n unless name.include?('Nota')\n state = State.find_by_name(name)\n unless state\n state = State.create(name: name)\n end\n sheet.each_with_index(D_mnpio: 'mnpio', d_asenta: 'asenta',\n d_codigo: 'codigo') do |attributes, index|\n unless index == 0\n city = City.find_by(name: attributes[:D_mnpio], state_id: state&.id)\n unless city\n city = City.create(name: attributes[:D_mnpio], state_id: state&.id)\n end\n colony = Colony.find_by(name: attributes[:d_asenta], postcode: attributes[:d_codigo], city_id: city&.id)\n unless colony\n Colony.create(name: attributes[:d_asenta], postcode: attributes[:d_codigo], city_id: city&.id)\n end\n end\n end\n end\n end\n end", "def getvalues\r\n # Track via mixpanel\r\n MiscFunctions.mixPanelTrack(params[:street], params[:citystatezip], params[:product])\r\n\r\n # Determine if this is a bulk run or single property\r\n if (params[:street].nil? || params[:citystatezip].nil?) && params[:placeid].nil?\r\n @addresses = Address.all\r\n runID = \"Run: #{addresses.size}: #{Date.today.to_s}\"\r\n\r\n # Loop over records and compute PDQ score\r\n @addresses.each { |prop| PdqEngine.computeDecision(prop, params, runID) }\r\n \r\n else # if single property, create new address record or use place id if passed\r\n runID = \"#{params[:path].to_s.capitalize}: #{Date.today.to_s}\"\r\n\r\n # If we are provided a placeid (not active)\r\n if !params[:placeid].nil?\r\n geo_data = GeoFunctions.getGoogleGeoByPlaceId(params[:placeid])\r\n search_add = PdqEngine.computeDecision(geo_data, params, runID)\r\n\r\n else\r\n # These functions take \"unclean\" address from Billboard URL and clean it\r\n street = MiscFunctions.addressStringClean(params[:street])\r\n citystatezip = MiscFunctions.addressStringClean(params[:citystatezip])\r\n\r\n # Create an \"unclean\" (archive) lookup address\r\n hist_lookup_add = Address.new\r\n hist_lookup_add.street = street\r\n hist_lookup_add.citystatezip = citystatezip\r\n\r\n # Get Google place id\r\n geo_data = GeoFunctions.getGoogleGeoByAddress(street, citystatezip)\r\n search_add = PdqEngine.computeDecision(geo_data, params, runID, alt_lookup = hist_lookup_add)\r\n end\r\n @addresses = [search_add]\r\n end\r\n\r\n # update parameters to match clean-address format\r\n # params[:street] = a.street\r\n # params[:citystatezip] = a.citystatezip\r\n\r\n # Aggregate all output and render\r\n @allOutput = Output.all\r\n return render 'getvalues' if params[:path].nil?\r\n\r\n # Search here\r\n\r\n # If request coming from billboard\r\n # @calcedurl = URI.escape(\"/inspect/#{params[:street]}/#{params[:citystatezip]}\")\r\n @calcedurl = URI.escape(\"/inspect/#{search_add.street}/#{search_add.citystatezip}\")\r\n puts @calcedurl\r\n return render 'blank'\r\n end", "def perform\n\n handle_errors_and_exceptions do\n\n r = validate\n return r unless r.success?\n\n r = fetch_manager_validation_hash_details\n return r unless r.success?\n\n r = create_secure_data_acccess_token\n return r unless r.success?\n\n r = send_mail\n return r unless r.success?\n\n success_with_data({manager_validation_hash_id: @manager_validation_hash[:id]})\n\n end\n\n end", "def loadstudents\n #service = googleauthorisation(request)\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n #spreadsheet_id = '1CbtBqeHyYb9jRmROCgItS2eEaYSwzOMpQZdUWLMvjng'\n spreadsheet_id = current_user[:ssurl].match(/spreadsheets\\/d\\/(.*?)\\//)[1]\n logger.debug 'about to read spreadsheet'\n startrow = 3\n # first get the 3 columns - Student's Name + Year, Focus, study percentages\n range = \"STUDENTS!A#{startrow}:C\"\n response = service.get_spreadsheet_values(spreadsheet_id, range)\n @students = Array.new(response.values.length){Array.new(11)}\n #logger.debug \"students: \" + @students.inspect\n basecolumncount = 1 #index for loading array - 0 contains spreadsheet row number\n rowcount = 0\t\t\t \n response.values.each do |r|\n #logger.debug \"============ row #{rowcount} ================\"\n #logger.debug \"row: \" + r.inspect\n colcount = 0\n @students[rowcount][0] = rowcount + startrow\n r.each do |c|\n #logger.debug \"============ cell value for column #{colcount} ================\"\n \t #logger.debug \"cell value: \" + c.inspect\n \t @students[rowcount][basecolumncount + colcount] = c\n \t\t colcount = colcount + 1\n end\n rowcount = rowcount + 1\n end\n basecolumncount += 3\n # second get the 1 column - email\n range = \"STUDENTS!E#{startrow}:E\"\n response = service.get_spreadsheet_values(spreadsheet_id, range)\n #logger.debug \"students: \" + @students.inspect\n rowcount = 0\t\t\t \n response.values.each do |r|\n #logger.debug \"============ row #{rowcount} ================\"\n #logger.debug \"row: \" + r.inspect\n colcount = 0\n r.each do |c|\n #logger.debug \"============ cell value for column #{colcount} ================\"\n \t #logger.debug \"cell value: \" + c.inspect\n \t @students[rowcount][basecolumncount + colcount] = c\n \t\t colcount = colcount + 1\n end\n rowcount = rowcount + 1\n end\n basecolumncount += 1\n #third get the perferences and invcode\n range = \"STUDENTS!L#{startrow}:M\"\n response = service.get_spreadsheet_values(spreadsheet_id, range)\n rowcount = 0\n response.values.each do |r|\n colcount = 0\n r.each do |c|\n \t @students[rowcount][basecolumncount + colcount] = c\n \t\t colcount = colcount + 1\n end\n rowcount = rowcount + 1\n end\n basecolumncount += 2\n #fourth get the 3 columns daycode, term 4, daycode\n # these will be manipulated to get the savable daycode\n range = \"STUDENTS!P#{startrow}:R\"\n response = service.get_spreadsheet_values(spreadsheet_id, range)\n rowcount = 0\n response.values.each do |r|\n colcount = 0\n r.each do |c|\n \t @students[rowcount][basecolumncount + colcount] = c\n \t\t colcount = colcount + 1\n end\n rowcount = rowcount + 1\n end\n basecolumncount += 3\n #logger.debug \"students: \" + @students.inspect\n # Now to update the database\n loopcount = 0 # limit output during testing\n @students.each do |t| # step through all ss students\n pnameyear = t[1]\n logger.debug \"pnameyear: \" + pnameyear.inspect\n if pnameyear == \"\" || pnameyear == nil\n t[10] = \"invalid pnameyear - do nothing\"\n next\n end\n #pnameyear[/^zz/] == nil ? status = \"active\" : status = \"inactive\"\n name_year_sex = getStudentNameYearSex(pnameyear)\n pname = name_year_sex[0]\n year = name_year_sex[1]\n sex = name_year_sex[2]\n status = name_year_sex[3]\n logger.debug \"pname: \" + pname + \" : \" + year + \" : \" +\n sex.inspect + \" : \" + status\n # day code\n # use term 3 code unless a term 4 code, then take term 4\n t[9] == \"\" || t[9] == nil ? usedaycode = t[7] : usedaycode = t[9]\n # check if alrady an entry in the database\n # if so, update it. else create a new record.\n db_student = Student.find_by pname: pname\n if(db_student) # already in the database\n flagupdate = 0 # detect if any fields change\n updatetext = \"\"\n # first get the 4 columns - 1. Student's Name + Year, 2. Focus,\n # 3. study percentages, 4. email\n # now get the 5. perferences and 6. invcode\n # now get the 7. daycode, 8. term 4, 9. daycode\n if db_student.year != year\n db_student.year = year\n flagupdate = 1\n updatetext = updatetext + \" - year\" \n end\n if sex\n if db_student.sex != sex\n db_student.sex = sex\n flagupdate = 1\n updatetext = updatetext + \" - sex (\" + sex + \")\"\n end\n end\n if db_student.comment != t[2]\n db_student.comment = t[2]\n flagupdate = 1\n updatetext = updatetext + \" - comment\" \n end\n if db_student.study != t[3]\n db_student.study = t[3]\n flagupdate = 1\n updatetext = updatetext + \" - study percentages\" \n end\n if db_student.email != t[4]\n db_student.email = t[4]\n flagupdate = 1\n updatetext = updatetext + \" - email\" \n end\n if db_student.preferences != t[5]\n db_student.preferences = t[5]\n flagupdate = 1\n updatetext = updatetext + \" - preferences\" \n end\n if db_student.invcode != t[6]\n db_student.invcode = t[6]\n flagupdate = 1\n updatetext = updatetext + \" - invoice code\" \n end\n if db_student.daycode != usedaycode\n db_student.daycode = usedaycode\n flagupdate = 1\n updatetext = updatetext + \" - day code\" \n end\n if db_student.status != status\n db_student.status = status\n flagupdate = 1\n updatetext = updatetext + \" - status\" \n end\n logger.debug \"flagupdate: \" + flagupdate.inspect + \" db_student: \" + db_student.inspect\n if flagupdate == 1 # something changed - need to save\n if db_student.save\n logger.debug \"db_student saved changes successfully\"\n t[10] = \"updated #{db_student.id} \" + updatetext \n else\n logger.debug \"db_student saving failed - \" + @db_student.errors\n t[10] = \"failed to update\"\n end\n else\n t[10] = \"no changes\"\n end\n else\n # This Student is not in the database - so need to add it.\n #\n # first get the 4 columns - 1. Student's Name + Year, 2. Focus,\n # 3. study percentages, 4. email\n # now get the 5. perferences and 6. invcode\n # now get the 7. daycode, 8. term 4, 9. daycode\n @db_student = Student.new(\n pname: pname,\n year: year,\n comment: t[2],\n study: t[3],\n email: t[4],\n preferences: t[5],\n invcode: t[6],\n daycode: usedaycode,\n status: status,\n sex: sex\n )\n logger.debug \"new - db_student: \" + @db_student.inspect\n if @db_student.save\n logger.debug \"db_student saved successfully\"\n t[10] = \"created #{@db_student.id}\" \n else\n logger.debug \"db_student saving failed - \" + @db_student.errors.inspect\n t[10] = \"failed to create\"\n end\n end\n #exit\n if loopcount > 2\n #break\n end\n loopcount += 1\n end\n end", "def parse_worksheet(wb, i, worksheet_xml, worksheet_name, sheet_id)\n worksheet = Worksheet.new(wb, worksheet_name)\n wb.worksheets[i] = worksheet # Due to \"validate_workbook\" issues. Should remove that validation eventually.\n worksheet.sheet_id = sheet_id\n dimensions = RubyXL::Reference.new(worksheet_xml.css('dimension').attribute('ref').value)\n cols = dimensions.last_col\n\n # Create empty arrays for workcells. Using +downto()+ here so memory for +sheet_data[]+ is\n # allocated on the first iteration (in case of +upto()+, +sheet_data[]+ would end up being\n # reallocated on every iteration).\n dimensions.last_row.downto(0) { |i| worksheet.sheet_data[i] = Array.new(cols + 1) }\n\n namespaces = worksheet_xml.root.namespaces\n\n if @data_only\n row_xpath = '/xmlns:worksheet/xmlns:sheetData/xmlns:row[xmlns:c[xmlns:v]]'\n cell_xpath = './xmlns:c[xmlns:v[text()]]'\n else\n row_xpath = '/xmlns:worksheet/xmlns:sheetData/xmlns:row'\n cell_xpath = './xmlns:c'\n\n sheet_views_nodes = worksheet_xml.xpath('/xmlns:worksheet/xmlns:sheetViews/xmlns:sheetView', namespaces)\n worksheet.sheet_views = sheet_views_nodes.collect { |node| RubyXL::SheetView.parse(node) }\n\n col_node_set = worksheet_xml.xpath('/xmlns:worksheet/xmlns:cols/xmlns:col',namespaces)\n worksheet.column_ranges = col_node_set.collect { |col_node| RubyXL::ColumnRange.parse(col_node) }\n\n merged_cells_nodeset = worksheet_xml.xpath('/xmlns:worksheet/xmlns:mergeCells/xmlns:mergeCell', namespaces)\n worksheet.merged_cells = merged_cells_nodeset.collect { |child| RubyXL::Reference.new(child.attributes['ref'].text) }\n\n# worksheet.pane = worksheet.sheet_view[:pane]\n\n data_validations = worksheet_xml.xpath('/xmlns:worksheet/xmlns:dataValidations/xmlns:dataValidation', namespaces)\n worksheet.validations = data_validations.collect { |node| RubyXL::DataValidation.parse(node) }\n\n #extLst\n ext_list_node = worksheet_xml.xpath('/xmlns:worksheet/xmlns:extLst', namespaces)\n unless ext_list_node.empty?\n worksheet.extLst = Hash.xml_node_to_hash(ext_list_node.first)\n else\n worksheet.extLst = nil\n end\n #extLst\n\n ##legacy drawing##\n legacy_drawing_node = worksheet_xml.xpath('/xmlns:worksheet/xmlns:legacyDrawing', namespaces)\n unless legacy_drawing_node.empty?\n worksheet.legacy_drawing = Hash.xml_node_to_hash(legacy_drawing_node.first)\n else\n worksheet.legacy_drawing = nil\n end\n ##end legacy drawing\n\n drawing_nodes = worksheet_xml.xpath('/xmlns:worksheet/xmlns:drawing', namespaces)\n worksheet.drawings = drawing_nodes.collect { |n| n.attributes['id'] }\n end\n\n worksheet_xml.xpath(row_xpath, namespaces).each { |row|\n unless @data_only\n ##row styles##\n row_attributes = row.attributes\n row_style = row_attributes['s'] && row_attributes['s'].value || '0'\n\n worksheet.row_styles[row_attributes['r'].content] = { :style => row_style }\n\n if !row_attributes['ht'].nil? && (!row_attributes['ht'].content.nil? || row_attributes['ht'].content.strip != \"\" )\n worksheet.change_row_height(Integer(row_attributes['r'].value) - 1, Float(row_attributes['ht'].value))\n end\n ##end row styles##\n end\n\n row.search(cell_xpath).each { |value|\n #attributes is from the excel cell(c) and is basically location information and style and type\n value_attributes = value.attributes\n # r attribute contains the location like A1\n cell_index = RubyXL::Reference.ref2ind(value_attributes['r'].content)\n style_index = 0\n # t is optional and contains the type of the cell\n data_type = value_attributes['t'].content if value_attributes['t']\n element_hash ={}\n\n value.children.each { |node| element_hash[\"#{node.name()}_element\"] = node }\n\n # v is the value element that is part of the cell\n if element_hash[\"v_element\"]\n v_element_content = element_hash[\"v_element\"].content\n else\n v_element_content=\"\"\n end\n\n if v_element_content == \"\" # no data\n cell_data = nil\n elsif data_type == RubyXL::Cell::SHARED_STRING\n str_index = Integer(v_element_content)\n cell_data = wb.shared_strings[str_index].to_s\n elsif data_type == RubyXL::Cell::RAW_STRING\n cell_data = v_element_content\n elsif data_type == RubyXL::Cell::ERROR\n cell_data = v_element_content\n else# (value.css('v').to_s != \"\") && (value.css('v').children.to_s != \"\") #is number\n data_type = ''\n if(v_element_content =~ /\\./ or v_element_content =~ /\\d+e\\-?\\d+/i) #is float\n cell_data = Float(v_element_content)\n else\n cell_data = Integer(v_element_content)\n end\n end\n\n # f is the formula element\n cell_formula = nil\n fmla_css = element_hash[\"f_element\"]\n if fmla_css && fmla_css.content\n fmla_css_content= fmla_css.content\n if(fmla_css_content != \"\")\n cell_formula = fmla_css_content\n cell_formula_attr = {}\n fmla_css_attributes = fmla_css.attributes\n cell_formula_attr['t'] = fmla_css_attributes['t'].content if fmla_css_attributes['t']\n cell_formula_attr['ref'] = fmla_css_attributes['ref'].content if fmla_css_attributes['ref']\n cell_formula_attr['si'] = fmla_css_attributes['si'].content if fmla_css_attributes['si']\n end\n end\n\n style_index = value['s'].to_i #nil goes to 0 (default)\n\n worksheet.sheet_data[cell_index[0]][cell_index[1]] =\n Cell.new(worksheet,cell_index[0],cell_index[1],cell_data,cell_formula,\n data_type,style_index,cell_formula_attr)\n cell = worksheet.sheet_data[cell_index[0]][cell_index[1]]\n }\n }\n\n worksheet\n end", "def post_process_script options\n config_file = options[:file]\n app_name = File.basename(config_file, '.xlsx').downcase\n script_name = app_name + '_post.sh'\n file = File.open(\"#{script_name}\", \"w\")\n file.puts \"#!/bin/bash\"\n\n# file.puts \"cp -r assets2/* #{app_name}\"\n file.puts \"cd #{app_name}\"\n file.puts \"rake db:migrate\"\n\n# augment Abililties\n spreadsheet = Roo::Excelx.new(config_file)\n spreadsheet.default_sheet = 'ability'\n header = spreadsheet.row(1)\n\n file2 = File.open(\"#{app_name}/app/models/ability.rb\",'w')\n file2.puts \"class Ability\"\n file2.puts \"# https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities\"\n file2.puts \" include CanCan::Ability\\n\"\n file2.puts \" def initialize(user)\"\n\n attr = attr.map { |str| str.to_s} if !attr.nil?\n (2..spreadsheet.last_row).each do |i|\n h = header.zip spreadsheet.row i\n h = h.to_h\n roles = h['Role'].split(',').map { |role| \"user.#{role}? \" }\n abilities = h['Ability'].split(',').map { |ability| ability.strip.to_sym }\n resources = h['Resource'].split(',').map { |resource| resource.strip }\n conditions = []\n conditions = h['Condition'].split(',').map { |condition| condition.strip } if h['Condition']\n file2.puts \" if #{roles.join ' || '}\"\n\n # create abilities\n str = \" can #{abilities}, [#{resources.join ', '}]\"\n\n # add conditions if any\n str += ', ' if conditions.length > 0\n conditions.each_with_index { |condition, ii|\n str += ', ' if ii > 0\n if condition == 'user_id'\n str += \":#{condition} => user.id\"\n elsif condition == \"#{resources[0].underscore.downcase}_id\"\n str += \":id => user.#{condition}\"\n else\n str += \":#{condition} => user.#{condition}\"\n end\n }\n file2.puts str\n\n file2.puts \" end\"\n end\n file2.puts \" end\\nend\\n\"\n file2.close\n file.puts \"cat #{app_name}/app/models/ability.rb\"\n file.close\n File.chmod(0755, script_name)\n script_name\nend", "def process\n proccess_contacts_imports\n proccess_attendance_imports\n process_fnz_imports\n proccess_crm_imports\n process_planning_imports\n process_mailing_imports\n end", "def run\n super\n\n email_address = _get_entity_name\n\n @api_key = _get_task_config(\"hibp_api_key\")\n unless @api_key\n _log_error \"unable to proceed, no API key for HIBP provided\"\n return\n end\n\n _search_pastes_and_create_issues(email_address) if _get_option(\"search_pastes\")\n _search_breaches_and_create_issues(email_address) if _get_option(\"search_breaches\")\n end", "def populate_grid_data\n logger.debug \"populate_grid_data ->\"\n @insurance_eobs_saved ||= @check_information.insurance_payment_eobs.exists? if !@orbograph_correspondence_condition\n @patient_pay_eobs_saved ||= @check_information.patient_pay_eobs.exists?\n if @insurance_eobs_saved.blank? and @patient_pay_eobs_saved.blank?\n if @job.split_parent_job_id.blank?\n @check_information.index_file_check_amount = @check_information.check_amount\n @check_information.save\n end\n end\n @hide_adj_line = @insurance_pay\n if @hide_adj_line || @mpi_service_line.blank?\n svc_lines = []\n svc_lines << ServicePaymentEob.new\n @service_line = svc_lines\n end\n\n @micr_line_information = @check_information.micr_line_information unless\n @facility.details[:micr_line_info].blank?\n @amount_so_far = InsurancePaymentEob.amount_so_far(@check_information, @facility)\n @facility_name = @facility.name\n if(@facility_name == 'METROHEALTH SYSTEM' || @facility_name == 'AVITA HEALTH SYSTEMS')\n @faciltiy_lockbox = FacilityLockboxMapping.find_by_lockbox_number_and_facility_id(@batch.lockbox,@facility.id)\n @facility_lock_box_npi = @faciltiy_lockbox.npi unless @faciltiy_lockbox.nil?\n @facility_lock_box_tin = @faciltiy_lockbox.tin unless @faciltiy_lockbox.nil?\n end\n if @check_information.payer\n @payer = @check_information.payer\n elsif @micr_line_information && @micr_line_information.payer\n @payer = @micr_line_information.payer\n end\n\n if !@payer.blank?\n @payer_name = @payer.payer\n @payer_type = @payer.payer_type\n @payer_address_one = @payer.pay_address_one\n @payer_address_two = @payer.pay_address_two\n @payer_city = @payer.payer_city\n @payer_state = @payer.payer_state\n @payer_zip = @payer.payer_zip\n @payer_id = @payer.id\n @payid = @payer.supply_payid\n @rc_set_name_id = @payer.reason_code_set_name_id\n @payer_indicator_hash, @default_payer_indicator = applicable_payer_indicator(@payid)\n else\n @payer_indicator_hash = {\"ALL\" => \"ALL\"}\n end\n if @facility.details[:payer_tin]\n if @payer && !@payer.payer_tin.blank?\n @payer_tin = @payer.payer_tin\n elsif !@job.payer_tin.blank?\n @payer_tin = @job.payer_tin\n elsif @patient_pay\n @payer_tin = @facility.default_patpay_payer_tin unless @facility.default_patpay_payer_tin.blank?\n else\n @payer_tin = @facility.default_insurance_payer_tin unless @facility.default_insurance_payer_tin.blank?\n end\n end\n if @patient_837_information\n @organization = (@client_name.upcase.strip == 'UPMC' || @client_name.upcase.strip == 'UNIVERSITY OF PITTSBURGH MEDICAL CENTER') ? (@check_information.payee_name.blank? ? @patient_837_information.payee_name : @check_information.payee_name ) : (@patient_837_information.payee_name || @facility.name)\n else\n if (@check_information.insurance_payment_eobs.exists? && (@client_name.upcase.strip == 'UPMC' || @client_name.upcase.strip == 'UNIVERSITY OF PITTSBURGH MEDICAL CENTER'))\n @organization = @check_information.insurance_payment_eobs.first.provider_organisation\n else\n @organization = @facility.name unless (@client_name.upcase.strip == 'UPMC' || @client_name.upcase.strip == 'UNIVERSITY OF PITTSBURGH MEDICAL CENTER')\n end\n end\n if not @insurance_pay\n @claim_type_hash = {\"--\" => \"Primary\", \"Primary\" => \"Primary\", \"Secondary\" => \"Secondary\", \"Tertiary\" => \"Tertiary\" }\n else\n @claim_type_hash = {\"--\" => \"--\", \"Primary\" => \"Primary\", \"Secondary\" => \"Secondary\", \"Tertiary\" => \"Tertiary\",\n \"Denial\" => \"Denial\", \"RPP\" => \"Reversal of Prior payment\",\n \"PPO - No Payment\" => \"Predetermination Pricing Only - No Payment\",\n \"FAP\" => \"Processed as Primary - FAP\" }\n end\n @payment_type_items = ['', 'Money Order', 'Check']\n # HLSC Requirement\n # @payment_type_items = ['']\n # Exclude CHK from the dropdown box if the check type is correspondence\n # @payment_type_items << 'CHK' unless @check_information.correspondence?\n # @payment_type_items.concat(['EOB', 'HIP', 'PAY'])\n\n @job_payment_so_far = @check_information.total_payment_amount.to_f\n @transaction_type_hash = {\"Complete EOB\" => \"Complete EOB\",\n \"Missing Check\" => \"Missing Check\", \"Check Only\" => \"Check Only\", \"Correspondence\" => \"Correspondence\"}\n # The '@transaction_type_selection_value' holds the default seletion value of 'transaction_type'\n @transaction_type_selection_value = \"Complete EOB\"\n # The '@job_payment_so_far' holds the the total payment for this check\n if @job_payment_so_far.zero?\n @transaction_type_possible_value = \"Complete EOB\"\n else\n @transaction_type_possible_value = \"Missing Check\"\n end\n @hash_for_payee_type_format = {'' => nil, 'A' => 'A', 'B' => 'B', 'C' => 'C'}\n @hash_for_patpay_statement_fields = {'' => nil, 'Yes' => true, 'No' => false}\n @hash_for_statement_receiver = {'' => nil, 'Hospital' => 'Hospital', 'Physician' => 'Physician'}\n @show_patpay_statement_fields = (@facility.details[:patpay_statement_fields] &&\n @patient_pay)\n @twice_keying_fields = TwiceKeyingField.get_all_twice_keying_fields(@batch.client_id, @batch.facility_id, current_user.id, @rc_set_name_id)\n @allow_special_characters = @facility.details[:patient_account_number_hyphen_format]\n logger.debug \"<- populate_grid_data\"\n\n end", "def get_sheet_response(range)\n spreadsheet_id = get_spreadsheet_id(Time.now) #gets id of spreadsheet of current month\n $service.get_spreadsheet_values(spreadsheet_id, range).values # mock this\nend", "def import_package_learners_from_csv\n assessment_id = params[:user][:package_id]\n unless params[:import][:excel].nil? or params[:import][:excel].blank? then\n @import = Import.new(params[:import])\n mime = (MIME::Types.type_for(@import.excel.path)[0])\n unless mime.nil? or mime.blank? then\n mime_obj = mime.extensions[0]\n #dont process further if the uploaded file is other than xls,xls,csv\n if (!mime_obj.nil? and !mime_obj.blank?) and (mime_obj.include? \"xls\" or mime_obj.include? \"xlsx\" or mime_obj.include? \"ods\" or mime_obj.include? \"csv\" ) then\n if @import.save!\n #check for virus\n if no_virus(@import.excel.path) then\n #If mime_obj is not csv only then create roo_instace\n unless mime_obj.include? \"csv\" then\n @roo = create_roo_instance(@import.excel.path,mime_obj)\n else\n #so, its a csv format\n @roo = \"csv format\"\n end\n #if the uploaded\n unless @roo == \"Upload correct excel format.\" then\n if @roo == \"csv format\" then\n lines = parse_csv_file(@import.excel.path)\n else\n lines = parse_excel_file_roo(@roo)\n end\n\n if lines.size > 0\n @import.processed = lines.size\n i = 1\n failed_to_upload = Array.new\n lines.each do |line|\n if valid_assign(params[:id])\n if valid_learners_excel_upload(line)\n else\n failed_to_upload << i\n end\n else\n flash[:learner_limit_exceeds] = \"You cannot assign more learners\"\n end\n i = i + 1\n end\n @import.save\n\n delete_csv(@import.excel.path)\n\n @import.destroy\n if params.include? 'from_assign_learners_page' then\n redirect_to(\"/packages/assign_learners/\" + assessment_id.to_s)\n else\n total_failed_to_upload = failed_to_upload.join(\",\")\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}?failed_to_upload=#{total_failed_to_upload}\")\n end\n else\n flash[:error] = \"CSV data processing failed.\"\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:virus_error] = \"The file is Infected with virus.\"\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:error] = 'CSV data import failed.'\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n else\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n end", "def execute()\n @error_message = \"\"\n @error_handling = @parameters[\"error_handling\"]\n\n # CORE configuration\n ce_server = @info_values['ce_api_server'].chomp(\"/\")\n\n # ARS configuration\n\t ars_username = URI.encode(@info_values[\"ars_username\"])\n ars_password = @info_values[\"ars_password\"]\n ars_server = @info_values[\"ars_server\"]\n ars_form = URI.encode(@parameters['form'])\n ars_field_values = JSON.parse(@parameters['field_values'])\n\n # Handler Result Variables\n\t ars_result = \"\"\n ars_record_location = \"\"\n\t ars_request_id = \"\"\n\n begin\n # Reference for creating ARS entry w/attachments\n #\n # https://bmcsites.force.com/casemgmt/sc_KnowledgeArticle?sfdcid=kA33n000000XqnpCAC&type=ProductDescription\n \n \n puts(format_hash(\"Initial ARS Field Values:\", ars_field_values)) if @debug_logging_enabled\n\n # Remove any empty or nil values\n ars_field_values.reject!{ |key,value| (value.nil? or value.empty?) }\n\n # Walk the field values hash to check for a Null keyword - nil,\n # indicating the field value should be sent as null rather than\n # being skipped\n ars_field_values.each_key { |key| ars_field_values[key] = nil if ars_field_values[key] == \"nil\" }\n\n # Create the request body that will consist of multiple parts for the \n # form field values, and the attachments\n ars_request_body = {}\n\n # Get attachments and add to the name to the ARS field values, and \n # the file content to the request body\n if @parameters[\"ce_attachment_field_1\"]\n # download attachment field 1\n file_attachment_1 = download_ce_attachment(\n ce_server, @parameters['submission_id'], @parameters[\"ce_attachment_field_1\"])\n # add the name of the file to ARS attachment field 1\n ars_field_values[@parameters[\"ars_attachment_field_1\"]] = File.basename(file_attachment_1)\n # add the file as an attachment to the request body\n ars_request_body[\"attach-#{@parameters[\"ars_attachment_field_1\"]}\"] = File.new(file_attachment_1, 'rb')\n end\n if @parameters[\"ce_attachment_field_2\"]\n # download attachment field 2\n file_attachment_2 = download_ce_attachment(\n ce_server, @parameters['submission_id'], @parameters[\"ce_attachment_field_2\"])\n # add the name of the file to ARS attachment field 2\n ars_field_values[@parameters[\"ars_attachment_field_2\"]] = File.basename(file_attachment_2)\n # add the file as an attachment to the request body\n ars_request_body[\"attach-#{@parameters[\"ars_attachment_field_2\"]}\"] = File.new(file_attachment_2, 'rb')\n end\n if @parameters[\"ce_attachment_field_3\"]\n # download attachment field 3\n file_attachment_3 = download_ce_attachment(\n ce_server, @parameters['submission_id'], @parameters[\"ce_attachment_field_3\"])\n # add the name of the file to ARS attachment field 3\n ars_field_values[@parameters[\"ars_attachment_field_3\"]] = File.basename(file_attachment_3)\n # add the file as an attachment to the request body\n ars_request_body[\"attach-#{@parameters[\"ars_attachment_field_3\"]}\"] = File.new(file_attachment_3, 'rb')\n end\n\n puts(format_hash(\"Final ARS Field Values:\", ars_field_values)) if @debug_logging_enabled\n\n # entry field values\n entry_file = File.join(Dir::tmpdir, \"entry.json\")\n File.open(entry_file, \"w\") { |f| f.write( { \"values\" => ars_field_values }.to_json) }\n ars_request_body[\"entry\"] = File.new(entry_file, 'r')\n\n # Generate the URL to create the ARS entry\n ars_request_url = \"#{ars_server}/arsys/v1/entry/#{ars_form}\"\n puts(\"ARS Create URL: #{ars_request_url}\") if @debug_logging_enabled\n\n # ars headers\n ars_request_headers = {\n :authorization => \"AR-JWT #{ars_access_token(ars_server, ars_username, ars_password)}\",\n :content_type => \"multipart/form-data\"\n }\n\n # Uncomment to add additional logging. !!Warning token value will be save to log\n # RestClient.log = 'stdout' if @debug_logging_enabled\n\n # Build the HTTP request to create the ARS entry\n ars_request = RestClient::Request.new({\n method: :post,\n url: ars_request_url,\n payload: ars_request_body,\n headers: ars_request_headers\n })\n \n # execute request\n ars_response = ars_request.execute \n\n ars_result = \"Successful\"\n puts(format_hash(\"ARS Response Headers: \", ars_response.headers)) if @debug_logging_enabled\n\n # Retrieve the ARS record URL from the location header\n ars_record_location = ars_response.headers[:location]\n puts(\"ARS Record Location: #{ars_record_location}\") if @debug_logging_enabled\n\n # parse the record ID off the location\n ars_request_id = ars_record_location.split('/').last\n \n rescue RestClient::RequestTimeout => e\n @error_message = \"Timeout creating ARS entry: #{e}\" \n \n # Raise the error if instructed to, otherwise will fall through to\n # return an error message.\n raise if @error_handling == \"Raise Error\"\n rescue RestClient::Exception => e\n @error_message = \"Error creating ARS entry:\" + \n \"\\n\\tResponse Code: #{e.response.code}\\n\\tResponse: #{e.response.body}\"\n \n # Raise the error if instructed to, otherwise will fall through to\n # return an error message.\n raise if @error_handling == \"Raise Error\"\n rescue Exception => e\n @error_message = \"Error creating ARS entry:\\n\\tException: #{e.inspect}\"\n # Raise the error if instructed to, otherwise will fall through to\n # return an error message.\n raise if @error_handling == \"Raise Error\"\n ensure\n # Delete the entry values file\n delete_file(entry_file) if entry_file\n # Delete the attachment files that were downloaded with this handler\n delete_file(file_attachment_1) if file_attachment_1\n delete_file(file_attachment_2) if file_attachment_2\n delete_file(file_attachment_3) if file_attachment_3\n end\n\n # Return the results\n results = <<-RESULTS\n <results>\n\t <result name=\"Handler Error Message\">#{escape(@error_message)}</result>\n <result name=\"Result\">#{escape(ars_result)}</result>\n <result name=\"Record Location\">#{escape(ars_record_location)}</result>\n\t <result name=\"Record ID\">#{escape(ars_request_id)}</result>\n </results>\n RESULTS\n \n return results\n end", "def vision_sheet_input\n @vision_sheet = @xlsx.sheet('Vision').parse(header_search: [])\n @vision_sheet.drop(1).each do |row|\n @vision = Vision.create!(blurb: row['blurb'])\n end\n end", "def store_yardi_summary_files\n doc = Document.find_by_id(@options[:doc_id])\n period = ''\n date_err = false\n month = year = nil\n get_all_sheets.each do |sheet|\n if !read_via_numeral_abs(1, 1, sheet).blank? and read_via_numeral_abs(1, 1, sheet).downcase == 'boxscore summary'\n unless read_via_numeral_abs(3, 1, sheet).blank?\n dts = read_via_numeral_abs(3, 1, sheet).split(' = ').last.split('-')\n begin\n dts[0] = dts[0].to_date\n dts[1] = dts[1].to_date\n rescue\n date_err = true\n end\n unless date_err\n if dts[0] < dts[1] && dts[0].month == dts[1].month && (dts[1] - dts[0]).to_i > 27 && dts[1].year == dts[0].year\n month = dts[0].month\n year = dts[0].year\n period = 'year'\n elsif dts[0] < dts[1] && (dts[1] - dts[0]).to_i == 6\n period = 'weekly'\n else\n period = 'quit'\n doc.update_attribute('parsing_done',false)\n end\n end\n end\n if period == 'year'\n 6.upto find_last_base_cell(sheet) do |row|\n if read_via_numeral_abs(row, 1, sheet).blank? and !read_via_numeral_abs(row, 2, sheet).blank? and read_via_numeral_abs(row, 2, sheet).strip == 'Total'\n property_occupancy_summary = PropertyOccupancySummary.find_or_create_by_real_estate_property_id_and_year_and_month(doc.real_estate_property_id, year, month)\n property_occupancy_summary.total_building_rentable_s = read_via_numeral_abs(row, 3, sheet)\n property_occupancy_summary.current_year_sf_occupied_actual = (property_occupancy_summary.total_building_rentable_s.to_f * (read_via_numeral_abs(row,17,sheet).blank? ? 1 : read_via_numeral_abs(row,17,sheet).to_f)) / 100 rescue 0\n property_occupancy_summary.current_year_sf_vacant_actual = property_occupancy_summary.total_building_rentable_s - property_occupancy_summary.current_year_sf_occupied_actual rescue 0\n property_occupancy_summary.vacant_leased_number = read_via_numeral_abs(row, 7, sheet).blank? ? 0 : read_via_numeral_abs(row, 7, sheet).to_i\n property_occupancy_summary.vacant_leased_percentage = (property_occupancy_summary.vacant_leased_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.currently_vacant_leases_number = property_occupancy_summary.vacant_leased_number + (read_via_numeral_abs(row, 8, sheet).blank? ? 0 : read_via_numeral_abs(row, 8, sheet).to_f)\n property_occupancy_summary.currently_vacant_leases_percentage = ( property_occupancy_summary.currently_vacant_leases_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.occupied_preleased_number = read_via_numeral_abs(row, 9, sheet).blank? ? 0 : read_via_numeral_abs(row, 9, sheet).to_i\n property_occupancy_summary.occupied_preleased_percentage = (property_occupancy_summary.occupied_preleased_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.occupied_on_notice_number = property_occupancy_summary.occupied_preleased_number + (read_via_numeral_abs(row, 10, sheet).blank? ? 0 : read_via_numeral_abs(row, 10, sheet).to_i)\n property_occupancy_summary.occupied_on_notice_percentage = (property_occupancy_summary.occupied_on_notice_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.net_exposure_to_vacancy_number = (property_occupancy_summary.currently_vacant_leases_number - property_occupancy_summary.vacant_leased_number) + (property_occupancy_summary.occupied_on_notice_number - property_occupancy_summary.occupied_preleased_number)\n property_occupancy_summary.net_exposure_to_vacancy_percentage = (property_occupancy_summary.net_exposure_to_vacancy_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.current_year_units_total_actual = read_via_numeral_abs(row, 5, sheet).to_f\n property_occupancy_summary.current_year_units_occupied_actual = (property_occupancy_summary.current_year_units_total_actual.to_f * (read_via_numeral_abs(row,17,sheet).blank? ? 1 : read_via_numeral_abs(row,17,sheet).to_f)) / 100 rescue 0\n property_occupancy_summary.current_year_units_vacant_actual = property_occupancy_summary.current_year_units_total_actual - property_occupancy_summary.current_year_units_occupied_actual rescue 0\n property_occupancy_summary.save\n break\n end\n end if !date_err && month && year && period # check the excel file is valid.\n elsif period == \"weekly\"\n index_hash = {}\n availability, conversion = false, false\n 4.upto find_last_base_cell(sheet) do |row|\n if !read_via_numeral_abs(row, 1, sheet).blank? && [\"Availability\", \"Conversion Ratios\", \"Resident Activity\"].include?(read_via_numeral_abs(row, 1, sheet))\n availability = true if read_via_numeral_abs(row, 1, sheet) == \"Availability\"\n conversion = true if read_via_numeral_abs(row, 1, sheet) == \"Conversion Ratios\"\n elsif read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank? && read_via_numeral_abs(row, 2, sheet) == 'Total'\n availability, conversion = false, false\n elsif !read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank?\n if availability\n index_hash.update({read_via_numeral_abs(row, 1, sheet)=> ''})\n elsif conversion\n index_hash.update({read_via_numeral_abs(row, 1, sheet)=> row}) if index_hash.include? read_via_numeral_abs(row, 1, sheet)\n end\n end\n end\n 4.upto find_last_base_cell(sheet) do |row|\n unless read_via_numeral_abs(row, 1, sheet) == 'Code' && index_hash.include?(read_via_numeral_abs(row, 1, sheet))\n obj = PropertyWeeklyOsr.find_or_initialize_by_real_estate_property_id_and_floor_plan_and_time_period(doc.real_estate_property_id, read_via_numeral_abs(row, 1, sheet),dts[1].strftime(\"%Y-%m-%d\"))\n obj.user_id = doc.user_id\n obj.units = read_via_numeral_abs(row, 5, sheet)\n obj.prelsd = read_via_numeral_abs(row, 7, sheet).blank? ? 0 : read_via_numeral_abs(row, 7, sheet).to_i\n obj.vacant_total = obj.prelsd + (read_via_numeral_abs(row, 8, sheet).blank? ? 0 : read_via_numeral_abs(row, 8, sheet).to_i)\n obj.prelsd2 = read_via_numeral_abs(row, 9, sheet).blank? ? 0 : read_via_numeral_abs(row, 9, sheet).to_i\n obj.ntv_status_total = obj.prelsd2 + (read_via_numeral_abs(row, 10, sheet).blank? ? 0 : read_via_numeral_abs(row, 10, sheet).to_i)\n obj.current = obj.vacant_total + obj.ntv_status_total\n obj.pi_total = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 3, sheet)\n obj.wi_total = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 4, sheet)\n obj.dep_total = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 9, sheet)\n obj.dep_rej = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 14, sheet)\n obj.dep_canc = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 15, sheet)\n obj.save\n end if !read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank?\n break if read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank? && read_via_numeral_abs(row, 2, sheet) == 'Total'\n end unless index_hash.empty?\n end\n end\n end\n end", "def import\n\t\t@employees_array = CSV.read(\"#{Rails.root}/app/assets/TOGV_BUCKS.CSV\")\n\t\t@employees_array.shift # Get rid of header contents\n\n\t\t@employees_array.each do |e|\n\n\t\t\tif e[COLUMN_EMPLOYEE_NUMBER] == 'Employee Number'\n\t\t\t\treturn\n\t\t\tend\n\n\t\t\tif !Job.exists?(jobcode: e[COLUMN_JOB_CODE])\n\t\t\t\tjob_params = { \n\t\t\t\t\t:jobcode => e[COLUMN_JOB_CODE],\n\t\t\t\t\t:title => e[COLUMN_JOB_TITLE]\n\t\t\t\t}\n\t\t\t\tJob.new(job_params).save\n\t\t\telse\n\t\t\t\tjob = Job.find(e[COLUMN_JOB_CODE])\n\t\t\t\tif job.title != e[COLUMN_JOB_TITLE]\n\t\t\t\t\tjob.update_attribute(:title, e[COLUMN_JOB_TITLE])\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif !Department.exists?(name: e[COLUMN_DEPARTMENT])\n\t\t\t\tDepartment.new(:name => e[COLUMN_DEPARTMENT],\n\t\t\t\t\t:property_id => e[COLUMN_EMPLOYEE_NUMBER][0..-8]).save\n\t\t\tend\n\n\t\t\tif !Employee.exists?(IDnum: e[COLUMN_EMPLOYEE_NUMBER])\n\t\t\t\temployee_params = { \n\t\t\t\t\t:IDnum => e[COLUMN_EMPLOYEE_NUMBER],\n\t\t\t\t\t:first_name => extract_first_name(e[COLUMN_EMPLOYEE_NAME]),\n\t\t\t\t\t:last_name => extract_last_name(e[COLUMN_EMPLOYEE_NAME]),\n\t\t\t\t\t:job_id => e[COLUMN_JOB_CODE],\n\t\t\t\t\t:department_id => extract_department_id(e[COLUMN_DEPARTMENT]),\n\t\t\t\t\t:password => extract_initial_password(e[COLUMN_HIRED]),\n\t\t\t\t\t:property_id => e[COLUMN_EMPLOYEE_NUMBER][0..-8],\n\t\t\t\t\t:email => e[COLUMN_EMAIL],\n\t\t\t\t\t:status => e[COLUMN_STATUS],\n\t\t\t\t\t:new_pass => true\n\t\t\t\t}\n\n\t\t\t\tEmployee.new(employee_params).save\n\t\t\telse\n\t\t\t\t@employee = Employee.find(e[COLUMN_EMPLOYEE_NUMBER])\n\t\t\t\t@employee.update_attributes(status: e[COLUMN_STATUS], department_id: extract_department_id(e[COLUMN_DEPARTMENT]),\n\t\t\t\t\tjob_id: e[COLUMN_JOB_CODE], email: e[COLUMN_EMAIL], first_name: extract_first_name(e[COLUMN_EMPLOYEE_NAME]), last_name: extract_last_name(e[COLUMN_EMPLOYEE_NAME]))\n\t\t\tend\n\t\tend\n\tend", "def generate_test_from_google_xls spreadsheet, sl_no\n\n\ttheEmail = get_email()\n\tthePassword = get_password()\n\n\tsession = GoogleDrive.login(theEmail, thePassword)\n\tws = session.spreadsheet_by_key(\"#{spreadsheet}\").worksheets[sl_no.to_i]\n\n\t# Check the structure of xls sheet\n\tif ws[1,5] != \"Case Description\" # Case Description\n\t\tputs \"Provide your Case Description column name properly\"\n\t\texit\n\telsif ws[1,7] != \"Procedure\" # Procedure\n\t\tputs \"Provide your Procedure column name properly\"\n\t\texit\n\telsif ws[1,8] != \"Expected Results\" # Expected Results\n\t\tputs \"Provide your Expected Results column name properly\"\n\t\texit\n\telsif ws[1,9] != \"Notes\" # Notes\n\t\tputs \"Provide your Notes column name properly\"\n\t\texit\n\tend\n\n\tFile.open($path_to_spec, 'w') do |f|\n\t\t#Start Describe\n \tf.puts \"describe('#{ws.title} Functionality Test', function() {\"\n\tend\n\t# Dumps all cells.\n\tfor row in 2..ws.num_rows\n\t\ttest_casedescription = (ws[row,5].gsub(\"\\n\", \"<br/>\")).gsub(\"'\", %q(\\\\\\'))\n\t\ttest_procedure = (ws[row,7].gsub(\"\\n\", \"<br/>\")).gsub(\"'\", %q(\\\\\\'))\n\t\ttest_expected = (ws[row,8].gsub(\"\\n\", \"<br/>\")).gsub(\"'\", %q(\\\\\\'))\n\t\t\n\t\tFile.open($path_to_spec, 'a') do |f|\n\t\t\t#Start it\n\t\t\tf.puts \"it('#{test_casedescription}',function(){\"\n\t\t\tf.puts \"dispTestCaseRunning('#{test_procedure}');\"\n\t\t\tf.puts \"dispExpectedResult('#{test_expected}');\"\n\t\t\tf.puts \"//Common Method implemented to wait for tester to run the test.Code available in specHelper.js\"\n\t\t\tf.puts \"_result.waitToRunTest();\"\n\t\t\tf.puts \"runs(function(){\"\n\t\t\tf.puts \"// Write your code here.\"\n\t\t\tf.puts \"});\"\n\t\t\tf.puts \"//Add more waitsfor or run blocks if required.\"\n\t\t\tf.puts \"//Common Method implemented to wait for tester to make it pass or fail.Code available in specHelper.js\"\n\t\t\tf.puts \"_result.waitForResponse();\"\n\t\t\tf.puts \"});\"\n\t\tend\n\n\tend\n\tFile.open($path_to_spec, 'a') do |f|\n\t\t#End Describe\n\t\tf.puts \"});\"\n\tend\n\nend", "def process_data()\n \tSpreadsheet.client_encoding='UTF-8'\n\tbook=Spreadsheet::Workbook.new\n\tsheet = book.create_worksheet\n\tsheet.row(0).push 'Link Text','Link Url','Description' #For including headers to the spreadsheet.\n\n\tmain_content=Array.new\n\ts=''\n\ts1=''\n\tvalue=0\n\trow_count=1\n\titerate=@range1.to_i\n\twhile iterate <= @range2.to_i\n \t\tif iterate==1\n \t\t\turl='http://www.google.co.in/search?q='+@query_string.to_s\n \t\t\tlink_count=11\n \t\telsif iterate>1\n \t\t\tvalue=(iterate-1)*10\n \t\t\tlink_count=10\n \t\t\turl='http://www.google.co.in/search?q='+@query_string.to_s+'&start='+value.to_s\n \t\tend\n \t\tdoc = Pismo::Document.new(url)\n \t\tcontent=doc.body.to_s\n \t\tmain_content=content.split('*',11)\n \t\ttmp=1\n \t\twhile tmp <= link_count\n \t\t\ts=main_content[tmp]\n \t\t\ts1=s.lines.map(&:chomp) #s1=s.split(/[\\n]+/)\n \t\t\t#print \"Link #{j} : \" + s1[1].to_s + \"\\nUrl #{j} : \" + s1[2].to_s + \"\\nDesc #{j} : \" + s1[3].to_s + \"\\n\"\n \t\t\tsheet.row(row_count).push s1[1].to_s,s1[2].to_s,s1[3].to_s\n \t\t\tbook.write('/home/chandrasekar/training-ruby/shekar/18_September/website_link.xls')\n \t\t\trow_count+=1\n \t\t\ttmp+=1\n \t\tend\n \t\titerate+=1\n\tend\n end", "def step1_1_swimmer_analysis\n# DEBUG\n logger.debug( \"\\r\\n\\r\\n!! ------ #{self.class.name} - swimmer_analysis -----\" )\n logger.debug( \"> #{params.inspect}\" )\n # [Steve, 20161001] We need to whitelist all parameters, since we are using this as Admins\n params.permit!()\n # Propagate forward (phase-3) the parameters from Phase-1, if any:\n @force_missing_meeting_creation = (params[:force_meeting_creation] == 'true') ||\n (params[:force_meeting_creation].to_i > 0)\n @force_team_or_swimmer_creation = (params[:force_team_or_swimmer_creation] == 'true') ||\n (params[:force_team_or_swimmer_creation].to_i > 0)\n if ( params[:id].to_i > 0 )\n @data_import_session = DataImportSession.find_by_id( params[:id].to_i )\n @analysis_results = DataImportSwimmerAnalysisResult.where( data_import_session_id: @data_import_session.id )\n else\n @data_import_session = nil\n @analysis_results = []\n end\n end", "def execute()\n \n # Retrieve a single entry from KS_SRV_Helper form\n base_record = @@remedy_forms['KS_SRV_CustomerSurvey'].find_entries(\n :single,\n :conditions => [%|'CustomerSurveyInstanceId' = \"#{@parameters['Submission ID']}\" OR 'CustomerSurveyID' = \"#{@parameters['Submission ID']}\"|],\n :fields => :all\n )\n \n raise \"Unable to find KS_SRV_CustomerSurvey record with CustomerSurvey ID or instanceId of: #{@parameters['Submission ID']}\" if base_record.nil?\n \n\tif (@taskVersion == \"3\")\n\t#v3\n # Build the template record from the KS_SRV_CustomerSurvey record, which\n # includes the Template fields.\n\t template_record = Records::Template.new(base_record)\n \n # Build the template dataset mappings based on the KS_SRV_DataSet form\n # records for dataset specified on the current KS_SRV_CustomerSurvey\n # record.\n\n\t @dataset_hash = Records::TemplateDataSetMapping.find_all(\n\t\t :data_set => template_record.data_set\n\t\t).inject({}) do |hash, mapping_record|\n\t\t # Define the current KS_SRV_DataSet record's field_id as a Fixnum\n\t\t field_id = mapping_record.field_id.to_i\n\t\t # Retrieve the ArsModels::Field associated with the current\n\t\t # KS_SRV_CustomerSurvey field.\n\t\t mapping_field = Records::RequestBase.form.field_for(field_id)\n\t\t # Unless the field does not exist on the form, or the field is display only\n\t\t unless mapping_field.nil? || mapping_field.entrymode == \"DISPLAY_ONLY\"\n\t\t\t# Retrieve the value of the field on the KS_SRV_CustomerSurvey entry\n\t\t\tvalue = base_record[field_id]\n\t\t\t# Map the KS_SRV_DataSet record's field label value to the field value\n\t\t\thash[mapping_record.field_label] = value.respond_to?(:value) ? value.value : value\n\t\t end\n\t\t # Return the hash to continue injecting\n\t\t hash\n\t\tend\n\t\t puts(format_hash(\"Dataset Found: \", @dataset_hash)) if @debug_logging_enabled\n\t\n\telsif (@taskVersion == \"4\")\n\t \n\t template_record = Records::Template.new(base_record, :context => @@remedy_context)\n\t \n\t @dataset_hash = Records::TemplateDataSetMapping.find_all(\n\t\t :data_set => template_record.data_set, :context => @@remedy_context\n\t\t).inject({}) do |hash, mapping_record|\n\t\t # Define the current KS_SRV_DataSet record's field_id as a Fixnum\n\t\t field_id = mapping_record.field_id.to_i\n\t\t # Retrieve the ArsModels::Field associated with the current\n\t\t # KS_SRV_CustomerSurvey field.\n\t\t mapping_field = Records::RequestBase.form.field_for(field_id)\n\t\t # Unless the field does not exist on the form, or the field is display only\n\t\t unless mapping_field.nil? || mapping_field.entrymode == \"DISPLAY_ONLY\"\n\t\t\t# Retrieve the value of the field on the KS_SRV_CustomerSurvey entry\n\t\t\tvalue = base_record[field_id]\n\t\t\t# Map the KS_SRV_DataSet record's field label value to the field value\n\t\t\thash[mapping_record.field_label] = value.respond_to?(:value) ? value.value : value\n\t\t end\n\t\t # Return the hash to continue injecting\n\t\t hash\n\t\tend\n\t\tputs(format_hash(\"Dataset Found: \", @dataset_hash)) if @debug_logging_enabled\n\t\t\n\tend\n \n dataset_results = \"\" \n @dataset_hash.each_pair {|key, value|\n dataset_results << %|<result name=\"#{key}\">#{escape(value)}</result>|\n }\n \n <<-RESULTS\n <results>\n #{dataset_results}\n </results>\n RESULTS\n \n end", "def import_all\n data_in_batches do |batch|\n Bookings::Data::SchoolMassImporter.new(batch, email_override).import\n end\n end", "def upload_product_excel\n require 'spreadsheet'\n\n @excel = Excel.new(name: 'Excel_upload', parse_errors: nil, spreadsheet: params[:file])\n \n logger.info \"********* File: #{params[:file]}\"\n logger.debug \"********** Errors: #{@excel.errors.full_messages}\"\n open_part = Spreadsheet.open(params[:file].tempfile.path)\n\n part = open_part.worksheet(0)\n \n #skip the first column of each row.\n part_row = part.row(1)\n part_size = part.count\n if part_size <= 2\n\n #pulls out the name which is the part number of the product\n #(needs to be a string)\n @excel.part_num = part_row[0].to_int.to_s\n\n #pulls out the category from the product sheet\n #(needs to be a string given the dash in the category)\n @category = part_row[1].to_s\n\n #pulls out the Description from the product sheet\n #(needs to be a string and will have to work to ensure this works when putting into a text format)\n @excel.description = part_row[2].to_s\n\n #pulls out the Item Tax Code\n #(Not sure on this one need to figure out)\n @item_tax_code = part_row[3]#what is this column numbers and letters? Just Numbers\n\n #pulls out the Unit Price of the item\n #(needs to be a decimal)\n @excel.price = part_row[4]\n\n #pulls out the Last purchase cost\n #(needs to be a decimal)\n @excel.LastPurchasecost = part_row[5]\n\n #pulls out the product length (in)\n #(needs to be a decimal)\n @excel.Productlength = part_row[6]\n\n #pulls out the product width (in)\n #(needs to be a decimal)\n @excel.Productwidth = part_row[7].to_s\n\n #pulls out the product height (in)\n #(needs to be a decimal)\n @excel.Productheight = part_row[8].to_s\n\n #pulls out the product weight\n #(needs to be a decimal)\n @excel.Productweight = part_row[9].to_s\n\n #Remarks\n #(needs to be a string)\n #In my opinion this needs to be removed from the table\n remarks = part_row[10].to_s\n\n #application\n #(needs to be a string)\n @excel.Application = part_row[11].to_s\n\n #Location\n #(needs to be a string)\n @excel.Location = part_row[12].to_s\n\n #Condition \n #(needs to be a string)\n condition = part_row[13].to_s\n\n #Cross Reference\n #(needs to be a string)\n @excel.CrossReference = part_row[14].to_s\n\n #Casting number\n #(needs to be an integer)\n @excel.CastingNum = part_row[15]\n unless @excel.CastingNum.nil?\n @excel.CastingNum = @excel.CastingNum.to_int\n end\n\n #Core Charge\n #(needs to be a decimal)\n @excel.CoreCharge = part_row[16]\n\n #For sale (date in which it is for sale)\n #(needs to be a string)\n @excel.ForSale = part_row[17].to_s\n\n #Online store\n #(needs to be a string for now)\n #I may request this to be removed it seems to be redundant at this point\n @excel.OnlineStore = part_row[18].to_s\n\n #IsActive\n #(needs to be a string for now)\n @excel.IsActive = part_row[19].to_s\n\n #Item\n #I believe I would like this to be removed\n item = part_row[20].to_s\n\n #location-duplicate with column [17] above.\n #(needs to be a string)\n loc = part_row[21].to_s\n\n #Sublocation\n #(needs to be a string)\n @excel.Sublocation= part_row[22].to_s\n\n #Quantity\n #(needs to be an integer)\n @excel.Quantity = part_row[23].to_int\n unless @excel.Quantity.nil?\n @excel.Quantity = @excel.Quantity.to_int\n end\n \n # @product = Product.new(name: part_name,description: descrip)\n # #redirect_to admin_product_path(@product)\n # @product.master.price = price\n # if @product.save\n # #flash[:success] = \"Product successfully saved\"\n # redirect_to edit_admin_product_url(@product)\n # else\n # flash[:success] = \"Product didn't save\"\n # end\n if @excel.save\n @product = Product.new\n @product.id = @excel.part_num\n @product.name = @excel.part_num\n @product.master.id = @excel.part_num\n @product.description = @excel.description\n @product.available_on = @excel.ForSale\n if @product.save\n flash[:success] = @product#{}\"Success\"\n else\n flash[:success] = \"Still missing something\"\n end\n\n #redirect_to admin_general_settings_url\n end\n end\n # part.each do |row|\n # #grab each name based upon the location of the data.\n # part_name = part[0]\n # part_name = part_name.to_int\n # part_name = part_name.to_s\n # end\n render :action => :upload\n end", "def create\n \n @@val = false #set false for file not finished parsing \n params_to_pass = spreadsheet_params\n params_to_pass[\"name\"] = params[\"year\"]\n @spreadsheet = Spreadsheet.new(params_to_pass)\n \n #do the database population in separate thread\n Thread.new do\n \n saved = @spreadsheet.saveAndMove\n \n location = \"public/uploads/spreadsheet/attachment/\" + params[\"spreadsheet\"][\"attachment\"].original_filename \n command = \"cat \" + location \n system(command) \n \n csv_data = CSV.read location \n headerFields = csv_data[0] \n headerFields = headerFields.map { |header| \n CreateHeaderString(header).to_sym \n } \n \n iteration = 0 \n csv_data.each do |data| \n if iteration > 0 \n createStudent(headerFields, data, params[\"year\"]) \n end \n iteration = iteration + 1 \n end\n ActiveRecord::Base.connection.close\n \n \n @@val = true\n\n end\n \n data = {:value => \"Howdy\"} #likely was just used for testing\n\n respond_to do |format|\n format.html\n format.js\n end\n\n end", "def validate_record record = nil, current_user_info\r\n self.status = \"Validating records...\"\r\n if record\r\n record_id = record[:id].to_s\r\n jid = ValidateImportWorker.perform_async(id, office.id, record_id, current_user_info)\r\n else\r\n #validates everything\r\n jid = ValidateImportWorker.perform_async(id, office.id, nil, current_user_info)\r\n end\r\n save\r\n jid\r\n end", "def processEnclaveControlsFile(filePath)\n # setup\n sql = ActiveRecord::Base.connection();\n fileName = \"#{FileUtils.pwd()}/upload/#{filePath}.xls\"\n fileName = fileName.gsub(/\\//, '\\\\')\n \n # set up two pointers for spreadsheet to work on different tabs\n s = Excel.new(fileName)\n s2 = Excel.new(fileName)\n s.default_sheet = s.sheets[1]\n s2.default_sheet = s2.sheets[4]\n \n # process each record in spreadsheet\n 8.upto(s.last_row) do |line|\n # get line of info from spreadsheet\n line2 = line + 1\n #baseControlNumber = s.cell(line, 'A')\n baseControlNumber = s2.cell(line2, 'F')\n #controlName = s.cell(line, 'B')\n controlName = s2.cell(line2, 'G')\n cagControla = s.cell(line, 'E')\n cagControl = s2.cell(line2, 'K')\n implementationStatus = s.cell(line, 'F')\n implementationDescription = s.cell(line, 'G')\n testMethod = s.cell(line, 'H')\n poam = s.cell(line, 'I')\n \n # debug info to log\n #Rails.logger.error \"\\n\" + \"#{line}-a: #{baseControlNumber}, b: #{controlName}, c: #{cagControl}, d: #{implementationStatus}, e: #{implementationDescription}, f: #{testMethod}\\n\"\n \n if baseControlNumber != nil then #Skip empty lines\n # determin cybercontrol referenced\n controlFamily = ''\n controlNumber = 0\n enhancement = nil\n parts = baseControlNumber.split(/-/)\n controlFamily = parts[0]\n controlNumber = parts[1]\n if (/^\\([0-9]*\\)$/ =~ controlName) then\n enhancement = controlName.gsub(/\\(/,'')\n enhancement = enhancement.gsub(/\\)/, '')\n end\n \n # get matching cyber control\n cc = nil\n if enhancement != nil then\n cc = Cybercontrol.where(:controlFamilyCode => controlFamily, :controlNumber => controlNumber, :enhancement => enhancement).first\n else\n cc = Cybercontrol.where(\"controlFamilyCode=? AND controlNumber=? AND enhancement IS NULL\", controlFamily, controlNumber).first\n end\n \n # Post data to enclave controls table\n #sqlcode = \"UPDATE enclavecontrols SET SSPImplementationStatus=?, SSPImplementationDescription=?, testMethod=?\" + ((cagControl='RMF') ? \", RMF=1\" : \"\") + \" WHERE cybercontrol_id=#{cc.id}\"\n #status = sql.execute(sqlcode, implementationStatus, implementationDescription, )\n ecSet = Enclavecontrol.where(:cybercontrol_id => cc.id)\n ecSet.each do |ec|\n ec.SSPImplementationStatus = implementationStatus\n ec.SSPImplementationDescription = implementationDescription\n ec.testMethod = testMethod\n if (cagControla==\"RMF\") then\n ec.RMF = 1\n else\n ec.RMF = 0\n end\n ec.save\n end\n end\n \n end\n end", "def validate!\n\n reset = \"\\r\\e[0K\"\n\n @check_users = true\n line = reset_line\n\n add_check_all(validate_csv_header :user, @check_users)\n user_bar = ProgressBar.new(\"Users...\", csv_size(:user)) if @verbose\n csv_for_each :user do |row|\n user = true\n row.each do |col, value|\n user &= value.present?\n end\n\n print_error :err_missing, :user, line unless user\n\n @check_users &= user\n # cache user id\n user_ids[row[\"id\"]] = true\n user_bar.inc if @verbose\n line += 1\n break unless user\n end\n user_bar.finish if @verbose\n add_check_all(@check_users)\n\n @check_groups = true\n\n add_check_all(validate_csv_header :group, @check_groups)\n line = reset_line\n # This function will change the header\n # due to a very common typo on csv\n fix_csv_elp_name\n group_bar = ProgressBar.new(\"Groups...\", csv_size(:group)) if @verbose\n csv_for_each :group do |row|\n group = true\n row.each do |col, value|\n group &= value.present?\n end\n print_error :err_missing, :group, line unless group\n\n group &= row[\"privacy\"].downcase == \"public\" || row[\"privacy\"].downcase == \"private\"\n print_error :err_validity, :group, line, \"privacy\", \"Privacy\", row[\"privacy\"] unless group\n\n group &= !row[\"privacy\"].downcase!\n print_error :err_lowercase, :group, line, \"privacy\", \"Privacy\", row[\"privacy\"] unless group\n\n @check_groups &= group\n # cache group id\n groups[row[\"id\"]] = true\n group_bar.inc if @verbose\n line += 1\n break unless group\n end\n group_bar.finish if @verbose\n\n add_check_all(@check_groups)\n\n @check_memberships = true\n line = reset_line\n add_check_all(validate_csv_header :membership, @check_memberships)\n member_bar = ProgressBar.new(\"Memberships\", csv_size(:membership)) if @verbose\n csv_for_each :membership do |row|\n membership = true\n row.each do |col, value|\n membership &= value.present? unless col==\"creator_id\"\n end\n print_error :err_missing, :membership, line unless membership\n\n membership &= groups[row[\"group_id\"]] if membership\n print_error :err_foreign, :membership, line, \"group_id\" unless membership\n\n if row[\"creator_id\"].present?\n membership &= user_ids[row[\"creator_id\"]]\n print_error :err_foreign, :membership, line, \"creator_id\" unless membership\n end\n\n membership &= row[\"level\"].downcase == \"admin\" || row[\"level\"].downcase == \"member\"\n print_error :err_validity, :membership, line, \"level\", \"Access Level\", row[\"level\"] unless membership\n\n membership &= !row[\"level\"].downcase!\n print_error :err_lowercase, :membership, line, \"level\", \"Access Level\", row[\"level\"] unless membership\n\n @check_memberships &= membership\n line += 1\n member_bar.inc if @verbose\n\n break unless membership\n end\n member_bar.finish if @verbose\n add_check_all(@check_memberships)\n\n @check_lings = true\n line = reset_line\n add_check_all(validate_csv_header :ling, @check_lings)\n ling_bar = ProgressBar.new(\"Lings\", csv_size(:ling)) if @verbose\n csv_for_each :ling do |row|\n ling = true\n row.each do |col, value|\n ling &= value.present? unless col==\"creator_id\" || col==\"parent_id\"\n end\n print_error :err_missing, :ling, line unless ling\n\n ling &= groups[row[\"group_id\"]] if ling\n print_error :err_foreign, :ling, line, \"group_id\" unless ling\n\n if row[\"creator_id\"].present?\n ling &= user_ids[row[\"creator_id\"]] if ling\n print_error :err_foreign, :ling, line, \"creator_id\" unless ling\n end\n\n @check_lings &= ling\n # cache ling id\n ling_ids[row[\"id\"]] = row[\"group_id\"]\n\n line += 1\n ling_bar.inc if @verbose\n break unless ling\n end\n ling_bar.finish if @verbose\n add_check_all(@check_lings)\n line = reset_line\n @check_parents = true\n ling_ass_bar = ProgressBar.new(\"Lings Associations\", csv_size(:ling)) if @verbose\n csv_for_each :ling do |row|\n if row[\"parent_id\"].blank?\n ling_ass_bar.inc if @verbose\n next\n end\n\n parent = ling_ids[row[\"parent_id\"]].present?\n print_error :err_foreign, :ling, line, \"parent_id\" unless parent\n\n parent &= ling_ids[row[\"parent_id\"]] == row[\"group_id\"]\n print_error :err_foreign, :ling, line, \"group_id\" unless parent\n\n print_to_console \"\\n=> Should be '#{ling_ids[row[\"parent_id\"]]}' instead of '#{row[\"group_id\"]}'\" unless parent\n @check_parents &= parent\n\n line += 1\n ling_ass_bar.inc if @verbose\n break unless parent\n end\n ling_ass_bar.finish if @verbose\n add_check_all(@check_parents)\n\n @check_categories = true\n line = reset_line\n add_check_all(validate_csv_header :category, @check_categories)\n cat_bar = ProgressBar.new(\"Category\", csv_size(:category)) if @verbose\n csv_for_each :category do |row|\n category = true\n row.each do |col, value|\n category &= value.present? unless col==\"creator_id\" || col==\"description\"\n end\n print_error :err_missing, :category, line unless category\n\n category &= groups[row[\"group_id\"]] if category\n print_error :err_foreign, :category, line, \"group_id\" unless category\n\n if row[\"creator_id\"].present?\n category &= user_ids[row[\"creator_id\"]] if category\n print_error :err_foreign, :category, line, \"creator_id\" unless category\n end\n\n @check_categories &= category\n\n # cache category id\n category_ids[row[\"id\"]] = true\n\n line += 1\n cat_bar.inc if @verbose\n break unless category\n end\n cat_bar.finish if @verbose\n add_check_all(@check_categories)\n\n @check_properties = true\n line = reset_line\n add_check_all(validate_csv_header :property, @check_properties)\n prop_bar = ProgressBar.new(\"Property\", csv_size(:property)) if @verbose\n csv_for_each :property do |row|\n property = true\n row.each do |col, value|\n property &= value.present? unless col==\"creator_id\" || col==\"description\"\n end\n\n print_error :err_missing, :property, line unless property\n\n property &= groups[row[\"group_id\"]] if property\n print_error :err_foreign, :property, line, \"group_id\" unless property\n\n property &= category_ids[row[\"category_id\"]] if property\n print_error :err_foreign, :property, line, \"category_id\" unless property\n\n if row[\"creator_id\"].present?\n property &= user_ids[row[\"creator_id\"]] if property\n print_error :err_foreign, :property, line, \"creator_id\" unless property\n end\n\n @check_properties &= property\n # cache property id\n property_ids[row[\"id\"]] = true\n\n line += 1\n prop_bar.inc if @verbose\n break unless property\n end\n prop_bar.finish if @verbose\n add_check_all(@check_properties)\n\n @check_examples = true\n line = reset_line\n add_check_all(validate_csv_header :example, @check_examples)\n ex_bar = ProgressBar.new(\"Examples\", csv_size(:example)) if @verbose\n csv_for_each :example do |row|\n example = true\n row.each do |col, value|\n example &= value.present? unless col==\"creator_id\"\n end\n\n print_error :err_missing, :example, line unless example\n\n example &= groups[row[\"group_id\"]] if example\n print_error :err_foreign, :example, line, \"group_id\" unless example\n\n example &= ling_ids[row[\"ling_id\"]] if example\n print_error :err_foreign, :example, line, \"ling_id\" unless example\n\n if row[\"creator_id\"].present?\n example &= user_ids[row[\"creator_id\"]] if example\n print_error :err_foreign, :example, line, \"creator_id\" unless example\n end\n\n @check_examples &= example\n # cache example id\n example_ids[row[\"id\"]] = true\n\n line += 1\n ex_bar.inc if @verbose\n break unless example\n end\n ex_bar.finish if @verbose\n add_check_all(@check_examples)\n\n @check_lings_properties = true\n line = reset_line\n add_check_all(validate_csv_header :lings_property, @check_lings_properties)\n lp_bar = ProgressBar.new(\"Lings Properties\", csv_size(:lings_property)) if @verbose\n csv_for_each :lings_property do |row|\n lp = true\n row.each do |col, value|\n lp &= value.present? unless col==\"creator_id\"\n end\n\n print_error :err_missing, :lings_property, line unless lp\n\n lp &= groups[row[\"group_id\"]] if lp\n print_error :err_foreign, :lings_property, line, \"group_id\" unless lp\n\n lp &= ling_ids[row[\"ling_id\"]] if lp\n print_error :err_foreign, :lings_property, line, \"ling_id\" unless lp\n\n if row[\"creator_id\"].present?\n lp &= user_ids[row[\"creator_id\"]] if lp\n print_error :err_foreign, :lings_property, line, \"creator_id\" unless lp\n end\n\n @check_lings_properties &= lp\n lp_bar.inc if @verbose\n # cache lings_property id\n lings_property_ids[row[\"id\"]] = true\n\n break unless lp\n end\n lp_bar.finish if @verbose\n add_check_all(@check_lings_properties)\n\n @check_examples_lp = true\n line = reset_line\n add_check_all(validate_csv_header :examples_lings_property, @check_examples_lp)\n elp_bar = ProgressBar.new(\"Examples Lings Properties\", csv_size(:examples_lings_property)) if @verbose\n csv_for_each :examples_lings_property do |row|\n elp = true\n row.each do |col, value|\n elp &= value.present? unless col==\"creator_id\"\n end\n\n print_error :err_missing, :examples_lings_property, line unless elp\n\n elp &= groups[row[\"group_id\"]] if elp\n print_error :err_foreign, :examples_lings_property, line, \"group_id\" unless elp\n\n elp &= lings_property_ids[row[\"lings_property_id\"]] if elp\n print_error :err_foreign, :examples_lings_property, line, \"lings_property_id\" unless elp\n\n elp &= example_ids[row[\"example_id\"]] if elp\n print_error :err_foreign, :examples_lings_property, line, \"example_id\" unless elp\n\n if row[\"creator_id\"].present?\n elp &= user_ids[row[\"creator_id\"]] if elp\n print_error :err_foreign, :examples_lings_property, line, \"example_id\" unless elp\n end\n\n @check_examples_lp &= elp\n elp_bar.inc if @verbose\n line += 1\n break unless elp\n end\n elp_bar.finish if @verbose\n\n add_check_all(@check_examples_lp)\n\n @check_stored_values = true\n line = reset_line\n add_check_all(validate_csv_header :stored_value, @check_stored_values)\n sv_bar = ProgressBar.new(\"Stored Values\", csv_size(:stored_value)) if @verbose\n csv_for_each :stored_value do |row|\n stored_value = true\n row.each do |col, value|\n stored_value &= value.present?\n end\n\n print_error :err_missing, :stored_value, line unless stored_value\n\n stored_value &= groups[row[\"group_id\"]] if stored_value\n print_error :err_foreign, :stored_value, line, \"group_id\" unless stored_value\n\n stored_value &= example_ids[row[\"storable_id\"]] if stored_value\n print_error :err_foreign, :stored_value, line, \"storable_id\" unless stored_value\n\n @check_stored_values &= stored_value\n\n line += 1\n sv_bar.inc if @verbose\n break unless stored_value\n end\n sv_bar.finish if @verbose\n add_check_all(@check_stored_values)\n @check_all\n end", "def import_learners_from_csv\n assessment_id = params[:user][:assessment_id]\n unless params[:import][:excel].nil? or params[:import][:excel].blank? then\n @import = Import.new(params[:import])\n mime = (MIME::Types.type_for(@import.excel.path)[0])\n unless mime.nil? or mime.blank? then\n mime_obj = mime.extensions[0]\n #dont process further if the uploaded file is other than xls,xls,csv\n if (!mime_obj.nil? and !mime_obj.blank?) and (mime_obj.include? \"xls\" or mime_obj.include? \"xlsx\" or mime_obj.include? \"ods\" or mime_obj.include? \"csv\" ) then\n if @import.save!\n #check for virus\n if no_virus(@import.excel.path) then\n #If mime_obj is not csv only then create roo_instace\n unless mime_obj.include? \"csv\" then\n @roo = create_roo_instance(@import.excel.path,mime_obj)\n else\n #so, its a csv format\n @roo = \"csv format\"\n end\n #if the uploaded\n unless @roo == \"Upload correct excel format.\" then\n if @roo == \"csv format\" then\n lines = parse_csv_file(@import.excel.path)\n else\n lines = parse_excel_file_roo(@roo)\n end\n \n if lines.size > 0\n @import.processed = lines.size\n i = 1\n failed_to_upload = Array.new\n lines.each do |line|\n if valid_assign(params[:id])\n if valid_learners_excel_upload(line)\n else\n failed_to_upload << i\n end\n else\n flash[:learner_limit_exceeds] = \"You cannot assign more learners\"\n end\n i = i + 1\n end\n @import.save\n\n delete_csv(@import.excel.path)\n\n @import.destroy\n if params.include? 'from_assign_learners_page' then\n redirect_to(\"/assessments/assign_learners/\" + assessment_id.to_s)\n else\n total_failed_to_upload = failed_to_upload.join(\",\")\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}?failed_to_upload=#{total_failed_to_upload}\")\n end\n else\n flash[:error] = \"CSV data processing failed.\"\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:virus_error] = \"The file is Infected with virus.\"\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:error] = 'CSV data import failed.'\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n else\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n end", "def validateValuesFromSheet(rowNumber) \n\t\tforeginWord = getRawValueFromSheet(rowNumber, 1) # todo: remove duplication\n\t\ttranslatedWord = getRawValueFromSheet(rowNumber, 2)\n\n validationResult = false\n\t\tif foreginWord != nil && translatedWord != nil \n\t\t\tvalidationResult = true\n\t\tend\n \n return validationResult\n\tend", "def build_and_save_imported_result(row_hash, user, competition)\n result = ExternalResult.preliminary.create(\n competitor: CompetitorFinder.new(competition).find_by(bib_number: row_hash[:bib_number]),\n points: row_hash[:points],\n details: row_hash[:details],\n status: row_hash[:status],\n entered_at: Time.current,\n entered_by: user\n )\n if result.persisted?\n true\n else\n result.errors.full_messages.each do |message|\n @errors << message\n end\n false\n end\n rescue ActiveRecord::RecordNotFound\n @errors << \"Unable to find registrant (#{row_hash})\"\n false\n end", "def treatments\n begin\n if is_extractable_spreadsheet?\n\t xml = spreadsheet_xml\n Seek::Treatments.new xml\n else\n Seek::Treatments.new\n end\n rescue Exception=>e\n Rails.logger.error(\"Error reading spreadsheet #{e.message}\")\n Seek::Treatments.new\n end\n end", "def read_and_run(access_token, issue_key, issue_id)\n errors = []\n execution_id = 0\n begin \n test_steps = @j2jira.read_test_data(issue_key, issue_id)\n execution_id = @j2jira.new_execution(issue_key, issue_id)\n test_steps.each_with_index do |step, index|\n api_spec_json = JSON.parse(step[\"step\"]) \n errors = @validator.validate_api_spec(api_spec_json)\n return errors unless errors.size.eql?(0)\n api_req_body = step[\"data\"]\n res_schema = step[\"result\"]\n controls = api_spec_json[\"api_spec\"][\"controls\"]\n delay_minutes = controls.nil? ? 0 : controls[\"delay_minutes\"]\n return [] if delay_minutes.eql?(-1)\n puts \"before sleep: #{Time.now}\"\n sleep delay_minutes*60 unless delay_minutes.eql?(0)\n puts \"after sleep #{Time.now}\"\n errs = run_step(access_token, api_spec_json, api_req_body, res_schema)\n errors << \"step #{index} failed with errors: #{errs.join('|')}\" unless errs.size.eql?(0)\n #skip iteration when errors exists in a given step.\n break if errors.size > 0 \n end \n rescue JSON::ParserError => pe\n errors << \"error in test case, please check json format for Test Step, Test Data and Expected Result or the API response\" \n rescue Exception => e \n puts \"exception occured #{e}\"\n errors << \"something went wrong - #{e.message}\"\n ensure\n puts \"do we have errors for the Jira Issue: #{issue_key}? #{errors}\"\n @failed_executions+= 1 unless errors.size.eql?(0)\n @j2jira.update_test_case(execution_id, issue_key, errors) unless execution_id.eql?(0)\n @j2jira.issue_comment(issue_key, errors) \n end \n end", "def gather_data # The commands that retrieve required data from the User\n puts 'This script takes in a 1 column csv (set your column header to course_id)'\n puts 'Enter the Bridge instance URL (e.g. https://ibennion.bridgeapp.com)'\n @url = gets.chomp! # Prompts user for desired Bridge domain\n puts 'Enter your Bridge API Key'\n @token = gets.chomp!\n puts 'These calls require you masquerade as an admin. What is the admin user ID?'\n @admin_id = gets.chomp! # The 'publish' endpoint requires you masquerade as an admin. Set the admin's User ID here.\n puts 'Enter the path to your CSV mapping file (e.g. /Users/ibennion/Documents/mapping.csv)'\n @csv_path = gets.chomp! # Set your path to the csv file. e.g. '/Users/ccromar/Downloads/sample.csv'\nend", "def parse_upload\n\t@worksheet = (params[:uploaded_doc][:workbook])\n \t@file_path = [Rails.root, 'public', 'upload', @worksheet.original_filename].join('/')\n\t@worksheet_class = (params[:uploaded_doc][:workbook]).class\n\t@worksheet_type = (params[:uploaded_doc][:workbook]).content_type\n\t@worksheet_name = (params[:uploaded_doc][:workbook]).original_filename \n\tFile.open(Rails.root.join('public', 'uploads', @worksheet.original_filename), 'r') do |file|\n\t\t@worksheet_array << file.gets \n\tend\n=begin\t@worksheet_array = RubyXL::Parser.parse(params[:uploaded_doc][:workbook]).worksheets[0].extract_data\n \t@worksheet = RubyXL::Parser.parse(Rails.root.join('public', 'uploads', (params[:uploaded_doc][:workbook]).original_filename , 'w'))#.worksheets[0].extract_data\n\tFile.open(Rails.root.join('public', 'uploads', @worksheet.original_filename), 'r') do |file|\n\t\t@worksheet_array << file.gets \n\tend\n\n=end\n end", "def perform\n\n handle_errors_and_exceptions do\n\n r = validate\n return r unless r.success?\n\n r = fetch_sub_env_payloads\n return r unless r.success?\n\n success_with_data(\n {\n manager: @manager,\n client: @client,\n client_manager: @client_manager,\n sub_env_payloads: @sub_env_payloads\n })\n\n end\n\n end", "def sheet_params\n params.require(:sheet).permit(:spreadsheet, :campaign_id)\n end", "def run\n\t\t\t\tstart_flowcell\n\t\t\t\tdistributions = []\n\n\n\t\t\t\tunless @options[:no_distribute]\n\t\t\t\t\tdistributions = @flowcell.external_data.distributions_for @flowcell.id \n\t\t\t\tend\n\n\t\t\t\tsteps = @options[:steps]\n\t\t\t\tlogm \"running steps: #{steps.join(\", \")}\"\n\n\t\t\t\tif steps.include? \"setup\"\n\t\t\t\t\tcopy_sample_sheet\n\t\t\t\tend\n\n\t\t\t\tif steps.include? \"unaligned\"\n\t\t\t\t\t#process_unaligned_reads distributions\n\t\t\t\tend\n\n\t\t\t\tif steps.include?\n\n\n\t\t\tend\n\n\t\t\tdef logm message\n\t\t\t\tlog \"# #{message}\"\n\t\t\t\tSolexaLogger.log(@flowcell.paths.id, message) unless @options[:test]\n\t\t\tend\n\n\t\t\tdef copy_sample_sheet\n\t\t\t\tsource = File.join(@flowcell.paths.base_dir, \"SampleSheet.csv\")\n\t\t\t\tdestination = File.join(@flowcell.paths.unaligned_dir, \"SampleSheet.csv\")\n\t\t\t\tif !File.exists? source\n\t\t\t\t\tputs \"ERROR: cannot find SampleSheet at: #{source}\"\n\t\t\t\tend\n\n\t\t\t\texecute(\"cp #{source} #{destination}\")\n\t\t\tend\n\n\t\t\tdef process_unaligned_reads distributions\n\t\t\t\tstatus \"processing unaligned\"\n\t\t\t\tsteps = @options[:steps]\n\t\t\t\tfastq_groups = group_fastq_files(@flowcell.paths.unalinged_project_dir,\n\t\t\t\t\t @flowcell.paths.fastq_combine_dir)\n\t\t\t\t#unless @options[:only_distribute]\n\t\t\t\t#\tcat files fastq_groups\n\t\t\t\t#end\n\n\t\t\t\t###### LAST STOP\n\n\t\t\tend\n\n\n\t\t\t#\n # Helper method that executes a given string on the command line.\n # This should be used instead of calling system directly, as it also\n # deals with if we are in test mode or not.\n #\n def execute command\n log command\n system(command) unless @options[:test]\n end\n\n\n #\n # Gets grouping data for fastq.gz files\n #\n def group_fastq_files starting_path, output_path, options = {:prefix => \"L\", :suffix => \".fastq.gz\", :exclude_undetermined => true}\n execute \"mkdir -p #{output_path}\"\n fastq_groups = []\n \n fastq_files = Dir.glob(File.join(starting_path, fastq_search_path))\n if fastq_files.empty?\n log \"# ERROR: no fastq files found in #{starting_path}\" if fastq_files.empty?\n else\n log \"# #{fastq_files.size} fastq files found in #{starting_path}\"\n fastq_file_data = get_file_data fastq_files, \"\\.fastq\\.gz\"\n fastq_groups = group_files fastq_file_data, output_path, options\n end\n fastq_groups\n end\n\n #\n # Actually combines the related fastq files\n # using cat.\n #\n def cat_files file_groups\n file_groups.each do |group|\n check_exists(group[:paths])\n # this is the Illumina recommended approach to combining these fastq files.\n # See the Casava 1.8 Users Guide for proof\n files_list = group[:paths].join(\" \")\n command = \"cat #{files_list} > #{group[:path]}\"\n execute command\n end\n end\n\n\n\n #\n # Returns an array of hashes, one for each\n # new combined fastq file to be created\n # Each hash will have the name of the\n # combined fastq file and an Array of\n # paths that the group contains\n #\n def group_files file_data, output_path, options = {:prefix => \"L\", :suffix => \".fastq.gz\", :exclude_undetermined => true}\n\t\t\t\t# alternatively inherit the parent class and call super???? \n\t\t\t\t# super \n\t\t\t\t# \t\n groups = {}\n file_data.each do |data|\n if data[:barcode] == \"Undetermined\" and options[:exclude_undetermined]\n log \"# Undetermined sample lane: #{data[:lane]} - name: #{data[:sample_name]}. Skipping\"\n next\n end\n \n group_key = name_for_data data, options\n \n if groups.include? group_key\n if groups[group_key][:sample_name] != data[:sample_name]\n raise \"ERROR: sample names not matching #{group_key} - #{data[:path]}:#{data[:sample_name]}vs#{groups[group_key][:sample_name]}\"\n end\n if groups[group_key][:lane] != data[:lane]\n raise \"ERROR: lanes not matching #{group_key} - #{data[:path]}\"\n end\n groups[group_key][:files] << data\n else\n group_path = File.join(output_path, group_key)\n groups[group_key] = {:group_name => group_key,\n :path => group_path,\n :sample_name => data[:sample_name],\n :read => data[:read],\n :lane => data[:lane],\n :files => [data]\n }\n end\n end\n \n # sort based on read set\n groups.each do |key, group|\n group[:files] = group[:files].sort {|x,y| x[:set] <=> y[:set]}\n group[:paths] = group[:files].collect {|data| data[:path]}\n end\n groups.values\n end\n\n\n\n\tend", "def new\n @job_sheet = JobSheet.new\n @quotation = QuotationRequestForm.find(params[:id]) if params[:id]\n collect_all_process_types(@quotation)\n @sales_orders = SalesOrder.mass_active\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @job_sheet }\n end\n end", "def treatments\n begin\n if content_blob.is_extractable_spreadsheet?\n xml = spreadsheet_xml\n Seek::Data::Treatments.new xml\n else\n Seek::Data::Treatments.new\n end\n rescue Exception => e\n Rails.logger.error(\"Error reading spreadsheet #{e.message}\")\n raise(e) if Rails.env==\"test\"\n Seek::Data::Treatments.new\n end\n end", "def initialize(spreadsheet_key, options = {})\n @filename = spreadsheet_key\n @access_token = options[:access_token] || ENV['GOOGLE_TOKEN']\n @session = options[:session]\n super\n @cell = Hash.new { |h, k| h[k] = Hash.new }\n @cell_type = Hash.new { |h, k| h[k] = Hash.new }\n @formula = {}\n %w(date time datetime).each do |key|\n __send__(\"#{key}_format=\", self.class.const_get(\"#{key.upcase}_FORMAT\"))\n end\n end", "def retrieve_and_process_by_bookings_data(bookings_data, property)\n validate = true\n temp_message = ''\n result = {\n :status => 'success',\n :message => 'Chanelink inventory updated!'\n }\n\n #validate data\n bookings_data.each do |booking_data|\n\n room_type = nil\n room_type_map = RoomTypeChannelMapping.first(\n :conditions => [\n \"ota_room_type_id = ? AND ota_rate_type_id = ?\",\n booking_data[:rate_plan_code].to_s,\n booking_data[:rate_plan_category].to_s\n ]\n )\n if room_type_map and room_type_map.active?\n room_type = room_type_map.room_type\n end\n\n\n temp_validate = validate(property, channel, room_type, booking_data[:total_rooms], booking_data[:date_start], booking_data[:date_end])\n validate = false if temp_validate[:is_error]\n temp_message = temp_message + ' ' + temp_validate[:message]\n\n end\n\n #store data\n if validate\n bookings_data.each do |booking_data|\n\n new_booking = CtripBooking.new\n new_booking.property = property\n new_booking.channel = channel\n\n # set pool that this current channel currently belongs to\n new_booking.pool = PropertyChannel.find_by_property_id_and_channel_id(property.id, channel.id).pool\n\n # find the chanelink room type that this booking correspond to\n room_type_map = RoomTypeChannelMapping.first(\n :conditions => [\n \"ota_room_type_id = ? AND ota_rate_type_id = ?\",\n booking_data[:rate_plan_code].to_s,\n booking_data[:rate_plan_category].to_s\n ]\n )\n if room_type_map and room_type_map.active?\n new_booking.room_type = room_type_map.room_type\n end\n\n # set all the data into our own booking object\n new_booking.guest_name = booking_data[:guest_name]\n new_booking.date_start = booking_data[:date_start]\n new_booking.date_end = booking_data[:date_end]\n new_booking.booking_date = booking_data[:booking_date]\n\n new_booking.total_rooms = booking_data[:total_rooms]\n new_booking.amount = booking_data[:amount]\n\n # new_booking.ctrip_booking_id = booking_data[:ctrip_booking_id]\n\n new_booking.save\n end\n else\n result = {\n :status => 'failed',\n :message => temp_message\n }\n end\n\n return result\n end", "def excel_parse\n excel = Spreadsheet.open \"clientes.xls\"\n hoja = excel.worksheet 0\n\n# @filas = []\n hoja.each 1 do |fila|\n #solo añadimos aquellos clientes que no existan, comprobamos que el codigo no exista\n #\n ficha = Cliente.find_by_codigo( fila[4])\n if not ficha then\n ficha = Cliente.new\n ficha.user_id = 1 #usuario de test, para cuando sea MMO\n ficha.codigo = fila[4]\n ficha.nombre = fila[3]\n ficha.provincia = fila[25]\n ficha.direccion = fila[26]\n ficha.ciudad = fila[27]\n ficha.cp = fila[28]\n ficha.telefono = fila[29]\n ficha.grupo_id = fila[1]\n ficha.notas = \"\"\n ficha.save!\n# @filas << ficha\n end\n\n #parseamos la marca a la que pertenece la venta\n m = Marca.find_by_codigo( fila[10])\n if not m then\n m = Marca.new\n m.codigo = fila[10]\n m.user = 0\n m.save!\n end\n\n #parseamos las ventas de esa fila suponiendo que el cliente existe\n vdata = Venta.new do |v|\n v.user= 1\n v.cliente= ficha.id\n #v.marca = Marca.find_by_codigo(fila[10]).id\n v.marca = m.id\n v.piezas_12m = fila[23]\n v.piezas_fact_last_mes = fila[12]\n v.piezas_last_pedido = fila[18]\n v.piezas_pendientes = fila[11]\n end\n vdata.save!\n end\n end", "def populate_spreadsheet(date, spreadsheet_link, spreadsheet_id)\n month = date.month\n while date.month == month do \n create_new_sheet(date, spreadsheet_id)\n date = date.tomorrow\n end\n \n #delete the first sheet\n delete_sheet(spreadsheet_link, spreadsheet_id)\nend", "def create_spreadsheet\n @package = Axlsx::Package.new\n @workbook = @package.workbook\n\n selected_buildings = @report.user_buildings\n\n services_selected = selected_buildings.collect { |b| b.building_json['services'] }.flatten # s.collect { |s| s['code'].gsub('-', '.') }\n services_selected.uniq!\n\n @workbook.add_worksheet(name: 'Building Information') do |sheet|\n # sheet.add_row ['Buildings information']\n i = 0\n [['Buildings information', nil],\n ['Building Type', 'eg. General office - customer facing, non customer facing, call centre operations.'],\n ['Address', ''],\n [nil, nil], [nil, nil], [nil, nil],\n ['GIA', 'Gross Internal Area: Square Metre (GIA) per annum']].each do |label|\n vals = []\n vals << label[0] << label[1] << row(selected_buildings, i)\n vals.flatten!\n sheet.add_row vals\n i += 1\n end\n end\n\n # selected_services = services_selected.map { |s| s['code'].gsub('-', '.') }\n services = @report.list_of_services # @report.selected_services(selected_services)\n uom_values_for_selected_buildings = @report.uom_values(selected_buildings)\n\n uoms = CCS::FM::UnitsOfMeasurement.all.group_by(&:service_usage)\n uom2 = {}\n uoms.map { |u| u[0].each { |k| uom2[k] = u[1] } }\n\n @workbook.add_worksheet(name: 'Service Matrix') do |sheet|\n i = 1\n vals = ['Work Package', 'Service Reference', 'Service Name', 'Unit of Measure']\n selected_buildings.each do |building|\n vals << 'Building ' + i.to_s + ' - ' + building.building_json['name']\n i += 1\n end\n sheet.add_row vals\n\n work_package = ''\n services.sort_by { |s| [s.work_package_code, s.code[s.code.index('.') + 1..-1].to_i] }.each do |s|\n if work_package == s.work_package_code\n label = nil\n else\n label = 'Work Package ' + s.work_package_code + ' - ' + s.work_package.name\n end\n\n work_package = s.work_package_code\n\n vals = [label, s.code, s.name]\n\n vals_v = []\n vals_h = nil\n uom_labels_2d = []\n selected_buildings.each do |building|\n id = building.building_json['id']\n suv = uom_values_for_selected_buildings.select { |v| v['building_id'] == id && v['service_code'] == s.code }\n\n any_suv = uom_values_for_selected_buildings.select { |v| v['service_code'] == s.code }\n\n vals_h = []\n uom_labels = []\n if suv.empty?\n if uom2[s.code]\n uom_labels << uom2[s.code].last.spreadsheet_label\n elsif s.work_package_code == 'A' || s.work_package_code == 'B'\n uom_labels << nil\n elsif s.work_package_code == 'M' || s.work_package_code == 'N'\n uom_labels << 'Percentage of Year 1 Deliverables Value (excluding Management and Corporate Overhead, and Profit) at call-off'\n elsif any_suv.empty?\n uom_labels << 'service (per annum)'\n end\n\n vals_h << nil\n else\n suv.each do |v|\n if v['spreadsheet_label']\n uom_labels << v['spreadsheet_label']\n elsif uom2[s.code]\n uom_labels << uom2[s.code].last.spreadsheet_label\n end\n\n vals_h << v['uom_value']\n end\n end\n vals_v << vals_h\n uom_labels_2d << uom_labels\n rescue StandardError\n vals << '=NA()'\n end\n\n uom_labels_max = uom_labels_2d.max\n\n max_j = vals_v.map(&:length).max\n if max_j\n (0..max_j - 1).each do |j|\n vals << uom_labels_max[j]\n\n (0..vals_v.count - 1).each do |k|\n vals << vals_v[k][j]\n end\n sheet.add_row vals\n\n vals = [nil, s.code, s.name]\n end\n end\n # end\n work_package = s.work_package_code\n end\n end\n\n @workbook.add_worksheet(name: 'Procurement summary') do |sheet|\n date = sheet.styles.add_style(format_code: 'dd mmm yyyy', border: Axlsx::STYLE_THIN_BORDER)\n left_align = sheet.styles.add_style(alignment: { horizontal: :left })\n ccy = sheet.styles.add_style(format_code: '£#,##0')\n\n sheet.add_row ['CCS reference number & date/time of production of this document']\n sheet.add_row\n sheet.add_row ['1. Customer details']\n sheet.add_row ['Name']\n sheet.add_row ['Organisation']\n sheet.add_row ['Position']\n sheet.add_row ['Contact details']\n sheet.add_row\n sheet.add_row ['2. Contract requirements']\n sheet.add_row ['Initial Contract length', @report.contract_length_years, 'years'], style: [nil, nil, left_align]\n sheet.add_row ['Extensions']\n sheet.add_row\n sheet.add_row ['Tupe involvement', @report.tupe_flag]\n sheet.add_row\n sheet.add_row ['Contract start date', @report.start_date&.to_date], style: [nil, date]\n sheet.add_row\n sheet.add_row ['3. Price and sub-lot recommendation']\n sheet.add_row ['Assessed Value', @report.assessed_value], style: [nil, ccy]\n sheet.add_row ['Assessed value estimated accuracy'], style: [nil, ccy]\n sheet.add_row\n sheet.add_row ['Lot recommendation', @report.current_lot]\n sheet.add_row ['Direct award option']\n sheet.add_row\n # sheet.add_row ['4. Supplier Shortlist']\n label = '4. Supplier Shortlist'\n @report.selected_suppliers(@current_lot).each do |supplier|\n sheet.add_row [label, supplier.data['supplier_name']]\n label = nil\n end\n sheet.add_row\n\n # sheet.add_row ['5. Regions summary']\n label = '5. Regions summary'\n FacilitiesManagement::Region.all.select { |region| @data[:posted_locations].include? region.code }.each do |region|\n sheet.add_row [label, region.name]\n label = nil\n end\n sheet.add_row\n\n # sheet.add_row ['6 Services summary']\n # services = FacilitiesManagement::Service.where(code: @data['posted_services'])\n services = @report.list_of_services\n services.sort_by!(&:name)\n label = '6 Services summary'\n services.each do |s|\n sheet.add_row [label, s.name]\n label = nil\n end\n sheet.add_row\n end\n end", "def import_course_learners_from_csv\n assessment_id = params[:user][:course_id]\n unless params[:import][:excel].nil? or params[:import][:excel].blank? then\n @import = Import.new(params[:import])\n mime = (MIME::Types.type_for(@import.excel.path)[0])\n unless mime.nil? or mime.blank? then\n mime_obj = mime.extensions[0]\n #dont process further if the uploaded file is other than xls,xls,csv\n if (!mime_obj.nil? and !mime_obj.blank?) and (mime_obj.include? \"xls\" or mime_obj.include? \"xlsx\" or mime_obj.include? \"ods\" or mime_obj.include? \"csv\" ) then\n if @import.save!\n #check for virus\n if no_virus(@import.excel.path) then\n #If mime_obj is not csv only then create roo_instace\n unless mime_obj.include? \"csv\" then\n @roo = create_roo_instance(@import.excel.path,mime_obj)\n else\n #so, its a csv format\n @roo = \"csv format\"\n end\n #if the uploaded\n unless @roo == \"Upload correct excel format.\" then\n if @roo == \"csv format\" then\n lines = parse_csv_file(@import.excel.path)\n else\n lines = parse_excel_file_roo(@roo)\n end\n\n if lines.size > 0\n @import.processed = lines.size\n i = 1\n failed_to_upload = Array.new\n lines.each do |line|\n if valid_assign(params[:id])\n if valid_learners_excel_upload(line)\n else\n failed_to_upload << i\n end\n else\n flash[:learner_limit_exceeds] = \"You cannot assign more learners\"\n end\n i = i + 1\n end\n @import.save\n\n delete_csv(@import.excel.path)\n\n @import.destroy\n if params.include? 'from_assign_learners_page' then\n redirect_to(\"/courses/assign_learners/\" + assessment_id.to_s)\n else\n total_failed_to_upload = failed_to_upload.join(\",\")\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}?failed_to_upload=#{total_failed_to_upload}\")\n end\n else\n flash[:error] = \"CSV data processing failed.\"\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:virus_error] = \"The file is Infected with virus.\"\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:error] = 'CSV data import failed.'\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n else\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n end", "def perform\n\n handle_errors_and_exceptions do\n\n r = validate\n return r unless r.success?\n\n r = fetch_token_details\n return r unless r.success?\n\n r = fetch_sub_env_payloads\n return r unless r.success?\n\n r = fetch_goto\n return r unless r.success?\n \n r = fetch_default_price_points\n return r unless r.success?\n\n r = fetch_stake_currency_details\n return r unless r.success?\n\n @sign_message = {\n wallet_association: GlobalConstant::MessageToSign.wallet_association\n }\n\n api_response_data = {\n token: @token,\n sign_messages: @sign_message,\n client_manager: @client_manager,\n manager: @manager,\n price_points: @price_points,\n sub_env_payloads: @sub_env_payload_data,\n all_stake_currencies: @all_stake_currencies\n }\n\n if @token[:stake_currency_id].present?\n api_response_data[:stake_currencies] = @stake_currencies\n end\n\n success_with_data(api_response_data)\n\n end\n\n end", "def perform_spreadsheet_load( file_name, options = {} )\n\n @mandatory = options[:mandatory] || []\n\n @excel = Spreadsheet.open file_name\n \n puts \"\\nLoading from Excel file: #{file_name}\"\n\n sheet_number = options[:sheet_number] || 0\n\n @sheet = @excel.sheet( sheet_number )\n\n header_row_index = options[:header_row] || 0\n @header_row = @sheet.getRow(header_row_index)\n\n raise MissingHeadersError, \"No headers found - Check Sheet #{@sheet} is complete and Row #{header_row_index} contains headers\" unless(@header_row)\n\n @headers = []\n \n (0..JExcelFile::MAX_COLUMNS).each do |i|\n cell = @header_row.getCell(i)\n break unless cell\n header = \"#{@excel.cell_value(cell).to_s}\".strip\n break if header.empty?\n @headers << header\n end\n\n raise MissingHeadersError, \"No headers found - Check Sheet #{@sheet} is complete and Row #{header_row_index} contains headers\" if(@headers.empty?)\n\n # Create a method_mapper which maps list of headers into suitable calls on the Active Record class\n map_headers_to_operators( @headers, options)\n\n load_object_class.transaction do\n @loaded_objects = []\n\n (1..@excel.num_rows).collect do |row|\n\n # Excel num_rows seems to return all 'visible' rows, which appears to be greater than the actual data rows\n # (TODO - write spec to process .xls with a huge number of rows)\n #\n # This is rubbish but currently manually detect when actual data ends, this isn't very smart but\n # got no better idea than ending once we hit the first completely empty row\n break if @excel.sheet.getRow(row).nil?\n\n contains_data = false\n\n # TODO - Smart sorting of column processing order ....\n # Does not currently ensure mandatory columns (for valid?) processed first but model needs saving\n # before associations can be processed so user should ensure mandatory columns are prior to associations\n\n # as part of this we also attempt to save early, for example before assigning to\n # has_and_belongs_to associations which require the load_object has an id for the join table\n\n # Iterate over the columns method_mapper found in Excel,\n # pulling data out of associated column\n @method_mapper.method_details.each_with_index do |method_detail, col|\n\n value = value_at(row, col)\n\n contains_data = true unless(value.nil? || value.to_s.empty?)\n\n #puts \"DEBUG: Excel process METHOD :#{method_detail.inspect}\", value.inspect\n prepare_data(method_detail, value)\n \n process()\n end\n \n break unless(contains_data == true)\n\n # TODO - requirements to handle not valid ?\n # all or nothing or carry on and dump out the exception list at end\n #puts \"DEBUG: FINAL SAVE #{load_object.inspect}\"\n save\n #puts \"DEBUG: SAVED #{load_object.inspect}\"\n\n # don't forget to reset the object or we'll update rather than create\n new_load_object\n\n end\n end\n puts \"Spreadsheet loading stage complete - #{loaded_objects.size} rows added.\"\n end", "def process!\n @data.each do |field, value|\n data_type = field.split('_').first.to_sym\n number = field.split('_').last.to_i\n store_date(data_type, number, value)\n end\n prompts.compact.zip responses.compact\n end", "def import_input_data(data)\n\n # clear all the old data\n #InputRecord.delete_all\n\n # grab the table out of the data file\n table = /<table.*?>(.*)<\\/table>/im.match(data.squish)\n # split into array rows based on <tr></tr> and do some cleanup\n tabledata = table[1].gsub(/\\&nbsp;/,\" \").gsub(/ </,\"<\").gsub(/> /,\">\").gsub(/<b>|<\\/b>|<img.*?>|<\\/img>|<span.*?>|<\\/span>|<td.*?>|<a .*?>|<\\/a>/,\"\").scan(/<tr.*?>.*?<\\/tr>/im)\n # split by columns and remove extraneous tags\n tabledata.map!{ |row| row.gsub(/<tr.*?>/,\"\").gsub(/<\\/td><\\/tr>/,\"\").force_encoding(\"UTF-8\").gsub(/\\u{a0}/,\"\").split(\"</td>\")}\n\n data_columns = {\n \"Acronym\" => :acronym,\n \"Title\" => :title,\n \"Organization\" => :organization,\n \"Department\" => :department,\n \"Agency\" => :agency,\n \"RFP #\" => :rfp_number,\n \"Solicitation #\" => :rfp_number,\n \"Program Value\" => :program_value,\n \"Value($k)\" => :program_value,\n \"RFP Date\" => :rfp_date,\n \"Solicitation Date\" => :rfp_date,\n \"Status\" => :status,\n \"User List\" => :user_list,\n \"Project Award Date\" => :project_award_date,\n \"Projected Award Date\" => :project_award_date,\n \"Opportunity Id\" => :input_opportunity_number,\n \"Opp Id\" => :input_opportunity_number,\n \"Contract Type\" => :contract_type,\n \"Contract Type (Combined List)\" => :contract_type_combined,\n \"Primary Service\" => :primary_service,\n \"Contract Duration\" => :contract_duration,\n \"Last Updated\" => :last_updated,\n \"Competition Type\" => :competition_type,\n \"NAICS\" => :naics,\n \"Primary State of Perf.\" => :primary_state_of_performance,\n \"Summary\" => :summary,\n \"Comments\" => :comments,\n \"Latest News\" => :comments,\n \"DOD/Civil\" => :dod_civil,\n \"Incumbent\" => :incumbent,\n \"Contractor\" => :incumbent,\n \"Contractor (Combined List)\" => :contractor_combined,\n \"Incumbent Value\" => :incumbent_value,\n \"Contract Value($k)\" => :incumbent_value,\n \"Incumbent Contract #\" => :incumbent_contract_number,\n \"Contract Number\" => :incumbent_contract_number,\n \"Incumbent Award Date\" => :incumbent_award_date,\n \"Contract Award Date\" => :incumbent_award_date,\n \"Incumbent Expire Date\" => :incumbent_expire_date,\n \"Contract Expire Date\" => :incumbent_expire_date,\n \"Priority\" => :priority,\n \"Vertical\" => :vertical,\n \"Vertical (Combined List)\" => :vertical_combined,\n \"Segment\" => :segment,\n \"Segment (Combined List)\" => :segment_combined,\n \"Key Contacts\" => :key_contacts\n }\n\n # figure out which input columns map to which data columns\n keys = []\n cols = {}\n tabledata[0].each_index do |column|\n keys[column] = data_columns[tabledata[0][column].strip]\n cols[data_columns[tabledata[0][column]]] = column\n# puts \"found #{keys[column]} in #{cols[data_columns[tabledata[0][column]]]}\"\n end\n\n record_count = 0\n\n # load the data\n for row in 1..(tabledata.length-1) # for each row (except the header row)\n# puts \"loading row #{row}\"\n opportunity_number_column = cols[:input_opportunity_number]\n opportunity_number = tabledata[row][opportunity_number_column]\n record = InputRecord.find_or_create_by_input_opportunity_number(opportunity_number) # get the record or make a new one\n keys.each_index do |column| # for each column in the input file, update the attribute\n case keys[column]\n when :title #need special processing for title to split URL from actual title\n if tabledata[row][column] =~ /<a/\n data = /<a href=\"(.*?)\">(.*?)<\\/a>/i.match(tabledata[row][column])\n record.input_url = data[1] unless data[1].nil?\n record.title = data[2] unless data[2].nil?\n else\n record.title = tabledata[row][column]\n end\n when :department\n @dept = tabledata[row][column]\n when :agency\n if tabledata[row][column].nil?\n record.send(\"organization=\", \"#{@dept}\")\n else\n record.send(\"organization=\", \"#{@dept}/#{tabledata[row][column]}\")\n end\n when :rfp_date, :project_award_date, :last_updated, :incumbent_award_date, :incumbent_expire_date\n record.send(\"#{keys[column]}=\",GovwinIQ.fix_input_date(tabledata[row][column]))\n else\n record.send(\"#{keys[column]}=\", tabledata[row][column]) unless keys[column].nil?\n end\n end\n record.save!\n record_count += 1\n end\n\n return record_count\n end", "def new\n #destroy all traces of an identical assignment before beginning\n #otherwise have the spreadsheet output be completely fucked up\n Exportsheet.delete_all(:assignment_id => params[:id].to_i)\n #query students and assignments\n @assignment = Assignment.where(\"id = ?\", params[:id]).to_a.first\n if @assignment\n @ass_students = AssignmentsStudents.where(\" assignment_id = ?\", params[:id]).to_a\n \n # assemble student => ass_stdnt hash \n # that hash to be used to write to the exportsheet record\n @students_hash = Hash.new\n dem_students = Student.where(\"course_id = ?\", @assignment.course_id)\n counter = 0\n @ass_students.each{ |ass_stdnt|\n s = dem_students[counter]\n if !@students_hash.key?(s) and s != nil then\n h = Hash.new\n h[s] = ass_stdnt\n if h != nil then\n @students_hash.merge!( h )\n end\n end\n counter += 1\n }\n\n #create exportsheets\n counter = 0\n @students_hash.each{ |stdnt, ass_stdnt|\n if counter == @students_hash.size then\n break\n end\n @exportsheet = Exportsheet.new({\n :student => stdnt.full_name,\n :grade => ass_stdnt.grade * 100,\n :assignment_id => @assignment.id\n })\n @exportsheet.save\n counter +=1\n }\n end\n\n #format html, csv, and xls formats\n respond_to do |format|\n format.html # new.html.erb\n format.csv { send_data @exportsheet.to_csv }\n format.xls # { send_data @exportsheet.to_csv(col_sep: \"\\t\") }\n end\n end", "def step1_1_team_analysis\n# DEBUG\n logger.debug( \"\\r\\n\\r\\n!! ------ #{self.class.name} - team_analysis -----\" )\n logger.debug( \"> #{params.inspect}\" )\n # [Steve, 20161001] We need to whitelist all parameters, since we are using this as Admins\n params.permit!()\n # Propagate forward (phase-3) the parameters from Phase-1, if any:\n @force_missing_meeting_creation = (params[:force_meeting_creation] == 'true') ||\n (params[:force_meeting_creation].to_i > 0)\n @force_team_or_swimmer_creation = (params[:force_team_or_swimmer_creation] == 'true') ||\n (params[:force_team_or_swimmer_creation].to_i > 0)\n if ( params[:id].to_i > 0 )\n @data_import_session = DataImportSession.find_by_id( params[:id].to_i )\n @analysis_results = DataImportTeamAnalysisResult.where( data_import_session_id: @data_import_session.id )\n else\n @data_import_session = nil\n @analysis_results = []\n end\n end", "def execute_mapped_resource_automation\n begin\n\n # pass along pagination controls\n page = params[:page].to_i\n per_page = params[:per_page].to_i\n offset = page * per_page\n\n # set up a dummy step\n step = Step.new\n\n # since this is a member url we should have the id in the url or throw a 404\n external_script = Script.find(params[:id])\n\n # cache the plan involved for later assignment to selected tickets\n plan = Plan.find(params[:plan_id]) if params[:plan_id].present?\n\n # prepare an argument hash\n argument_hash = {}\n\n # cycle through the form variables to see what has been set, ignoring blank values\n params[:argument].each do |key, value|\n argument_name = ScriptArgument.find(key).argument\n # guarantee that all values are an array\n value = Array(value)\n # select box values are coming through as single element arrays\n if value.length < 2\n argument_hash[argument_name] = value[0] unless value.blank? || value[0].blank?\n else\n # CHKME: Does AO allow arrays of values from a multi-select?\n argument_hash[argument_name] = value\n end\n end\n\n # Execute and fetch the resource automation output\n external_script_output = view_context.execute_automation_internal(step, external_script, argument_hash, nil, offset, per_page)\n\n # for testing purposes construct the hash here\n # external_script_output = {\n # :perPage => 5,\n # :totalItems => 100,\n # :data =>\n # [\n # [\"ra_uniq_identifier\",\"Foreign Id\",\"Name\",\"Ticket Type\", \"Status\", \"Status Label\", \"Extended Attributes\"],\n # [\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\"]\n # ]\n # }\n query_name = \"#{external_script.project_server.name}: #{external_script.name}: #{Time.now.to_s(:short_audit)}\"\n # now is a good time -- with a successful run we hope -- to save this query for later recall\n @query = plan.queries.create( :project_server => external_script.project_server,\n :name => query_name,\n :script => external_script,\n :user => User.current_user )\n # if that was successful, go ahead and add the arguments to the query details\n if @query\n argument_hash.each do |key, value|\n # FIXME: Type in schema for conjunction <> conjuction\n @query.query_details.create(:query_element => key, :query_criteria => \"=\", :query_term => value, :conjuction => 'AND')\n end\n end\n # cache the new saved queries so we can update the menu with this latest run\n # now see if there are any past queries\n saved_queries = plan.queries.where(:last_run_by => User.current_user.try(:id)).order('created_at DESC').limit(25)\n\n # send all this data to a js partial that will reload items as needed\n render :partial => 'shared_scripts/execute_mapped_resource_automation',\n :locals => { :external_script_output => external_script_output,\n :project_server_id => external_script.integration_id,\n :plan => plan, :saved_queries => saved_queries }\n rescue Exception => err\n log_automation_errors(step, err, external_script_output)\n render :text => ApplicationController.helpers.options_for_select([['N.A', '']])\n end\n end", "def close(*sheetnames)\n num_sheets = sheetnames.size\n\n ################################################\n # Prepend in reverse order!!\n #\n\n # Prepend the sheet dimensions\n store_dimensions\n\n # Prepend the autofilter filters.\n store_autofilters\n\n # Prepend the sheet autofilter info.\n store_autofilterinfo\n\n # Prepend the sheet filtermode record.\n store_filtermode\n\n # Prepend the COLINFO records if they exist\n unless @colinfo.empty?\n while (!@colinfo.empty?)\n arrayref = @colinfo.pop\n store_colinfo(*arrayref)\n end\n end\n\n # Prepend the DEFCOLWIDTH record\n store_defcol\n\n # Prepend the sheet password\n store_password\n\n # Prepend the sheet protection\n store_protect\n store_obj_protect\n\n # Prepend the page setup\n store_setup\n\n # Prepend the bottom margin\n store_margin_bottom\n\n # Prepend the top margin\n store_margin_top\n\n # Prepend the right margin\n store_margin_right\n\n # Prepend the left margin\n store_margin_left\n\n # Prepend the page vertical centering\n store_vcenter\n\n # Prepend the page horizontal centering\n store_hcenter\n\n # Prepend the page footer\n store_footer\n\n # Prepend the page header\n store_header\n\n # Prepend the vertical page breaks\n store_vbreak\n\n # Prepend the horizontal page breaks\n store_hbreak\n\n # Prepend WSBOOL\n store_wsbool\n\n # Prepend the default row height.\n store_defrow\n\n # Prepend GUTS\n store_guts\n\n # Prepend GRIDSET\n store_gridset\n\n # Prepend PRINTGRIDLINES\n store_print_gridlines\n\n # Prepend PRINTHEADERS\n store_print_headers\n\n #\n # End of prepend. Read upwards from here.\n ################################################\n # Append\n store_table\n store_images\n store_charts\n store_filters\n store_comments\n store_window2\n store_page_view\n store_zoom\n store_panes(*@panes) if !@panes.nil? && !@panes.empty?\n store_selection(*@selection)\n store_validation_count\n store_validations\n store_tab_color\n store_eof\n\n # Prepend the BOF and INDEX records\n store_index\n store_bof(0x0010)\n end", "def new_data_entry\n # subject_event_id = params[:sheet][:subject_event_id] if params[:sheet] && params[:sheet].key?(:subject_event_id)\n # @sheet = @subject.sheets.new(project_id: @project.id, design_id: @design.id, subject_event_id: subject_event_id)\n @sheet = @subject.sheets\n .where(\n project_id: @project.id,\n design_id: @design.id,\n adverse_event_id: params[:adverse_event_id],\n ae_adverse_event_id: params[:ae_adverse_event_id]\n )\n .new(sheet_params)\n render \"sheets/new\"\n end", "def import(file)\n spreadsheet = ModelCommon.open_spreadsheet(file)\n return '<p class = \"alert alert-error\">Try to do the following instructions:<br/>\n 1. Please save as the file to excel format.<br/>\n 2. Make sure MOAS data in the first sheet.<br/>\n 3. Header is in the first row.</p>' if spreadsheet.nil?\n\n header = downcase_array_key spreadsheet.row(1)\n\n # verify header, raise error if not map\n no_failed_hearders = MOASHeader.verify_header(header, @language)\n\n return ('<p class = \"alert alert-error\">Below is the missing header titles list. Please update header title(s) of the excel file || contact your administrator<br/>' << no_failed_hearders.to_s << '</p>') if no_failed_hearders != true\n return ('<p class = \"alert alert-error\">No data in excel file. Please re-check!</p>') if spreadsheet.last_row <= 1\n\n # begin transaction\n begin\n connection = Connection.new\n connection.open_connection_in_config\n connection.con.autocommit false\n\n # 1. DELETE ALL RECORDS\n connection.execute_sql_statement \"delete from #{@table}\"\n pstmt = connection.con.prepare(\"insert into #{@table}(golivedate,appstatus,sku,shorttitle,longtitle,gender,agefrommonths,agetomonths,skill,curriculum,longdesc,platformcompatibility,specialmsg,teaches,licenselegal,licnonlic,license,language,pricetier,category,us,ca,uk,ie,au,row,fr_fr,fr_ca,fr_row) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\")\n (2..spreadsheet.last_row).each do |i|\n row = Hash[[header, spreadsheet.row(i)].transpose]\n\n # 2. INSERT DATA TO DATABASE\n insert_data pstmt, row\n end\n\n # 3. UPDATE DATA FOR LOCALE\n update_locale connection\n connection.con.commit # commit transaction\n\n return '<p class = \"alert alert-success\">MOAS file is imported successfully!</p>'\n rescue => e\n connection.con.rollback # rollback transaction\n return '<p class = \"alert alert-error\">PLEASE SELECT CORRECT TABLE. <br/>' << e.message << '</p>'\n ensure\n connection.close_connection if connection\n end # end begin transaction\n end", "def execute()\n # Retrieve a single entry from SIT:Site based on provided site\n siteEntry = @@remedy_forms['SIT:Site'].find_entries(\n :single,\n :conditions => [%|'Site' = \"#{@parameters['site']}\"|],\n :fields => :all\n )\n\n # Raise error if unable to locate the entry\n raise(\"No matching entry on the SIT:Site form for the given site [#{@parameters['site']}]\") if siteEntry.nil?\n\n #Get values out of Site into fields\n\t@field_values[\"Site ID\"] = siteEntry[\"Site ID\"]\n\t@field_values[\"Site City\"] = siteEntry[\"City\"]\n\t@field_values[\"Site Country\"] = siteEntry[\"Country\"]\n\t@field_values[\"Site State Province\"] = siteEntry[\"State Province\"]\n\t@field_values[\"Site Street\"] = siteEntry[\"Street\"]\n\t@field_values[\"Site Zip/Postal Code\"] = siteEntry[\"Zip/Postal Code\"]\n\t@field_values[\"Time Zone\"] = siteEntry[\"Time Zone\"]\n\t\n\t@create = 1\n\tbegin\n\t# Create the CTM:People record using the @field_values hash\n # that was built up. Pass 'Person ID' and 'InstanceId' to the fields\n # argument because these fields will be used in the results xml.\n entry = @@remedy_forms['CTM:People'].create_entry!(\n :field_values => @field_values,\n :fields => ['Person ID']\n )\n\trescue Exception => e\n\t\tputs(\"Exception: #{e.message}\") if @debug_logging_enabled\n\t\tputs(\"END OF EXCEPTION MESSAGE\") if @debug_logging_enabled\n\t\tif e.message.include?(\"is already in use, please choose another Login ID\")\n\t\t\t entry = @@remedy_forms['CTM:People'].find_entries(\n\t\t\t :single,\n\t\t\t :conditions => [%|'Remedy Login ID' = \"#{@parameters['remedy_login_id']}\"|],\n\t\t\t :fields => ['Person ID']\n\t\t\t)\n\t\t\t@create = 0\n\t\tend\n\tend\n\t\n # Create a notes string that will be stored within the audit record. It\n # contains the author of the modifications as well as details about each of\n # the modified values.\n notes = \"The CTM:People record was created by #{@parameters['author']}\"\n @field_values.each do |field_id, value|\n notes << \"\\nfield '#{field_id}' was entered as '#{value}'\"\n end\n\n # If any of the values were we checked are to be modified we save the\n # CTM:People record. Then we create an entry in CTM:People WorkLog to audit\n # this modification.\n if !entry.nil? && @create == 1\n @@remedy_forms['CTM:People WorkLog'].create_entry!(:field_values => {\n 'Person ID' => entry.id,\n 'Description' => 'Created by BmcItsm7PersonCreate handler.',\n 'Work Log Type' => 'General Information',\n 'Detailed Description' => notes,\n 'Work Log Submitter' => @parameters['author']\n },\n :fields => [])\n\telsif @create == 0\n\t\tputs(\"Did not create new user, login ID Already in use: #{@parameters['remedy_login_id']}\") if @debug_logging_enabled\n elsif entry.nil?\n\t\t# Raise error if unable to create the entry\n\t\traise(\"Unable to create people record for [#{@parameters['remedy_login_id']}]\")\n\tend\n \n\t\n # Build the results xml that will be returned by this handler.\n results = <<-RESULTS\n <results>\n <result name=\"Person ID\">#{escape(entry['Person ID'])}</result>\n </results>\n RESULTS\n puts(\"Results: \\n#{results}\") if @debug_logging_enabled\n #puts(\"Results: \\n#{results}\")\n\n # Return the results String\n return results\n end", "def upload_csv\n if !params[:sheet].blank?\n tmp = params[:sheet][:sheet_name].tempfile\n file = File.join(\"public\", params[:sheet][:sheet_name].original_filename)\n FileUtils.cp tmp.path, file\n report_file = File.open(\"#{Rails.root}/#{file}\", \"r\")\n csv = CSV.parse(report_file, :headers => true)\n csv.each do |row|\n row = row.to_hash.with_indifferent_access\n Sheet.create(row.to_hash.symbolize_keys)\n end\n end\n redirect_to :back\n end", "def process_data_file!\n filename = self.attachment.file.file\n data = CSV.read(filename, col_sep: \"\\t\")\n data.delete_at(0)\n\n sales_attrs = data.map do |row|\n row.each_with_index.map do |value, index|\n Hash[ CSV_HEADERS[index], value ]\n end.reduce(&:merge)\n end\n\n sales_attrs.each do |sale_attr|\n self.sales.create(sale_attr)\n end\n\n total_revenue = self.sales.map{|sale| sale.amount * sale.unit_price }.reduce(:+)\n self.update_attributes({\n processed: true,\n revenue: total_revenue,\n batch_code: SecureRandom.uuid\n })\n end", "def create_from_spreadsheet\n require 'simple_xlsx_reader'\n workbook = SimpleXlsxReader.open '/Users/athom/Desktop/codingProjects/zeman_project/app/assets/customerlist.xlsx'\n @worksheets = workbook.sheets\n\n @worksheets[0].rows.each_with_index do |row, index|\n if index > 0\n @customer = Customer.new\n @golden_account = CustomerAccount.new\n @nova_account = CustomerAccount.new\n @location = CustomerLocation.new\n @customer.name = row[0] != nil ? row[0] : ''\n @customer.phone_1 = row[1] != nil ? row[1] : ''\n @customer.phone_2 = row[2] != nil ? row[2] : ''\n @customer.email = row[3] != nil ? row[3] : ''\n @golden_account.customer_id = row[12]\n @golden_account.vendor_id = 1\n @golden_account.account_number = row[4] != nil ? row[4] : ''\n @golden_account.terms = row[5] != nil ? row[5] : ''\n @golden_account.price_level = row[6] != nil ? row[6] : ''\n @golden_account.freight_terms = row[7] != nil ? row[7] : ''\n @nova_account.customer_id = row[12]\n @nova_account.vendor_id = 2\n @nova_account.account_number = row[8] != nil ? row[8] : ''\n @nova_account.terms = row[9] != nil ? row[9] : ''\n @nova_account.price_level = row[10] != nil ? row[10] : ''\n @nova_account.freight_terms = row[11] != nil ? row[11] : ''\n @location.customer_id = row[12]\n @location.primary_billing = row[13] != nil ? row[13] : ''\n @location.primary_shipping = row[14] != nil ? row[14] : ''\n @location.address_1 = row[15] != nil ? row[15] : ''\n @location.city = row[16] != nil ? row[16] : ''\n @location.state = row[17] != nil ? row[17] : ''\n if @customer.name != '' && @customer.name != nil\n @customer.save\n end\n if @golden_account.account_number != '' && @golden_account.account_number != nil\n @golden_account.save\n end\n if @nova_account.account_number != '' && @nova_account.account_number != nil\n @nova_account.save\n end\n if @location.address_1 != '' && @location.address_1 != nil\n @location.save\n end\n end\n end\n render 'new'\n end" ]
[ "0.6807867", "0.66459835", "0.6291309", "0.6095432", "0.6003874", "0.57418203", "0.5722642", "0.5714362", "0.57080144", "0.57065916", "0.5676959", "0.564049", "0.5632519", "0.5628784", "0.5594937", "0.55781126", "0.5573592", "0.5568315", "0.55349046", "0.5499037", "0.5497785", "0.549613", "0.5482554", "0.5430354", "0.5418466", "0.5415081", "0.53854513", "0.5362875", "0.53480893", "0.5339576", "0.5335838", "0.5307876", "0.5296511", "0.5281092", "0.52529824", "0.52446747", "0.5225701", "0.52228004", "0.52115333", "0.51958746", "0.51889145", "0.5185328", "0.5164053", "0.5138938", "0.51109666", "0.5106244", "0.51031303", "0.5100524", "0.50958675", "0.5087423", "0.5070881", "0.5063006", "0.50499004", "0.5031347", "0.5026914", "0.502025", "0.50180876", "0.5017028", "0.5013646", "0.5013134", "0.50029904", "0.50025624", "0.49975094", "0.49960524", "0.4990059", "0.4989313", "0.4976041", "0.4972073", "0.49696425", "0.49693337", "0.49687883", "0.49584234", "0.49552497", "0.49552178", "0.4950363", "0.49498627", "0.49462318", "0.4937756", "0.49343255", "0.49341267", "0.493377", "0.49276206", "0.4924199", "0.49196306", "0.49142936", "0.49128717", "0.49112484", "0.49081415", "0.49069837", "0.49069682", "0.49024537", "0.4900481", "0.48980173", "0.48873246", "0.4885791", "0.4885393", "0.48770487", "0.48618624", "0.48610383", "0.48507068" ]
0.6307966
2
Run all the processing
def process progressbar = ProgressBar.create(title: "Rows", total: @values.count, format: "%B | %c/%u | %p% | %E ") rows = [["Valid Original URL?", "Valid Article URL?"]] @values.each_with_index do |row, index| next if index == 0 valid_original_url = validate_url(row[9]) ? "" : "DIRTY" valid_article_url = validate_url(row[10]) ? "" : "DIRTY" rows << [valid_original_url, valid_article_url] progressbar.increment end update_sheet(rows) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_processing_run(faids)\n perform_analysis(faids)\n perform_processing!\n end", "def process!\n end", "def run_all()\n end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def run_all\n end", "def run_all\n end", "def process\n end", "def run_all\n perform\n end", "def run_all\n perform\n end", "def run() end", "def run\n @file_paths.each do |path|\n process_file(path)\n end\n @report\n end", "def do( args )\n\t\tqueue_files_for_processing( args )\n\t\tretrack\n\tend", "def post_process\n end", "def process(*)\n end", "def processor; end", "def process\n proccess_contacts_imports\n proccess_attendance_imports\n process_fnz_imports\n proccess_crm_imports\n process_planning_imports\n process_mailing_imports\n end", "def perform_processing!\n raise \"This run is already processed!\" if run_for_processing\n update(run_for_processing: true)\n outdir = File.join(OUTPUT_DIR, \"#{id}\").shellescape\n indir = File.join(INPUT_DIR, \"#{id}\").shellescape\n Dir.mkdir(outdir, 0755) unless File.directory?(outdir)\n Dir.mkdir(indir, 0755) unless File.directory?(indir)\n\n # Stream input files to zip\n zout_in = java.util.zip.ZipOutputStream.new(File.open(File.join(indir, 'input.zip'), 'wb', 0644).to_outputstream)\n zout_out = java.util.zip.ZipOutputStream.new(File.open(File.join(outdir, 'out.zip'), 'wb', 0644).to_outputstream)\n\n finding_aid_versions\n .joins(:finding_aid, :concrete_issues => :issue)\n .select('finding_aid_versions.*,\n finding_aids.eadid,\n ARRAY_AGG(DISTINCT issues.identifier) AS identifiers')\n .group('finding_aids.eadid,finding_aid_versions.id')\n .each do |fa|\n add_to_zip(zout_in, fa.eadid, fa.file)\n\n # Preflight XML\n fa_xml = Fixes.preflights.values.reduce(fa.xml) do |xml, fix|\n apply_fix(xml, fix)\n end\n\n # Apply all relevant fixes to Finding Aid\n repaired = Fixes\n .to_h\n .select {|identifier, _| fa.identifiers.include? identifier}\n .reduce(fa_xml) do|xml, (identifier, fix)|\n pe = processing_events.create(issue_id: schematron.issues.find_by(identifier: identifier).id,\n finding_aid_version_id: fa.id)\n apply_fix(xml, fix, pe)\n\n end # end of .reduce\n\n # Any problems which have fixes that exist now should theoretically\n # be things that were shadowed by the first pass, so take additional passes\n # untill either no known issues or MAX_PASSES\n MAX_PASSES.times do\n remaining_problems = schematron.issues.where(id: @checker.check_str(repaired.serialize(encoding: 'UTF-8')).map {|el| el[:issue_id]}.uniq).pluck(:identifier) & Fixes.to_h.keys\n\n # Run a second round of fixing if there are remaining problems\n break if remaining_problems.blank?\n repaired = Fixes\n .to_h\n .select {|identifier, _| remaining_problems.include? identifier}\n .reduce(repaired) do |xml, (identifier, fix)|\n pe = processing_events.create(issue_id: schematron.issues.find_by(identifier: identifier).id,\n finding_aid_version_id: fa.id)\n apply_fix(xml, fix, pe)\n end\n end\n\n\n # Add notice of processing to revisiondesc\n today = DateTime.now.in_time_zone\n rd = repaired.at_xpath('/ead/eadheader/revisiondesc') || repaired.at_xpath('/ead/eadheader').add_child(Nokogiri::XML::DocumentFragment.new(repaired, '<revisiondesc />')).first\n rd.prepend_child(Nokogiri::XML::DocumentFragment.new(repaired, \"\\n\" + <<-FRAGMENT.strip_heredoc + \"\\n\"))\n <change>\n <date calendar=\"gregorian\" era=\"ce\" normal=\"#{today.strftime('%Y%m%d')}\">#{today.strftime('%m/%d/%Y')}</date>\n <item>This resource was modified by the ArchivesSpace Preprocessor developed by the Harvard Library (https://github.com/harvard-library/archivesspace-preprocessor)</item>\n </change>\n FRAGMENT\n\n File.open(File.join(outdir, \"#{fa.eadid}.xml\"), 'w', 0644) do |f|\n repaired.write_xml_to(f, encoding: 'UTF-8')\n end\n\n add_to_zip(zout_out, fa.eadid, File.open(File.join(outdir, \"#{fa.eadid}.xml\"), 'r'))\n end\n\n update(completed_at: DateTime.now)\n ensure\n close_zipfiles(zout_in, zout_out)\n end", "def run\n end", "def post_process; end", "def process_all_nodes\n debug 'Start processing all nodes'\n each_node do |node|\n process_node node\n end\n end", "def process!\n events.each(&:process!)\n end", "def run\n end", "def processes\n GoodData::Process.all\n end", "def after_processing\n end", "def run\n end", "def run\n end", "def run\n executor.run\n @files\n end", "def perform\n \n 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", "def call\n process\n end", "def runs; end", "def process\n by_time_batch\n by_waiting_batch\n rescue\n @logger.fatal \"Failed to process: #{$!}\"\n @logger.fatal $!.backtrace.join(\"\\n\")\n end", "def run!()\n\t\t\tif(@options[:elb])\n\t\t\t\tprocess_elbs()\n\t\t\tend\n\t\t\tnext_precience()\n\t\t\tif(@options[:ec2_tags])\n\t\t\t\t@options[:ec2_tags].each do |tag_name|\n\t\t\t\t\tprocess_ec2_tag_name(tag_name)\n\t\t\t\t\tnext_precience()\n\t\t\t\tend\n\t\t\tend\n\t\t\treduce_dns_pool()\n\t\t\tprocess_zone_updates()\n\t\t\treturn nil\n\t\tend", "def run\n \n end", "def run\n \n end", "def process_files files=[]\n files.each do |file|\n process_file file\n end\n end", "def do_work\n end", "def run\n start_processing\n at_exit { ShellOut.stop }\n end", "def perform\n\n begin\n\n # acquire lock and fetch the locked hooks\n fetch_hooks_to_be_processed\n\n # Process these Hooks\n process_hooks\n\n # Mark Hooks as processed\n update_status_to_processed\n\n rescue StandardError => se\n\n @hooks_to_be_processed.each do |hook|\n hook_id = hook.id\n # Skip if we already know that his hook was processed or failed\n next if @success_responses[hook_id].present? ||\n @failed_hook_to_be_ignored[hook_id].present? ||\n @failed_hook_to_be_retried[hook_id].present?\n @failed_hook_to_be_retried[hook_id] = {\n exception: {message: se.message, trace: se.backtrace}\n }\n end\n\n ensure\n\n # For hooks which failed, mark them as failed\n release_lock_and_update_status_for_non_processed_hooks\n\n # Notify Devs in case on Errors\n notify_devs\n\n success_with_data(processor_response)\n\n end\n\n end", "def process\n process_setting_specs\n process_shard_specs\n process_connection_specs\n end", "def process\n raise \"Must be implemented\"\n end", "def run_all\n jammit\n end", "def process_all_nodes\n debug 'Start processing all nodes'\n hook 'pre_all'\n each_node do |node|\n process_node node\n end\n hook 'post_all'\n end", "def run_and_transform; end", "def main()\n res = @s.execute_get(@s.url_for(\"var/search/needsprocessing.json\"))\n unless res.code == '200'\n raise \"Failed to retrieve list to process [#{res.code}]\"\n end\n\n process_results = JSON.parse(res.body)['results']\n log \"processing #{process_results.size} entries\"\n unless process_results.size > 0\n return\n end\n\n # Create some temporary directories.\n Dir.mkdir DOCS_DIR unless File.directory? DOCS_DIR\n Dir.mkdir PREV_DIR unless File.directory? PREV_DIR\n Dir.mkdir PDFS_DIR unless File.directory? PDFS_DIR\n\n # Create a temporary file in the DOCS_DIR for all the pending files and outputs all the filenames in the terminal.\n Dir.chdir DOCS_DIR\n queued_files = process_results.collect do |result|\n FileUtils.touch result['_path']\n end\n\n log \" \"\n log \"Starts a new batch of queued files: #{queued_files.join(', ')}\"\n\n Dir['*'].each do |id|\n FileUtils.rm_f id\n log \"processing #{id}\"\n\n begin\n meta_file = @s.execute_get @s.url_for(\"p/#{id}.json\")\n unless meta_file.code == '200'\n raise \"Failed to process: #{id}\"\n end\n\n meta = JSON.parse meta_file.body\n mime_type = meta['_mimeType']\n given_extension = meta[\"sakai:fileextension\"]\n extension = determine_file_extension_with_mime_type(mime_type, given_extension)\n filename = id + extension\n log \"with filename: #{filename}\"\n\n if ignore_processing?(mime_type) || extension.eql?('')\n if extension.eql?('')\n log \"ignoring processing of #{filename}, no preview can be generated for files without a known mime type\"\n log \"The file's original extension was #{given_extension}, and it's mime type is #{mime_type}\"\n else\n log \"ignoring processing of #{filename}, no preview can be generated for #{mime_type} files\"\n end\n else\n # Making a local copy of the file.\n content_file = @s.execute_get @s.url_for(\"p/#{id}\")\n unless ['200', '204'].include? content_file.code\n raise \"Failed to process file: #{id}, status: #{content_file.code}\"\n end\n File.open(filename, 'wb') { |f| f.write content_file.body }\n\n if process_as_image? extension\n extension = output_extension extension\n page_count = 1\n filename_thumb = 'thumb' + extension\n\n content = resize_and_write_file filename, filename_thumb, 900\n post_file_to_server id, content, :normal, page_count, extension\n\n content = resize_and_write_file filename, filename_thumb, 180, 225\n post_file_to_server id, content, :small, page_count, extension\n\n FileUtils.rm_f DOCS_DIR + \"/#{filename_thumb}\"\n else\n begin\n # Check if user wants autotagging\n user_id = meta[\"sakai:pool-content-created-for\"]\n user_file = @s.execute_get @s.url_for(\"/system/me?uid=#{user_id}\")\n unless user_file.code == '200'\n raise \"Failed to get user: #{uid}\"\n end\n user = JSON.parse(user_file.body)\n if user[\"user\"][\"properties\"][\"isAutoTagging\"] != \"false\"\n # Get text from the document\n Docsplit.extract_text filename, :ocr => false\n text_content = IO.read(id + \".txt\")\n terms = extract_terms(text_content)\n tags = \"\"\n terms.each_with_index do |t, i|\n tags += \"- #{t}\\n\"\n terms[i] = \"/tags/#{t}\"\n end\n # Generate tags for document\n @s.execute_post @s.url_for(\"p/#{id}\"), {':operation' => 'tag', 'key' => terms}\n log \"Generate tags for #{id}, #{terms}\"\n admin_id = \"admin\"\n origin_file_name = meta[\"sakai:pooled-content-file-name\"]\n if not terms.nil? and terms.length > 0 and user[\"user\"][\"properties\"][\"sendTagMsg\"] and user[\"user\"][\"properties\"][\"sendTagMsg\"] != \"false\"\n msg_body = \"We have automatically added the following tags for #{origin_file_name}:\\n\\n #{tags}\\n\\nThese tags were created to aid in the discoverability of your content.\\n\\nRegards, \\nThe Sakai Team\"\n @s.execute_post(@s.url_for(\"~#{admin_id}/message.create.html\"), {\n \"sakai:type\" => \"internal\",\n \"sakai:sendstate\" => \"pending\",\n \"sakai:messagebox\" => \"outbox\",\n \"sakai:to\" => \"internal:#{user_id}\",\n \"sakai:from\" => \"#{admin_id}\",\n \"sakai:subject\" => \"We've added some tags to #{origin_file_name}\",\n \"sakai:body\" => msg_body,\n \"_charset_\" => \"utf-8\",\n \"sakai:category\" => \"message\"\n })\n log \"sending message from #{admin_id} user to #{user_id}\"\n end\n end\n rescue Exception => msg\n log \"failed to generate document tags: #{msg}\", :warn\n end\n\n # Generating image previews of the document.\n if only_first_page? extension\n Docsplit.extract_images filename, :size => '1000x', :format => :jpg, :pages => 1\n else\n Docsplit.extract_images filename, :size => '1000x', :format => :jpg\n end\n\n # Skip documents with a page count of 0, just to be sure.\n next if Dir[id + '_*'].size == 0\n\n Dir.mkdir PREV_DIR + \"/#{id}\" unless File.directory? PREV_DIR + \"/#{id}\"\n\n # Moving these previews to another directory: \"PREVS_DIR/filename/index.jpg\".\n Dir[id + '_*'].each_with_index do |preview, index|\n FileUtils.mv \"#{id}_#{index + 1}.jpg\", \"#{PREV_DIR}/#{id}/#{index}.jpg\"\n end\n\n Dir.chdir PREV_DIR + \"/#{id}\"\n page_count = Dir[\"*\"].size\n\n # Upload each preview and create+upload a thumbnail.\n for index in (0..page_count - 1)\n filename_p = \"#{index}.jpg\"\n # Upload the generated preview of this page.\n nbytes, content = File.size(filename_p), nil\n File.open(filename_p, \"rb\") { |f| content = f.read nbytes }\n post_file_to_server id, content, :large, index + 1\n\n # Generate 2 thumbnails and upload them to the server.\n filename_thumb = File.basename(filename_p, '.*') + '.normal.jpg'\n content = resize_and_write_file filename_p, filename_thumb, 700\n post_file_to_server id, content, :normal, index + 1\n\n filename_thumb = File.basename(filename_p, '.*') + '.small.jpg'\n content = resize_and_write_file filename_p, filename_thumb, 180, 225\n post_file_to_server id, content, :small, index + 1\n end\n\n FileUtils.remove_dir PREV_DIR + \"/#{id}\"\n end\n # Pass on the page_count\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:pagecount\" => page_count, \"sakai:hasPreview\" => \"true\"}\n\n # Change to the documents directory otherwise we won't find the next file.\n Dir.chdir DOCS_DIR\n end\n\n #SAKAI TO PDF\n # We check if mimetype is sakaidoc\n if(mime_type == \"x-sakai/document\")\n if (File.exist?(\"../wkhtmltopdf\"))\n # Go to PDF Dir\n Dir.chdir PDFS_DIR\n\n #delay in secs\n $delay = \"20\"\n\n #filename with extension\n filename_p = id + \".pdf\"\n\n # We parse the structure data to var structure (we do not need the rest)\n structure = JSON.parse meta['structure0']\n\n # Create var and add beginning of code line to run\n line = \"../wkhtmltopdf \"\n\n # Go through structure and add the pagelink for each page id\n structure.each do |page|\n link = \"content#l=\" + page[0] + \"&p=\" + id\n link = @s.url_for(link)\n link = \"'\" + link + \"' \"\n line += link\n end\n\n # Fetch cookie value to get access to all content\n # USERNAME PASSWORD SERVER\n $username = \"admin\"\n auth = \"../auth.sh \" + $username + \" \" + $pw + \" \" + $preview_referer\n cookietoken = `#{auth}`\n\n # Append end of line containing arguments for print css, delay and authentication\n line += filename_p + \" --print-media-type --redirect-delay \" + $delay + \"000 --cookie 'sakai-trusted-authn' \" + cookietoken\n\n # Run the command line (run wkhtmltopdf)\n `#{line}`\n\n # We read the content from the pdf in the PDF directory\n content = open(filename_p, 'rb') { |f| f.read }\n\n # We post it to server through this function\n post_pdf_to_server id, content\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"false\"}\n #Change dir\n Dir.chdir DOCS_DIR\n else\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"true\"}\n log \"PDF Converter (wkhtmltopdf) not present in directory\"\n log \"Cannot convert Sakai document to PDF\"\n log \"Continuing without conversion\"\n end\n end\n rescue Exception => msg\n # Output a timestamp + the error message whenever an exception is raised\n # and flag this file as failed for processing.\n log \"error generating preview/thumbnail (ID: #{id}): #{msg.inspect}\\n#{msg.backtrace.join(\"\\n\")}\", :warn\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"true\"}\n ensure\n # No matter what we flag the file as processed and delete the temp copied file.\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:needsprocessing\" => \"false\"}\n FileUtils.rm_f DOCS_DIR + \"/#{filename}\"\n end\n end\n\n FileUtils.remove_dir PDFS_DIR\n FileUtils.remove_dir PREV_DIR\n FileUtils.remove_dir DOCS_DIR\nend", "def main\n \n operations.each do |op|\n in_collection = op.input(INPUT).collection\n keep_plt = op.input(KEEP_PLT).val.to_s\n \n # export_filename(collection=in_collection, method='timeseries', timepoint=20) # timepoint is duration of timeseries plate reader\n filename = Item.find(in_collection.id).get('timeseries_filename')\n \n # Directs tech through biotek plate reader software in order to export time series measurements\n export_timeseries_data(filename)\n \n # Find measurements and upload\n show {\n title \"Locating Upload\"\n separator\n note \"The file you just exported should be in the <b>'_UWBIOFAB'</b> directory\"\n note \"It is called: #{filename}\"\n }\n # Show block upload button and retrieval of file uploaded\n up_show, up_sym = upload_show(filename)\n if (up_show[up_sym].nil?)\n show {warning \"No upload found for Plate Reader measurement. Try again!!!\"}\n up_show, up_sym = upload_show(filename)\n else\n upload = find_upload_from_show(up_show, up_sym)\n key = \"#{filename}\"\n associate_to_plans(key, upload)\n associate_to_item(in_collection, key, upload)\n end\n \n (keep_plt == 'No') ? (in_collection.mark_as_deleted) : (in_collection.location = 'Bench')\n in_collection.save\n if (keep_plt == 'No')\n show {\n title \"Cleaning Up...\"\n separator\n note \"Rinse out Plate <b>#{in_collection}</b> with DI H2O and bleach\"\n note \"Then rinse once more with EtOH\"\n }\n else\n show {\n title \"Cleaning Up...\"\n separator\n note \"Move <b>#{in_collection}</b> to <b>#{in_collection.location}</b>\"\n }\n end\n end\n \n end", "def run\n self.proc.call\n end", "def run_program()\n final_words()\n segmented_output()\n end", "def run_loop\n # Run all plugins\n @controller_plugins.each do |controller_plugin|\n controller_plugin.run\n log_stats(controller_plugin)\n end\n trigger_success_handlers\n end", "def process(*)\n end", "def process(*)\n end", "def process_files\n Dir[DATA_DIR + '/**/*.csv'].each do |file|\n process_file(file)\n end\n end", "def run\n\n # Gets possible data source(s)\n service(:sniffer).exec\n\n # Filters the data source(s) to extract the relevant only.\n service(:filter).exec\n\n # ETL\n context[:to_be_extracted].each_with_index do |ds, i|\n log.debug \"starting ETL, idx=#{i + 1}\"\n context[:extract] = ds\n service(:extractor).exec\n service(:transformer).exec\n service(:loader).exec\n end\n\n log.info 'Bye bye'\n end", "def process\n # start with the original as if it was the last destination\n tasks.each do |t|\n process_task(t)\n end\n close_files\n\n result_details\n end", "def process\n self.generate\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def process\n # no-op by default\n end", "def run\n executor.run\n @files.map { |file| File.join(@output_dir, file.relative_file_name) }\n end", "def post_loop; end", "def process\n # no-op\n end", "def execute\n\n logger = Logger.new(\"/dev/null\")\n logger.level = Logger::WARN\n log_adapter = JerichoLoggerAdapter.new(logger)\n\n perl_pages = File.join(top_git_directory, 'java/code/**/*.{jsp,jspf}')\n java_pages = File.join(top_git_directory, 'web//**/*.{pxt, pxi}')\n [perl_pages, java_pages].each do |pages|\n Dir.glob(pages).each do |path|\n content = File.read(path)\n on_file_start(content, path)\n source = Source.new(content)\n source.setLogger(log_adapter)\n out = OutputDocument.new(source)\n\n tags = source.getAllStartTags\n tags.each do |tag|\n if applicable?(tag)\n process_tag(source, out, tag, path)\n end\n end\n\n on_file_changed(content, out.toString, path)\n on_file_done(path)\n end\n end\n\n Dir.glob(File.join(top_git_directory, 'java/code/**/*.{java}')).each do |path|\n content = File.read(path)\n on_file_start(content, path)\n on_file_done(path)\n end\n\n Dir.glob(File.join(top_git_directory, 'web/**/*.{pm}')).each do |path|\n content = File.read(path)\n on_file_start(content, path)\n on_file_done(path)\n end\n\n on_done\n end", "def run\n\n # Identify method entry\n debug_print \"#{ self } : #{ __method__ }\\n\"\n\n # Go through all files added from CL (sort them first)\n # If empty, sort and each will do nothing, no errors\n _completed_dirs = Array.new()\n _completed_files = Array.new()\n if @config.cl_entry_set\n @config.file_list.sort.each do |_file|\n _completed_files.push(parse_file(_file))\n end\n end\n\n # Then go through all the specified directories\n # Initial parse depth to parse_dir is 0 (unlimited)\n @config.dir_list.sort.each do |_dir|\n _completed_dirs.push(parse_dir(_dir, 0))\n end\n\n # Create overall hash for parsed files\n _structure = Hash.new()\n _structure[:files] = _completed_files\n _structure[:subdirs] = _completed_dirs\n\n debug_print \"_structure dump\\n\\n\"\n debug_print PP.pp(_structure, '')\n debug_print \"\\n\\n\"\n\n # Pass structure to poster with count as 0\n Remote.post_structure(_structure, @config, 0)\n\n _structure\n end", "def run(_); end", "def run(_); end", "def run\n self.prominence!\n return self.send_results if @query.any?\n\n self.fuzzy_match\n self.apply_narrowing_filters\n self.apply_limit\n self.load_and_sort_by_matches\n self.send_results\n end", "def pump_results!\n loop do\n distribute_results!\n end\n end", "def run\n if @files.empty?\n @commander.Process(STDIN)\n else\n @files.each do |filename|\n File.open(filename) { |f| @commander.Process(f) }\n end \n end\n end", "def process_result\n end", "def run\n logger.debug(\"WORK HORSE PROCESS JOB STARTED.\")\n downloadRemotefiles\n unzipFiles\n #parsePhotoRequestReponseXMl\n #updateProducts\n zipXMLFiles\n uploadZipFiles\n logger.debug(\"JOB FINISHED.\")\n end", "def process_all\n @events = []\n\n # Download and parse each of the files for all the seasons\n # and week ranges we need to process\n Config.read(\"seasons\").each do |season|\n Config.read(\"week_ranges\").each do |weeks|\n data = download(academic_year, season, weeks)\n parse(data)\n end\n end\n\n # Do nothing if saving to cache was not possible\n Cache.save(@course_id, @events) rescue nil\n\n init_calendar\n add_to_calendar(@events)\n end", "def run \n each do |runnable|\n if runnable.respond_to?(:run)\n runnable.run\n end\n end\n end", "def run\n end", "def run\n logger.debug('WORK HORSE PROCESS JOB STARTED.')\n download_remotefiles\n unzip_files\n parse_photo_request_reponse_xml\n update_products\n zip_xml_files\n upload_zip_files\n import_response\n logger.debug('JOB FINISHED.')\n end", "def process\n self\n end", "def executor; end", "def executor; end", "def executor; end", "def masterrun\n self.workersrun \n self.serverrun \n end", "def process\n process_moves\n reassign_team_sets\n reset_quantitative_data\n #notify\n end", "def running; end" ]
[ "0.75878906", "0.72011226", "0.70884836", "0.7060549", "0.7060549", "0.7060549", "0.7060549", "0.7060549", "0.7060549", "0.7060549", "0.7060549", "0.69959456", "0.69959456", "0.69923913", "0.6974905", "0.6974905", "0.6797452", "0.6794056", "0.6662708", "0.66526353", "0.6624871", "0.66066897", "0.6597357", "0.65549785", "0.65517974", "0.6530998", "0.65144193", "0.6499142", "0.64695585", "0.64652115", "0.64620703", "0.6446676", "0.6446676", "0.6441368", "0.64377373", "0.6437423", "0.6437423", "0.6437423", "0.6437423", "0.6437423", "0.6437423", "0.6437423", "0.6437423", "0.6437423", "0.642007", "0.64100933", "0.6406068", "0.637945", "0.637799", "0.637799", "0.63707846", "0.6364221", "0.63256645", "0.6322824", "0.63133484", "0.63042223", "0.63038296", "0.6299516", "0.628744", "0.6281331", "0.6265361", "0.6265258", "0.62641186", "0.62592995", "0.62483877", "0.62483877", "0.6246508", "0.62441814", "0.6230857", "0.62197894", "0.62134916", "0.62134916", "0.62134916", "0.62134916", "0.62134916", "0.62134916", "0.62134916", "0.62026", "0.61973083", "0.61949986", "0.6187517", "0.6175136", "0.6174371", "0.6171985", "0.6171985", "0.615946", "0.61087734", "0.61038196", "0.60930794", "0.6092842", "0.6091258", "0.60899925", "0.6086451", "0.6072589", "0.6062972", "0.6042137", "0.6042137", "0.6042137", "0.6040994", "0.6021014", "0.601784" ]
0.0
-1
Ensure valid credentials, either by restoring from the saved credentials files or intitiating an OAuth2 authorization. If authorization is required, the user's default browser will be launched to approve the request.
def authorize client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store user_id = "default" credentials = authorizer.get_credentials user_id if credentials.nil? url = authorizer.get_authorization_url base_url: OOB_URI puts "Open the following URL in the browser and enter the " \ "resulting code after authorization:\n" + url code = ask "code?: " credentials = authorizer.get_and_store_credentials_from_code( user_id: user_id, code: code, base_url: OOB_URI ) end credentials end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorize\r\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\r\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\r\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\r\n user_id = \"default\"\r\n credentials = authorizer.get_credentials user_id\r\n\r\n # launch default browser to approve request of initial OAuth2 authorization\r\n if credentials.nil?\r\n url = authorizer.get_authorization_url base_url: OOB_URI\r\n puts \"Open the following URL in the browser and enter the resulting code after authorization:\\n\" + url\r\n code = gets\r\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\r\n end\r\n\r\n credentials\r\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(@CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(@CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(@CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => @SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{@CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\n end", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIAL))\n file_store = Google::APIClient::FileStore.new(CREDENTIAL)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRET)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIAL}\" unless auth.nil?\n end\n auth\n end", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n credentials = authorizer.get_credentials('default')\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n\n server = WEBrick::HTTPServer.new(Port: 3000)\n server.mount_proc('/oauth2callback') do |req, res|\n code = req.query['code']\n credentials = authorizer.get_and_store_credentials_from_code(user_id: 'default', code: code, base_url: OOB_URI)\n res.body = 'Authorization successful. You can close this window and return to the terminal.'\n server.shutdown\n end\n\n warn('Open the following URL in your browser and authorize the app:')\n warn(url)\n server.start\n end\n credentials\nend", "def authorize interactive\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil? and interactive\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n code = ask(\"Open the following URL in the browser and enter the resulting code after authorization\\n\" + url)\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(@CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(@CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: @CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, @SCOPE, token_store)\n\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: @OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: @OOB_URI)\n end\n credentials\n end", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n \n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\n end", "def find_or_prompt_for_credentials\n client_id = Google::Auth::ClientId.from_hash(CLIENT_SECRET_HASH)\n token_store = Google::Auth::Stores::RedisTokenStore.new(:prefix => REDIS_KEY_PREFIX)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization:\"\n puts url\n\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n\n credentials\n end", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n\n # changed SCOPE to SCOPES to pass in multiple OAUTH scopes\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPES, token_store)\n\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\n end", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' +\n 'resulting code after authorization'\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n client_id: app_info.client_id,\n client_secret: app_info.client_secret,\n scope: SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "def authorize(interactive)\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store, '')\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil? && interactive\n url = authorizer.get_authorization_url(base_url: BASE_URI, scope: SCOPE)\n code = ask(\"Open the following URL in the browser and enter the resulting code after authorization\\n#{url}\")\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: BASE_URI\n )\n end\n credentials\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n end\n auth\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(self.credentials_path)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: self.token_path)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPES, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\r\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\r\n\r\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\r\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\r\n authorizer = Google::Auth::UserAuthorizer.new(\r\n client_id, SCOPE, token_store)\r\n user_id = 'default'\r\n credentials = authorizer.get_credentials(user_id)\r\n if credentials.nil?\r\n url = authorizer.get_authorization_url(\r\n base_url: OOB_URI)\r\n puts \"Open the following URL in the browser and enter the \" +\r\n \"resulting code after authorization\"\r\n puts url\r\n code = gets\r\n credentials = authorizer.get_and_store_credentials_from_code(\r\n user_id: user_id, code: code, base_url: OOB_URI)\r\n end\r\n credentials\r\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n\tFileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n\tclient_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n\ttoken_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n\tauthorizer = Google::Auth::UserAuthorizer.new(\n\t\tclient_id, SCOPE, token_store)\n\tuser_id = 'default'\n\tcredentials = authorizer.get_credentials(user_id)\n\tif credentials.nil?\n\t\turl = authorizer.get_authorization_url(\n\t\t\tbase_url: OOB_URI)\n\t\tputs \"Open the following URL in the browser and enter the \" +\n\t\t\"resulting code after authorization\"\n\t\tputs url\n\t\tcode = STDIN.gets\n\t\tcredentials = authorizer.get_and_store_credentials_from_code(\n\t\t\tuser_id: user_id, code: code, base_url: OOB_URI)\n\tend\n\tcredentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = $stdin.gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI,\n )\n end\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = 'default'\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = $stdin.readline()\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\r\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\r\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\r\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\r\n user_id = \"default\"\r\n credentials = authorizer.get_credentials user_id\r\n if credentials.nil?\r\n url = authorizer.get_authorization_url base_url: OOB_URI\r\n puts \"Open the following URL in the browser and enter the \" \\\r\n \"resulting code after authorization:\\n\" + url\r\n code = gets\r\n credentials = authorizer.get_and_store_credentials_from_code(\r\n user_id: user_id, code: code, base_url: OOB_URI\r\n )\r\n end\r\n credentials\r\nend", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n # client_id = Google::Auth::ClientId.from_hash(Rails.application.config.gdrive_secrets)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store\n )\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI\n )\n puts 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization'\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\r\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\r\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\r\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\r\n user_id = 'default'\r\n credentials = authorizer.get_credentials(user_id)\r\n if credentials.nil?\r\n url = authorizer.get_authorization_url(base_url: OOB_URI)\r\n puts 'Open the following URL in the browser and enter the ' \\\r\n \"resulting code after authorization:\\n\" + url\r\n code = gets\r\n credentials = authorizer.get_and_store_credentials_from_code(\r\n user_id: user_id, code: code, base_url: OOB_URI\r\n )\r\n end\r\n credentials\r\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPES, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.\n new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.\n new(client_id, SCOPE, token_store)\n credentials = authorizer.\n get_credentials(CONFIGURATION[\"calendar\"][\"user_id\"])\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \"\\\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: CONFIGURATION[\"calendar\"][\"user_id\"],\n code: code,\n base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI,\n )\n end\n credentials\nend", "def authorize\n ##FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n if !File.exist?(CLIENT_SECRETS_PATH)\n puts \"Error: OAuth2認証用のsecretファイルが見つかりませんでした\"\n puts \"以下のURLからこのプロジェクト用のsecretを作成し、'client_secret.json'というファイル名でこのディレクトリに保存してください。\"\n puts\n puts \"https://console.developers.google.com/start/api?id=sheets.googleapis.com\"\n exit 1\n end\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"以下のURLにWebブラウザでアクセスし、認証を行った後、表示されるコードを入力してください:\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization:\\n' + url\n code = $stdin.gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization:\\n' + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n return credentials if credentials\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = $stdin.gets\n authorizer.get_and_store_credentials_from_code(\n user_id: user_id,\n code: code,\n base_url: OOB_URI\n )\n end", "def authorize(force_reload)\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if force_reload || credentials.nil?\n session[:is_authorized] = false\n redirect_to google_fetch_path\n return\n end\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file(@credentials_path)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: @token_path)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, @scope, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: @oob_uri)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: @oob_uri\n )\n end\n credentials\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code( user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize(credentials_path, secrets_path, scope)\n\n FileUtils.mkdir_p(File.dirname(credentials_path))\n\n file_store = Google::APIClient::FileStore.new(credentials_path)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(secrets_path)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => scope})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{credentials_path}\" unless auth.nil?\n end\n auth\n end", "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the resulting code after authorization:\\n\\n\"\n puts url\n print \"\\nCode: \"\n code = gets\n puts\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def check_credentials\n raise \"Please set load_configuration with #{RightSignature2013::Connection.api_token_keys.join(',')} or #{RightSignature2013::Connection.oauth_keys.join(',')}\" unless has_api_token? || has_oauth_credentials?\n end", "def valid_for_http_auth?; end", "def authorize\n credentialsFile = FILE_POSTFIX\n\n if File.exist? credentialsFile\n File.open(credentialsFile, 'r') do |file|\n credentials = JSON.load(file)\n @authorization.access_token = credentials['access_token']\n @authorization.client_id = credentials['client_id']\n @authorization.client_secret = credentials['client_secret']\n @authorization.refresh_token = credentials['refresh_token']\n @authorization.expires_in = (Time.parse(credentials['token_expiry']) - Time.now).ceil\n if @authorization.expired?\n @authorization.fetch_access_token!\n save(credentialsFile)\n end\n end\n else\n auth = @authorization\n url = @authorization.authorization_uri().to_s\n server = Thin::Server.new('0.0.0.0', 8081) do\n run lambda { |env|\n # Exchange the auth code & quit\n req = Rack::Request.new(env)\n auth.code = req['code']\n auth.fetch_access_token!\n server.stop()\n [200, {'Content-Type' => 'text/html'}, RESPONSE_HTML]\n }\n end\n\n Launchy.open(url)\n server.start()\n\n save(credentialsFile)\n end\n\n return @authorization\n end", "def authorize\n\tclient_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n\ttoken_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n\tauthorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n\tuser_id = 'default'\n\n\tcredentials = authorizer.get_credentials(user_id)\n\treturn credentials unless credentials.nil?\n\n\turl = authorizer.get_authorization_url(base_url: OOB_URI)\n\tputs 'Open the following URL in the browser and enter the ' \\\n\t\t \"resulting code after authorization:\\n#{url}\"\n\tcode = gets\n\n\treturn authorizer.get_and_store_credentials_from_code(\n\t\tbase_url: OOB_URI,\n\t\tuser_id: user_id,\n\t\tcode: code,\n\t)\n\nend", "def authorize\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the resulting code after authorization:\"\n puts url\n puts \"\"\n puts \"paste code here:\"\n code = gets\n\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize(credentials)\n credentials_path = \"#{PATH}#{credentials}-gmail.json\"\n token_path = \"#{PATH}#{credentials}-token.yaml\"\n client_id = Google::Auth::ClientId.from_file credentials_path\n token_store = Google::Auth::Stores::FileTokenStore.new file: token_path\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = 'default'\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "def authorize(token_path, scope)\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: token_path\n authorizer = Google::Auth::UserAuthorizer.new client_id, scope, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "def authorize\n client_id = create_client_id\n token_store = create_token_store\n\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI\n )\n Rails.logger.debug do\n 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization'\n end\n Rails.logger.debug url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id:, code:, base_url: OOB_URI\n )\n end\n credentials\n end", "def verify_credentials!\n raise AuthenticationError.new(\"missing client code\") if Applitrack.client_code.nil? || Applitrack.client_code.empty?\n raise AuthenticationError.new(\"missing username\") if Applitrack.username.nil? || Applitrack.username.empty?\n raise AuthenticationError.new(\"missing password\") if Applitrack.password.nil? || Applitrack.password.empty?\n end", "def check_auth_expiration(auth, client_secrets_path, scope)\n return false unless auth.nil? ||\n (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(client_secrets_path)\n flow = Google::APIClient::InstalledAppFlow.new(\n client_id: app_info.client_id,\n client_secret: app_info.client_secret,\n scope: scope)\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{credentials_path}\" unless auth.nil?\n end", "def prompt_user_authorisation\n\n require './app/routes/web'\n\n # Start local API\n Launchy.open(\"http://localhost:5000/cli/auth\")\n\n auth_thread = Thread.new do\n Linkedin2CV::Routes::Web.run!\n end\n\n auth_thread\n end", "def auth_process\n\t\tif @auth_file.authorization.nil?\n \t\t\tmake_auth\n\t\telse\n\t\t\t@client.authorization = @auth_file.authorization\n\t\tend\n\tend", "def grant_authorization\n create_verification_code if authorized?\n redirect_back\n end", "def ensure_auth # rubocop:disable Metrics/AbcSize, Metrics/MethodLength\n if session[:prospect_params]\n # we have an application going so we've probably just refreshed the\n # screen\n redirect_to action: 'new', controller: 'prospects'\n elsif session[:cas].nil? || session[:cas][:user].nil?\n render status: :unauthorized, plain: 'Redirecting to SSO...'\n else\n user = User.find_by cas_directory_id: session[:cas][:user]\n if user.nil?\n render status: :forbidden, plain: 'Unrecognized user'\n else\n update_current_user(user)\n end\n end\n nil\n end", "def authorize\n\t\tclient_id = Google::Auth::ClientId.new(@config[\"AuthKey\"], @config[\"AuthSecret\"])\n\t\ttoken_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n\t\tauthorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n\t\tuser_id = \"default\"\n\t\tLOGGER.debug \"[GmailDriver#authorize] Authorizing...\"\n\t\tcredentials = authorizer.get_credentials(user_id)\n\t\tif credentials.nil?\n\t\t\turl = authorizer.get_authorization_url(base_url: OOB_URI)\n\t\t\tLOGGER.warn \"Open the following URL in the browser and enter the \" \\\n\t\t\t\t\t \"resulting code after authorization:\\n\" + url\n\t\t\tcode = gets\n\t\t\tcredentials = authorizer.get_and_store_credentials_from_code(\n\t\t\t\tuser_id: user_id, code: code, base_url: OOB_URI\n\t\t\t)\n\t\tend\n\t\tcredentials\n\tend", "def authorize!(current_user)\n @authorized = false\n oauth_drive_token = OauthDriveToken.get_provider_for(current_user, APP_CONFIG['oauth']['google']['provider_number'])\n if oauth_drive_token.present?\n # Set details\n @client.authorization.access_token = oauth_drive_token.access_token\n @client.authorization.refresh_token = oauth_drive_token.refresh_token\n @client.authorization.client_id = oauth_drive_token.client_number\n\n if oauth_drive_token.expires_at < Time.now\n # Present but expired, attempt to refresh\n @authorized = true if self.refresh_token(oauth_drive_token)\n elsif self.current_token_still_valid?\n @authorized = true\n else\n # Not valid so destroy it and prompts for re-auth\n oauth_drive_token.destroy\n end\n end\n end", "def setup_credentials\n unless yes?('Would you like to configure and store your credentials?')\n $stderr.puts \"Unable to proceed without credentials\"\n exit 1\n end\n\n begin\n choice = choose do |menu|\n menu.prompt = 'Which type of credentials would you like to set up? (token is highly recommended) '\n menu.choices(:password, :token, :none)\n end.to_sym\n end until [:password, :token, :none].include? choice\n\n if choice == :password\n setup_password_credentials\n elsif choice == :token\n setup_token_credentials\n else\n return false\n end\n rescue StandardError => e\n options.debug ? warn(e) : raise(e)\n false\n end", "def request_authorization\n create_ticket\n verify_resource_owner or return\n render_authorize_form\n end", "def user_credentials_for(scope)\n FileUtils.mkdir_p(File.dirname(token_store_path))\n\n if ENV['GOOGLE_CLIENT_ID']\n client_id = Google::Auth::ClientId.new(ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET'])\n else\n client_id = Google::Auth::ClientId.from_file(client_secrets_path)\n end\n token_store = Google::Auth::Stores::FileTokenStore.new(:file => token_store_path)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, scope, token_store)\n\n user_id = options[:user] || 'default'\n\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n say \"Open the following URL in your browser and authorize the application.\"\n say url\n code = ask \"Enter the authorization code:\"\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\n end", "def credentials(authorization, request); end", "def authorise\n # checks can go here (is the application registered for example)\n grant = generate_grant\n valid_grants << grant\n grant\n end", "def oauth\n\t\tdropbox = DropboxConnection.new\n\t\n\t\tif params[:not_approved] == 'true'\n\t\t\tredirect_to dropbox_path, flash: { error: 'You just cancelled, didn\\'t you?' }\n\t\telse\n\t\t\t# the user has returned from Dropbox so save the session and go away\n\t\t\tdropbox.authorized\n\t\t\tredirect_to :root\n\t\tend\n\tend", "def login_required\n return if authorized?\n unauthorized! unless auth.provided?\n bad_request! unless auth.basic?\n unauthorized! unless authorize(*auth.credentials)\n @req.env['REMOTE_USER'] = auth.username\n end", "def authorize\n @credentials = authorizer.get_credentials(user_id)\n if @credentials.nil? || @credentials.expired?\n raise CalendarBot::AuthorizationError\n end\n\n @credentials\n end", "def login_required\n authorized? || throw(:halt, :access_denied)\n end", "def oauth_token_required\n unless oauth_token\n headers['WWW-Authenticate'] = 'Bearer'\n halt 403, 'OAuth token required'\n end\n end", "def authorize\n client_id = Google::Auth::ClientId.from_file(ENV['CREDENTIALS_PATH'])\n token_store = Google::Auth::Stores::FileTokenStore.new(file: ENV['TOKEN_PATH'])\n authorizer = Google::Auth::UserAuthorizer.new(client_id, ENV['SCOPE'], token_store)\n user_id = 'default'\n authorizer.get_credentials(user_id)\n end", "def login_required\n authorized? || throw(:halt, :access_denied)\n end", "def check_authorization\n # Decode Basic Auth, future jwt?\n require 'base64'\n\n credentials = request.headers['Authorization']\n\n if credentials.nil?\n render json: { error: 'Missing credentials, Authorization: Basic Auth (user@two.se:usertwo)'}, status: :forbidden\n else\n # Split > decode > split\n credentials = Base64.decode64(credentials.split[1]).split(':')\n\n # Get the creator by email\n @current_creator = Creator.find_by(email: credentials[0].downcase)\n\n # If nil and not able to authenticate with the password, return forbidden 403\n unless @current_creator && @current_creator.authenticate(credentials[1])\n render json: { error: 'Not authorized! Wrong credentials!'}, status: :forbidden\n end\n end\n end", "def auth_required\n unless Facts.config.user\n Facts.ui.puts \"Authorization required for this task, use `facts config`\"\n exit(0)\n end\n end" ]
[ "0.69323707", "0.67216325", "0.6658172", "0.6651308", "0.6555863", "0.6524707", "0.649825", "0.6493513", "0.6472096", "0.6463644", "0.64555514", "0.6454093", "0.6451952", "0.6449939", "0.64482194", "0.6437596", "0.6408479", "0.64000255", "0.63946193", "0.63938075", "0.6385079", "0.6385079", "0.6380894", "0.63795036", "0.6379188", "0.6379188", "0.6379188", "0.6379188", "0.6379188", "0.6379188", "0.63687146", "0.6349332", "0.6339358", "0.63328636", "0.63318324", "0.6330805", "0.633075", "0.63274515", "0.6326726", "0.6325007", "0.6323912", "0.6322864", "0.6321069", "0.63205945", "0.63205945", "0.63205945", "0.63205945", "0.6317178", "0.6317178", "0.63038373", "0.62996507", "0.62979025", "0.62979025", "0.62979025", "0.62979025", "0.62979025", "0.62979025", "0.62979025", "0.62979025", "0.62979025", "0.62979025", "0.62979025", "0.62873006", "0.62782913", "0.62702227", "0.6266718", "0.624927", "0.6247116", "0.6246878", "0.623187", "0.62261236", "0.6190892", "0.6184348", "0.6127769", "0.61023253", "0.60276955", "0.59749514", "0.59460896", "0.5941884", "0.5853156", "0.5842164", "0.5838309", "0.58348113", "0.58305913", "0.5805599", "0.58024776", "0.5800167", "0.57993275", "0.5784495", "0.57662344", "0.57584906", "0.57247275", "0.57128066", "0.5705982", "0.5680068", "0.56523013", "0.56375533", "0.5626036", "0.5616536", "0.56145036" ]
0.64405745
15
Check if the URL is valid by first checking if it passes a regex. Second, if it resolves to a 200
def validate_url(url) results = /\A(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?\z/.match(url) return false if results.nil? || results.length == 0 response = Typhoeus.get(url) return true if response.code == 200 true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_url?(url)\n resp = Curl.get url\n\n if resp.body_str.include? @invalid_text\n return false\n else\n return true\n end\nend", "def valid_url?(url)\n begin\n Net::HTTP.get_response(URI(url)).code == \"200\" ? true : false\n rescue SocketError\n false\n end\nend", "def check_url(path, url)\n res = http_client.get(url, follow_redirect: true)\n return if res.status == 200\n raise(nil) unless res.status.to_s.match(/50\\d|403/)\n\n puts \"::warning file=#{path}:: Unexpected response from #{url} (#{res.status})\"\nrescue StandardError => e\n puts \"::warning file=#{path}:: Unable to reach #{url} #{res.respond_to?('status') ? res.status : nil}\"\n puts e.full_message unless e.instance_of?(TypeError)\n 1\nend", "def valid_url?\n # Not sure if we should make a change in the user initial data, we could just return as invalid.\n my_target_url = target_url.match(/http/) ? target_url : target_url.prepend(\"http://\")\n\n response = HTTParty.get(my_target_url) rescue nil\n\n return if response&.code == 200\n\n errors.add(:short_url)\n end", "def validate_url\n return head(:bad_request, content_type: 'application/json') unless params[:shorten][:url]\n end", "def valid_url?\n @url =~ URI::regexp\n end", "def invalid_url?(url)\n url.include? 'hurl.it'\n end", "def url_regex\n if url.downcase.match(/whatsmyranking.com\\/records\\/.*/) || url.downcase.match(/46\\.101\\.115\\.155\\/records\\/.*/) || url.downcase[\"localhost\"]\n errors.add :url, \"This URL is blocked\"\n end\n end", "def http200(url)\n begin\n Net::HTTP.get_response(URI.parse(url)).code == '200'\n rescue Exception\n false\n end\n end", "def validate(url)\n begin\n uri = URI.parse(url)\n if uri.class != URI::HTTP\n\t return false\n end\n rescue URI::InvalidURIError\n\t return false\n end\n return true\nend", "def build_host_regex_check(regex)\n @host_check = lambda do |url|\n if url.host.to_s !~ regex\n [422, {}, \"URL must match #{regex.inspect}\"]\n end\n end\n end", "def url_valid?\n uri = URI(full_url)\n Net::HTTP.start(uri.host, uri.port, :use_ssl => full_url.start_with?(\"https\")) do |http|\n response = http.request_get(full_url)\n return response.is_a?(Net::HTTPOK) || response.is_a?(Net::HTTPRedirection)\n end\n end", "def is_valid_url?\n (@url =~ URI::DEFAULT_PARSER.make_regexp) != nil\n end", "def rubygems_valid_response?(http, url)\n url.include?(RubygemsApi::BASE_URL) && http_valid_status_code?(http, [200, 404])\n end", "def url_must_be_valid\n url.blank? ||\n (url_is_remote? and url_has_suffix? and url_matches?) ||\n errors.add(:url, :invalid)\n end", "def validate_url\r\n url = @hostname\r\n #puts \"DEBUG: url: \" + url\r\n \r\n url_part = []\r\n url_parts = url.split('.') \r\n #puts \"DEBUG: url_parts[0]: \" + url_parts[0]\r\n \r\n if url_parts[0].is_a? Numeric \r\n validate_sub_url(url_parts[0])\r\n validate_sub_url(url_parts[1])\r\n validate_sub_url(url_parts[2])\r\n validate_sub_url(url_parts[3])\r\n else # letters\r\n #puts \"URL just letters\"\r\n end\r\n ping_url\r\n end", "def valid?(url)\n url =~ %r|^http://www.megaupload.com/\\?d=[a-zA-Z0-9]+$|\nend", "def url_ok(url)\n return url =~ URI::ABS_URI\n end", "def check_host(url)\n if url.scheme !~ /^https?$/\n [422, {}, \"Invalid url: #{url}\"]\n else\n @host_check.call url\n end\n end", "def url_exist?\n\t\tbegin\n\t\t\turi = URI.parse(valid_url?)\n\t\t\tresponse = Net::HTTP.get_response(uri)\n\t\trescue \n\t\t\terrors.add(:long_url,\"is invalid url\")\n\t\t\t# in AR, error is a class by itself already \n\t\t\t# go to static.rb to check the errors\n\t\tend\n\tend", "def fake_url?\n url =~ /^\\d\\d\\d\\d-/\n end", "def valid_link?(url)\n # GET or HEAD? Head is more friendly to the server, but some pages\n # May behave differently depending on HEAD or GET.\n HTTParty.head(url,\n verify: false, # don't verify ssl certs\n ).code == 200\n end", "def validate_url\n url = params[:url] || params[:program][:url]\n begin\n URI.parse(url) if url\n rescue URI::InvalidURIError\n raise ExceptionTypes::BadRequestError.new(\"Invalid characters used in URL: #{url}\")\n end\n end", "def assert_url\n begin\n URI.parse(url)\n return true\n rescue URI::InvalidURIError => e\n errors.add(\"url\", \"has invalid format\")\n return false\n end\n end", "def verify_url!\n fail InvalidUrlException unless uri.to_s =~ URI::regexp\n fail UnsupportedFileException if !valid_readers_format? && !valid_file_format?\n end", "def check_http_status(href)\n url = href.split(\".com/\")\n response = nil\n Net::HTTP.start(url[0].split(\"https://\").last + \".com\", 80) {|http|\n response = http.head(\"/\" + url[1])\n }\n if(response.code != \"200\")\n fail(href + \" returned code: \" + response.code)\n end\nend", "def valid_url?(url)\n uri = URI.parse(url)\n uri.kind_of?(URI::HTTP)\n rescue URI::InvalidURIError\n false\n end", "def reachable?(url)\n page = MetaInspector.new(url)\n\n if page.response.status < 400\n true\n else\n false\n end\n rescue\n false\n end", "def url_is_valid_url\n uri = URI.parse(url)\n if !uri.kind_of?(URI::HTTP)\n errors.add(:url, \"must be a valid HTTP/HTTPS URL\")\n end\n rescue URI::InvalidURIError\n end", "def shields_io_valid_response?(http, url)\n url.include?(BadgeApi::BASE_URL) && http_valid_status_code?(http, 200) && http_valid_content_types?(http)\n end", "def good_resource?(url)\n if rx_url\n !(url.to_s !~ rx_url)\n else\n true\n end\n end", "def validate_uri(uri)\n validate_text(Net::HTTP.get(URI.parse(uri)))\n end", "def validate(url)\n if url && url.is_a?(String) && url.match(/(^$)|(^(http|https):\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(([0-9]{1,5})?\\/.*)?$)/ix)\n return true\n else\n raise InvalidURL\n end\n end", "def validate_uri(url)\n return validate({:url => url})\n end", "def validate_url_format\n valid_url = false\n begin\n uri = URI.parse(url)\n valid_url = uri.scheme.present? || uri.host.present?\n rescue URI::InvalidURIError\n valid_url = false\n end\n errors.add(:url, 'format is invalid') unless valid_url\n end", "def validate_url(url, user_agent = nil)\n resp = Pod::HTTP.validate_url(url, user_agent)\n\n if !resp\n warning('url', \"There was a problem validating the URL #{url}.\", true)\n elsif !resp.success?\n note('url', \"The URL (#{url}) is not reachable.\", true)\n end\n\n resp\n end", "def check_url_status(url)\n begin\n conn = Faraday.new(:url => url)\n response = conn.get\n rescue Faraday::ConnectionFailed => e\n return \"Unknown. Requires attention.\"\n else\n statusNum = response.status\n puts case statusNum\n when 200\n return \"200: Online\"\n when 201\n return \"201: Created\"\n when 204\n return \"204: No Content\"\n when 301\n return \"301: Moved Permanantly\"\n when 302\n return \"302: Redirecting\"\n when 304\n return \"304: Not Modified\"\n when 400\n return \"400: Bad Request\"\n when 401\n return \"401: Unauthorized\"\n when 403\n return \"403: Access Forbidden\"\n when 404\n return \"404: Not Found\"\n when 409\n return \"409: Conflict\"\n when 500\n return \"500: Internal Server Error\"\n else\n return \"Status code: #{statusNum}\"\n end\n\n end\n end", "def ok?(http_code)\n http_code =~ /^20/ ||\n http_code =~ /^40/\n end", "def valid?\n (uri.host =~ LINK_REGEX || uri.host =~ LINK_IP_REGEX) ? true : false\n end", "def is_valid_url?(url)\n if (url =~ /\\A#{URI::DEFAULT_PARSER.make_regexp}\\z/) == 0\n return true\n else\n return false\n end\n end", "def is_url_valid\n\t\tunless self.long_url.starts_with?(\"http://\", \"https://\")\n\t\t\terrors.add(:long_url, \"invalid format\")\n\t\tend\n\tend", "def consume_bad_url; end", "def verify_uri_acessibility uri\n res = Net::HTTP.get_response URI(uri)\n res.is_a? Net::HTTPSuccess\nend", "def check(url)\n LongURL::URL.check url\n end", "def valid_http_code_returned?(http_client, url)\n rubygems_valid_response?(http_client, url) || shields_io_valid_response?(http_client, url)\n end", "def validate_url(string)\n schemes = ['http', 'https']\n match = string.match(URI.regexp(schemes))\n return (0 == match.begin(0) and string.size == match.end(0)) if match\n false\n end", "def check_error_response(last_response)\n refute_match 'Sinatra doesn&rsquo;t know this ditty', last_response.body, \"unmatched url\"\n end", "def error!(url); end", "def http_url\n errors[:url] << 'not a valid url' unless URI.parse(url).kind_of?(URI::HTTP)\n rescue URI::InvalidURIError\n errors[:url] << 'not a valid url'\n end", "def url_valid?(url)\n url = URI.parse(url) rescue false\n url.kind_of?(URI::HTTP) || url.kind_of?(URI::HTTPS)\n end", "def url_valid?(url)\n url = URI.parse(url) rescue false\n url.kind_of?(URI::HTTP) || url.kind_of?(URI::HTTPS)\n end", "def url_valid?(url)\n url = URI.parse(url) rescue false\n url.kind_of?(URI::HTTP) || url.kind_of?(URI::HTTPS)\n end", "def valid?(mac, url)\n Net::HTTP.get_response(URI.parse(url + mac)).code == '200'\nend", "def validate_uri(url)\n !!URI.parse(url)\n end", "def validate_uri(url)\n !!URI.parse(url)\n end", "def url_valid?(url)\n url = URI.parse(url) rescue false\n url.kind_of?(URI::HTTP) || url.kind_of?(URI::HTTPS)\n end", "def url_valid?(url)\n url = URI.parse(url) rescue false\n url.kind_of?(URI::HTTP) || url.kind_of?(URI::HTTPS)\n end", "def url_valid?(url)\n url = URI.parse(url) rescue false\n url.kind_of?(URI::HTTP) || url.kind_of?(URI::HTTPS)\n end", "def validate_full_url\n if self.full_url.nil?\n return\n end\n\n if((self.full_url =~ URI::regexp(\"http\")) == nil && (self.full_url =~ URI::regexp(\"https\")) == nil)\n self.errors.add(:full_url, \"Full url is not a valid url\")\n end\n end", "def check_head(url)\n http_basic_authentication = SS::MessageEncryptor.http_basic_authentication\n\n redirection = 0\n max_redirection = SS.config.cms.check_links[\"max_redirection\"].to_i\n\n if url.match?(/^\\/\\//)\n url = @base_url.sub(/\\/\\/.*$/, url)\n elsif url[0] == \"/\"\n url = File.join(@base_url, url)\n end\n\n begin\n Timeout.timeout(@head_request_timeout) do\n ::URI.open url, proxy: true, redirect: false, http_basic_authentication: http_basic_authentication, progress_proc: ->(size) { raise \"200\" }\n end\n false\n rescue OpenURI::HTTPRedirect => e\n return false if redirection >= max_redirection\n redirection += 1\n url = e.uri\n retry\n rescue Timeout::Error\n return false\n rescue => e\n return e.to_s == \"200\"\n end\n end", "def check_head(url)\n http_basic_authentication = SS::MessageEncryptor.http_basic_authentication\n\n redirection = 0\n max_redirection = SS.config.cms.check_links[\"max_redirection\"].to_i\n\n if url.match?(/^\\/\\//)\n url = @base_url.sub(/\\/\\/.*$/, url)\n elsif url[0] == \"/\"\n url = File.join(@base_url, url)\n end\n\n begin\n Timeout.timeout(@head_request_timeout) do\n ::URI.open url, proxy: true, redirect: false, http_basic_authentication: http_basic_authentication, progress_proc: ->(size) { raise \"200\" }\n end\n false\n rescue OpenURI::HTTPRedirect => e\n return false if redirection >= max_redirection\n redirection += 1\n url = e.uri\n retry\n rescue Timeout::Error\n return false\n rescue => e\n return e.to_s == \"200\"\n end\n end", "def link_is_existent?(url)\n \tbegin\n\t uri = URI.parse(url)\n \t http_conn = Net::HTTP.new(uri.host, uri.port)\n \t resp, data = http_conn.head(\"/\" , nil)\n \t puts \"=== RESPONSE CODE #{resp.code}\"\n \t resp.code != \"404\"\n \trescue URI::InvalidURIError, Errno::ECONNREFUSED, SocketError\n \t\tfalse\n \tend\n end", "def check_uri(uri)\n curl = Curl::Easy.new(uri)\n curl.ssl_verify_peer = false\n curl.follow_location = true\n curl.headers['User-Agent'] = 'static-site-generator-comparison-0.1.0.0'\n curl.headers['Accept'] = 'text/html,application/xhtml+xml,application/xml'\n begin\n curl.perform\n rescue Exception => e\n puts \"#{uri}: failed to curl\"\n raise e\n end\n\n unless curl.response_code == 200\n raise \"#{uri}: #{curl.response_code} response\"\n end\nend", "def ensure_params_url\n if !params[:url]\n render json: ['No URL has been provided.'], status: 422 \n else \n render json: ['Url format is Improper.'], status: 422 unless ShortURL.validate_url_format(params[:url])\n end\n end", "def check_url_validation\n errors.add(:url, I18n.t('url_not_proper')) unless UrlShort.is_valid? (url)\n end", "def valid_url?(url)\n\t\turi = URI.parse(url)\n\t\treturn true if uri.is_a?(URI::HTTP) || uri.is_a?(URI::HTTPS)\n\t\tfalse\n\trescue\n\t\tfalse\n\tend", "def url_is_valid\n errors.add(:url, \"url is not valid\") unless is_http_url? || is_spotify_url?\n end", "def valid_url?(url)\r\n uri = URI.parse(url)\r\n return true if uri.is_a?(URI::HTTP) || uri.is_a?(URI::HTTPS)\r\n false\r\n rescue\r\n false\r\n end", "def validate_url\n self.url = ExternalWork.format_url(self.url)\n errors.add_to_base(t('invalid_url', :default => \"Not a valid URL\")) unless self.url_active?\n end", "def valid_url?(url)\n uri = URI.parse(url)\n return true if uri.is_a?(URI::HTTP) || uri.is_a?(URI::HTTPS)\n false\n rescue\n false\n end", "def url_accessibility(url)\n open(url).status.last == 'OK'\n rescue ::SocketError, Timeout::Error, Errno::ECONNREFUSED, OpenURI::HTTPError\n false\n end", "def valid_url?\n\t\t# http:// or not http://\n\t\tx = self.long_url.start_with?(\"http://\", \"https://\")\n\t\tif x == false\n\t\t\treturn \"http://\" + self.long_url\n\t\telse\n\t\t\treturn self.long_url\n\t\tend\n\tend", "def url_exists?(url_string)\n url = URI.parse(url_string)\n req = Net::HTTP.new(url.host, url.port)\n req.use_ssl = true\n path = url.path unless url.path.empty?\n res = req.request_head(path || '/')\n if res.kind_of?(Net::HTTPRedirection)\n return false\n else\n ! %W(4 5).include?(res.code[0]) # Not from 4xx or 5xx families\n end\nrescue Errno::ENOENT\n false #false if can't find the server\nend", "def test_match\n reg = RustRegexp.new(\"(https?://[^/]+)[-a-zA-Z0-9./]+\")\n assert_false reg.match(\"http://masamitsu-murase.12345/hoge.html\").nil?\n assert_nil reg.match(\"http:///masamitsu-murase.12345/hoge.html\")\n end", "def page_ok?(config, url)\n uri = URI.parse(url) rescue nil\n (uri.respond_to?(:host) && uri.host =~ config[\"host_re\"] &&\n uri.respond_to?(:path) && uri.path !~ %r{^/b/}).tap do |result|\n if !result\n puts \"Rejecting page #{url} for key #{config[\"key\"]}\"\n end\n end\n end", "def contains_invalid_urls(markdown)\n urls = markdown.scan(/]\\((?<matching>http[^\\)\"]+)/).flatten # matches [text](url) or [text](url \"title\")\n urls += markdown.scan(/<(?<matching>http[^>]+)/).flatten # matches <url>\n urls += markdown.scan(/: (?<matching>http[^\"\\n]+)/).flatten # matches [id]: url or [id]: url \"title\"\n urls.each do |url|\n begin\n check_url(url.strip) # strip url because matches on [text](url \"title\") end with a space\n rescue => e\n declare_url_error('content', url, \"got an error : '#{e}'\")\n end\n end\n end", "def check_submissions(url)\n url = url.downcase\n if url.include?(\"http://www.\")\n valid_url?(url) ? url : false\n elsif url.include?(\"www.\")\n valid_url?(url.insert(0,\"http://\")) ? url : false\n else\n valid_url?(url.insert(0,\"http://www.\")) ? url : false\n end\nend", "def valid?\n code == 200\n end", "def test_get_invalid_url1\n get '/param0/param1/param2/param3/param4'\n assert_equal 404, last_response.status\n end", "def valid_url?(url)\n return false if url.nil? || url.strip.empty?\n\n URI(url)\n true\n rescue URI::InvalidURIError\n false\n end", "def verify_pcgw_url(pcgw_id)\n url = URI.parse(\"https://pcgamingwiki.com/wiki/#{pcgw_id}\")\n req = Net::HTTP.new(url.host, url.port)\n req.use_ssl = true\n res = req.request_head(url.path)\n if res.code == \"200\"\n return true\n elsif res.code == \"404\"\n return false\n else\n return false\n end\nend", "def is_a_real_url?\n begin\n URI.parse(long_url)\n rescue URI::InvalidURIError\n errors.add(:message, \"must be a valid URL\")\n end \n end", "def proper_url? \n\t\tif !(self.long_url.start_with?('http://') || self.long_url.start_with?('https://'))\n\t\t\terrors.add(:long_url, \"is in invalid format.\")\n\t\tend \n\tend", "def is?(url)\n return true if url.match('https?://twitter\\.com.*status/(\\d+)')\n end", "def error(url); end", "def handle_error (url, res)\n puts \"#{url} was not found\" if res.code.to_i == 404\n puts \"#{url} requires authorization\" if res.code.to_i == 401\n puts \"#{url} returns an application error\" if res.code.to_i == 500\nend", "def invalid_uri?(uri)\n uri.grep(/^(#{PROTOCOLS.join('|')}):\\/\\/\\w/).empty?\n end", "def valid?\n status == 200\n end", "def is?(url)\n return true if url.match('https?://github\\.com/(.+)/(.+)')\n end", "def is_url?(url)\n\t\tputs \"Validate the URL format is valid: #{url}\" if @verbose\n\t\tbegin\n\t\t\tif url =~ /(http|https)\\:\\/\\/((.)+)/i\n\t\t\t\thost=$2.split('/')[0]\n\t\t\t\thost=host.split(':')[0]\n\t\t\t\tif is_ip?(host) or is_fqdn?(host)\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tputs \"Unknown URL format: #{url}\" if @verbose\n\t\t\t\treturn false\n\t\t\tend\n\t\trescue => ee\n\t\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n\t\t\treturn false\n\t\tend\n\tend", "def robots_error!(url); end", "def uri_exists(url)\n\n u = URI(url)\n\n Net::HTTP.start(u.host, u.port) do |http|\n http.open_timeout = 1\n http.read_timeout = 1\n res = http.head(u.path)\n\n if res.code == \"200\"\n return true\n end\n return false\n end\n end", "def url_exist?(url_string)\n encoded_url = URI.encode(url_string)\n url = URI.parse(encoded_url)\n req = Net::HTTP.new(url.host, url.port)\n req.use_ssl = (url.scheme == 'https')\n path = url.path if url.path\n\n # these if statements are dodgy to me, needs better test and writing utilities for URIs\n if path[0] == nil\n path.prepend(\"/\")\n end\n\n if path == nil || req == nil\n return false\n end\n\n # the script breaks here if the resquest fails, hence the resuce\n begin\n res = req.request_head(path)\n rescue\n return false\n\n end\n\n if res.kind_of?(Net::HTTPRedirection)\n url_exist?(res['location']) # Go after any redirect and make sure you can access the redirected URL\n else\n ! %W(4 5).include?(res.code[0]) # Not from 4xx or 5xx families\n end\n rescue Errno::ENOENT\n false #false if can't find the server\n end", "def ping_url(url)\n begin\n Net::HTTP.get(URI.parse(url))\n return true\n rescue\n return false\n end\n end", "def verify_url(url_to_check)\n uri =\n begin\n URI.parse(url_to_check)\n rescue StandardError\n nil\n end\n\n if uri.nil? || uri.host.nil?\n raise AhaService::InvalidUrlError, \"URL is empty or invalid\"\n end\n\n if (verified = @@verified_urls[uri.host]) == false\n raise AhaService::InvalidUrlError, \"Invalid local address #{uri.host}\"\n elsif verified\n return url_to_check\n end\n\n ip_to_check = IPSocket::getaddress(uri.host)\n @@prohibited_addresses.each do |addr|\n if addr === ip_to_check\n @@verified_urls[uri.host] = false\n raise AhaService::InvalidUrlError, \"Invalid local address #{uri.host}\"\n end\n end\n\n @@verified_urls[uri.host] = true\n url_to_check\n end", "def http_error?\n !(200..299).include?(http_code)\n end", "def value_url_valid?\n begin\n uri = URI.parse(value)\n uri = URI.parse(\"http://#{url}\") if uri.scheme.nil?\n if uri.scheme.downcase != 'http' and uri.scheme.downcase != 'https'\n @errors_data << 'validate_no_http_s_url'\n return false\n end\n value = uri.to_s\n return true\n rescue\n @errors_data << 'validate_invalid_url'\n return false\n end\n end", "def checkHTTP(base)\n # We don't check the pattern on the form for two reasons:\n # - not all browsers support it\n # - allows the input to be more flexible\n\n # Fix up the URL\n base.strip!\n base += '/' unless base.end_with? '/'\n base = 'http://' + base unless base.start_with? 'http'\n # Now check the syntax:\n\n I \"Checking #{base} ...\"\n\n unless URLMATCH.match(base)\n F \"Invalid URL syntax: #{base}\"\n return\n end\n\n setup\n\n response = getHTTPHdrs(base)\n server = response['server']\n if server =~ /Apache/\n I \"Server: #{server}\"\n else\n W \"Server: '#{server}' - expected 'Apache' in server response\"\n end\n\n # Check the mirror time (and that zzz/ is readable)\n time = check_page(base, 'zzz/time.txt', severity = :F)\n if time\n match = /^(\\d+) \\S+$/.match(time)\n if match\n now = Time.now.to_i\n stamp = match[1].to_i\n age = (now - stamp)/60 # minutes\n if age > 60*24\n W \"Mirror is over 1 day old: #{age} minutes\"\n else\n I \"Mirror is less than 1 day old: #{age} minutes\"\n end\n else\n F \"Invalid time.txt contents: #{time}\"\n end\n else\n return # cannot process further (already recorded the error\n end\n\n # check the main body\n body = check_page(base, '')\n checkHdrFtr(base, body)\n if %r{<(img|IMG) (src|SRC)=\"/icons/}.match(body)\n I \"Index page has icons as expected\"\n else\n W \"Missing or unexpected img icon tags\"\n end\n checkIndex(body, :tlps)\n\n ibody = check_page(base, 'incubator/')\n checkHdrFtr(base+'incubator/', ibody)\n checkIndex(ibody, :podlings)\n\n check_page(base, 'harmony/', :E, expectedStatus=\"404\")\n\n zbody = check_page(base, HTTPDIR)\n# Not sure this is useful on its own anymore\n# It was originally used to detect sites with advertising wrappers,\n# but most recent examples have been tables around directory listings\n# which is obviously OK as it does not affect the user experience.\n# if %r{<table}i.match(zbody)\n# W \"#{HTTPDIR} - TABLE detected\"\n# else\n# I \"#{HTTPDIR} - No TABLE detected, OK\"\n# end\n checkHdrFtr(base+HTTPDIR, zbody)\n if HDRMATCH.match(zbody)\n I \"Index page for #{HTTPDIR} contains the expected header text\"\n else\n W \"Index page for #{HTTPDIR} does not contain the expected header text\"\n end\n if FTRMATCH.match(zbody)\n I \"Index page for #{HTTPDIR} contains the expected footer text\"\n else\n W \"Index page for #{HTTPDIR} does not contain the expected footer text\"\n end\n\n check_page(base,HTTP404,:E, expectedStatus=\"404\")\n\n # Check that archives don't have Content-Encoding\n MIRRORTEST_FILES.each do |file|\n check_CT(base, MIRRORTEST + file)\n end\n check_redirect(base, 'zzz/mirror-tests/redirect-test/xyz', 'http://www.apache.org/')\nend", "def check_404\n end", "def error!(url)\n robots_txt_for(url).error!\n end" ]
[ "0.7474573", "0.74340713", "0.73269325", "0.7312319", "0.72817117", "0.72326356", "0.71225625", "0.70499736", "0.70081174", "0.7007038", "0.6991357", "0.6966782", "0.6898965", "0.6889834", "0.6883453", "0.6875627", "0.6873403", "0.6856323", "0.68135035", "0.6798069", "0.6764762", "0.67593247", "0.6754906", "0.6682683", "0.6680158", "0.66792834", "0.6677083", "0.6672464", "0.66079414", "0.6604288", "0.66030264", "0.6589038", "0.6586909", "0.6581516", "0.65806204", "0.6576292", "0.65754783", "0.6545258", "0.6541319", "0.6536473", "0.6527668", "0.6497543", "0.64968145", "0.64876944", "0.6482596", "0.6468042", "0.64645827", "0.6406558", "0.63874346", "0.6386028", "0.6386028", "0.6386028", "0.6383778", "0.6380911", "0.63711464", "0.6369961", "0.6369961", "0.6369961", "0.6354393", "0.6342948", "0.6342948", "0.63412696", "0.62930626", "0.6285017", "0.62811387", "0.625754", "0.6247516", "0.6242889", "0.6221701", "0.622155", "0.6217254", "0.6203731", "0.62016624", "0.6193272", "0.6190923", "0.61884725", "0.6178158", "0.61764425", "0.616224", "0.6157129", "0.61485463", "0.6147076", "0.6137149", "0.6114033", "0.6111174", "0.6076488", "0.607616", "0.6065692", "0.60519505", "0.6046421", "0.60418177", "0.6039506", "0.60360146", "0.6028599", "0.6024968", "0.602028", "0.6013637", "0.5998433", "0.5973282", "0.5968545" ]
0.66475284
28
Update the sheet with the go/nogo values
def update_sheet(rows) a1_notation = "'Published factchecks'!R1:S#{rows.count}" request_body = Google::Apis::SheetsV4::BatchUpdateValuesRequest.new value_range = Google::Apis::SheetsV4::ValueRange.new value_range.range = a1_notation value_range.major_dimension = "ROWS" value_range.values = rows request_body.data = [value_range] request_body.include_values_in_response = true request_body.value_input_option = "RAW" response = @service.batch_update_values(@spreadsheet_id, request_body) puts response.to_json end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_value(row,col,value,sheet=nil)\n sheet = @default_sheet unless sheet\n raise RangeError, \"sheet not set\" unless sheet\n #@@ Set and pass sheet_no\n begin\n sheet_no = sheets.index(sheet)+1\n rescue\n raise RangeError, \"invalid sheet '\"+sheet.to_s+\"'\"\n end\n row,col = normalize(row,col)\n @gs.add_to_cell_roo(row,col,value,sheet_no)\n # re-read the portion of the document that has changed\n if @cells_read[sheet]\n key = \"#{row},#{col}\"\n (value, value_type) = determine_datatype(value.to_s)\n @cell[sheet][key] = value \n @cell_type[sheet][key] = value_type \n end\n end", "def stock_in_google_spreadsheet\n\n # On appelle l'URL comprenant les informations et on y stocke les URL trouvées dans notre hash\n hash = get_all_the_urls_of_val_doise_townhalls('http://www.annuaire-des-mairies.com/val-d-oise.html')\n\n # On se sert d'each_with_index pour récupérer un index incrementé\n # et faire passer chaque clef et valeur associée dans le spreadsheet\n # en faisant démarrer les deux depuis la ligne 2\n hash.each_with_index do |(key, value), index |\n $ws[index+2, 1] = key\n $ws[index+2, 2] = value\n end\n $ws.save\nend", "def update_values\n end", "def update_values\n end", "def set(row, col, value, sheet = default_sheet)\n validate_sheet!(sheet)\n\n sheet_no = sheets.index(sheet) + 1\n row, col = normalize(row, col)\n add_to_cell_roo(row, col, value, sheet_no)\n # re-read the portion of the document that has changed\n if @cells_read[sheet]\n value, value_type = determine_datatype(value.to_s)\n\n _set_value(row, col, value, sheet)\n set_type(row, col, value_type, sheet)\n end\n end", "def update_auto_fit_data\n worksheet.send(:update_auto_fit_data, self.cells)\n end", "def replace_formulae_with_calculated_values \n worksheets do |name,xml_filename|\n r = ReplaceFormulaeWithCalculatedValues.new\n r.excel_file = excel_file\n replace r, [name, 'Formulae'], [name, 'Formulae']\n @replacements_made_in_the_last_pass += r.replacements_made_in_the_last_pass\n end\n end", "def update_cell_value!(nrow, ncol_or_name, value)\r\n ncol = header_index(ncol_or_name)\r\n if (0..(row_count - 1)).include?(nrow) && \\\r\n (0..(col_count - 1)).include?(ncol)\r\n @data.fill((nrow * (col_count)) + ncol,1) {|i| value}\r\n end\r\n end", "def update_spreadsheet\n\t\tconnection = GoogleDrive.login(ENV[\"GMAIL_USERNAME\"], ENV[\"GMAIL_PASSWORD\"])\n\t\tss = connection.spreadsheet_by_title('Learn-Rails-Example')\n\t\tif ss.nil?\n\t\t\tss = connection.create_spreadsheet('Learn-Rails-Example')\n\t\tend\n\t\tws = ss.worksheets[0]\n\t\tlast_empty_row = 1 + ws.num_rows\n\t\tws[last_empty_row, 1] = Time.new\n\t\tws[last_empty_row, 2] = self.name\n\t\tws[last_empty_row, 3] = self.email\n\t\tws[last_empty_row, 4] = self.content\n\t\tws.save\n\tend", "def update_cells(value, key)\n rows = target_rows(key)\n rows.each do |row|\n @worksheet[row, @selected_browser_column] = value\n end\n @worksheet.save\n end", "def update\n @sheet.add_row(count_params) if params[:change] == \"add_row\"\n @sheet.add_column(count_params) if params[:change] == \"add_column\"\n @sheet.move_row(move_params) if params[:change] == \"move_row\"\n @sheet.move_column(move_params) if params[:change] == \"move_column\"\n @sheet.drop_row(count_params) if params[:change] == \"drop_row\"\n @sheet.drop_column(count_params) if params[:change] == \"drop_column\"\n\n @sheet.update_content(content_params) if params[:change] == \"content\"\n\n @sheet.update_attributes(sheet_params) if params[:sheet]\n\n respond_to do |format|\n if @sheet.save\n format.html { redirect_to @sheet, notice: 'Sheet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sheet.add_row(count_params) if params[:change] == \"add_row\"\n @sheet.add_column(count_params) if params[:change] == \"add_column\"\n @sheet.move_row(move_params) if params[:change] == \"move_row\"\n @sheet.move_column(move_params) if params[:change] == \"move_column\"\n @sheet.drop_row(count_params) if params[:change] == \"drop_row\"\n @sheet.drop_column(count_params) if params[:change] == \"drop_column\"\n\n @sheet.update_content(content_params) if params[:change] == \"content\"\n\n @sheet.update_attributes(sheet_params) if params[:sheet]\n\n respond_to do |format|\n if @sheet.save\n format.html { redirect_to @sheet, notice: 'Sheet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @cells = args[:cells] if args.key?(:cells)\n end", "def update!(**args)\n @cells = args[:cells] if args.key?(:cells)\n end", "def update\n fname = @import.filename\n bs, _, ext = fname.rpartition(\".\")\n outfname = \"#{bs}-out.#{ext}\"\n\n book = RubyXL::Parser.parse(fname)\n master = book[\"Master\"]\n\n # Write out the meeting names unconditionally into Excel row 2 of the Master tab\n meetnamerow = master[1]\n col = 6\n Meeting.order(:date).each do |mtg|\n if master[2].nil? || master[2][col].nil? || master[2][col].value.blank?\n flash[:error] =\n \"Missing prepared column in Master sheet, row 3, column #{col + 1}\"\n end\n # Overwrite existing information with the information from the database\n fmt = if mtg.date.day == 1\n \"%B %Y \"\n else\n \"%-d %B %Y \"\n end\n master.add_or_chg(1, col, \"#{mtg.date.strftime(fmt)}#{mtg.meetingtype} Meeting\")\n meetnamerow[col].style_index = meetnamerow[col - 1].style_index if col > 6 # copy previous cell's style\n col += 1\n end\n\n # Go through the database Items in numerical order:\n # 1. In a row on the Master sheet, write out the item's properties and then its per-meeting statuses.\n # Handle missing meeting statuses including at the end of the line.\n # NOTE: With the current release of RubyXL (3.3.12), there's nothing we can do about the hyperlinks.\n # They are properties of the sheet, not the cell.\n # RubyXL::Reference.ref2ind(master.hyperlinks.first.ref.to_s)\n # master.relationship_container.find_by_rid(master.hyperlinks.first.r_id)\n # 2. Write three rows on the Minutes sheet.\n rowno = 2\n Item.order(:number).each do |item|\n # Change_contents spoils the shared string thing, so don't write unless you have to.\n # Anyhow, when writing, rows and columns might not exist.\n master.add_or_chg(rowno, 0, item.number.to_s) # Use this method to ensure that the row exists\n master.add_or_chg(rowno, 1, item.date.strftime(\"%d-%b-%Y\"))\n master.add_or_chg(rowno, 2, item.standard)\n master.add_or_chg(rowno, 3, item.clause)\n master.add_or_chg(rowno, 4, item.subject)\n master.add_or_chg(rowno, 5, item.draft)\n # There may not be a minutes entry corresponding to each meeting (=column), so keep a track of the item's current\n # status and use that where no minutes entry exists.\n current_sts = \"-\"\n colno = 6\n Meeting.order(:date).each do |mtg|\n min = item.minutes.where(\"minutes.meeting_id = ?\", mtg.id).first\n current_sts = min.minst.code if min&.minst\n if master[rowno][colno].nil? || master[rowno][colno].blank?\n flash[:error] =\n \"Missing prepared column in Master sheet, row #{rowno + 1}, column #{colno + 1}\"\n end\n master.add_or_chg(rowno, colno, current_sts)\n colno += 1\n end\n # Write hash signs on the remaining cells in the row, adding new cells to the right if necessary.\n # Issue #29: master[rowno].cells.count comes out as a big number (16384) for unused rows.\n # Calculate the last column number instead.\n # Also, if there are more meetings than the input spreadsheet allowed for, there won't be cells for each meeting.\n lastcolno = Meeting.count + 6\n (colno..lastcolno).each do |colcolno|\n if master[rowno][colcolno].nil?\n master.add_cell(rowno, colcolno, \"#\")\n else\n master[rowno][colcolno].chg_cell(\"#\")\n end\n end\n # Add a hash at the end of the row if there isn't one\n unless master[rowno][lastcolno + 1] && master[rowno][lastcolno + 1].value == \"#\"\n master.add_cell(rowno, lastcolno + 1, \"#\")\n end\n rowno += 1\n end\n # Fill the rest of the rows with hash signs. Make sure there's at least one row of hashes.\n make_master_hash_row(master, rowno) unless master[rowno] && master[rowno][1] && master[rowno][1].value == \"#\"\n ((rowno + 1)..(master.count - 1)).each do |r|\n make_master_hash_row(master, r)\n end\n\n minutes = book[\"Minutes\"]\n rowno = 1\n Item.order(:number).each do |item|\n minutes.add_or_chg(rowno, 1, item.number.to_s)\n colno = 3\n Meeting.order(:date).each do |mtg|\n min = item.minutes.where(\"minutes.meeting_id = ?\", mtg.id).first\n if min && !min.date.blank?\n datestr = min.date.strftime(\"%-d-%b-%Y\")\n minutes.add_or_chg(rowno, colno, datestr)\n else\n minutes.delete_cell(rowno, colno)\n end\n if min && !min.text.blank?\n minutes.add_or_chg(rowno + 1, colno, min.text)\n else\n minutes.delete_cell(rowno + 1, colno)\n end\n if min && (!min.date.blank? || !min.text.blank?)\n minutes.add_or_chg(rowno + 2, colno, \"#\")\n else\n minutes.delete_cell(rowno + 2, colno)\n end\n colno += 1\n end\n rowno += 3\n end\n # Delete the rest of the rows, making sure the last row has a single '#' in the number column.\n # Note that delete_row pushes cells up, so we delete the same numbered row repeatedly.\n (rowno..(minutes.count - 1)).each { |_r| minutes.delete_row(rowno) }\n minutes.add_cell(rowno, 0, \"\")\n minutes.add_cell(rowno, 1, \"#\")\n\n book.write(outfname)\n\n respond_to do |format|\n format.html do\n response.headers[\"Content-Length\"] = File.size(outfname).to_s\n send_file(outfname, type: @import.content_type, x_sendfile: true)\n return\n end\n format.json { render :show, status: :ok, location: @import }\n end\n end", "def update_worksheet(worksheet, updates)\n raise Errors::ProxyError, \"File #{worksheet.id} is not a Google Sheets worksheet\" unless worksheet.is_a? GoogleDrive::Worksheet\n\n cells_feed_url = CGI.escapeHTML worksheet.cells_feed_url.to_s\n cells_feed_url_base = cells_feed_url.gsub(/\\/private\\/full\\Z/, '')\n xml = <<-EOS\n <feed xmlns=\"http://www.w3.org/2005/Atom\"\n xmlns:batch=\"http://schemas.google.com/gdata/batch\"\n xmlns:gs=\"http://schemas.google.com/spreadsheets/2006\">\n <id>#{cells_feed_url}</id>\n EOS\n\n updates.each do |coordinates, value|\n row, col = coordinates\n safe_value = value ? CGI.escapeHTML(value).gsub(\"\\n\", '&#x0a;') : nil\n xml << <<-EOS\n <entry>\n <batch:id>#{row},#{col}</batch:id>\n <batch:operation type=\"update\"/>\n <id>#{cells_feed_url_base}/R#{row}C#{col}</id>\n <link rel=\"edit\" type=\"application/atom+xml\" href=\"#{cells_feed_url}/R#{row}C#{col}\"/>\n <gs:cell row=\"#{row}\" col=\"#{col}\" inputValue=\"#{safe_value}\"/>\n </entry>\n EOS\n end\n\n xml << <<-EOS\n </feed>\n EOS\n\n batch_url = \"#{cells_feed_url}/batch\"\n\n begin\n result = @session.execute!(\n http_method: :post,\n uri: batch_url,\n body: xml,\n headers: {\n 'Content-Type' => 'application/atom+xml;charset=utf-8',\n 'If-Match' => '*'\n }\n )\n log_response result\n raise Errors::ProxyError, \"update_worksheet failed at URL #{batch_url}. Error: #{result.data['error']}\" if result.error?\n raise Errors::ProxyError, \"update_worksheet failed at URL #{batch_url}. Error: interrupted\" if result.body.include? 'batch:interrupted'\n result.body\n rescue Google::APIClient::TransmissionError => e\n log_transmission_error(e, \"update_worksheet failed failed at URL #{batch_url}\")\n raise e\n end\n end", "def updateColumns ws,srcColumn,srcHash,destColumn,writeNew = false\r\n row = 1\r\n keys = srcHash.keys\r\n #as long as the cell content is not nill\r\n while value = ws.cells(row,srcColumn).value\r\n #check if the contents of the srcColumn is present in the given hash\r\n if keys.include? value\r\n ws.cells(row,destColumn).value = srcHash[value]\r\n\t\t\t#Delete the entry , after writing into the excel\r\n\t\t\tsrcHash.delete value\r\n end\r\n\t\trow = row + 1\r\n end \r\n\t#check if new values should be written\r\n\tsrcHash.clear unless writeNew\r\n\r\n\t#Write the remaining entries in the excel sheet\r\n\tsrcHash.each do |key, value|\r\n\t\t#Since the key dint exist originally, write that as well\r\n\t\tws.cells(row,srcColumn).value = key\r\n\t\tws.cells(row,destColumn).value = srcHash[key]\r\n\t\trow = row + 1\r\n\tend\r\n \r\nend", "def batch_update(batch_data, cellfeed_uri)\n batch_uri = cellfeed_uri + '/batch'\n\n batch_request = <<FEED\n<?xml version=\"1.0\" encoding=\"utf-8\"?> \\\n <feed xmlns=\"http://www.w3.org/2005/Atom\" \\\n xmlns:batch=\"http://schemas.google.com/gdata/batch\" \\\n xmlns:gs=\"http://schemas.google.com/spreadsheets/2006\" \\\n xmlns:gd=\"http://schemas.google.com/g/2005\">\n <id>#{cellfeed_uri}</id>\nFEED\n\n batch_data.each do |batch_request_data|\n version_string = get_version_string(cellfeed_uri + '/' +\n batch_request_data[:cell_id])\n data = batch_request_data[:data]\n batch_id = batch_request_data[:batch_id]\n cell_id = batch_request_data[:cell_id]\n row = batch_request_data[:cell_id][1,1]\n column = batch_request_data[:cell_id][3,1]\n edit_link = cellfeed_uri + '/' + cell_id + '/' + version_string\n \n batch_request<< <<ENTRY\n <entry>\n <gs:cell col=\"#{column}\" inputValue=\"#{data}\" row=\"#{row}\"/>\n <batch:id>#{batch_id}</batch:id>\n <batch:operation type=\"update\" />\n <id>#{cellfeed_uri}/#{cell_id}</id>\n <link href=\"#{edit_link}\" rel=\"edit\" type=\"application/atom+xml\" />\n </entry>\nENTRY\n end\n \n batch_request << '</feed>'\n return post(batch_uri, batch_request)\n end", "def update_content(data)\n data.values.each do |change|\n row = change[0].to_i\n col = change[1].to_i\n cell = self[row][col]\n cell.content = change.last\n cell.save\n end\n end", "def set_name_of_sheet(name, sheet_id, spreadsheet_id)\n #initialize the requests\n \n #BatchUpdateRequest attribute: array of Requests\n # Request attribute: update_sheet_properties = UpdateSheetPropertiesRequest\n #UpdateSheetPropertiesRequest attributes: fields, properties\n property_update_request = Google::Apis::SheetsV4::UpdateSheetPropertiesRequest.new\n name_change_request = Google::Apis::SheetsV4::Request.new\n batch_update_request = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n \n #set the actual property to change\n property_update_request.fields = \"title\"\n property_update_request.properties = {sheet_id: sheet_id, title: name}\n \n #assign the requests\n name_change_request.update_sheet_properties = property_update_request\n batch_update_request.requests = [name_change_request]\n \n #call the update\n $service.batch_update_spreadsheet(spreadsheet_id, batch_update_request) \nend", "def save_as_spreadsheet\n session = GoogleDrive::Session.from_config('./config.json')\n key = '1cAn303rPBOi1d2O0j4tQuGi5FZksD2yVAzNQd57cDns'\n ws = session.spreadsheet_by_key(key).worksheets[0]\n i = 1\n get_townhall_url.sto_a.each do |x|\n ws[i, 1] = x[0]\n ws[i, 2] = x[1]\n i += 1\n end\n ws.save\n puts \"\\nTon fichier google est prêt\\n\\n\"\n Index.new.index\n end", "def set_value(row,col,value,sheet=nil)\n sheet = @default_value unless sheet\n @cell[sheet][[row,col]] = value\n end", "def loadtest2\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n#-----------------------------------------------------------------\n# Create a new spreadsheet -works and tested\n #request_body = Google::Apis::SheetsV4::Spreadsheet.new\n #response = service.create_spreadsheet(request_body)\n #ss = response\n #spreadsheet_id = ss.spreadsheet_id\n#-----------------------------------------------------------------\n\n\n#-----------------------------------------------------------------\n# Use an existing previously created spreadsheet\n# Only need the id to make use of this.\n spreadsheet_id = '1VHNfTl0Qxok1ZgBD2Rwby-dqxihgSspA0InqS5dTXNI'\n#-----------------------------------------------------------------\n sheet_name = \"Sheet1\"\n\n# ************ update spreadsheet title ************************\n# https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate \n spreadsheet_title = \"Testing Updates from BIT Server\"\n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n myussp = {\"properties\": {\"title\": spreadsheet_title}, \"fields\": \"*\" }\n request_body.requests = [{\"update_spreadsheet_properties\": myussp }]\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n\n\n\n\n# ************ delete all cells (rows) in a sheet ****************************\n# https://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/SheetsV4/Request#delete_range-instance_method \n \tgridrange = {\n \t sheet_id: 0,\n \t start_row_index: 0,\n# \t end_row_index: 1,\n \t start_column_index: 0,\n# \t end_column_index: 2\n \t }\n requests = []\n requests.push(\n {\n delete_range:{\n range: gridrange,\n shift_dimension: \"ROWS\"\n }\n }\n )\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n\n# ************ update values using update_spreadsheet_value ****************************\n# doco: https://www.rubydoc.info/github/google/google-api-ruby-client/Google%2FApis%2FSheetsV4%2FSheetsService%3Aupdate_spreadsheet_value \n range = \"#{sheet_name}!A1:B1\"\n request_body = Google::Apis::SheetsV4::ValueRange.new\n request_body.values = [[\"update_spreadsheet_value\",\"test data - this row will get a background colour\"]]\n request_body.major_dimension = \"ROWS\"\n result = service.update_spreadsheet_value(spreadsheet_id, range, request_body, \n {value_input_option: 'USER_ENTERED'})\n logger.debug \"update_spreadsheet_value completed\"\n\n# ************ update values using update_spreadsheet_value ****************************\n range = \"#{sheet_name}!A2:B3\"\n mydata = [\n {\n range: range,\n majorDimension: 'ROWS',\n values: [\n [\"spreadsheet_values_batchUpdate\", \"test data\"],\n [\"spreadsheet_values_batchUpdate\", \"third row\"]\n ]\n }\n ]\n request_body = Google::Apis::SheetsV4::BatchUpdateValuesRequest.new\n request_body.value_input_option = 'USER_ENTERED'\n request_body.data = mydata\n result = service.batch_update_values(spreadsheet_id, request_body, {})\n\n# ******** update background colours using batch_update_spreadsheet ********\n \tgridrange = {\n \t sheet_id: 0,\n \t start_row_index: 0,\n \t end_row_index: 1,\n \t start_column_index: 0,\n \t end_column_index: 2\n \t }\n requests = []\n requests.push(\n {\n repeat_cell: {\n \t range: gridrange,\n cell:\n {\n \t user_entered_format:\n \t {\n \t\t text_format: {bold: true},\n \t\t background_color:\n \t\t {\n \t\t\t red: 0.0,\n \t\t\t green: 1.0,\n \t\t\t blue: 0.0\n \t\t }\n \t }\n \t },\n fields: \"user_entered_format(background_color, text_format.bold)\"\n }\n }\n )\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n\n# ******** autorezise columns using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/rowcolumn \n requests = []\n requests.push(\n {\n auto_resize_dimensions: {\n dimensions:\n {\n \t dimension: \"COLUMNS\",\n \t sheet_id: 0,\n end_index: 2,\n \t start_index: 0\n \t },\n }\n }\n )\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n\n# ******** adjust columns width using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/rowcolumn \n requests = []\n requests.push(\n {\n update_dimension_properties: {\n range:\n {\n \t dimension: \"COLUMNS\",\n \t sheet_id: 0,\n end_index: 2,\n \t start_index: 0\n \t },\n \t properties: {\n \t pixel_size: 160\n \t },\n \t fields: \"pixelSize\"\n }\n }\n )\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n\n end", "def save_as_spreadsheet\n\t\tsession = GoogleDrive::Session.from_config(\"config.json\")\n\t\tws = session.spreadsheet_by_key(\"1UAtn3oB21_a_gUM5TL8OK6Ud7zp6Z7z6c8tGYV6J4HA\").worksheets[0]\n\n\t\ti = 2\n\t\tws[1,1]= \"Ville\"\n\t\tws[1,2] = \"Contact\"\n\t\t@email_town.each_pair do |key, value| #/ on aurait pû utiliser each mais each_pair est plus conseillé lorsqu'il y a deux éléments \n\t\t\tws[i,1] = key\n\t\t\tws[i,2] = value\n\t\t\ti += 1\n\t\tend\n\t\tws.save \n\t\tws.reload\n\tend", "def save_as_spreadsheet\n session = GoogleDrive::Session.from_config(\"../config.json\")\n ws = session.spreadsheet_by_key(ENV['SPREADSHEET_KEY']).worksheets[0]\n ws.reload\n i = 0\n n = get_townhall_urls.count\n while i <= 4\n ws[i+1, 1] = @emails[i]\n ws[i+1, 2] = @names_of_town[i]\n i +=1\n end\n ws.save\n end", "def update_metric_values!\n puts \"Updating metric values...\"\n update_daily_happiness_distributions!\n update_weekly_happiness_distributions!\n update_monthly_happiness_distributions!\n update_annual_happiness_distributions!\n update_average_happiness_distributions!\n update_averages_for_metrics!\n puts \"Done updating metric values.\"\n end", "def save_as_spreadsheet\n\nsession = GoogleDrive::Session.from_config(\"config.json\")\n# First worksheet of\n# https://docs.google.com/spreadsheets/d/19fXbxVaXn9knKHPAQMuuMsiKH_Q50cN5jlj6K3H8VQc/edit#gid=0\nws = session.spreadsheet_by_key(\"19fXbxVaXn9knKHPAQMuuMsiKH_Q50cN5jlj6K3H8VQc\").worksheets[0]\n\n# Gets content of A2 cell.\n#p ws[2, 1] #==> \"hoge\"\n\n# Changes content of cells.\n# Changes are not sent to the server until you call ws.save().\n\nx = 1\n$my_hash.each do |key, value|\n\tws[x, 1] = key\n\tws[x, 2] = value\n\tx +=1\nend\nws.save\n\n# Dumps all cells.\n(1..ws.num_rows).each do |row|\n (1..ws.num_cols).each do |col|\n p ws[row, col]\n end\nend\n\n# Yet another way to do so.\np ws.rows #==> [[\"fuga\", \"\"], [\"foo\", \"bar]]\n\n# Reloads the worksheet to get changes by other clients.\nws.reload\nend", "def set_date_of_sheet(date, spreadsheet_id)\n day = date.day\n month = date.month\n year = date.year\n weekday = date.strftime('%A')\n formatted_date = \"#{month}/#{day}/#{year} #{weekday}\"\n range = \"#{day}!A2\" #sheet_name = date\n write_sheet_values(range, [[formatted_date]], date)\nend", "def report \n @cars = Car.all\n\n book = Spreadsheet::Workbook.new \nsheet = book.create_worksheet :name => 'Test' \nmerge = Spreadsheet::Format.new :horizontal_align => :merge \nsheet.row(0).set_format(1, merge) \nsheet.row(0).set_format(2, merge) \nsheet.row(0).set_format(3, merge) \nsheet.row(0).set_format(4, merge) \n @cars.each_with_index do |car, i|\n sheet[i, 1] = car.title\n sheet[i, 5] = car.price\n car.parameters.each do |p| \n\tsheet[i, 2] = p.value if !(p.name !~ /发动机排量/)\n\tsheet[i, 3] = p.value if !(p.name !~ /生产厂家/) \n\tsheet[i, 4] = p.value if !(p.name !~ /生产状态/)\n end\n \n \n end\nbook.write '/home/ruby/mycar/fruits.xls' \n redirect_to :action => 'download' \nend", "def update_shared_xp_fields(grade_sheet)\n StatsSheet.shared_xp_fields.each do |m|\n current_xp = self.send(m)\n updated_xp = current_xp + grade_sheet.exercise_stats_sheet.send(m)\n self[m] += updated_xp\n end\n end", "def set_cell_values(sheet, row, col, i, v, value_type, formula, _tr, font)\n # key = \"#{y}, #{x+i}\"\n key = [row, col + i]\n if formula\n @formula[sheet][key] = formula\n value_type = :formula\n end\n @cell_type[sheet][key] = value_type\n @fonts[sheet][key] = font\n @cell[sheet][key] = v\n end", "def write_to_sheet(worksheet, api_data, format)\n col = row = 0\n # puts \"api_data #{api_data.size}\"\n for row in 0...api_data.size\n contents = api_data[row]\n # puts \"contents : #{contents.size}\"\n for col in 0...contents.length\n # puts \"contents[col #{contents[col]}\"\n worksheet.write(row, col, contents[col], format)\n end\n end\nend", "def googleroster\n returned_authorisation = googleauthorisation(request)\n if returned_authorisation[\"authorizationurl\"]\n redirect_to returned_authorisation[\"authorizationurl\"] and return\n end\n service = returned_authorisation[\"service\"]\n#-----------------------------------------------------------------\n# Create a new spreadsheet -works and tested\n #request_body = Google::Apis::SheetsV4::Spreadsheet.new\n #response = service.create_spreadsheet(request_body)\n #ss = response\n #spreadsheet_id = ss.spreadsheet_id\n#-----------------------------------------------------------------\n\n#-----------------------------------------------------------------\n# Use an existing previously created spreadsheet\n# Only need the id to make use of this.\n #spreadsheet_id = '1VHNfTl0Qxok1ZgBD2Rwby-dqxihgSspA0InqS5dTXNI'\n spreadsheet_id = '1mfS0V2IRS1x18otIta1kOdfFvRMu6NltEe-edn7MZMc'\n#-----------------------------------------------------------------\n\n#-----------------------------------------------------------------\n# Use the spreadsheet configured in user profiles\n# = Roster Google Spreadsheet URL \n spreadsheet_id = current_user[:rosterssurl].match(/spreadsheets\\/d\\/(.*?)\\//)[1]\n\n # Get URL of spreadsheet\n response = service.get_spreadsheet(spreadsheet_id)\n @spreadsheet_url = response.spreadsheet_url\n\n # Sheet we are working on.\n sheet_name = \"Sheet1\"\n sheet_id = 0\n\n #this function converts spreadsheet indices to column name\n # examples: e[0] => A; e[30] => AE \n e =->n{a=?A;n.times{a.next!};a} \n\n# ************ update spreadsheet title ************************\n# https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate\n spreadsheet_title = \"Google Roster\" \n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n myussp = {\"properties\": {\"title\": spreadsheet_title}, \"fields\": \"*\" }\n request_body.requests = [{\"update_spreadsheet_properties\": myussp }]\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n\n# ************ add sheet ************************\n googleAddSheet = lambda{ |mytitle, mysheetproperties|\n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n myas = {\"properties\": {\"title\": mytitle}}\n request_body.requests = [{\"add_sheet\": myas }]\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n mysheetproperties.push({'index' => result.replies[0].add_sheet.properties.index,\n 'sheet_id' => result.replies[0].add_sheet.properties.sheet_id,\n 'title' => result.replies[0].add_sheet.properties.title})\n }\n \n# ************ delete sheets ************************\n googleSheetDelete = lambda{\n result = service.get_spreadsheet(spreadsheet_id)\n mysheets = result.sheets\n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n mysheets.each_with_index do |o, i|\n next if i == 0\n request_body.requests == nil ?\n request_body.requests = [{\"delete_sheet\": {\"sheet_id\": o.properties.sheet_id}}] :\n request_body.requests.push({\"delete_sheet\": {\"sheet_id\": o.properties.sheet_id}})\n end\n unless request_body.requests == nil\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n end\n }\n\n# ************ get spreadsheet properties ************************\n googleSheetProperties = lambda{\n result = service.get_spreadsheet(spreadsheet_id)\n mysheets = result.sheets\n mysheetproperties = mysheets.map{|p| {'index' => p.properties.index, \n 'sheet_id' => p.properties.sheet_id,\n 'title' => p.properties.title } }\n \n }\n\n# ************ update sheet title ************************\n# https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate\n googleSetSheetTitle = lambda{ |mytitle|\n request_body = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new\n myusp = {\"properties\": {\"title\": mytitle }, \"fields\": \"title\" }\n request_body.requests = [{\"update_sheet_properties\": myusp }]\n result = service.batch_update_spreadsheet(spreadsheet_id, request_body, {})\n }\n\n# ************ delete all cells (rows) in a sheet ****************************\n# https://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/SheetsV4/Request#delete_range-instance_method \n googleClearSheet = lambda{|passed_sheet_id|\n requests = [{ delete_range:{\n range: {sheet_id: passed_sheet_id, start_row_index: 0, start_column_index: 0 },\n shift_dimension: \"ROWS\"}}]\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n }\n \n\n# ******** set vertical alignment using batch_update_spreadsheet ********\n # googleVertAlignAll.call(palign \"TOP | MIDDLE | BOTTOM\")\n googleVertAlignAll = lambda{ |passed_sheet_id, palign|\n requests = [{repeat_cell: {\n \t range: {sheet_id: passed_sheet_id,\n \t start_row_index: 0,\n \t start_column_index: 0\n \t },\n cell: {user_entered_format: {vertical_alignment: palign} },\n fields: \"user_entered_format(vertical_alignment)\"\n }\n }]\n body = {requests: requests}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n }\n\n# ****************** calls batch_update_spreadsheet ******************\n # googlebatchdataitem.call(passed_items [googlebackgroundcolouritem, ...])\n googleBatchUpdate = lambda{|passeditems|\n if passeditems.count > 0\n body = {requests: passeditems}\n result = service.batch_update_spreadsheet(spreadsheet_id, body, {})\n end\n }\n\n# ******** update background colours using batch_update_spreadsheet ********\n # googleBGColourItem.call(rowStart, colStart, numberOfRows, numberOfCols,\n # colour[red_value, geen_value, blue_value])\n googleBGColourItem = lambda{|passed_sheet_id, rs, cs, nr, nc, pcolour|\n {repeat_cell: {\n \t range: {sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t end_row_index: rs - 1 + nr,\n \t start_column_index: cs - 1,\n \t end_column_index: cs - 1 + nc},\n cell:{user_entered_format:\n \t {background_color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}}},\n fields: \"user_entered_format(background_color)\"}}}\n \n# ******** set vertical alignment using batch_update_spreadsheet ********\n # googleVertAlign.call(rowStart, colStart, numberOfRows, numberOfCols,\n # palign \"TOP | MIDDLE | BOTTOM\")\n googleVertAlign = lambda{|passed_sheet_id, rs, cs, nr, nc, palign|\n pad = 5\n result = {repeat_cell: {\n \t range: {sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t start_column_index: cs - 1 },\n cell:{user_entered_format: {vertical_alignment: palign,\n padding: {\n top: pad,\n right: pad,\n bottom: pad,\n left: pad\n }\n } \n },\n fields: \"user_entered_format(vertical_alignment,padding)\"\n }\n }\n if nr != nil then\n result[:repeat_cell][:range][:end_row_index] = rs - 1 + nr \n end\n if nc != nil then\n result[:repeat_cell][:range][:end_column_index] = cs - 1 + nc \n end\n return result\n }\n\n# ******** set wrap text using batch_update_spreadsheet ********\n # googleWrapText.call(rowStart, colStart, numberOfRows, numberOfCols,\n # wrap \"OVERFLOW_CELL | LEGACY_WRAP | CLIP | WRAP\")\n googleWrapText = lambda{|passed_sheet_id, rs, cs, nr, nc, pwrap|\n result = {repeat_cell: {\n \t range: {sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t start_column_index: cs - 1 },\n cell:{user_entered_format: {wrap_strategy: pwrap} },\n fields: \"user_entered_format(wrap_strategy)\"\n }\n }\n if nr != nil then\n result[:repeat_cell][:range][:end_row_index] = rs - 1 + nr \n end\n if nc != nil then\n result[:repeat_cell][:range][:end_column_index] = cs - 1 + nc \n end\n return result\n }\n\n# ******** update borders using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/formatting\n # googleBorder.call(sheet_id, rowStart, colStart, numberOfRows, numberOfCols,\n # {left: color, right: .., top: .., bottom: ..}, width)\n googleBorder = lambda{|passed_sheet_id, rs, cs, nr, nc, pcolour, passedStyle |\n {\n update_borders: {\n \t range: { sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t end_row_index: rs - 1 + nr,\n \t start_column_index: cs - 1,\n \t end_column_index: cs - 1 + nc },\n top: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}},\n left: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}},\n right: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}},\n bottom: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}},\n }\n }\n }\n\n# ******** update borders using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/formatting\n # googleBorder.call(sheet_id, rowStart, colStart, numberOfRows, numberOfCols,\n # {left: color, right: .., top: .., bottom: ..}, width)\n googleRightBorder = lambda{|passed_sheet_id, rs, cs, nr, nc, pcolour, passedStyle |\n {\n update_borders: {\n \t range: { sheet_id: passed_sheet_id,\n \t start_row_index: rs - 1,\n \t end_row_index: rs - 1 + nr,\n \t start_column_index: cs - 1,\n \t end_column_index: cs - 1 + nc },\n right: { style: passedStyle,\n \t color: {red: pcolour[0], green: pcolour[1], blue: pcolour[2]}}\n }\n }\n }\n\n# ******** adjust columns width using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/rowcolumn \n\n # googlecolwidthitem.call(colStart, numberOfCols,\n # width_pixels)\n googleColWidthItem = lambda{|passed_sheet_id, cs, nc, passedpw|\n {\n update_dimension_properties: {\n range: { dimension: \"COLUMNS\",\n \t sheet_id: passed_sheet_id,\n \t start_index: cs - 1,\n end_index: cs - 1 + nc },\n \t properties: { pixel_size: passedpw },\n \t fields: \"pixelSize\"\n }\n }\n }\n\n# ******** autoresize columns using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/rowcolumn \n\n # googlecolautowidthitem.call(passed_sheet_id, colStart, numberOfCols)\n googleColAutowidthItem = lambda{|passed_sheet_id, cs, nc|\n {\n auto_resize_dimensions: { dimensions: { dimension: \"COLUMNS\",\n \t sheet_id: passed_sheet_id,\n \t start_index: cs - 1,\n end_index: cs - 1 + nc }\n }\n }\n }\n \n# ******** merge cells using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/formatting \n # googleMergeCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols)\n googleMergeCells = lambda{|passed_sheet_id, rs, nr, cs, nc|\n {\n merge_cells: { range: { sheet_id: passed_sheet_id,\n start_row_index: rs - 1,\n end_row_index: rs - 1 + nr,\n start_column_index: cs - 1,\n end_column_index: cs - 1 + nc },\n merge_type: \"MERGE_ALL\"\n }\n }\n }\n\n# ******** format header cells using batch_update_spreadsheet ********\n# https://developers.google.com/sheets/api/samples/formatting \n # googlefomratCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols, fontSize)\n googleFormatCells = lambda{|passed_sheet_id, rs, nr, cs, nc, fs|\n {\n repeat_cell: { range: { sheet_id: passed_sheet_id,\n start_row_index: rs - 1,\n end_row_index: rs - 1 + nr,\n start_column_index: cs - 1,\n end_column_index: cs - 1 + nc },\n cell: { user_entered_format: {\n horizontal_alignment: \"CENTER\",\n text_format: {\n font_size: fs,\n bold: true\n }\n }\n },\n fields: \"userEnteredFormat(textFormat, horizontalAlignment)\"\n }\n }\n }\n\n# ************ update values using update_spreadsheet_value ****************************\n# doco: https://www.rubydoc.info/github/google/google-api-ruby-client/Google%2FApis%2FSheetsV4%2FSheetsService%3Aupdate_spreadsheet_value \n# call using\n\n# googlevalues.call(rowStartIndex, columnStartIndex, numberOfRows, numberOfColumns, values[[]])\n# Indexes start at 1 for both rows and columns\n googleValues = lambda{|rs, cs, nr, nc, values| \n range = \"#{sheet_name}!\" + e[cs - 1] + rs.to_s + \":\" +\n e[cs + nc - 1] + (rs + nr).to_s\n request_body = Google::Apis::SheetsV4::ValueRange.new\n request_body.values = values\n request_body.major_dimension = \"ROWS\"\n service.update_spreadsheet_value(spreadsheet_id, range, request_body, \n {value_input_option: 'USER_ENTERED'})\n }\n \n# ************ update values using batch_update_values ****************************\n # googlebatchdataitem.call(rowStart, colStart, numberOfRows, numberOfCols,\n # values[[]])\n googleBatchDataItem = lambda{|passed_sheet_name, rs, cs, nr, nc, values|\n range = \"#{passed_sheet_name}!\" + e[cs - 1] + rs.to_s + \":\" +\n e[cs + nc - 1] + (rs + nr).to_s\n {\n range: range,\n majorDimension: 'ROWS',\n values: values\n }\n }\n\n# ************ execute batch update of values - [data items] ****************************\n # googlebatchdataitem.call(spreadsheet_id, \n # passed in batch data [gppg;ebatcjdataote, ...])\n googleBatchDataUpdate = lambda{|ss_id, dataitems |\n if dataitems.count > 0\n request_body = Google::Apis::SheetsV4::BatchUpdateValuesRequest.new\n request_body.value_input_option = 'USER_ENTERED'\n request_body.data = dataitems\n service.batch_update_values(ss_id, request_body, {})\n end\n }\n\n# ************ text format run using batch_update_values ****************************\n # googlebatchTextFormatRunItem.call(rowStart, colStart, \n # text, breakPointToChangeFormat[])\n googleTextFormatRun = lambda{|passed_sheet_id, rs, cs, myText, myBreaks|\n result = \n {\n update_cells: {\n \t start: {sheet_id: passed_sheet_id,\n \t row_index: rs - 1,\n \t column_index: cs - 1\n \t },\n rows: [ \n { values: [ \n {\n user_entered_value: {\n string_value: myText\n },\n user_entered_format: {\n text_format: {\n fontFamily: \"Arial\"\n }\n },\n text_format_runs: [\n {\n start_index: myBreaks[0],\n format: {\n bold: true,\n font_size: 10\n }\n }\n ]\n }\n ]\n }\n \n ],\n fields: \"userEnteredValue, userEnteredFormat.textFormat.bold, textFormatRuns.format.(bold, fontSize, fontFamily)\"\n }\n }\n if myBreaks[1] < myText.length then\n secondRun = {\n start_index: myBreaks[1],\n format: {\n bold: false,\n font_size: 10\n }\n }\n result[:update_cells][:rows][0][:values][0][:text_format_runs].push(secondRun)\n end\n return result\n }\n \n \n# ************ batch update of data items ****************************\n # googlebatchdataitem.call(spreadsheet_id, \n # passed in batch data [gppg;ebatcjdataote, ...])\n googleBatchDataUpdate = lambda{|ss_id, dataitems |\n if dataitems.count > 0\n request_body = Google::Apis::SheetsV4::BatchUpdateValuesRequest.new\n request_body.value_input_option = 'USER_ENTERED'\n request_body.data = dataitems\n service.batch_update_values(ss_id, request_body, {})\n end\n }\n\n#-------- To test or not to test ------------------------------\ntesting = false # true or false\nif testing then\n\n#--------------------- Test Data -------------------------------\n# Clear the sheet\n googleClearSheet.call(sheet_id)\n \n# Some test formatting\n batchitems = []\n\n batchitems.push(googleBGColourItem.call(sheet_id, 1,1,1,2,[0,1,0]))\n batchitems.push(googleBGColourItem.call(sheet_id, 6,1,1,2,[1,0,0]))\n batchitems.push(googleBGColourItem.call(sheet_id, 7,1,1,2,[0,0,1]))\n\n batchitems.push(googleBorder.call(sheet_id, 2,1,2,2, [0,0,0], \"SOLID_MEDIUM\"))\n \n batchitems.push(googleVertAlign.call(sheet_id,2,1,2,2, \"TOP\"))\n\n batchitems.push(googleWrapText.call(sheet_id, 2,1,2,2, \"WRAP\"))\n\n batchitems.push(googleColWidthItem.call(sheet_id, 1,3,160))\n \n googleBatchUpdate.call(batchitems) \n\n# Some test cellvalues - individual update\n myvalues = [[\"update_spreadsheet_value\",\"test data - this row will get a background colour\"]]\n googleValues.call(1, 1, 1, 2, myvalues)\n\n# Some test value data - batch update\n mydata = []\n mydata.push(googleBatchDataItem.call(sheet_name,2,1,2,2,\n [\n [\"spreadsheet_values_batchUpdate\", \"test data\"],\n [\"spreadsheet_values_batchUpdate\", \"third row\"]\n ])\n )\n mydata.push(googleBatchDataItem.call(sheet_name,6,1,2,2,\n [\n [\"spreadsheet_values_batchUpdate2\", \"test data\"],\n [\"spreadsheet_values_batchUpdate2\", \"seventh row\"]\n ])\n )\n googleBatchDataUpdate.call(spreadsheet_id, mydata)\n\n #Note: need to do values first so autoformat works.\n batchitems = [] # reset\n batchitems.push(googleColAutowidthItem.call(sheet_id, 1, 1))\n googleBatchUpdate.call(batchitems) \n \n logger.debug \"about to try out googleTextFormatRun\"\n batchitems = []\n batchitems.push(googleTextFormatRun.call(sheet_id, 10,2, \"123456789\\n1234567890123456789\", [0,10]))\n googleBatchUpdate.call(batchitems) \n logger.debug \"done googleTextFormatRun\"\n\nelse # Not to test.\n\n# let does some processing - writing rosters to google sheets.\n #@sf = 5 # number of significant figures in dom ids for lesson,tutor, etc.\n\n #mystartdate = current_user.daystart\n #myenddate = current_user.daystart + current_user.daydur.days\n @options = Hash.new\n #@options[:startdate] = current_user.daystart\n #@options[:enddate] = current_user.daystart + current_user.daydur.days\n @options[:startdate] = current_user.rosterstart\n @options[:enddate] = current_user.rosterstart + current_user.rosterdays.days\n \n #*****************************************************************\n # Set these to control what is displayed in the roster\n \n @tutorstatusforroster = [\"scheduled\", \"dealt\", \"confirmed\", \"attended\"]\n @studentstatusforroster = [\"scheduled\", \"dealt\", \"attended\"]\n \n #*****************************************************************\n \n # call the library in controllers/concerns/calendarutilities.rb\n #@cal = calendar_read_display2(@sf, mystartdate, myenddate)\n #calendar_read_display1f(sf, mystartdate, myenddate, options)\n \n # @tutors and @students are used by the cal\n @tutors = Tutor\n .where.not(status: \"inactive\")\n .order('pname')\n @students = Student\n .where.not(status: \"inactive\")\n .order('pname')\n \n #@cal = calendar_read_display1f(@sf, mystartdate, myenddate, {})\n #@cal = calendar_read_display1f(@sf, @options)\n @cal = calendar_read_display1f(@options)\n # Clear the first sheet - the rest are deleted.\n googleClearSheet.call(sheet_id)\n #googleVertAlignAll.call(\"TOP\")\n\n # kinds will govern the background colours for tutors and students.\n kindcolours = Hash.new\n=begin\n kindcolours = {\n 'tutor-kind-training' => [244, 164, 96],\n 'tutor-kind-called' => [135, 206, 250],\n 'tutor-kind-standard' => [0, 250, 154],\n 'tutor-kind-relief' => [245, 222, 179],\n 'tutor-kind-BFL' => [255, 255, 0],\n 'tutor-kind-onCall' => [0, 255, 255],\n 'tutor-kind-onSetup' => [234, 209, 220],\n 'student-kind-free' => [0, 255, 0],\n 'student-kind-first' => [182, 215, 168],\n 'student-kind-catchup' => [173, 216, 230],\n 'student-kind-fortnightly' => [70, 130, 180], \n 'student-kind-onetoone' => [250, 128, 114],\n 'student-kind-standard' => [0, 250, 154],\n 'tutor-kind-' => [255, 255, 255],\n 'tutor-student-' => [255, 255, 255]\n }\n=end\n kindcolours.default = [255, 255, 255] # result if called with missing key\n \n # clear unused sheets & get sheet properties\n googleSheetDelete.call\n # sets mysheetproperties = [{'index', 'sheet_id', 'title'}, ..]\n mysheetproperties = googleSheetProperties.call \n\n # will increment to 1 on stepping into loops => 1..n\n # Note: both rows and column indexes spreadsheets start at 1\n # Following counters used to track loactions in the spreadsheet\n timeData = ''\n baseSiteRow = 1 \n baseSlotRowInSite = 1\n baseLessonRowInSlot = 0\n currentTutorRowInLesson = 0\n currentStudentRowInLesson = 0\n currentStudentInLesson = 0\n maxPersonRowInAnySlot = 0\n maxPersonRowInAnySlot = 0\n currentCol = 1\n currentRow = 1\n baseSiteRow = 1 # first site \n baseSiteRowAll = 1 # for the 'all' tab \n locationindex = 0 # index into the sites\n \n # to compress or not - remove unused days\n @compress = false # can be true or false\n\n # have an all tab in google sheets to show all sites in that page\n # this is for tutors to seach for their name across all sites.\n # We still have a separate tab for each site\n googleSetSheetTitle.call(\"All\")\n mysheetproperties[locationindex]['title'] = \"All\"\n sheet_name_all = mysheetproperties[locationindex]['title']\n sheet_id_all = mysheetproperties[locationindex]['sheet_id']\n ###----------------------------------------------------------------------\n ###------------------- step through the sites ---------------------------\n ###----------------------------------------------------------------------\n @cal.each do |location, calLocation| # step through sites\n if @compress # remove days with no valid slot for this site\n usedColumns = calLocation[0][0][\"days\"].keys\n usedColumnsIndex = [0]\n for i in 1..(calLocation[0].length-1)\n if usedColumns.include?(calLocation[0][i][\"value\"]) then\n usedColumnsIndex.push(i)\n end\n end \n end\n\n mydata = [] # google batch data writter at end of processing a site\n myformat = []\n\n # make separate sheet entry for each site\n baseSiteRow = 1 # reset when new sheet for each site.\n # baseSiteRowAll continues across all sites.\n if locationindex == 0 # set up the all tab - contains all sites\n # googleSetSheetTitle.call(location)\n # mysheetproperties[locationindex]['title'] = location\n # General formatting for the 'all' sheet - done once\n myformat.push(googleVertAlign.call(sheet_id_all, 1, 1, nil, nil, \"TOP\"))\n myformat.push(googleWrapText.call(sheet_id_all, 1, 1, nil, nil, \"WRAP\"))\n myformat.push(googleColWidthItem.call(sheet_id_all, 1,100,200))\n myformat.push(googleColWidthItem.call(sheet_id_all, 1,1,0))\n end\n # now have a sheet for each site.\n mysheetproperties = googleAddSheet.call(location, mysheetproperties) # add a sheet\n # mysheets = result.sheets\n # mysheetproperties = mysheets.map{|o| {'index' => o.properties.index, \n # 'sheet_id' => o.properties.sheet_id,\n # 'title' => o.properties.title } }\n locationindex += 1\n sheet_name = mysheetproperties[locationindex]['title']\n sheet_id = mysheetproperties[locationindex]['sheet_id']\n\n # This function formats a lesson row\n # myformal and mydata are global to this google roster function\n # we are passing in values to ensure they are in the correct context.\n formatLesson = lambda { |baseLessonRowInSlot, baseSlotRowInSite, baseSiteRow, baseSiteRowAll, currentCol, maxPersonRowInLesson|\n borderRowStart = baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow\n borderRowStartAll = baseLessonRowInSlot + baseSlotRowInSite + baseSiteRowAll\n borderColStart = currentCol\n borderRows = maxPersonRowInLesson\n borderCols = 4 # one tutor col and 2 student cols + lesson commment col.\n # merge the cells within the comment section of a single session\n # googleMergeCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols)\n myformat.push(googleMergeCells.call(sheet_id, borderRowStart, borderRows,\n borderColStart + borderCols - 1, 1))\n myformat.push(googleMergeCells.call(sheet_id_all, borderRowStartAll, borderRows,\n borderColStart + borderCols - 1, 1))\n myformat.push(googleBorder.call(sheet_id, borderRowStart, borderColStart, borderRows, borderCols, [0, 0, 0], \"SOLID_MEDIUM\"))\n myformat.push(googleBorder.call(sheet_id_all, borderRowStartAll, borderColStart, borderRows, borderCols, [0, 0, 0], \"SOLID_MEDIUM\"))\n myformat.push(googleRightBorder.call(sheet_id, borderRowStart, borderColStart, borderRows, 1, [0, 0, 0], \"SOLID\"))\n myformat.push(googleRightBorder.call(sheet_id_all, borderRowStartAll, borderColStart, borderRows, 1, [0, 0, 0], \"SOLID\"))\n myformat.push(googleRightBorder.call(sheet_id, borderRowStart, borderColStart+2, borderRows, 1, [0, 0, 0], \"SOLID\"))\n myformat.push(googleRightBorder.call(sheet_id_all, borderRowStartAll, borderColStart+2, borderRows, 1, [0, 0, 0], \"SOLID\"))\n myformat.push(googleWrapText.call(sheet_id, borderRowStart, borderColStart, borderRows, borderCols, \"WRAP\"))\n myformat.push(googleWrapText.call(sheet_id_all, borderRowStartAll, borderColStart, borderRows, borderCols, \"WRAP\"))\n # want to put timeslot time (timeData) in first column of each lesson row.\n for i in borderRowStart..borderRowStart+borderRows-1 do\n mydata.push(googleBatchDataItem.call(sheet_name, i,1,1,1,[[timeData]]))\n end\n for i in borderRowStartAll..borderRowStartAll+borderRows-1 do\n mydata.push(googleBatchDataItem.call(sheet_name_all,i,1,1,1,[[timeData]]))\n end\n }\n #------------- end of lambda function: formatLesson ---------\n\n ### correction ###render flexibledisplay\n \n # General formatting for each site sheet\n myformat.push(googleVertAlign.call(sheet_id, 1, 1, nil, nil, \"TOP\"))\n myformat.push(googleWrapText.call(sheet_id, 1, 1, nil, nil, \"WRAP\"))\n myformat.push(googleColWidthItem.call(sheet_id, 1,100,350))\n myformat.push(googleColWidthItem.call(sheet_id, 1,1,0))\n\n #<table id=site-<%= location %> >\n baseSlotRowInSite = 0 # first slot\n currentRow = baseSlotRowInSite + baseSiteRow\n currentRowAll = baseSlotRowInSite + baseSiteRowAll\n ###----------------------------------------------------------------------\n ###-- step through each time period for this site e.g. 3:30, 4:30, etc. - \n ###-- (entry 0 = title info: 1. site 2. populated days by date) \n ###----------------------------------------------------------------------\n calLocation.each do |rows| # step through slots containing multiple days (fist row is actually a header row!)\n timeData = rows[0][\"value\"] \n #<tr>\n maxPersonRowInAnySlot = 0 # initialised to 1 to step a row even if no tutor or student found.\n currentCol = 1\n ###--------------------------------------------------------------------\n ###------- step through each day for this time period -----------------\n ### (entry 0 = time of lesson)\n ###--------------------------------------------------------------------\n rows.each_with_index do |cells, cellIndex| # step through each day (first column is head column - for time slots!)\n if @compress \n unless usedColumnsIndex.include?(cellIndex) then\n next\n end \n end\n awaystudents = \"\"\n ###-------------------------------------------------------------------------------------------\n ###------------------- step through each lesson in this slot ---------------------------------\n ###-------------------------------------------------------------------------------------------\n if cells.key?(\"values\") then # lessons for this day in this slot \n if cells[\"values\"].respond_to?(:each) then # check we have lessons?\n # This is a slot with lessons, do I need to output a title.\n #byebug\n # First column for each day needs to have the width set\n # googlecolwidthitem.call(sheet_id, colStart, numberOfCols, width_pixels)\n myformat.push(googleColWidthItem.call(sheet_id, currentCol, 1, 130))\n myformat.push(googleColWidthItem.call(sheet_id_all, currentCol, 1, 130))\n myformat.push(googleColWidthItem.call(sheet_id, currentCol+3, 1, 200))\n myformat.push(googleColWidthItem.call(sheet_id_all, currentCol+3, 1, 200))\n title = calLocation[0][0]['value'] + # site name\n calLocation[0][cellIndex]['datetime'].strftime(\" %A %e/%-m/%y \") + # date\n rows[0]['value'] # sesson time \n mydata.push(googleBatchDataItem.call(sheet_name,\n baseSiteRow + baseSlotRowInSite - 1, \n currentCol,1,1,[[title]]))\n mydata.push(googleBatchDataItem.call(sheet_name_all,\n baseSiteRowAll + baseSlotRowInSite - 1,\n currentCol,1,1,[[title]]))\n # googleMergeCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols)\n myformat.push(googleMergeCells.call(sheet_id, baseSiteRow + baseSlotRowInSite - 1, 1,\n currentCol, 4))\n myformat.push(googleMergeCells.call(sheet_id_all, baseSiteRowAll + baseSlotRowInSite - 1, 1,\n currentCol, 4))\n # Format the header line (merged cells)\n # googlefomratCells.call(passed_sheet_id, rowStart, numOfRows, colStart, numberOfCols, fontSize)\n myformat.push(googleFormatCells.call(sheet_id, baseSiteRow + baseSlotRowInSite - 1, 1,\n currentCol, 4, 16))\n myformat.push(googleFormatCells.call(sheet_id_all, baseSiteRowAll + baseSlotRowInSite - 1, 1,\n currentCol, 4, 16))\n baseLessonRowInSlot = 0 # index of first lesson in this slot for this day\n cells[\"values\"].sort_by {|obj| [valueOrderStatus(obj),valueOrder(obj)] }.each do |entry| # step thru sorted lessons\n next if (entry.status != nil && [\"global\", \"park\"].include?(entry.status))\n currentTutorRowInLesson = 0\n if entry.tutors.respond_to?(:each) then\n entry.tutors.sort_by {|obj| obj.pname }.each do |tutor|\n if tutor then\n thistutrole = tutor.tutroles.where(lesson_id: entry.id).first\n if @tutorstatusforroster.include?(thistutrole.status) then # tutors of interest\n currentRow = currentTutorRowInLesson + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow\n currentRowAll = currentTutorRowInLesson + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRowAll\n #<div class=\"tutorname tutorinline <%= set_class_status(tutor, entry) %>\">tutor: <%= tutor.pname %></div>\n tutorData = tutor.pname\n tutorDataAll = tutor.pname\n formatBreakPoints = []\n formatBreakPointsAll = []\n formatBreakPoints.push(0)\n formatBreakPointsAll.push(0)\n formatBreakPoints.push(tutor.pname.length)\n formatBreakPointsAll.push(tutor.pname.length)\n # tutor.subjects\n mysubjects = tutor.subjects\n mysubjects = mysubjects ? mysubjects : \"\"\n # thistutrole.comment\n # tutor.comment\n # Status: thistutrole.status Kind: thistutrole.kind\n mykind = thistutrole.kind\n mykind = mykind ? mykind : \"\"\n # don't diaplay subjects or kind for tutors on setup\n unless (entry.status == 'onSetup' && mykind == 'onSetup') ||\n (entry.status == 'onCall' && mykind == 'onCall')\n tutorData += ((mysubjects == \"\") ? \"\" : (\"\\n\" + mysubjects)) \n tutorData += ((mykind == \"\") ? \"\" : (\"\\n\" + mykind)) unless [\"standard\"].include?(mykind)\n tutorDataAll += ((mykind == \"\") ? \"\" : (\"\\n\" + mykind)) unless [\"standard\"].include?(mykind)\n end\n if thistutrole.comment != nil && thistutrole.comment != \"\"\n tutorData += \"\\n\" + thistutrole.comment\n end\n mycolour = kindcolours['tutor-kind-' + mykind]\n mycolour = mycolour.map {|p| p/255.0} \n myformat.push(googleTextFormatRun.call(sheet_id, currentRow, currentCol,\n tutorData, formatBreakPoints))\n myformat.push(googleTextFormatRun.call(sheet_id_all, currentRowAll, currentCol,\n tutorDataAll, formatBreakPointsAll))\n ###myformat.push(googleBGColourItem.call(sheet_id, currentRow, currentCol, 1, 1, mycolour))\n ###myformat.push(googleBGColourItem.call(sheet_id_all, currentRowAll, currentCol, 1, 1, mycolour))\n currentTutorRowInLesson += 1\n end # tutors of interest\n end\n #break\n end\n # keep track of the largest count of tutors or students in lesson.\n maxPersonRowInAnySlot = maxPersonRowInAnySlot > currentTutorRowInLesson + baseLessonRowInSlot ?\n maxPersonRowInAnySlot : currentTutorRowInLesson + baseLessonRowInSlot\n end\n currentStudentRowInLesson = 0\n currentStudentInLesson = 0\n studentLessonComments = \"\"\n if entry.students.respond_to?(:each) then\n entry.students.each do |student|\n if student then\n logger.debug \"student: \" + student.pname\n thisrole = student.roles.where(lesson_id: entry.id).first\n #logger.debug \"thisrole: \" + thisrole.inspect\n if ['away', 'awaycourtesy', 'bye', 'absent'].include?(thisrole.status) then \n displayname = student.pname + \" (\" + thisrole.status + \")\"\n awaystudents += awaystudents.length > 0 ? \"\\n\" + displayname : displayname\n end\n if @studentstatusforroster.include?(thisrole.status) then # students of interest\n #logger.debug \"*************processing student: \" + student.pname\n #logger.debug \"currentStudentInLesson: \" + currentStudentInLesson.inspect\n #logger.debug \"currentStudentRowInLesson + baseLessonRowInSlot + baseSlotRowInSite: \" +\n # currentStudentRowInLesson.to_s + \", \" + baseLessonRowInSlot.to_s + \", \" + baseSlotRowInSite.to_s\n currentRow = currentStudentRowInLesson + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow\n currentRowAll = currentStudentRowInLesson + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRowAll\n #<div class=\"studentname studentinline <%= set_class_status(student, entry) %>\">student: <%= student.pname %></div>\n #logger.debug \"DataItem parameters: \" + currentRow.to_s + \", \" + currentCol.to_s + \", 1, 1, \" + student.pname \n formatBreakPoints = []\n formatBreakPoints.push(0)\n studentData = student.pname\n studentSex = student.sex == nil ? \"\" :\n (student.sex.downcase.include?(\"female\") ? \"(F) \" : (student.sex.downcase.include?(\"male\") ? \"(M) \" : \"\"))\n studentData += \" \" + studentSex\n #logger.debug \"student.pname: \" + student.pname \n #logger.debug \"lesson_id: \" + entry.id.to_s\n #formatBreakPoints.push(student.pname.length)\n #studentSubjects = \" Yr: \" + (student.year == nil ? \" \" : student.year.rjust(3)) +\n # \" | \" + (student.study == nil ? \"\" : student.study)\n #studentYear = \" Yr:\" + (student.year == nil ? student.year.rjust(3))\n studentYear = \" Yr:\" + (student.year == nil ? \"\" : student.year)\n studentSubjects = student.study == nil ? \"\" : student.study\n studentData += studentYear\n studentDataAll = studentData\n formatBreakPointsAll = formatBreakPoints\n studentData += \"\\n\" + studentSubjects\n formatBreakPoints.push(studentData.length)\n # thisrole.comment\n # student.comment\n # Status: thisrole.status Kind: thisrole.kind\n mykind = thisrole.kind\n mykind = mykind ? mykind : \"\"\n studentData += \" (\" + mykind + \")\" unless [\"standard\"].include?(mykind)\n if thisrole.comment != nil && thisrole.comment != \"\"\n studentLessonComments += student.pname + \":\\n\" + thisrole.comment + \"\\n\"\n #studentData += \"\\n\" + thisrole.comment\n end\n if student.comment != nil && student.comment != \"\"\n studentData += \"\\n\" + student.comment\n end\n mycolour = kindcolours['student-kind-' + mykind]\n mycolour = mycolour.map {|p| p/255.0}\n #myformat.push(googleTextFormatRun.call(sheet_id, currentRow, currentCol + 1,\n # studentData, formatBreakPoints))\n colOffset = 1 + (currentStudentInLesson % 2)\n myformat.push(googleTextFormatRun.call(sheet_id, currentRow, currentCol + colOffset,\n studentData, formatBreakPoints))\n myformat.push(googleTextFormatRun.call(sheet_id_all, currentRowAll, currentCol + colOffset,\n studentDataAll, formatBreakPointsAll))\n ###myformat.push(googleBGColourItem.call(sheet_id, currentRow, currentCol + colOffset, 1, 1, mycolour))\n ###myformat.push(googleBGColourItem.call(sheet_id_all, currentRowAll, currentCol + colOffset, 1, 1, mycolour))\n \n #byebug \n currentStudentRowInLesson += 1 if (currentStudentInLesson % 2) == 1 # odd\n currentStudentInLesson += 1\n end # students of interest\n end\n end\n # Need to get correct count of rows (rounding up is necessary)\n # derive currentStudentRowInLesson from the currentStudentInLesson\n currentStudentRowInLesson = (currentStudentInLesson % 2) == 0 ? \n currentStudentInLesson / 2 : (currentStudentInLesson / 2) + 1 \n \n # keep track of the largest count of tutors or students in lesson.\n maxPersonRowInAnySlot = maxPersonRowInAnySlot > currentStudentRowInLesson + baseLessonRowInSlot ?\n maxPersonRowInAnySlot : currentStudentRowInLesson + baseLessonRowInSlot\n end\n maxPersonRowInLesson = currentTutorRowInLesson > currentStudentRowInLesson ? \n currentTutorRowInLesson : currentStudentRowInLesson \n # put a border around this lesson if there were lessons with people\n if maxPersonRowInLesson > 0 then\n # put in lesson comments if there were tutors or students.\n #<div class=\"lessoncommenttext\"><% if entry.comments != nil && entry.comments != \"\" %><%= entry.comments %><% end %></div>\n #<div class=\"lessonstatusinfo\"><% if entry.status != nil && entry.status != \"\" %>Status: <%= entry.status %> <% end %></div>\n mylessoncomment = ''\n if entry.status != nil && entry.status != ''\n unless [\"standard\", \"routine\", \"flexible\"].include?(entry.status) # if this is a standard lesson \n mylessoncomment = entry.status + \"\\n\" # don't show the lesson status (kind)\n end\n end\n mylessoncommentAll = mylessoncomment\n if entry.comments != nil && entry.comments != \"\"\n mylessoncomment += entry.comments\n end\n mylessoncomment += studentLessonComments\n if mylessoncomment.length > 0\n mylessoncomment = mylessoncomment.sub(/\\n$/, '') # remove trailing new line\n mydata.push(googleBatchDataItem.call(sheet_name, currentRow, currentCol+3,1,1,[[mylessoncomment]]))\n mydata.push(googleBatchDataItem.call(sheet_name_all,currentRowAll,currentCol+3,1,1,[[mylessoncommentAll]]))\n end\n # ----- formatting of the lesson row within the slot ---------\n formatLesson.call(baseLessonRowInSlot, baseSlotRowInSite, baseSiteRow, baseSiteRowAll, currentCol, maxPersonRowInLesson)\n end\n ###baseLessonRowInSlot += maxPersonRowInLesson\n baseLessonRowInSlot += maxPersonRowInLesson\n #currentRow = maxPersonRowInAnySlot + baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow # next empty row \n end # end looping sorted lessons within a day/slot\n end # responds to cell[\"values\"]\n elsif cells.key?(\"value\") then # just holds cell info (not lessons) to be shown\n currentRow = baseSlotRowInSite + baseSiteRow\n currentRowAll = baseSlotRowInSite + baseSiteRowAll\n #timeData = cells[\"value\"].to_s #if currentCol == 1 &&\n # cells[\"value\"] != nil # pick up the time\n #mydata.push(googleBatchDataItem.call(sheet_name, currentRow, currentCol,1,1,[[cells[\"value\"].to_s]]))\n #mydata.push(googleBatchDataItem.call(sheet_name_all,currentRowAll,currentCol,1,1,[[cells[\"value\"].to_s]]))\n end\n # Now add a dummy row at end of slot to show students who are away\n if awaystudents.length > 0\n currentRow = baseLessonRowInSlot + baseSlotRowInSite + baseSiteRow\n currentRowAll = baseLessonRowInSlot + baseSlotRowInSite + baseSiteRowAll\n mydata.push(googleBatchDataItem.call(sheet_name, currentRow, currentCol,1,1,[[\"Students Away\"]]))\n mydata.push(googleBatchDataItem.call(sheet_name_all, currentRowAll, currentCol,1,1,[[\"Students Away\"]]))\n myformat.push(googleFormatCells.call(sheet_id, currentRow, 1, currentCol, 1, 10))\n myformat.push(googleFormatCells.call(sheet_id_all, currentRowAll, 1, currentCol, 1, 10))\n mydata.push(googleBatchDataItem.call(sheet_name, currentRow, currentCol + 1,1,1,[[awaystudents]]))\n mydata.push(googleBatchDataItem.call(sheet_name_all, currentRowAll, currentCol + 1,1,1,[[awaystudents]]))\n maxPersonRowInLesson = 1\n formatLesson.call(baseLessonRowInSlot, baseSlotRowInSite, baseSiteRow,\n baseSiteRowAll, currentCol, maxPersonRowInLesson) # apply the standard formatting\n baseLessonRowInSlot += 1 # add another row for this\n # update tracking of the largest count of tutors or students in lesson.\n maxPersonRowInAnySlot = maxPersonRowInAnySlot > currentStudentRowInLesson + baseLessonRowInSlot ?\n maxPersonRowInAnySlot : currentStudentRowInLesson + baseLessonRowInSlot\n maxPersonRowInAnySlot = maxPersonRowInAnySlot > currentTutorRowInLesson + baseLessonRowInSlot ?\n maxPersonRowInAnySlot : currentTutorRowInLesson + baseLessonRowInSlot\n end\n #</td>\n currentCol += currentCol == 1 ? 1 : 4 # first column is title, rest have adjacent tutors & students.\n end # end looping days within slots\n #</tr>\n #byebug\n baseSlotRowInSite += maxPersonRowInAnySlot # set ready for next slot (row of days)\n if baseLessonRowInSlot == 0 && maxPersonRowInAnySlot == 0 then\n baseSlotRowInSite += 1 # cater for when no lessons with tutors or students of interest\n end\n # Add an extra row between slots - except the first title slot\n # Jasmine wanted no rows between slots so reduced from 2 to 1.\n baseSlotRowInSite += 1 unless baseSlotRowInSite == 1\n end # end looping slots\n holdRailsLoggerLevel = Rails.logger.level\n Rails.logger.level = 1 \n googleBatchDataUpdate.call(spreadsheet_id, mydata)\n googleBatchUpdate.call(myformat) \n Rails.logger.level = holdRailsLoggerLevel\n\n #</table>\n baseSiteRow += baseSlotRowInSite + 1 # +1 adds blank row between sites\n baseSiteRowAll += baseSlotRowInSite + 1 # +1 adds blank row between sites\n #<br>\n end # end looping sites\nend # end of testing option.\n ### correction ###return # return without rendering.\n end", "def worksheet=(v) DataTypeValidator.validate :row_worksheet, Worksheet, v; @worksheet = v; end", "def newSheet(table, taskName, id=nil)\n # open the Google Sheet service\n service = Google::Apis::SheetsV4::SheetsService.new\n service.client_options.application_name = APPLICATION_NAME\n service.authorization = authorize\n\n # open the Google Drive service\n drive = Google::Apis::DriveV3::DriveService.new\n drive.client_options.application_name = APPLICATION_NAME\n drive.authorization = authorize\n puts \"id in export sheet\"\n puts id\n\n #create a new sheet\n if id == nil\n\n spreadsheet = {\n properties: {\n title: taskName\n }\n }\n spreadsheet = service.create_spreadsheet(spreadsheet,\n fields: 'spreadsheetId')\n puts \"Spreadsheet ID: #{spreadsheet.spreadsheet_id}\"\n #fill the sheet with the data 'table'\n data = [\n {\n range: 'A:Z',\n majorDimension: \"ROWS\",\n values: table,\n }\n ]\n value_range_object = Google::Apis::SheetsV4::ValueRange.new(range: 'A:Z',\n majorDimension: \"ROWS\",\n values: table)\n result = service.update_spreadsheet_value(spreadsheet.spreadsheet_id,\n 'A:Z',\n value_range_object,\n value_input_option: 'RAW')\n puts = \"#{result.updated_cells} cells updated.\"\n file = drive.get_file(spreadsheet.spreadsheet_id)\n puts \"Create this file name: #{file.name}\"\n id = spreadsheet.spreadsheet_id\n\n ##\n # change the permision of the created file\n # line in google-api-ruby-client/lib/google/apis/core/api_command.rb return {} and make and error.\n # self.body = request_representation.new(request_object).to_json(user_options: { skip_undefined: true })\n #\n data = \n {\n \"role\" => \"writer\",\n \"type\" => \"anyone\"\n }\n # byebug\n permision = drive.create_permission(id, data.to_json,\n options: {skip_serialization: true})\n \n link = \"https://docs.google.com/spreadsheets/d/#{file.id}\"\n puts \"use this link: #{link}\"\n \n return link\n ##\n # Updating the file with new information\n else\n id = id.split('/')[5]\n file = drive.get_file(id)\n #geting the info of the sheet\n get_celds = service.get_spreadsheet_values(id, 'A:C')\n #byebug\n puts get_celds.values.length\n n = get_celds.values.length + 1\n range = \"A#{n}:B#{n}\"\n #write!\n value_range_object = Google::Apis::SheetsV4::ValueRange.new(range: range,\n values: table)\n result = service.update_spreadsheet_value(id,\n range,\n value_range_object,\n value_input_option: 'RAW')\n puts \"Updating this: #{file.name}\"\n link = \"https://docs.google.com/spreadsheets/d/#{file.id}\"\n puts \"use this link: #{link}\"\n return link\n end\nend", "def set_cell_values(sheet,x,y,i,v,vt,formula,tr,str_v,\n excelx_type=nil,\n excelx_value=nil,\n s_attribute=nil)\n key = [y,x+i]\n @cell_type[sheet] = {} unless @cell_type[sheet]\n @cell_type[sheet][key] = vt\n @formula[sheet] = {} unless @formula[sheet]\n @formula[sheet][key] = formula if formula\n @cell[sheet] = {} unless @cell[sheet]\n case @cell_type[sheet][key]\n when :float\n @cell[sheet][key] = v.to_f\n when :string\n @cell[sheet][key] = str_v\n when :date\n @cell[sheet][key] = (Date.new(1899,12,30)+v.to_i).strftime(\"%Y-%m-%d\") \n when :datetime\n @cell[sheet][key] = (DateTime.new(1899,12,30)+v.to_f).strftime(\"%Y-%m-%d %H:%M:%S\")\n when :percentage\n @cell[sheet][key] = v.to_f\n when :time\n @cell[sheet][key] = v.to_f*(24*60*60)\n else\n @cell[sheet][key] = v\n end\n @excelx_type[sheet] = {} unless @excelx_type[sheet]\n @excelx_type[sheet][key] = excelx_type\n @excelx_value[sheet] = {} unless @excelx_value[sheet]\n @excelx_value[sheet][key] = excelx_value\n @s_attribute[sheet] = {} unless @s_attribute[sheet]\n @s_attribute[sheet][key] = s_attribute\n end", "def save_as_spreedsheet(array)\n\n session = GoogleDrive::Session.from_config(\"config.json\")\n ws = session.spreadsheet_by_key(\"1jCyeGCeITqEWCu5r4NaTE8TxD0WHa9PNwuY93XP_Y2w\").worksheets[0]\n\n final_array = array\n\n ws[1, 1] = \"Nom des Villes\"\n ws[1, 2] = \"Emails des Villes\"\n\n row = 3\n final_array.each do |x|\n ws[row, 1] = x.keys.join\n ws[row, 2] = x.values.join\n row += 1\n end\n\n # Cannot load change without it\n ws.save\n ws.reload\n end", "def update!(**args)\n @cell_id = args[:cell_id] if args.key?(:cell_id)\n @fprint = args[:fprint] if args.key?(:fprint)\n @temporary_data = args[:temporary_data] if args.key?(:temporary_data)\n end", "def sheets_steps= value ; @sheets_steps = value end", "def export_my_absence\n workbook = Spreadsheet::Workbook.new\n data_sheet = workbook.create_worksheet :name => \"absensi harian #{@current_person.full_name}\"\n format = Spreadsheet::Format.new :weight => :bold\n data_sheet.row(0).default_format = format\n data_sheet.row(0).replace ['Jam Masuk','Jam Keluar','Lama Kerja']\n data_sheet = set_data_export_my_absence(data_sheet)\n spreadsheet = StringIO.new\n workbook.write spreadsheet\n send_data spreadsheet.string, :filename => \"absent_harian_#{@current_person.full_name}.xls\", :type => \"application/vnd.ms-excel\"\n end", "def worksheet=(value)\n @worksheet = value\n end", "def worksheet=(value)\n @worksheet = value\n end", "def update!(**args)\n @all_values = args[:all_values] if args.key?(:all_values)\n @range = args[:range] if args.key?(:range)\n @value = args[:value] if args.key?(:value)\n end", "def worksheet=(v) DataTypeValidator.validate \"Row.worksheet\", Worksheet, v; @worksheet=v; end", "def update\n @grid.update\n end", "def update\n respond_to do |format|\n if @label_sheet.update_attributes(label_sheet_params)\n format.html { redirect_to([:admin, @label_sheet], notice: 'Label Sheet was successfully updated.') }\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated Label Sheet: #{@label_sheet.name}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @label_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "def best_move(cells)\n cells.find_by(place: @best_move).update(value: 2)\n end", "def update\n \n end", "def sheet(flag)\n @sheet = (flag == true)\n end", "def team_update\n data = {\n row: params[:row],\n col: params[:col],\n letter: params[:letter],\n solver_id: params[:solver_id],\n red: params[:red],\n green: params[:green],\n blue: params[:blue]\n }\n\n Pusher.trigger(params[:channel], 'change_cell', data)\n\n render nothing: true\n end", "def process\n progressbar = ProgressBar.create(title: \"Rows\", total: @values.count, format: \"%B | %c/%u | %p% | %E \")\n rows = [[\"Valid Original URL?\", \"Valid Article URL?\"]]\n @values.each_with_index do |row, index|\n next if index == 0\n valid_original_url = validate_url(row[9]) ? \"\" : \"DIRTY\"\n valid_article_url = validate_url(row[10]) ? \"\" : \"DIRTY\"\n rows << [valid_original_url, valid_article_url]\n progressbar.increment\n end\n\n update_sheet(rows)\n end", "def update() end", "def process_data()\n \tSpreadsheet.client_encoding='UTF-8'\n\tbook=Spreadsheet::Workbook.new\n\tsheet = book.create_worksheet\n\tsheet.row(0).push 'Link Text','Link Url','Description' #For including headers to the spreadsheet.\n\n\tmain_content=Array.new\n\ts=''\n\ts1=''\n\tvalue=0\n\trow_count=1\n\titerate=@range1.to_i\n\twhile iterate <= @range2.to_i\n \t\tif iterate==1\n \t\t\turl='http://www.google.co.in/search?q='+@query_string.to_s\n \t\t\tlink_count=11\n \t\telsif iterate>1\n \t\t\tvalue=(iterate-1)*10\n \t\t\tlink_count=10\n \t\t\turl='http://www.google.co.in/search?q='+@query_string.to_s+'&start='+value.to_s\n \t\tend\n \t\tdoc = Pismo::Document.new(url)\n \t\tcontent=doc.body.to_s\n \t\tmain_content=content.split('*',11)\n \t\ttmp=1\n \t\twhile tmp <= link_count\n \t\t\ts=main_content[tmp]\n \t\t\ts1=s.lines.map(&:chomp) #s1=s.split(/[\\n]+/)\n \t\t\t#print \"Link #{j} : \" + s1[1].to_s + \"\\nUrl #{j} : \" + s1[2].to_s + \"\\nDesc #{j} : \" + s1[3].to_s + \"\\n\"\n \t\t\tsheet.row(row_count).push s1[1].to_s,s1[2].to_s,s1[3].to_s\n \t\t\tbook.write('/home/chandrasekar/training-ruby/shekar/18_September/website_link.xls')\n \t\t\trow_count+=1\n \t\t\ttmp+=1\n \t\tend\n \t\titerate+=1\n\tend\n end", "def write_to_sheet(worksheet, api_data, format)\n\tcol = row = 0\n\t# puts \"api_data #{api_data.size}\"\n\tfor row in 0...api_data.size\n\t\tcontents = api_data[row]\n\t\t# puts \"contents : #{contents.size}\"\n\t\tfor col in 0..2\n\t\t\t# puts \"contents[col #{contents[col]}\"\n\t\t\tworksheet.write(row, col, contents[col], format)\n\t\tend\n\tend\nend", "def write_to_sheet(worksheet, api_data, format)\n\tcol = row = 0\n\t# puts \"api_data #{api_data.size}\"\n\tfor row in 0...api_data.size\n\t\tcontents = api_data[row]\n\t\t# puts \"contents : #{contents.size}\"\n\t\tfor col in 0..2\n\t\t\t# puts \"contents[col #{contents[col]}\"\n\t\t\tworksheet.write(row, col, contents[col], format)\n\t\tend\n\tend\nend", "def descargar_calificaciones\n sitio_web = SitioWeb.sitio_actual(params[:asignatura_nombre],params[:semestre])\n\n if __es_del_grupo_docente\n\n Spreadsheet.client_encoding = 'UTF-8'\n book = Spreadsheet::Workbook.new\n\n bold = Spreadsheet::Format.new :weight => :bold\n \n sheets = []\n \n hoja = 0\n fila = 0\n col = 0\n\n tipos = [\"Teoría\",\"Práctica\",\"Laboratorio\",\"Otro\"]\n\n sitio_web.seccion_sitio_web.each_with_index do |seccion_sitio_web, index|\n sheet = book.create_worksheet :name => seccion_sitio_web.seccion.nombre.to_s\n fila = 0\n col = 0\n sheet[fila,col] = \"Sección: \"+seccion_sitio_web.seccion.nombre\n\n sheet.row(fila).set_format(col, bold)\n\n fila = 1\n sheet[fila,col] = \"Cédula\"\n sheet.row(fila).set_format(col, bold)\n col = 1\n\n sheet[fila,col] = \"Estudiante\"\n sheet.row(fila).set_format(col, bold)\n col = 2\n \n\n\n tipos.each do |tipo|\n if Evaluacion.where(:sitio_web_id => sitio_web.id, :tipo => tipo).size > 0\n Evaluacion.where(:sitio_web_id => sitio_web.id, :tipo => tipo).each do |evaluacion|\n sheet[fila,col] = evaluacion.nombre\n sheet.row(fila).set_format(col, bold)\n col += 1\n end\n sheet[fila,col] = \"Total \" + tipo\n sheet.row(fila).set_format(col, bold)\n col += 1\n end\n end\n\n sheet[fila,col] = \"Total\"\n sheet.row(fila).set_format(col, bold)\n\n \n\n fila += 1\n col = 0\n\n Usuario.order(:apellido, :nombre).where(:id => EstudianteSeccionSitioWeb.where(\n :seccion_sitio_web_id => seccion_sitio_web.id).collect{|x| x.estudiante_id}).each do |usuario|\n col = 0\n sheet[fila,col] = usuario.cedula\n col = 1\n sheet[fila,col] = (usuario.apellido + \" \" + usuario.nombre)\n col = 2\n\n total = 0\n suma = 0\n\n porcentaje = Evaluacion.where(:sitio_web_id => sitio_web.id).sum(\"valor\")\n\n tipos.each_with_index do |tipo|\n if Evaluacion.where(:sitio_web_id => sitio_web.id, :tipo => tipo).size > 0\n suma = 0\n Evaluacion.where(:sitio_web_id => sitio_web.id, :tipo => tipo).each do |evaluacion|\n if calificacion = Calificacion.where(:evaluacion_id => evaluacion.id, :estudiante_id => usuario.id).first\n if calificacion.calificacion\n sheet[fila,col] = calificacion.calificacion\n suma += (evaluacion.valor.to_f*calificacion.calificacion.to_f)\n end\n end\n col += 1\n end\n sheet[fila,col] = (suma/porcentaje).round(2)\n total += suma\n col += 1\n end\n end\n\n sheet[fila,col] = (total/porcentaje).round(2)\n sheet.row(fila).set_format(col, bold)\n fila += 1\n end\n\n sheets[hoja] = sheet\n end\n\n\n\n ruta = (\"#{Rails.root}/doc/calificaciones/calificaciones.xls\").to_s\n\n book.write ruta\n\n send_file ruta, :filename => \"Calificaciones de \"+sitio_web.asignatura.nombre + \" \" + sitio_web.periodo + \".xls\"\n\n return\n end\n\n flash[:error] = \"Parece que no se puede realizar la descarga en este momento. Inténtelo nuevamente.\"\n redirect_to :back\n end", "def update\n @answer_sheet = AnswerSheet.find(params[:id])\n @group = Group.find(params[:group_id])\n @survey = @group.surveys.find(params[:survey_id])\n\n # XXX: Added for quick updating of answer_sheet (dec 11, 2011)\n @answer_sheet.answer_sheet_properties.each do |p|\n pid = \"property_\" + p.id.to_s\n if !params[pid].nil?\n\tp.ocr_value = params[pid]\n\tp.save\n end\n end\n\n if @answer_sheet.update_attributes(params[:answer_sheet])\n redirect_to group_survey_answer_sheet_url(@group, @survey, @answer_sheet)\n else\n render :action => \"edit\"\n end\n end", "def get_the_name_and_email_and_put_it_in_spreadsheet(session, excel, tab)\n\n\t\t#on recupere le fichier mairie de notre drive\n\t\ttownhall_file = session.spreadsheet_by_title(excel)\n\n\t\t#je me positionne dans le 1er onglet de mon fichier spreadsheet drive (excel drive)\n\t\tonglet1 = townhall_file.worksheets[0]\n\n\t\t# on demarre\n\t\t# i à 2 car la 1ere ligne est la ligne qui contient les noms de colonne , i va de 2 à taille du tableau de hash soit 185+2=187\n\t\t# le hash est sous cette forme {nom_mairie:email_mairie}\n\t\ti=2\n\t\t#binding.pry\n\t\ttab.each do |element_du_tab_est_hash|\n\t\t\telement_du_tab_est_hash.each do |k,v|\n\t\t\t\tonglet1[i,1] = k\n\t\t\t\tonglet1[i,2] = v\n\t\t\tend\n\t\t\t#incrementation des lignes \"i\" en dehors des boucles d'insertion des valeurs\n\t\t\ti += 1\n\t\tend\n\t\t#on envoie les donnees au sheet drive :\n\t\tonglet1.save\n\t\treturn onglet1\n\tend", "def update!(**args)\n @avg_pedo_page_score = args[:avg_pedo_page_score] if args.key?(:avg_pedo_page_score)\n @final_pedo_site_score = args[:final_pedo_site_score] if args.key?(:final_pedo_site_score)\n @number_of_pages = args[:number_of_pages] if args.key?(:number_of_pages)\n @number_of_pedo_pages = args[:number_of_pedo_pages] if args.key?(:number_of_pedo_pages)\n @site = args[:site] if args.key?(:site)\n @site_porn_ratio = args[:site_porn_ratio] if args.key?(:site_porn_ratio)\n @site_softporn_ratio = args[:site_softporn_ratio] if args.key?(:site_softporn_ratio)\n @versionedscore = args[:versionedscore] if args.key?(:versionedscore)\n @violence_score = args[:violence_score] if args.key?(:violence_score)\n @violence_stats = args[:violence_stats] if args.key?(:violence_stats)\n end", "def set_cellval(x,y,value, opts = {:color => 0})\n cell = @ole_worksheet.Cells.Item(x, y)\n cell.Interior.ColorIndex = opts[:color] # 42 - aqua-marin, 4-green\n @workbook.modified_cells << cell if @workbook\n cell.Value = value\n rescue WIN32OLERuntimeError\n raise RangeNotEvaluatable, \"cannot assign value #{value.inspect} to cell (#{y.inspect},#{x.inspect})\"\n end", "def updateCells\n \tfor y in 0...5 do\n \t\tfor x in 0...5 do\n \t\t\tif @cells[y][x] == KILL\n \t\t\t\t@cells[y][x] = DEAD\n \t\t\tend\n \t\t\tif @cells[y][x] == SPAWN\n \t\t\t\t@cells[y][x] = ALIVE\n \t\t\tend\n \t\tend\n \tend\n end", "def update_values(next_loc)\r\n @books += 1 if next_loc == 'Hillman'\r\n @toy += 1 if next_loc == 'Museum'\r\n @classes *= 2 if next_loc == 'Cathedral'\r\n @current_place = if %w[Monroeville Downtown].include? next_loc\r\n 'Outside'\r\n else\r\n next_loc\r\n end\r\n end", "def update_counts_and_value!\n entries = inventory_entries.reload\n total_on_hand = entries.sum(:on_hand)\n total_reserved = entries.sum(:reserved)\n total_pending = entries.sum(:pending)\n weighted_total_cents = entries.map { |e| e.on_hand * e.value_cents }.sum\n\n update_columns(\n on_hand: total_on_hand,\n reserved: total_reserved,\n pending: total_pending,\n value_cents: total_on_hand == 0 ? nil : weighted_total_cents / total_on_hand\n )\n end", "def update\n \n end", "def update_get(row, sf_row)\n type = row[3]\n final_staff_check = row[FINAL_STAFF_CHECK].to_s.strip.casecmp('x').zero?\n # handle municipal????\n return unless ['A prominent individual', 'An organization'].include?(type)\n\n is_org = (type == 'An organization')\n\n street = [row[12].to_s.strip + row[13].to_s.strip, row[14].to_s.strip].map(&:strip).reject(&:empty?).join(', ')\n contact_name = \"#{row[4].to_s.strip} #{row[5].to_s.strip}\"\n name = is_org ? row[9].to_s.strip : contact_name\n status = row[STATUS_COL]\n postal_code = row[17].to_s.rjust(5, '0')\n sf_end_status = final_staff_check ? 'Posted to Web' : %w[Declined Verified].include?(status) ? status : 'Pending'\n \n org_map = { Mailing_City__c: 15, Email__c: 7, Primary_Contact_Title__c: 6, Phone__c: 8, Endorsement_Campaign__c: 23 }\n end_type = is_org ? 'Organizational' : 'Individual'\n end_map = { City__c: 15, Contact_Email__c: 7, Contact_Phone__c: 8, Comments__c: 21, Endorsement_Campaign__c: 23 }\n \n # only update if a field changed\n sf_org = sf_row.EndorsementOrg__r\n org_changed = false\n org_map.each do |sf_field, row_index|\n sheet_val = row[row_index].to_s\n org_changed = set_if_different(sf_org, sf_field, sheet_val.to_s.strip) || org_changed\n end\n # non-auto fields\n org_changed = set_if_different(sf_org, :Endorser_Type__c, end_type) || org_changed\n org_changed = set_if_different(sf_org, :Name__c, name) || org_changed\n org_changed = set_if_different(sf_org, :Mailing_Street__c, street) || org_changed\n org_changed = set_if_different(sf_org, :Primary_Contact_Name__c, contact_name) || org_changed\n org_changed = set_if_different(sf_org, :Website__c, 'http://' + row[11]) || org_changed\n org_changed = set_if_different(sf_org, :Population__c, row[20].to_i.to_f) || org_changed if row[20].present?\n org_changed = set_if_different(sf_org, :Employees__c, row[19].to_i.to_f) || org_changed if row[19].present?\n org_changed = set_if_different(sf_org, :Mailing_Zip_Postal_Code__c, postal_code) || org_changed\n \n if org_changed\n LOG.info(\"SF Endorser Org #{sf_org.Id} Changed: #{sf_org}\")\n did_save = sf_org.save!\n unless did_save\n LOG.error(\"Failed to save: #{sf_org}\")\n send_email(\"Failed to save: #{sf_org}\")\n end\n end\n \n # update endorsement\n end_changed = false\n end_map.each do |sf_field, row_index|\n sheet_val = row[row_index].to_s\n end_changed = set_if_different(sf_row, sf_field, sheet_val.to_s.strip) || end_changed\n end\n contact_title = [row[6].to_s, row[10].to_s].map(&:strip).reject(&:empty?).join(', ')\n end_changed = set_if_different(sf_row, :Endorser_Type__c, end_type) || end_changed\n\n unless sf_end_status == 'Verified'\n end_changed = set_if_different(sf_row, :Verification_Status__c, sf_end_status) || end_changed\n end\n end_changed = set_if_different(sf_row, :Address__c, street) || end_changed\n end_changed = set_if_different(sf_row, :Org_Ind_Name__c, name) || end_changed\n end_changed = set_if_different(sf_row, :Contact_Title__c, contact_title) || end_changed\n end_changed = set_if_different(sf_row, :Contact_Name__c, contact_name) || end_changed\n end_changed = set_if_different(sf_row, :Zip_Postal_Code__c, postal_code) || end_changed\n \n if end_changed\n LOG.info(\"SF Endorsement #{sf_row.Id} Changed: #{sf_row}\")\n did_save = sf_row.save!\n unless did_save\n LOG.error(\"Failed to save: #{sf_row}\")\n send_email(\"Failed to save: #{sf_row}\")\n end\n end\n\n end_changed || org_changed\n end", "def update\r\n\r\n end", "def initialize\n @sheet1_a1 = 1000.0\n end", "def write_changes workbook, io\n sanitize_worksheets workbook.worksheets\n collect_formats workbook, :existing_document => true\n reader = workbook.ole\n sheet_data = {}\n sst_status, sst_total, sst_strings = complete_sst_update? workbook\n sst = {}\n sst_strings.each_with_index do |str, idx| sst.store str, idx end\n sheets = worksheets(workbook)\n positions = []\n newsheets = []\n sheets.each do |sheet|\n @sst[sheet] = sst\n pos, len = workbook.offsets[sheet.worksheet]\n if pos\n positions.push pos\n sheet.write_changes reader, pos + len, sst_status\n else\n newsheets.push sheet\n sheet.write_from_scratch\n end\n sheet_data[sheet.worksheet] = sheet.data\n end\n Ole::Storage.open io do |ole|\n ole.file.open 'Workbook', 'w' do |writer|\n reader.seek lastpos = 0\n workbook.offsets.select do |key, pair|\n workbook.changes.include? key\n end.sort_by do |key, (pos, _)|\n pos\n end.each do |key, (pos, len)|\n data = reader.read(pos - lastpos)\n writer.write data\n case key\n when Spreadsheet::Worksheet\n writer.write sheet_data[key]\n when :boundsheets\n ## boundsheets are hard to calculate. The offset below is only\n # correct if there are no more changes in the workbook globals\n # string after this.\n oldoffset = positions.min - len\n lastpos = pos + len\n bytechange = 0\n buffer = StringIO.new ''.dup\n if tuple = workbook.offsets[:sst]\n write_sst_changes workbook, buffer, writer.pos,\n sst_total, sst_strings\n pos, len = tuple\n if offset = workbook.offsets[:extsst]\n len += offset[1].to_i\n end\n bytechange = buffer.size - len\n write_boundsheets workbook, writer, oldoffset + bytechange\n reader.seek lastpos\n writer.write reader.read(pos - lastpos)\n buffer.rewind\n writer.write buffer.read\n elsif sst.empty? || workbook.biff_version < 8\n write_boundsheets workbook, writer, oldoffset + bytechange\n else\n write_sst workbook, buffer, writer.pos\n write_boundsheets workbook, writer, oldoffset + buffer.size\n pos = lastpos\n len = positions.min - lastpos\n if len > OPCODE_SIZE\n reader.seek pos\n writer.write reader.read(len - OPCODE_SIZE)\n end\n buffer.rewind\n writer.write buffer.read\n write_eof workbook, writer\n end\n else\n send \"write_#{key}\", workbook, writer\n end\n lastpos = [pos + len, reader.size - 1].min\n reader.seek lastpos\n end\n writer.write reader.read\n newsheets.each do |sheet|\n writer.write sheet.data\n end\n end\n end\n end", "def set_cell(args)\n arr = @rows.flatten\n arr[arr.find_index(args[:position])] = args[:piece]\n @rows = arr.enum_for(:each_slice, 3).to_a\n end", "def update ; end", "def update\n respond_to do |format|\n if @sheet.update(sheet_params)\n format.html { redirect_to @sheet, notice: 'Sheet was successfully updated.' }\n format.json { render json: @sheet }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "def save_from_on_GoogleDrive\n session = GoogleDrive::Session.from_config(\"config.json\")\n# ws = session.spreadsheet_by_key(\"1PzbUao-3UscYOWh48FL061r5yYcH2TBl1oWXtmaW1cw\").worksheets[0] #cle a changer en fonction du lien url du fichier google drive\n ws = session.spreadsheet_by_key(\"1PzbUao-3UscYOWh48FL061r5yYcH2TBl1oWXtmaW1cw\").worksheets[1] #cle a changer en fonction du lien url du fichier google drive\n table_of_mails=[]\n # for i in 1..table_data.length\n # ws[i, 1] = table_data[i-1][:nom]\n # ws[i, 2] = table_data[i-1][:url]\n # ws[i, 3] = table_data[i-1][:email]\n # end\n puts ws.num_rows\n (1..(ws.num_rows + 1)).each do |row|\n puts ws[row + 1, 2]\n table_of_mails << ws[row + 1, 2]\n end\n Operation_on_gmail(table_of_mails)\n ws.save\n ws.reload\nend", "def update_value_if_only_one_possible_value\n @grid.flatten(1).each do |square|\n if square.possible_values.length == 1 && square.value == nil\n set_value(square, square.possible_values[0])\n elsif square.possible_values.length == 0\n raise \"MAYDAY. No possible values for #{square}: row=#{square.row}, column=#{square.column}\"\n end\n end\n end", "def update_u_vals(comp_win, u_vals, alpha, gamma, comp_moves)\n # set the reward based on comp_win\n if comp_win == true then reward = 1 else reward = -1 end\n # update the appropriate values\n comp_moves.each do |key, val|\n curr_val = u_vals[key][val]\n u_vals[key][val] = curr_val + alpha * (reward + (gamma * (curr_val+reward)) - curr_val)\n end\n\n # record the new values to u_vals.txt\n File.open(\"u_vals.txt\", \"w\") do |file|\n u_vals.each do |i|\n i.each do |val|\n file.write(\"#{val} \")\n end\n file.write(\"\\n\")\n end\n end\nend", "def update\n respond_to do |format|\n if @prop_bet_sheet.update(prop_bet_sheet_params)\n format.html { redirect_to @prop_bet_sheet, notice: 'Prop bet sheet was successfully updated.' }\n format.json { render :show, status: :ok, location: @prop_bet_sheet }\n else\n format.html { render :edit }\n format.json { render json: @prop_bet_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_cell_values(sheet, x, y, i, v, value_type, formula, table_cell, str_v, style_name)\n key = [y, x + i]\n @cell_type[sheet] ||= {}\n @cell_type[sheet][key] = value_type.to_sym if value_type\n @formula[sheet] ||= {}\n if formula\n ['of:', 'oooc:'].each do |prefix|\n if formula[0, prefix.length] == prefix\n formula = formula[prefix.length..-1]\n end\n end\n @formula[sheet][key] = formula\n end\n @cell[sheet] ||= {}\n @style[sheet] ||= {}\n @style[sheet][key] = style_name\n case @cell_type[sheet][key]\n when :float\n value = (table_cell.attributes['value'].to_s.include?(\".\") || table_cell.children.first.text.include?(\".\")) ? v.to_f : v.to_i\n value = 'true' if formula == '=TRUE()'\n value = 'false' if formula == '=FALSE()'\n @cell[sheet][key] = value\n when :percentage\n @cell[sheet][key] = v.to_f\n when :string\n @cell[sheet][key] = str_v\n when :date\n # TODO: if table_cell.attributes['date-value'].size != \"XXXX-XX-XX\".size\n if attribute(table_cell, 'date-value').size != 'XXXX-XX-XX'.size\n #-- dann ist noch eine Uhrzeit vorhanden\n #-- \"1961-11-21T12:17:18\"\n @cell[sheet][key] = DateTime.parse(attribute(table_cell, 'date-value').to_s)\n @cell_type[sheet][key] = :datetime\n else\n @cell[sheet][key] = table_cell.attributes['date-value']\n end\n when :time\n hms = v.split(':')\n @cell[sheet][key] = hms[0].to_i * 3600 + hms[1].to_i * 60 + hms[2].to_i\n else\n @cell[sheet][key] = v\n end\n end", "def write_excel\n #get param\n @user = index\n @hashtags= @user.hashtags\n #generate new Excel file\n workbook = RubyXL::Workbook.new\n worksheet=workbook[0]\n #save information for all post\n worksheet.add_cell(0, 1, \"ID\")\n worksheet.add_cell(0, 2, \"FOLLOWERS\")\n worksheet.add_cell(0, 3, \"LEVEL\")\n worksheet.add_cell(0, 4, \"SCORE\")\n worksheet.add_cell(0, 5, \"SUM\")\n worksheet.add_cell(1, 1, @user.username)\n worksheet.add_cell(1, 2, @user.followers)\n worksheet.add_cell(1, 3, @user.level)\n worksheet.add_cell(1, 4, @user.score)\n worksheet.add_cell(1, 5, @user.sum)\n #write hashtags\n worksheet.add_cell(3, 0, \"RANK\")\n worksheet.add_cell(3, 1, \"HASHTAG\")\n worksheet.add_cell(3, 2, \"TIMES\")\n worksheet.add_cell(3, 3, \"GLOBAL TIMES\")\n worksheet.add_cell(3, 4, \"VALUE\")\n worksheet.add_cell(3, 5, \"AVAILABILITY\")\n i=0\n for hashtag in @hashtags\n worksheet.add_cell(i+4, 0, i+1)\n worksheet.add_cell(i+4, 1, hashtag.hashtags)\n worksheet.add_cell(i+4, 2, hashtag.use_by_user)\n worksheet.add_cell(i+4, 3, hashtag.use_by_global)\n worksheet.add_cell(i+4, 4, hashtag.avai == \"0\" ? hashtag.use_by_global*hashtag.use_by_user : 0 )\n worksheet.add_cell(i+4, 5, hashtag.avai) \n i=i+1 \n end\n #send\n send_data( workbook.stream.string, :filename => \"#{@user.username}-#{@percentage}%-hashtags.xlsx\" ) \n end", "def refresh(pricesheet)\n # For every entry, make it a multiple\n @prices = HashWithIndifferentAccess[ pricesheet.map { |k,v| [k, round(v)] } ]\n end", "def index\n #@spreadsheet = Spreadsheet.new()\n #@spreadsheets = Spreadsheet.all\n end", "def update_position(account_name, pos_id, order_qty, escrow)\n action \"set escrow for position(#{pos_id}) to #{escrow}\"\n p = get(pos_id)\n p.escrow += escrow\n p.order_qty += order_qty\n end", "def set_cell_count\n cell_count = self.all_cells_array.size\n Rails.logger.info \"Setting cell count in #{self.name} to #{cell_count}\"\n self.update(cell_count: cell_count)\n Rails.logger.info \"Cell count set for #{self.name}\"\n end", "def zdv(i)\n # Set the value of the current cell to 0\n %{ zdv\n}\n end", "def update(pokemon_number: @pokemon_number, name: @name)\n end", "def update_cell(tag, cell, value)\n cell.set(value, tag)\n update_candidate_solutions_of_neighbor_cells(tag, cell)\n cell_update_valid?(*cell.coords)\n end", "def update_cell(number, symbol)\n if cell_free?(number)\n self.cells[number - 1] = symbol.to_s\n show_board\n else\n puts \"la case est occupée choisis une autre case\"\n return false\n end\n end", "def update\n if @googlesheet.update(googlesheet_params)\n flash[:success] = \"Googlesheet was Successfully Updated!\"\n redirect_to googlesheets_path \n else\n render :edit\n end\n end", "def change_contents(data, formula=nil)\n validate_worksheet\n @datatype='str'\n if data.is_a?(Date) || data.is_a?(DateTime)\n data = @workbook.date_to_num(data)\n end\n if (data.is_a?Integer) || (data.is_a?Float)\n @datatype = ''\n end\n @value=data\n @formula=formula\n end", "def readWorkbook\n # open the speadsheet\n workbook = Roo::Spreadsheet.open(params[:file], extension: :xlsx)\n\n workbook.default_sheet = 'Rating'\n\n @policy.name= workbook.cell('C',3)\n @policy.quoted_by= workbook.cell('B',1)\n #@policy.date= workbook.cell('B',2)\n @policy.effective_date= workbook.cell('F',7)\n @policy.expiration_date= workbook.cell('J',7)\n\n @policy.dba= workbook.cell('B',4),\n @policy.business_type= workbook.cell('L',5)\n @policy.mortgagee= workbook.cell('S',3)\n\n @policy.street= workbook.cell('C',5)\n @policy.city= workbook.cell('B',6)\n @policy.state= workbook.cell('G',6)\n @policy.zip= workbook.cell('K',6).to_i.to_s\n\n # Property\n @policy.property.schedule_rating_pct= workbook.cell('J',36)\n @policy.property.premium_subtotal= workbook.cell('J',35)\n @policy.property.premium_total= workbook.cell('M',41)\n\n @policy.property.locations.destroy_all # no duplicates\n # First location (locations.first)\n #locationFields = {\n @policy.property.locations.create!(\n number: 1, premium: workbook.cell('N',33),\n co_ins: workbook.cell('L',14), co_ins_factor: workbook.cell('L',15),\n ded: workbook.cell('B',15), ded_factor: workbook.cell('G',15),\n\n street: workbook.cell('C',10), city: workbook.cell('B',11),\n state: workbook.cell('G',11), zip: workbook.cell('K',11).to_i.to_s,\n\n business_type: workbook.cell('L',10), coverage_type: workbook.cell('D',12),\n protection_class: workbook.cell('L',12), updates: workbook.cell('K',13),\n year_built: workbook.cell('B',13).to_i.to_s, construction_type: workbook.cell('H',13),\n stories: workbook.cell('E',13).to_i, square_feet: workbook.cell('B',14).to_i,\n parking_lot: workbook.cell('H',14).to_i,\n\n #food_limit: workbook.cell('F',17),\n food_rate: workbook.cell('H',17),\n food_premium: workbook.cell('J',17),\n\n theft_limit: workbook.cell('F',18),\n #theft_rate: workbook.cell('H',18),\n theft_premium: workbook.cell('J',18),\n\n #enhc_limit: workbook.cell('F',19),\n enhc_rate: workbook.cell('H',19),\n enhc_premium: workbook.cell('J',19),\n\n #mech_limit: workbook.cell('F',20),\n #mech_rate: workbook.cell('H',20),\n mech_premium: workbook.cell('J',20)\n )\n #if (!@policy.property.locations.where(number:1).exists?)\n #@policy.property.locations.create!(locationFields)\n\n for i in 23..29 do\n @policy.property.locations.first.exposures.create!(\n name: (workbook.cell('A',i) || \"\"),\n valuation: (workbook.cell('D',i) || \"\"),\n limit: (workbook.cell('F',i) || 0),\n rate: (workbook.cell('H',i) || 0),\n ded_factor: (workbook.cell('J',i) || 0),\n co_ins_factor: (workbook.cell('L',i) || 0),\n premium: (workbook.cell('O',i) || 0)\n )\n end\n #else\n #@policy.property.locations.first.update(locationFields)\n #end\n\n # Earnings should have all 0s\n @policy.property.locations.first.exposures.third.update(valuation: 0,\n ded_factor: 0, co_ins_factor: 0 )\n\n # Second location (locations.second) (optional)\n if (workbook.cell('T',10) != nil)\n @policy.property.locations.create!(\n number: 2, premium: workbook.cell('AE',33), co_ins: workbook.cell('AC',14),\n co_ins_factor: workbook.cell('AC',15), ded: workbook.cell('S',15),\n ded_factor: workbook.cell('X',15),\n\n street: workbook.cell('T',10), city: workbook.cell('S',11),\n state: workbook.cell('X',11), zip: workbook.cell('AB',11).to_i.to_s,\n\n business_type: workbook.cell('AC',10), coverage_type: workbook.cell('U',12),\n protection_class: workbook.cell('AC',12), updates: workbook.cell('AB',13),\n year_built: workbook.cell('S',13), construction_type: workbook.cell('Y',13),\n stories: workbook.cell('V',13).to_i, square_feet: workbook.cell('S',14).to_i,\n parking_lot: workbook.cell('Y',14).to_i,\n\n #food_limit: workbook.cell('W',17),\n food_rate: workbook.cell('Y',17),\n food_premium: workbook.cell('AA',17),\n\n theft_limit: workbook.cell('W',18),\n #theft_rate: workbook.cell('Y',18),\n theft_premium: workbook.cell('AA',18),\n\n #enhc_limit: workbook.cell('W',19),\n enhc_rate: workbook.cell('Y',19),\n enhc_premium: workbook.cell('AA',19),\n\n #mech_limit: workbook.cell('W',20),\n #mech_rate: workbook.cell('Y',20),\n mech_premium: workbook.cell('AA',20)\n )\n\n for i in 23..29 do\n @policy.property.locations.second.exposures.create!(\n name: (workbook.cell('R',i) || \"\"),\n valuation: (workbook.cell('U',i) || \"\"),\n limit: (workbook.cell('W',i) || 0),\n rate: (workbook.cell('Y',i) || 0),\n ded_factor: (workbook.cell('AA',i) || 0),\n co_ins_factor: (workbook.cell('AC',i) || 0),\n premium: (workbook.cell('AF',i) || 0)\n )\n end\n\n # Earnings should have all 0s\n @policy.property.locations.second.exposures.third.update(valuation: 0,\n ded_factor: 0, co_ins_factor: 0 )\n end\n\n # Crime\n @policy.crime.premium_total= workbook.cell('M',62)\n @policy.crime.premium_subtotal= workbook.cell('J',56)\n @policy.crime.schedule_rating= workbook.cell('J',57)\n @policy.crime.burglar_alarm= workbook.cell('F',44)\n @policy.crime.exclude_safe= workbook.cell('F',45)\n @policy.crime.ded= workbook.cell('K',44)\n\n @policy.crime.exposures.destroy_all # no duplications\n\n for i in 47..51 do\n @policy.crime.exposures.create!(\n name: workbook.cell('A',i), limit: workbook.cell('F',i),\n premium: workbook.cell('K',i)\n )\n end\n\n @policy.gl.exposure_gls.destroy_all # no duplications\n\n for i in 76..84 do\n if (workbook.cell('A',i) != nil)\n @policy.gl.exposure_gls.create!(\n name: \"exposure_#{i-75}\",\n loc_number: workbook.cell('A',i),\n description: workbook.cell('C',i),\n cov: workbook.cell('B',i),\n code: workbook.cell('H',i),\n premium_basis: workbook.cell('I',i),\n sales_type: workbook.cell('K',i),\n base_rate: workbook.cell('M',i),\n ilf: workbook.cell('O',i),\n premium: workbook.cell('Q',i)\n )\n end\n end\n\n @policy.gl.gas_premium= workbook.cell('M',88)\n @policy.gl.rate= workbook.cell('J',88)\n @policy.gl.water_gas_tank= workbook.cell('F',88)\n @policy.gl.add_ins_number= workbook.cell('F',87)\n @policy.gl.territory= workbook.cell('B',65).to_i\n @policy.gl.comments= (workbook.cell('B',99) || \"none\")\n\n @policy.gl.gen_agg= workbook.cell('F',67)\n @policy.gl.products_completed_operations= workbook.cell('F',68)\n @policy.gl.personal_advertising_injury= workbook.cell('F',69)\n @policy.gl.each_occurence= workbook.cell('F',70)\n @policy.gl.fire_damage= workbook.cell('F',71)\n @policy.gl.medical_expense= workbook.cell('F',72)\n\n if (workbook.cell('A',89) == nil)\n # General Liability\n @policy.gl.premium_total= workbook.cell('N',99)\n @policy.gl.premium_subtotal= workbook.cell('Q',89)\n @policy.gl.schedule_rating= workbook.cell('Q',91)\n @policy.gl.multi_loc_factor= workbook.cell('Q',90)\n\n # Commerical Auto\n @policy.auto.premium_total= workbook.cell('N',107)\n @policy.auto.locations= workbook.cell('K',102)\n @policy.auto.hired_auto= workbook.cell('F',103)\n @policy.auto.hired_auto_premium= workbook.cell('Q',103)\n\n @policy.package_premium_total= workbook.cell('N',109)\n else\n # General Liability\n @policy.gl.premium_total= workbook.cell('N',101)\n @policy.gl.premium_subtotal= workbook.cell('Q',91)\n @policy.gl.schedule_rating= workbook.cell('Q',93)\n @policy.gl.multi_loc_factor= workbook.cell('Q',92)\n\n # Commerical Auto\n @policy.auto.premium_total= workbook.cell('N',109)\n @policy.auto.locations= workbook.cell('K',104)\n @policy.auto.hired_auto= workbook.cell('F',105)\n @policy.auto.hired_auto_premium= workbook.cell('Q',105)\n\n @policy.package_premium_total= workbook.cell('N',111)\n end\n end", "def updateStats\n \n totalDays = 0\n\n @week.days.each do |day|\n if day.wr\n totalDays += 1\n updateTempValues(day.oTotal, day.dTotal)\n end\n end\n\n assignStats(totalDays)\n\n end", "def update_fill\n end", "def update\n @sheet = Sheet.find(params[:id])\n\n respond_to do |format|\n if @sheet.update_attributes(params[:sheet])\n format.html { redirect_to @sheet, :notice => 'Sheet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sheet.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def update!(**args)\n @daily_percentage = args[:daily_percentage] if args.key?(:daily_percentage)\n @name = args[:name] if args.key?(:name)\n @value = args[:value] if args.key?(:value)\n end", "def save_as_spreadsheet\n session = GoogleDrive::Session.from_config(\"../../config.json\")\n spreadsheet = session.spreadsheet_by_name(\"testcreatefile\").worksheets[0] # on dit a l'api que l'on souhaite modifier le spreadsheet qui porte X nom et la feuille numero 0 de ce meme spreadsheet\n @@name_and_email.map.with_index do |hash, index| # on parcour le tableau qui contion les nom et les emails de chasque ville\n name = hash.keys # je met la key du hash dans une variable, cette variable corespond au nom de la ville\n name = name[0] # je transforme ma variable en string (sans cette ligne cette variable est de type array)\n email = hash.values # je met la value du hash dans une variable, cette variable corespond a l'email de la ville\n email = email[0] # je transforme ma variable en string (sans cette ligne cette variable est de type array)\n spreadsheet[index + 1, 1] = name # le programme envoi le nom de la ville sur le spreadsheet\n spreadsheet[index + 1, 2] = email # le programme envoi l'email de la ville sur le spreadsheet\n end\n spreadsheet.save # le programme sauvegarde les modifications sur le spreadsheet qu'il a modifier\n end", "def update_oregon_mascot\n $mascots[:oregon] = \"Duck\"\n # or\n $mascots.values[3] = \"Duck\"\nend", "def goal_sheet_input\n goal_ranges.each do |range|\n @range = range\n @goal_sheet = @xlsx.sheet(@range).parse(header_search: [])\n create_goals\n end\n end", "def update!(**args)\n @count = args[:count] if args.key?(:count)\n @range = args[:range] if args.key?(:range)\n end" ]
[ "0.6290119", "0.622141", "0.5964924", "0.5964924", "0.59599894", "0.5827659", "0.5686042", "0.5680056", "0.56161904", "0.55750555", "0.55575186", "0.55575186", "0.54161173", "0.54161173", "0.5409983", "0.5404171", "0.5373949", "0.53346384", "0.53304774", "0.53169316", "0.5300143", "0.5299229", "0.52944314", "0.5291778", "0.5290109", "0.5266234", "0.52595574", "0.5236386", "0.52202475", "0.5203117", "0.5194862", "0.51866823", "0.5183432", "0.51816136", "0.5167689", "0.51652235", "0.5132396", "0.5126839", "0.5126634", "0.51234955", "0.5123239", "0.5123239", "0.51133144", "0.50929654", "0.5083175", "0.5074951", "0.5068481", "0.5060562", "0.50492775", "0.5047108", "0.50454295", "0.5037356", "0.5025957", "0.50105494", "0.50105494", "0.50008714", "0.4977664", "0.49759802", "0.49744692", "0.49704272", "0.49670786", "0.49660203", "0.4965952", "0.49520463", "0.49515784", "0.4942799", "0.49285725", "0.4926734", "0.4926133", "0.49047378", "0.48985597", "0.48927745", "0.48828915", "0.48676035", "0.48671338", "0.4866567", "0.48654884", "0.48613784", "0.4860794", "0.4855421", "0.48531532", "0.4852587", "0.48506448", "0.48488024", "0.48474964", "0.4845998", "0.48406604", "0.4833323", "0.4828416", "0.48272082", "0.4826999", "0.48261082", "0.48261082", "0.48261082", "0.48261082", "0.48193538", "0.4812451", "0.4806669", "0.4804767", "0.48039877" ]
0.59686637
2
answer "" for all unexpected calls
def method_missing(m, *args, &block) "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def doNothing\n\n system(%Q{say -v \"karen\" \"You do nothing and watch as 5 innocent men die\"})\n system(%Q{say -v \"karen\" \"Choosing to do nothing is still a chose\"})\n system(%Q{say -v \"karen\" \"You are responsible for these mens deaths\"})\n system(%Q{say -v \"karen\" \"and the blood is on your hands \"})\n\n end", "def what_was_that?\n puts \"-\" * 70\n puts \"***** I didn't catch that *****\"\n puts \"\"\n puts \"Would you please try a different answer?\"\n puts \"-\" * 70\n end", "def failedMaths\n system(%Q{say -v \"karen\" \"I beleived in you\"})\n system(%Q{say -v \"karen\" \"Oh well, time for an easier test then\"})\n end", "def bang!\n \"b a n g\"\n end", "def show_answer()\n system \"clear\"\n print_answers\nend", "def success_case\n\tputs \" - Ok #{@name}, c'est ton choix #{@answer_play}\" \n\tputs \" \"\n end", "def puts_none\n\tputs \"I got nothing T_T\"\nend", "def noop(msg); \"200 \"; end", "def this_has_error\n puts ''\n end", "def noop\n \"\"\n end", "def print_none()\n\tputs \"I got nothin' fellas\"\nend", "def answer_prompt(answer)\n\tputs \"The answer to your problem is: #{answer}\"\nend", "def puts_none()\r\n puts \"I got nothin'.\"\r\nend", "def puts_none()\n\tputs \"I got nothin'.\"\nend", "def puts_none()\n\tputs \"I got nothin'.\"\nend", "def puts_none()\n\tputs \"I got nothin'.\"\nend", "def puts_none()\n puts \"I got nothin'.\"\nend", "def puts_none()\n puts \"I got nothin'.\"\nend", "def bang!\n \"bang!ed method\"\n end", "def print_none()\r\n puts \"I got nothin'.\"end", "def print_none()\n\tputs \"I got nothin'.\"\nend", "def print_none()\n\tputs \"I got nothin'.\"\nend", "def print_none()\n\tputs \"I got nothin'.\"\nend", "def print_none()\n\tputs \"I got nothin'.\"\nend", "def print_none()\n\tputs \"I got nothin'.\"\nend", "def puts_none()\n\tputs \"I got nothin\"\nend", "def print_none\n puts \"I got nothin'.\"\nend", "def unrecognizedResponse( text )\n print \"Unrecognized Response : #{text}\"\n #say(\"For help, simply type: help\")\n end", "def complain something\n puts angry_dude_format something\n end", "def asks(question: 'some default message', test: false)\n print question unless test\n test || gets.chomp\n end", "def puts_none()\n\tputs \"I have nothin'.\"\nend", "def oops str\n STDERR.puts str\n exit\nend", "def print_result result\n return super if EatWhites.disabled?\n super unless @input.strip == ''\n end", "def puts_none()\r\n puts \"I got nothing'.\"\r\nend", "def print_none()\n puts \"i got nothin'.\"\n end", "def print_none()\n puts \"i got nothin'.\"\nend", "def puts_none()\n puts \"I got nothing'.\"\n end", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"i got nothin'.\"\n end", "def puts_none()\n puts \"I got nothing'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"I got nothin'.\"\nend", "def print_none()\n puts \"Nada. Zip. Zilch.\"\nend", "def puts_none()\n puts \"I got nothing'.\"\nend", "def puts_none()\n\tputs \"I got nothing.\"\nend", "def puts_none()\n\tputs \"I got nothing.\"\nend", "def puts_none()\n\tputs \"I gor nothin.\"\nend", "def print_none\n puts \"I got nothin'\"\nend", "def bark\n say('ouah ouah')\n nil\n end", "def print_none()\r\n puts \"I got nothin'\"\r\nend", "def print_none()\n puts \" I got nothin'\"\nend", "def complain\n\n end", "def puts_none()\n puts \"I got nothin.\"\nend", "def puts_none()\n puts \"I got nothin.\"\nend", "def question_and_answer(with_error, zero_or_one, mistery_num)\n message = \"Do you see your number here: (y)(n). To exit the game enter the letter e.\".colorize(:blue)\n if with_error == true\n puts \"\\nIncorrect Answer. \" + message\n else \n puts \"\\n#{message}\"\n end \n answer = gets.chomp.upcase\n case answer\n when \"Y\", \"YES\"\n if zero_or_one % 2 == 0\n mistery_num +=\"0\"\n else\n mistery_num +=\"1\"\n end\n return mistery_num\n when \"N\", \"NO\"\n if zero_or_one % 2 == 0\n mistery_num +=\"1\"\n else\n mistery_num +=\"0\"\n end\n return mistery_num\n when \"E\"\n return \"break\"\n else\n question_and_answer(true, zero_or_one, mistery_num)\n end \nend", "def void_string(*args)\n return nil.to_s\n end", "def get_response(name)\n puts `clear`\n puts \"*** Welcome to #{name} ****\"\n puts \"Please select one of the choices below.\"\n print \"a(d)d user, (l)ist of all animals, (g)ive animal, (a)doption a pet, (c)lient list, (e)dit animal, edit (u)ser, (q)uit: \"\n gets.chomp.downcase\nend", "def print_none()\n p \"I got nothin'.\"\nend", "def print_none()\n puts \"i got nothing'.\"\nend", "def print_none()\r\n\tputs \"I got nothin\"\r\nend", "def puts_non()\n\tputs \"I got nothin'.\"\nend", "def show_error str=\"There was an error with the parsing...\"\n puts str\n Choice.help\n exit\nend", "def print_none()\n\tputs \"\\t>> print_none\"\n\tputs \"i got nothin'.\"\n\tputs \"\\t<< print_none\"\nend", "def get_response_for question\nprint question + \": \"\ngets.chomp\nend", "def print_good(msg='')\n end", "def puts_none\n\tputs \"I have nothing\"\nend", "def print_none()\n puts \"I got nothing'.\"\nend", "def bye; end", "def result(answer)\n puts answer\nend", "def result(answer)\n puts answer\nend", "def get_answer\n\tprint \"please enter the keyword to 'exit': \"\n\tprint \"hint: it is one of the letters in the word 'exit' \"\n\tanswer = gets.chomp.downcase\n\treturn answer\nend", "def ask(prompt, echo = T.unsafe(nil)); end", "def space_prompts\n puts \"\"\nend", "def prompt(msg, default)\n result = nil\n while not result\n display(msg)\n result = gets.strip\n if result.downcase == \"q\"\n throw :quit\n elsif result.downcase == \"i\"\n result = nil\n instructions\n elsif result.downcase == \"m\"\n display(\"Statistics can only be shown during a round!\")\n elsif result == \"\"\n return default.to_s\n else \n return result \n end\n end\n return result\n end", "def print_none\n puts \"I got nothin.\"\nend", "def return_guess\r\n puts \"What will be the return value here?\" # puts nao retorna valor nenhum\r\n print \"Will print be any different?\"\r\nend", "def funny_responses\n [\n 'Huh?',\n \"What's that you say?\",\n 'come again?',\n \"Sorry, I don't know that command.\"\n ]\n end", "def invalid_command\n puts \"Please enter a valid command\"\nend", "def prompt(mess) # prompt for all questions\n puts \"==> #{mess}\"\nend", "def sce1_opt1\n # sce1_opt = gets.chomp.to_s.downcase\n puts \"\\nLooks like you will never solve the mystery\"\n puts \"Game Over\"\n `say -vFred Game Over`\nend", "def wrong\n puts \"That isn't an option.\"\nend", "def give_answer(question)\n if question.downcase == 'i am going to work'\n 'Great!'\n elsif question.chars[-1] == '?'\n 'Silly question, get dressed and go to work!'\n else\n 'I don\\'t care, get dressed and go to work!'\n end\n end", "def quack\n puts \"quack\"\nend", "def antibody_test_result_prompt\n puts \"\\nIf you know the antibody test result, please enter if it was positive or negative by typing 'positive' or 'negative'.\"\n antibody_res_response = gets.strip.downcase\n return_to_menu(antibody_res_response)\n exit_anything(antibody_res_response)\n if antibody_res_response == \"positive\" \n anti_body_test_result = true\n elsif antibody_res_response == \"negative\"\n anti_body_test_result = false\n else puts \"\\nDid you mean to hit 'positive', 'negative', 'menu', or 'exit'?\"\n antibody_test_result_prompt\n end\n anti_body_test_result\nend" ]
[ "0.66577536", "0.6499136", "0.64680016", "0.6317308", "0.62703776", "0.6220558", "0.6211194", "0.62051654", "0.61884993", "0.6188232", "0.61642796", "0.61583364", "0.6152237", "0.6147045", "0.6147045", "0.6147045", "0.6138358", "0.6138358", "0.6117474", "0.61154974", "0.6098689", "0.6098689", "0.6098689", "0.6098689", "0.6098689", "0.60875547", "0.60706455", "0.6066521", "0.6065249", "0.606212", "0.6061289", "0.605536", "0.6049937", "0.60422367", "0.60395426", "0.6025725", "0.60244757", "0.6024036", "0.6021616", "0.60093063", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60047156", "0.60024405", "0.59995455", "0.5997771", "0.5997771", "0.59953773", "0.5994168", "0.5986819", "0.5983124", "0.5974284", "0.5963865", "0.59617686", "0.59617686", "0.5949855", "0.5942091", "0.59413284", "0.5939506", "0.5934083", "0.591343", "0.59097296", "0.59006083", "0.58995664", "0.58930707", "0.5887248", "0.58840454", "0.5882529", "0.58766156", "0.58710265", "0.58710265", "0.58709985", "0.58631146", "0.58569705", "0.584953", "0.5848049", "0.5847851", "0.5816822", "0.58158165", "0.5813811", "0.5806317", "0.57982224", "0.57897043", "0.57863665", "0.5782392" ]
0.0
-1
act like any duck
def respond_to?(method_name, include_private = false) true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generic?; true; end", "def abstract!; end", "def same; end", "def for_cop(cop); end", "def any; end", "def direct_dependency(type, result = T.unsafe(nil)); end", "def wrapper; end", "def make(thing) end", "def cop=(_); end", "def cop=(_); end", "def make_it_quack(duck)\n duck.quack\nend", "def cyclic?\n raise NotImplementedError\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def quack_it(duck)\n duck.quack\nend", "def private; end", "def full_object\n fail NotImplementedError\n end", "def all(_obj)\n raise NotImplementedError\n end", "def refute_instance_of(cls, obj, msg = T.unsafe(nil)); end", "def explicit; end", "def abstract?; end", "def dispatch\n raise NotImplementedError\n end", "def guard; end", "def checked=(_arg0); end", "def overload; end", "def verify?; raise NotImplementedError; end", "def call(object); end", "def for_one?\n fail NotImplementedError\n end", "def wrap(object); end", "def awaken!\n\t\traise 'Not implemented'\n\tend", "def refute_kind_of(cls, obj, msg=nil)\n KindAssay.refute!(obj, cls, :message=>msg, :backtrace=>caller)\n end", "def no_circular_reference\n\n end", "def underscorize\n dup.tap(&:underscorize!)\n end", "def pass_by!\n end", "def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end", "def shallow given, trash = []\n if given.class == Module; given.constants.map { |x| given.const_get x }\n elsif given.class == Class\n here = given.constants.map { |x| given.const_get x }\n sup = given.superclass\n other = sup.constants.map { |x| sup.const_get x }\n here - other\n else []\n end - trash\n end", "def test_duck_type_beach_search_found_something\n ruby_rush=RubyRush.new(1, 2, 3)\n doubled_prng = Minitest::Mock.new('doubled prng')\n def doubled_prng.rand(seed); 2; end\n ruby_rush.prng=doubled_prng\n ruby_rush.cur_real_rb=2\n ruby_rush.cur_fake_rb=2\n ruby_rush.real_sp='rubies'\n ruby_rush.fake_sp='rubies'\n assert_output(\"\\tFound #{ruby_rush.cur_real_rb} #{ruby_rush.real_sp} and #{ruby_rush.cur_fake_rb} fake #{ruby_rush.fake_sp} in #{ruby_rush.city}.\\n\" ) {ruby_rush. duck_type_beach_search}\n end", "def make_it_swim(duck)\n duck.swim\nend", "def implementation; end", "def implementation; end", "def unquiesce \n raise NotImplementedError.new\n end", "def ne(_obj)\n raise NotImplementedError\n end", "def ignores; end", "def isolated; end", "def isolated; end", "def instantiate!; end", "def test_multiples_does_not_require_type_for_hashable_only\n HashableOnly.send(:multiples, :something)\n\n obj = HashableOnly.new\n obj.something = [1, 2]\n\n assert_instance_of(Hash, obj.hashify)\n end", "def dont_care\n each(&:dont_care)\n myself\n end", "def __dummy_test__\n end", "def realize_self\n raise NotImplementedError\n end", "def silly_adjective; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def isolated=(_arg0); end", "def isolated=(_arg0); end", "def sport(include_ancient: T.unsafe(nil), include_unusual: T.unsafe(nil)); end", "def internal?; end", "def pass; end", "def pass; end", "def pass=(_arg0); end", "def call_quack(duck)\n duck.quack\nend", "def match(object); end", "def spec; end", "def spec; end", "def test_turn_putter_fake\n pros = Prospector.new(0,0,0)\n assert pros.turn_putter(0,1).eql? \"\\tFound 1 fake ruby in Enumerable Canyon\"\n end", "def magic\n self.class.magic(self)\n end", "def internship_passed; end", "def refinement\n raise NotImplementedError\n end", "def _d(*_); end", "def hook_solution?(a); end", "def apply; nil; end", "def internal; end", "def objects_with_references\n end", "def passed?; end", "def passed?; end", "def passed?; end", "def unrealize_self\n raise NotImplementedError\n end", "def initialize(*)\n super\n reduce(public, any)\n end", "def anchored; end", "def alias_of; end", "def fmap(*)\n raise NotImplementedError\n end", "def deco_call; end", "def ean(base: T.unsafe(nil)); end", "def non_polymorphic_collection?(param0 = T.unsafe(nil)); end", "def dispatch(*_arg0); end", "def transition_for(object, requirements = T.unsafe(nil)); end" ]
[ "0.5900459", "0.5866042", "0.58528817", "0.5824319", "0.58108264", "0.5799593", "0.5736011", "0.5703646", "0.57025224", "0.57025224", "0.5693474", "0.568474", "0.5659443", "0.5659443", "0.5659443", "0.5659443", "0.5638124", "0.56196135", "0.56108063", "0.55734617", "0.5507375", "0.5463623", "0.544885", "0.5435941", "0.54168224", "0.5411058", "0.540824", "0.5383328", "0.5382915", "0.53695923", "0.53624946", "0.5361965", "0.5351626", "0.53501827", "0.53364825", "0.5304749", "0.53012097", "0.5300907", "0.5296504", "0.528827", "0.5285578", "0.5285578", "0.5271201", "0.5270774", "0.5267965", "0.5257753", "0.5257753", "0.52467114", "0.52408236", "0.52369285", "0.5228711", "0.52264786", "0.5222115", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5221503", "0.5210201", "0.5210201", "0.52052873", "0.5199941", "0.5196716", "0.5196716", "0.51935583", "0.5192413", "0.5186201", "0.5185148", "0.5185148", "0.5176005", "0.5172285", "0.5167153", "0.5157725", "0.5157713", "0.5156385", "0.5153662", "0.51473653", "0.5137987", "0.5137207", "0.5137207", "0.5137207", "0.51353836", "0.5127063", "0.5125113", "0.51203555", "0.5118233", "0.51112264", "0.51049423", "0.5103408", "0.50923663", "0.5088819" ]
0.0
-1
Here are our methods
def dist(line_start, stop_start, stop_finish) x = $mta[line_start].index(stop_start) y = $mta[line_start].index(stop_finish) return (x - y).abs end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def schubert; end", "def probers; end", "def operations; end", "def operations; end", "def implementation; end", "def implementation; end", "def suivre; end", "def formation; end", "def apply\n\t\t\n\tend", "def apply\n\t\t\n\tend", "def refutal()\n end", "def weber; end", "def who_we_are\r\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def custom; end", "def custom; end", "def identify; end", "def strategy; end", "def processor; end", "def methods() end", "def zuruecksetzen()\n end", "def methods; end", "def methods; end", "def methods; end", "def methods; end", "def apply\n\t\t\t\t\n\t\t\tend", "def common\n \n end", "def villian; end", "def relatorios\n end", "def handle; end", "def perform\n \n end", "def stderrs; 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", "def internal; end", "def eplore\n end", "def transformations; end", "def verdi; end", "def retire\n\n end", "def operation; end", "def get_data()\t\n\tend", "def berlioz; end", "def sn\n end", "def guct\n end", "def private_method\n end", "def terpene; end", "def celebration; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def calls; end", "def calls; end", "def call\n\n\tend", "def call\n\n\tend", "def intensifier; end", "def hd\n \n end", "def sitemaps; end", "def wrapper; end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def bs; end", "def run() end", "def r; end", "def r; end", "def anchored; end", "def trd; end", "def initialize\n\t\t\n\tend", "def post_process; end", "def schumann; end", "def details; end", "def invention; end", "def apis; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end" ]
[ "0.7603634", "0.67801857", "0.6753929", "0.65450233", "0.65450233", "0.65118206", "0.65118206", "0.64790374", "0.6465835", "0.6326218", "0.6326218", "0.63173103", "0.630146", "0.62885076", "0.62556875", "0.62556875", "0.62556875", "0.62556875", "0.6232442", "0.6232442", "0.6231341", "0.61968017", "0.6193896", "0.61774373", "0.6154046", "0.6134099", "0.6134099", "0.6134099", "0.6134099", "0.6054815", "0.6054287", "0.6050341", "0.6043428", "0.60233563", "0.60212266", "0.59957016", "0.5995618", "0.5995618", "0.5995618", "0.5995618", "0.5995618", "0.5995618", "0.5995618", "0.5995618", "0.5995618", "0.59672135", "0.5962726", "0.59610045", "0.59460026", "0.5909058", "0.59051657", "0.59006417", "0.5897019", "0.5891221", "0.587251", "0.58673584", "0.5863289", "0.5856479", "0.5833003", "0.5833003", "0.5833003", "0.5833003", "0.5833003", "0.5833003", "0.5833003", "0.5833003", "0.5823906", "0.5823906", "0.58146065", "0.58146065", "0.5814048", "0.5809241", "0.5769933", "0.5761058", "0.57521755", "0.57521755", "0.57521755", "0.57521755", "0.57521755", "0.57521755", "0.57521755", "0.57521755", "0.57514477", "0.5747998", "0.5747582", "0.5747582", "0.574648", "0.5745061", "0.57436013", "0.5742413", "0.57348233", "0.57332075", "0.571945", "0.57035536", "0.56984323", "0.56984323", "0.56984323", "0.56984323", "0.56984323", "0.56984323", "0.56984323" ]
0.0
-1
CSRF won't be able to be verified on returning from the OpenID server, so we will bypass that check for this strategy
def store? true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_authenticity_token; end", "def verified_request?\r\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\r\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end", "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end", "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end", "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end", "def protect_against_forgery?; end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n\t\tsuper || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n\tend", "def verified_request?\n\t\tsuper || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n\tend", "def any_authenticity_token_valid?; end", "def verify_csrf_token?\n false\n end", "def protect_against_forgery?\n end", "def clean_up_csrf?; end", "def clean_up_csrf?; end", "def protect_against_forgery?\n\n end", "def request_authenticity_tokens; end", "def verified_request?\n !protect_against_forgery? || request.get? ||\n form_authenticity_token == params[request_forgery_protection_token] ||\n form_authenticity_token == request.headers['X-XSRF-Token']\n end", "def verified_request?\n !protect_against_forgery? || request.get? ||\n form_authenticity_token == params[request_forgery_protection_token] ||\n form_authenticity_token == request.headers['X-XSRF-Token']\n end", "def verified_request?\n !protect_against_forgery? || request.get? ||\n form_authenticity_token == params[request_forgery_protection_token] ||\n form_authenticity_token == request.headers['X-XSRF-Token']\n end", "def check_csrf?\n true\n end", "def verify_csrf_token(req, res)\n handle_invalid_csrf_token(req, res) if invalid_csrf_token?(req, res)\n end", "def handle_checkid_request\n if allow_verification?\n save_checkid_request\n redirect_to proceed_path\n elsif openid_request.immediate\n render_response(openid_request.answer(false))\n else\n reset_session\n request = save_checkid_request\n session[:return_to] = proceed_path\n redirect_to( request.from_trusted_domain? ? login_path : safe_login_path )\n end\n end", "def verified_request?\n\t\t!protect_against_forgery? || request.get? ||\n\t\t\tform_authenticity_token == params[request_forgery_protection_token] || form_authenticity_token == request.headers['X-CSRF-Token'] ||\n\t\t\trequest.headers['X-XSRF-Token'] && form_authenticity_token == request.headers['X-XSRF-Token'].gsub!(/\\A\"|\"\\Z/, '')\n\tend", "def rails_check_csrf!\n rails_controller_instance.send(:verify_authenticity_token)\n end", "def form_authenticity_param; end", "def check_csrf?\n true\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_from_forgery\n end", "def protect_against_forgery?\n false\nend", "def rails_check_csrf!\n rails_controller_instance.send(:verify_authenticity_token)\n end", "def protect_against_forgery?\n false\n end", "def clean_up_csrf?\n false\n end", "def check_csrf\n rails_check_csrf!\n end", "def handle_unverified_request\n redirect_to root_url, :notice => \"We detect unmatching token form your form, please do not hack us\"\n \n end", "def auth_token\n (protect_against_forgery? ? form_authenticity_token : nil)\n end", "def protect_against_forgery?\n false\n end", "def check_csrf\n rails_check_csrf!\n end", "def handle_unverified_request\n raise ActionController::InvalidAuthenticityToken\n end", "def handle_unverified_request\n raise ActionController::InvalidAuthenticityToken\n end", "def handle_unverified_request\n \n # By default this method raises ActionController::InvalidAuthenticityToken\n #redirect_to root_url\n end", "def verify_authenticity_token\n verified_request? || raise(ActionController::InvalidAuthenticityToken)\n end", "def verify_authenticity_token\n super unless request_comes_from_facebook?\n end", "def handle_checkid_request\n if allow_verification?\n save_checkid_request\n redirect_to proceed_api_openid_provider_path(consumer_id)\n elsif openid_request.immediate\n render_response(openid_request.answer(false))\n else\n reset_session\n request = save_checkid_request\n session[:previous_url] = proceed_api_openid_provider_path(consumer_id)\n self.render_user_selection_page\n end\n end", "def clean_up_csrf?\n true\n end", "def clean_up_csrf?\n true\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def auth_csrf_token\n request.env['HTTP_X_AUTH_CSRF']\n end", "def csrf; end", "def valid_authenticity_token?(session, encoded_masked_token); end", "def clean_up_csrf?\n false\n end", "def verified_request?\n !protect_against_forgery? ||\n request.method == :get ||\n request.xhr? ||\n !verifiable_request_format? ||\n form_authenticity_token == params[request_forgery_protection_token]\n end", "def protect_against_forgery? #:nodoc:\n false\n end", "def verify_authenticity_token\n if auth_token_param.present?\n verify_valid_auth_token!\n else\n super\n end\n end", "def authenticity_token\n @authenticity_token || helper.form_authenticity_token\n end", "def authenticity_token\n @authenticity_token || helper.form_authenticity_token\n end", "def handle_unverified_request\n if Rails.env.production?\n reset_session\n else\n raise ActionController::InvalidAuthenticityToken\n end\n end", "def invalid_authenticity_request\n sign_out(current_user)\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n render error: 'invalid token', status: :unprocessable_entity\n end", "def allow_forgery_protection\n true\n end", "def handle_unverified_request\n logger.warn \" Form token: #{params[request_forgery_protection_token]}\" if logger\n logger.warn \" Header token: #{request.headers['X-CSRF-Token']}\" if logger\n logger.warn \" Session token: #{session[:_csrf_token]}\" if logger\n super\n end", "def ensure_valid_checkid_request\n self.openid_request = checkid_request\n if !openid_request.is_a?(OpenID::Server::CheckIDRequest)\n redirect_to root_path, :alert => t(:identity_verification_request_invalid)\n elsif !allow_verification?\n flash[:notice] = logged_in? && !pape_requirements_met?(auth_time) ?\n t(:service_provider_requires_reauthentication_last_login_too_long_ago) :\n t(:login_to_verify_identity)\n session[:return_to] = proceed_path\n redirect_to login_path\n end\n end", "def before_rodauth\n rails_verify_authenticity_token\n super\n end", "def verify_iat; end", "def verify_iat; end", "def form_authenticity_token\n \"foo\"\n end", "def form_authenticity_token(form_options: T.unsafe(nil)); end", "def ensure_valid_checkid_request\n self.openid_request = checkid_request\n if !openid_request.is_a?(OpenID::Server::CheckIDRequest)\n redirect_to root_path, :alert => t('openid.identity_verification_request_invalid')\n elsif !allow_verification?\n flash[:notice] = user_signed_in? && !pape_requirements_met?(auth_time) ?\n t('openid.service_provider_requires_reauthentication_last_login_too_long_ago') :\n t('openid.login_to_verify_identity')\n session[:previous_url] = proceed_api_openid_provider_path\n redirect_to new_user_session_path(ltype:'sso')\n end\n end", "def form_authenticity_token() 'token' end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN']) || api_operator.present?\n end", "def xsrf_token\n SecureRandom.urlsafe_base64 + SecureRandom.urlsafe_base64 + SecureRandom.urlsafe_base64\n end", "def verify_csrf_token?(req, *)\n !IDEMPOTENT_HTTP_METHODS[req.request_method]\n end", "def invalid_csrf_token?(req, res)\n return false unless verify_csrf_token?(req, res)\n\n missing_csrf_token?(req, res) ||\n !::Rack::Utils.secure_compare(req.session[CSRF_TOKEN], req.params[CSRF_TOKEN])\n end", "def csrf_token\n env[\"rack.session\"].fetch(:csrf)\nend", "def login_required?\n !using_open_id?\n end", "def verified_request?\n !protect_against_forgery? ||\n request.method == :get ||\n !verifiable_request_format? ||\n form_authenticity_token == params[request_forgery_protection_token]\n end", "def verify_state?(state)\n return false if state.nil? || state.empty?\n Rack::Utils.secure_compare(csrf_token, state)\nend", "def csrf_token\n session[:csrf] ||= SecureRandom.hex 32\n end", "def masked_authenticity_token(session, form_options: T.unsafe(nil)); end", "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end" ]
[ "0.7376418", "0.7265402", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7226555", "0.7217411", "0.7217411", "0.7217411", "0.7217411", "0.71578974", "0.7118049", "0.7118049", "0.7118049", "0.7112579", "0.70675695", "0.7009687", "0.6985166", "0.6933548", "0.69051236", "0.69051236", "0.6859025", "0.68575245", "0.68260914", "0.68260914", "0.68260914", "0.68161017", "0.67798406", "0.67761534", "0.67674714", "0.6753845", "0.6740879", "0.67299145", "0.6725732", "0.6725052", "0.6725052", "0.6725052", "0.6725052", "0.6725052", "0.6725052", "0.67101187", "0.6709403", "0.6707764", "0.6689081", "0.6677478", "0.6669014", "0.6662001", "0.6661558", "0.66557115", "0.66398966", "0.66310143", "0.66310143", "0.6626314", "0.6620241", "0.66049504", "0.6596114", "0.65904653", "0.65904653", "0.6589308", "0.6589308", "0.6588013", "0.6576496", "0.65740746", "0.6540375", "0.6479031", "0.64638233", "0.64613783", "0.64556915", "0.6455502", "0.6452759", "0.6443827", "0.6424347", "0.64080197", "0.63904095", "0.6382295", "0.63743955", "0.63743955", "0.6363847", "0.63600785", "0.6355467", "0.6341442", "0.6340952", "0.63408846", "0.6338682", "0.63331336", "0.63255215", "0.6324092", "0.6322765", "0.63166416", "0.63155925", "0.6293515", "0.62770087" ]
0.0
-1
Handles incoming provider response
def handle_response! logger.debug "Attempting OpenID auth: #{provider_response.inspect}" case provider_response.status when :success resource = find_resource || build_resource || create_resource if resource && validate(resource) begin update_resource!(resource) rescue fail! $! else success!(resource) end else fail! "This OpenID URL is not associated with any registered user" end when :cancel fail! "OpenID authentication cancelled" when :failure fail! "OpenID authentication failed" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_response(provider_response)\n nil\n end", "def process_response(provider_response)\n nil\n end", "def handle_response(response); end", "def handle_response(response); end", "def receive_response(response); end", "def handle_response(response)\n handler_for_code(response.code).call(response)\n end", "def process_response(obj)\n end", "def got_response(response)\n end", "def handle_response\n unless performed?\n if @error.present?\n handle_error(@error)\n else\n respond_with do |format|\n # Browser scope.\n format.html do\n handle_response_html\n end\n # Rails remote form.\n format.js do\n handle_response_js\n end\n # API / xhr scope.\n format.json do\n handle_response_json\n end\n end\n end\n end\n end", "def handle\n respond\n nil\n end", "def response_from_service\n\n end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def handle_response(response)\n type, msgid, error, result = response\n if observable = @requests[msgid]\n @requests[msgid].set_response(result, error)\n else\n warn \"unknown response with id=#{msgid}\"\n end\n end", "def on_response request, response, block\n block.call(response.name, response.params)\n end", "def on_response &b\n @response_proc = b\n self\n end", "def response\n raise \"Need to define how connector handles response\"\n end", "def callback_phase\n raw_response = request.params.symbolize_keys[:SAMLResponse]\n raise OneLogin::RubySaml::ValidationError.new(\"SAML response missing\") unless raw_response\n\n with_settings do |settings|\n # Handle the response.\n handle_response(raw_response, settings) do\n # yield the response to the omniauth controller.\n super\n end\n end\n rescue OneLogin::RubySaml::ValidationError\n fail!(:invalid_response, $!)\n end", "def on_success(_request, response)\n response\n end", "def process_response\n case @msg.sip_method\n when :INVITE\n if client_transaction = @msg.connection.class.invite_client_transactions[@msg.via_branch_id]\n client_transaction.receive_response(@msg)\n return\n end\n when :ACK\n when :CANCEL\n if client_transaction = @msg.connection.class.invite_client_transactions[@msg.via_branch_id]\n client_transaction.receive_response_to_cancel(@msg)\n return\n end\n else\n if client_transaction = @msg.connection.class.non_invite_client_transactions[@msg.via_branch_id]\n client_transaction.receive_response(@msg)\n return\n end\n end\n log_system_debug \"ignoring a response non matching a client transaction (#{@msg.sip_method} #{@msg.status_code})\" if $oversip_debug\n end", "def after_response(status_hash, responder)\n end", "def on_channel_pipelines_response(payload)\n return unless handle_response? payload\n id, req, responses, event, nodes = self.extract(payload)\n event.pipelines.each {|pipe|\n responses[pipe.nodeUrn] = [] if responses[pipe.nodeUrn].nil?\n pipe.handlerConfigurations.each{|config|\n responses[pipe.nodeUrn] << config.to_hash\n }\n }\n if self.collection_complete?(id)\n info \"Request #{id} is completed. Informing EC.\"\n self.inform_status(self.build_inform(id, responses, :channel_pipelines_response))\n end\n end", "def handle_response(response)\n token = response.token\n if response.is_a?(Result)\n if result = OperationResult.from_results(response)\n if result.non_delivery?\n @non_delivery_stats.update(result.content.nil? ? \"nil\" : result.content.inspect)\n elsif result.error?\n @result_error_stats.update(result.content.nil? ? \"nil\" : result.content.inspect)\n end\n @result_stats.update(result.status)\n else\n @result_stats.update(response.results.nil? ? \"nil\" : response.results)\n end\n\n if handler = @pending_requests[token]\n if result && result.non_delivery? && handler.kind == :send_retryable_request &&\n [OperationResult::TARGET_NOT_CONNECTED, OperationResult::TTL_EXPIRATION].include?(result.content)\n # Log and ignore so that timeout retry mechanism continues\n # Leave purging of associated request until final response, i.e., success response or retry timeout\n Log.info(\"Non-delivery of <#{token}> because #{result.content}\")\n else\n deliver(response, handler)\n end\n elsif result && result.non_delivery?\n Log.info(\"Non-delivery of <#{token}> because #{result.content}\")\n else\n Log.debug(\"No pending request for response #{response.to_s([])}\")\n end\n end\n true\n end", "def handle_response(response)\n response.body if response.success?\n end", "def provider_gather\n\n\t\tcontact = TwilioContact.where(id: params[:id]).first\n\n\t\t# determine if the provider wants to talk to client\n\t\tif params[:Digits] == '1'\n\t\t\tcontact.delay.make_callback(\"paused\")\n\t\t\tcontact.accepted = true\n\t\t\tcontact.save\n\t\t\t@number = contact.call_job.phone\n\t\telse\n\t\t\trender 'end_call'\n\t\tend\n\n\t\t# save request to history\n\t\tparams[:Action] = \"Provider_Gather\"\n\t\tTwilioHistory.create(history_params);\n\n\t\trespond_to :xml\n\tend", "def handle_response(resp)\n self.response = JSON.parse(resp.body, symbolize_names: true)\n\n # :content and :reference must be included in response.\n if response.keys.include?(:content) && response.keys.include?(:reference)\n return\n end\n\n # :content or :reference not included.\n raise ::EasyManageClient::InvalidResponseContent\n end", "def on_response( event )\n # You can access the response data being received using the event object:\n #\n # event.data.gsub!( 'SOMETHING', 'ELSE' )\n #\n #BetterCap::Logger.raw \"\\n#{BetterCap::StreamLogger.hexdump( event.data )}\\n\"\n BetterCap::Logger.info \"No response is working fine!\"\n end", "def finish_response; end", "def handle_response(response)\n case response.code\n when 200..299\n response\n else\n if response.request.format == :json\n raise FreebaseAPI::ServiceError.new(response['error'])\n else\n raise FreebaseAPI::NetError.new('code' => response.code, 'message' => response.response.message)\n end\n end\n end", "def response\n\t\t@response\n\tend", "def handle_response(res)\n # relogin if needed\n return relogin if should_relogin(res)\n\n check_unauthorized(res.status, res.env.url.to_s)\n check_not_found(res.status)\n check_not_success(res.status)\n handle_success(res.body) do |json_body|\n yield(json_body) if block_given?\n end\n end", "def handle\n @response.response_code = response_code\n @response.content = view\n @response.layout = set_layout\n @response.output_format = @request.path_info.split(\".\").last\n end", "def handle_response(response, success_state, failure_state)\n if response.is_a?(Spree::Adyen::BillingResponse) && response.redirect?\n self.create_redirect_response!(\n md: response.md,\n pa_request: response.pa_request,\n issuer_url: response.issuer_url,\n psp_reference: response.psp_reference\n )\n end\n\n super\n end", "def on_after_response(_http_response)\r\n raise NotImplementedError, 'This method needs\r\n to be implemented in a child class.'\r\n end", "def parse_response(response)\n raise NotImplementedError\n end", "def void(response_code, provider_source, gateway_options = {})\n Spree::PAYONE::Logger.info \"Void process started\"\n payment_payment_provider_successful_response\n end", "def handle_verify_response(response)\n verify_response = response\n status = verify_response[\"data\"][\"status\"]\n charge_code = verify_response[\"data\"][\"chargecode\"]\n\n if charge_code == \"00\" && status == \"successful\"\n res = {\"error\": false, \"transaction_complete\": true, \"data\": verify_response[\"data\"]}\n return JSON.parse(res.to_json)\n else\n res = {\"error\": false, \"transaction_complete\": false, \"data\": verify_response[\"data\"]}\n return JSON.parse(res.to_json)\n end\n end", "def handle_response(response)\n case response[:status]\n when :success, :created\n self.instance_variable_set('@notsaved', false)\n true\n when :errors\n Amfetamine.logger.warn \"Errors from response\\n #{response[:body]}\"\n response[:body].each do |attr, error_messages|\n error_messages.each do |msg|\n errors.add(attr.to_sym, msg)\n end\n end\n false\n when :server_error\n Amfetamine.logger.warn \"Something went wrong at the remote end.\"\n false\n end\n end", "def handle(context)\n\n # Notify all connection listeners by calling their on_server_response method.\n notify(context) do |connection_listener|\n connection_listener.on_server_response(context, self)\n end\n \n end", "def prepare_response(response)\n response\n end", "def process_response(response)\n case response.code.to_i\n when 200, 404\n parse_message response.body\n when 401, 500\n error_message = parse_message response.body\n raise \"Unauthorized: #{error_message['error']['message']}\"\n else\n raise \"Response code #{response.code} not recognized\"\n end\n end", "def handle_response(response, required_root_key = nil)\n # at this point the FaradayMiddleware::ParseXml or JSON should have parsed\n # all valid responses into a Hash\n if response.env[:method] != :delete && !response.body.is_a?(Hash)\n raise Errors::ResponseError, 'Unexpected or empty response'\n end\n\n case response.status\n when 401\n raise Errors::AuthenticationError, response['technical_message']\n when 500\n raise Errors::SystemError, response.body\n else\n if required_root_key\n response_data_for_key!(response.body, required_root_key)\n else\n response.body\n end\n end\n end", "def response; return @response end", "def handleResult(response)\n response = JSON.parse(response, :symbolize_names => true)\n case response[:code]\n when CODE_OK then response[:data]\n when CODE_INVALID_PARAMETERS, CODE_INVALID_API_KEY, CODE_INVALID_METHOD\n raise ArgumentError, response[:message]\n else\n raise StandardError, \"An unknown error ocurrced while handling the response: #{response.to_s}\"\n end\n end", "def handle_fetch_response(response)\n fetch_response = response\n status = fetch_response[\"status\"]\n data = fetch_response[\"data\"]\n\n if status == \"success\"\n response = {\"error\": false, \"data\": data}\n return JSON.parse(response.to_json)\n else\n response = {\"error\": true, \"data\": data}\n raise FetchPaymentPlanError, JSON.parse(response.to_json)\n end\n\n end", "def handle_request request, usecase=Usecase, &block\n usecase = build_usecase( request, usecase, &block )\n usecase.response\n end", "def parse_response!; end", "def callback\n return response if called\n self.response = k.inject(\n env.merge(RESPONSE_BODY => body ,\n RESPONSE_STATUS => status,\n RESPONSE_HEADERS => headers,\n RESPONSE_SOCKET => socket,\n FAIL => ((env[FAIL]||[]) + [error]).compact,\n LOG => env[LOG] ||[])){ |r, i| i.call(r) }\n ensure\n self.called = true\n end", "def parse_response(response)\n raise NotImplementedError, '.parse_response should be implemented in subclass'\n end", "def handle_response(response, used_by)\n if Utils.is_success_status_code(response.code)\n if response.body.nil? || response.body == ''\n nil\n else\n JSON.parse(response.body)\n end\n elsif Utils.is_under_maintenance_response(response.code)\n raise UnderMaintenanceException.new.reason\n elsif Utils.is_rate_limit_response(response.code)\n raise RateLimitException.new.reason\n else\n _err_message = '---------Copyleaks SDK Error (' + used_by + ')---------' + \"\\n\\n\"\n _err_message += 'status code: ' + response.code + \"\\n\\n\"\n\n _err_message += 'response body:' + \"\\n\" + response.body.to_json + \"\\n\\n\" unless response.body.nil?\n\n _err_message += '-------------------------------------'\n raise CommandException.new(_err_message).reason + \"\\n\"\n end\n end", "def handle_request( req )\n\t\tself.log.debug \"[:negotiation] Wrapping response with hypermedia presentation.\"\n\n\t\tresponse = super\n\t\tresponse.presenter = self.presenter\n\n\t\treturn response\n\tend", "def raw_response; end", "def response_parser; end", "def handle_response(response)\n case response.code.to_i\n when 200...300\n response\n else\n raise ResponseError.new(response)\n end\n end", "def on_server_response(connection, message)\n end", "def render_response\n response.headers['Content-Type'] = 'charset=utf-8'\n @resp = server.encode_response(@resp)\n return render_xml_response if is_xml_request?\n case @resp.code\n when OpenID::Server::HTTP_OK\n render :text => @resp.body, :status => 200\n when OpenID::Server::HTTP_REDIRECT\n redirect_to @resp.redirect_url\n else\n render :text => @resp.body, :status => 400\n end \n end", "def receive_response hResp\n resp = Response.factory( hResp )\n Handler.log.debug \"Response received from #{ip_port}##{resp.id} : #{resp.result? ? resp.result : resp.error}\"\n emit( 'response', resp )\n if resp.id && @response_waited[resp.id]\n @response_waited.delete(resp.id).call(resp)\n elsif resp.result?\n Handler.log.warn \"No handler for this response !\"\n end\n resp\n end", "def process_response(entry)\n entry.messagings.each do |messaging|\n # Set global variable Messenger Sender\n set_sender(messaging.sender_id)\n # Check if user is available to talk with bot or human.\n if bot_service_active?\n if messaging.callback.message?\n receive_message(messaging.callback)\n elsif messaging.callback.delivery?\n puts messaging.callback\n elsif messaging.callback.postback?\n receive_postback(messaging.callback)\n elsif messaging.callback.optin?\n puts messaging.callback\n elsif messaging.callback.account_linking?\n login_or_log_out(messaging.callback)\n end\n # puts Messenger::Client.get_user_profile(messaging.sender_id)\n else\n send_directly_message_without_boot(messaging)\n end\n end\n end", "def handle_cancel_response(response)\n cancel_response = response\n status = cancel_response[\"status\"]\n data = cancel_response[\"data\"]\n\n if status == \"success\"\n response = {\"error\": false, \"data\": data}\n return JSON.parse(response.to_json)\n else\n response = {\"error\": true, \"data\": data}\n raise CancelPaymentPlanError, JSON.parse(response.to_json)\n end\n end", "def received_user_response\n answer = params[:Body]\n phone_number = params[:From]\n\n respondent = Respondent.find_by_phone_number(phone_number.phony_normalized) || raise(RespondentNotFoundError)\n state = respondent.survey_execution_states.find_by(status: [INITIALIZED, IN_PROGRESS]) ||\n raise(SurveyExecutionStateNotFoundError)\n\n survey = state.survey\n question = state.question\n\n if question.response_choices.exists?\n # Lowercase for a case-insensitive comparison against the response choices\n # and persist it this way for consistency\n answer = answer.downcase\n end\n\n survey_response = SurveyResponse.find_or_create_by(survey: survey, respondent: respondent)\n response = Response.new(\n survey_response: survey_response, respondent: respondent, question: question, answer: answer)\n\n if question.is_response_valid?(response)\n response.save!\n next_question = question.next_question(response)\n if next_question.nil?\n message = survey.finished_message\n state.status = FINISHED\n else\n message = next_question.formatted_question_and_responses\n state.question = next_question\n state.status = IN_PROGRESS\n end\n else\n message = 'Invalid response, please try again.'\n state.status = IN_PROGRESS\n end\n state.save\n\n Sms::Client.instance.send(respondent.phone_number, message)\n\n head :ok\n end", "def adapt_response request_context, response\n connection.adapt_response request_context, response\n end", "def response\r\n @response\r\n end", "def consume\n # params[:SAMLResponse] can be blank if GET route is accessed directly without actual authn.\n if params[:SAMLResponse].blank?\n redirect_to frontend_error_path(\"invalid_saml_response\")\n return\n end\n\n response = OneLogin::RubySaml::Response.new(\n params[:SAMLResponse],\n settings: saml_settings,\n allowed_clock_drift: 5.seconds\n )\n\n unless response.is_valid?\n Rails.logger.error \"Invalid SAML response: #{response.errors}\"\n Rollbar.error \"Invalid SAML response\", errors: response.errors\n\n redirect_to frontend_error_path(\"invalid_saml_response\")\n return\n end\n\n Rails.logger.debug \"Reponse attributes: #{response.attributes.inspect}\"\n person = Person.new(response.attributes.multi(Vaalit::Haka::HAKA_STUDENT_NUMBER_FIELD))\n\n unless person.valid?\n Rails.logger.info \"No voting right for person '#{person.inspect}'\"\n Rollbar.info \"No voting right present\", person: person\n\n redirect_to frontend_error_path(\"no_voting_right\")\n return\n end\n\n redirect_to frontend_signin_path(\n SessionToken.new(person.voter).ephemeral_jwt\n )\n end", "def handle_response(response) # :nodoc:\n case response.code\n when 400\n #IN CASE WE WANT MORE PRECISE ERROR NAMES\n #data = response.parsed_response\n #case data['code']\n #when 230\n # raise ParameterDataInvalid.new data\n #else\n # raise BadRequest.new data\n #end\n raise BadRequest.new(response.parsed_response)\n when 403\n raise Unauthorized.new(response.parsed_response)\n when 404\n raise NotFound.new\n when 400...500\n raise ClientError.new\n when 500...600\n raise ServerError.new\n else\n response.parsed_response\n end\n end", "def on_response(session)\n peer_session = get_peer_session(session)\n if peer_session && session[:_sipper_b2b_transparent]\n peer_session.respond_with(session.iresponse.code)\n else\n super\n end\n end", "def on_consumers_responders_respond_with(event)\n calling = event[:caller]\n responder = calling.topic.responder\n data = event[:data]\n info \"Responded from #{calling.class} using #{responder} with following data #{data}\"\n end", "def handle res, opts = {}\n @response = res\n\n parse = opts.has_key?(:parse) ? opts[:parse] : true\n\n case res.status\n when 200..299, 422 then JSON.parse res.body if parse\n when 401, 403 then raise Audiosocket::Unauthorized\n when 404 then nil\n\n else\n raise \"Unexpected response (#{res.status}) from the API:\\n#{res.body}\"\n end\n end", "def respond\n end", "def handle_list_response(response)\n list_response = response\n\n status = list_response[\"status\"]\n message = list_response[\"message\"]\n data = list_response[\"data\"]\n paymentplans = list_response[\"data\"][\"paymentplans\"]\n\n if status == \"success\"\n response = {\"error\": false, \"status\": status,\"message\": message, \"data\": data}\n return JSON.parse(response.to_json)\n else\n response = {\"error\": true, \"data\": list_response[\"data\"]}\n raise ListPaymentPlanError, JSON.parse(response.to_json)\n end\n end", "def response_code; end", "def response_code; end", "def response_code; end", "def response_code; end", "def state_response\n unless resp = handle(@request)\n raise \"No handler found for this URI (#{@request.url})\"\n end\n send_response(resp)\n end", "def response\n @response\n end", "def response\n @response\n end", "def handle_response(response)\n case response\n when Net::HTTPOK \n begin\n JSON.parse(response.body)\n rescue JSON::ParserError\n response.body\n end\n when Net::HTTPUnauthorized\n raise ClearanceTwitter::Unauthorized, 'The credentials provided did not authorize the user.'\n else\n message = begin\n JSON.parse(response.body)['error']\n rescue JSON::ParserError\n if match = response.body.match(/<error>(.*)<\\/error>/)\n match[1]\n else\n 'An error occurred processing your Twitter request.'\n end\n end\n\n raise TwitterAuth::Dispatcher::Error, message\n end\n end", "def render_response(resp)\n clear_checkid_request\n render_openid_response(resp)\n end", "def render_response(resp)\n clear_checkid_request\n render_openid_response(resp)\n end", "def _handle_response(response)\n \n \n # -- MAJOR EXCEPTION handling (authentication)\n \n if (response == Net::HTTPUnauthorized || response.message == 'Unauthorized') ||\n (response && response['status'].to_i == 403 && response['message'] == \"Access to group-memberships denied\")\n raise APIAuthError.new\n \n \n # -- STANDARD handling\n \n else\n \n hashed_response = nil\n \n # Check if the 'response.body' starts with an '<?xml' tag -> indicating it's XML structure\n if response.body =~ /\\A<\\?xml/ \n hashed_response = Hash.from_xml(response.body)\n else\n hashed_response = hash_a_json(response.body)\n end\n \n # -- Bad request (e.g. posting duplicate content)\n \n \n \n _res = { :response_http_object => response }\n \n \n # -- Bad request (e.g. posting duplicate content)\n \n if response == Net::HTTPBadRequest || response.message == \"Bad Request\" || response.code == 400\n _res[:status] = \"bad_request\"\n _res[:response_object] = hashed_response\n \n \n # -- API SERVICE ERROR\n \n elsif response == Net::HTTPInternalServerError || response.message == 'Internal Server Error' || response.code == 500\n _res[:status] = \"api_service_error\"\n _res[:response_object] = hashed_response\n \n \n # -- FORBIDDEN -> trying to use a resource the user is not allowed, store the 'body' as plain XML at this point\n \n elsif response == Net::HTTPForbidden || response.message == 'Forbidden'\n _res[:status] = \"denied_access\" # e.g. post to LinkedIn group required moderation by an admin\n _res[:response_object] = hashed_response\n \n # Check if additional permissions are required (SHARING)\n if _res[:response_object]['error']['message'] == 'Access to posting shares denied'\n raise APIAuthError.new\n end\n \n \n # -- POST / PUT\n \n elsif response.body.blank? || (response.body.nil? && response.code == 204) # A response without content -> successful \n _res[:status] = \"updated_successfully\"\n \n if response.body.blank?\n _res[:response_object] = {}\n else\n _res[:response_object] = hashed_response\n end\n \n \n # -- GET\n \n else\n _res[:status] = \"retrieved_successfully\"\n _res[:response_object] = hashed_response\n \n end\n \n end\n \n \n _res\n \n end", "def convert_response(_response)\r\n raise NotImplementedError, 'This method needs\r\n to be implemented in a child class.'\r\n end", "def on_response( &block )\n @postprocessor = block\n end", "def handle_results(env, request = nil)\n # override me!\n end", "def subscribe_response_hook(name = SecureRandom.hex.to_sym, &block)\n EasyPost::Hooks.subscribe(:response, name, block)\n end", "def response\n @_response\n end", "def after_destroy_response\n respond_to do |format|\n format.html { redirect_to oai_endpoints_path }\n format.xml { head :ok }\n end\n end", "def handle_response(request, response)\n case response.code.to_i\n when 301,302\n raise(Redirection.new(request, response))\n when 200...400\n response\n when 400\n raise(BadRequest.new(request, response))\n when 401\n raise(UnauthorizedAccess.new(request, response))\n when 403\n raise(ForbiddenAccess.new(request, response))\n when 404\n raise(ResourceNotFound.new(request, response))\n when 405\n raise(MethodNotAllowed.new(request, response))\n when 409\n raise(ResourceConflict.new(request, response))\n when 412\n raise(PreconditionFailed.new(request, response))\n when 422\n raise(ResourceInvalid.new(request, response))\n when 401...500\n raise(ClientError.new(request, response))\n when 500...600\n raise(ServerError.new(request, response))\n else\n raise(ConnectionError.new(request, response, \"Unknown response code: #{response.code}\"))\n end\n begin\n if response.body.blank?\n nil\n else\n hash = JSON(response.body)\n normalize_hash(hash)\n end\n rescue JSON::ParserError => e\n raise(ConnectionError.new(request, response, \"Invalid json response: #{e.body}\"))\n end\n end", "def process_response(response)\n case response\n when Net::HTTPFound, Net::HTTPCreated\n response['Location']\n when Net::HTTPConflict\n raise URLConflict\n when Net::HTTPNotAcceptable\n raise URLFormatError\n else\n raise InvalidResponse.new(\"Invalid Shorty Response Code: #{response.code} #{response.message}\")\n end\n end", "def response_to(input)\nend" ]
[ "0.74769324", "0.74769324", "0.69911903", "0.69911903", "0.6476617", "0.64216244", "0.6421063", "0.6359647", "0.6281708", "0.61874574", "0.6095895", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.6092627", "0.60866064", "0.6079291", "0.6028496", "0.6024624", "0.5989107", "0.5941685", "0.594019", "0.5839098", "0.583578", "0.58114016", "0.5796249", "0.57842255", "0.5779645", "0.5775821", "0.5775696", "0.57697624", "0.57675534", "0.5727933", "0.57099015", "0.5701681", "0.5701062", "0.5661023", "0.5654803", "0.5621671", "0.56170636", "0.561508", "0.5589396", "0.5588543", "0.55873317", "0.55747885", "0.55744153", "0.5571452", "0.5546386", "0.55263555", "0.55229664", "0.5516894", "0.54935", "0.5484025", "0.54757106", "0.54755247", "0.5469144", "0.5459616", "0.5443033", "0.5435807", "0.54337704", "0.5420304", "0.54178554", "0.54160887", "0.5414244", "0.54092616", "0.5408674", "0.5406175", "0.54031646", "0.54017794", "0.53903884", "0.5388729", "0.5384479", "0.5384479", "0.5384479", "0.5384479", "0.5379922", "0.53753835", "0.53753835", "0.5374858", "0.5364942", "0.5364942", "0.53648454", "0.5353028", "0.53345674", "0.5323139", "0.5314054", "0.5312141", "0.5304465", "0.53007007", "0.5299116", "0.5295751" ]
0.6798185
4
Use callbacks to share common setup or constraints between actions.
def set_annotation @annotation = Annotation.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 annotation_params params.require(:annotation).permit(:body) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
input = two arguments, a positive integer representing salary, and a boolean output = an integer representing bonus for salary rules: if boolean == true, bonus is half of salary if boolean == false, bonus is 0 test cases: what if salary is 0 and boolean is true? what if salary is an odd number, should integer or float division be used? => float logic if condition to check value of boolean IF true, return salary.to_f / 2 ELSE false, return 0 def calculate_bonus(salary, boolean) if boolean return salary.to_f / 2 else return 0 end end refactor for brevity using ternary operator
def calculate_bonus(salary, boolean) boolean ? (salary.to_f / 2) : 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_bonus(salary, boolean)\n return salary / 2 if boolean == true \n return 0 if boolean == false\nend", "def calculate_bonus(salary, boolean)\n boolean ? (salary/2.0) : 0\nend", "def calculate_bonus(salary,boolean)\n \n if boolean == true\n return (salary / 2) \n else\n return 0\n end\n \nend", "def calculate_bonus(salary, bonus)\n if bonus == true\n salary / 2\n elsif bonus == false\n 0\n end\nend", "def calculate_bonus(salary, bool)\n bool ? (salary / 2) : 0\nend", "def calculate_bonus(salary, bonus)\n if bonus == true\n salary / 2\n else\n 0\n end\nend", "def calculate_bonus(salary, bonus)\n if bonus == true\n salary / 2\n else\n 0\n end\nend", "def bonus(salary, boolean)\n case boolean\n when true then bonus = salary / 2\n else bonus = 0\n end\n bonus\nend", "def calculate_bonus(salary, bonus)\n bonus_amount = 0\n if bonus == true\n bonus_amount = salary / 2\n else\n bonus_amount\n end\nend", "def calculate_bonus(salary, bonus)\n bonus == true ? salary * 0.5 : 0\nend", "def calculate_bonus(salary, bonus = true)\n if bonus == true\n bonus_amount = salary / 2\n else\n bonus_amount = 0\n end\n bonus_amount\nend", "def calculate_bonus(salary, bonus)\n bonus ? (salary / 2) : 0\nend", "def calculate_bonus(salary, bonus)\n bonus ? (salary / 2) : 0\nend", "def calculate_bonus(salary, bonus)\n bonus ? (salary / 2) : 0\nend", "def calculate_bonus(salary, bonus)\n bonus ? (salary / 2) : 0\nend", "def calculate_bonus(salary, bonus)\n bonus ? (salary / 2) : 0\nend", "def calculate_bonus(salary, bonus)\n bonus ? (salary / 2) : 0 \nend", "def calculate_bonus(salary, bonus)\n bonus ? salary / 2 : 0\nend", "def calculate_bonus(salary, bonus)\n bonus ? salary / 2 : 0\nend", "def calculate_bonus(salary, bonus)\n bonus ? salary / 2 : 0\nend", "def calculate_bonus(integer, boolean)\n if boolean == true\n integer / 2\n elsif boolean == false\n 0\n end\nend", "def calculate_bonus(salary, bonus)\n bonus ? salary / 2.0 : 0\nend", "def calculate_bonus(integer, boolean)\n boolean ? integer / 2.0 : 0\nend", "def calculate_bonus(integer, boolean)\n boolean == true ? integer / 2 : 0\nend", "def calculate_bonus(integer, bool)\n if bool\n integer / 2\n else\n 0\n end\nend", "def calculate_bonus(salary, bonus_bol)\n bonus_bol ? salary / 2 : 0\nend", "def calculate_bonus(num, boolean)\n boolean == true ? num / 2 : 0\nend", "def calculate_bonus(num, boolean_value)\n if boolean_value == true\n num / 2\n else \n 0\n end\nend", "def calculate_bonus(num, boolean)\n if boolean\n num / 2\n else\n num * 0\n end\nend", "def calculate_bonus(int, boolean)\n boolean ? int / 2 : 0\nend", "def calculate_bonus(num, boolean)\n boolean ? num / 2 : 0\nend", "def calculate_bonus(integer, boolean)\n boolean ? ((50 * integer)/100) : 0\nend", "def calculate_bonus(number, boolean)\n boolean ? number / 2 : 0\nend", "def calculate_bonus(salary, bonus)\n bonus ? (salary.to_f / 2).round(2) : 0\nend", "def calculate_bonus(salary, gets_bonus) \n bonus = 0\n bonus = salary / 2 if gets_bonus\n bonus\nend", "def calculate_bonus(salary, t_or_f)\n t_or_f ? salary / 2 : 0\nend", "def calculate_bonus(salary, gets_bonus = true)\n gets_bonus ? add_commas_to_integer(salary / 2) : 0\nend", "def calculate_bonus(salary, bonus)\n \n return salary / 2 if bonus\n 0\nend", "def bonus integer, boolean\n boolean == true ? (integer / 2.0) : 0\nend", "def calculate_bonus(salary, eligible)\n bonus = if eligible\n salary / 2\n else\n 0\n end\nend", "def calculate_bonus(integer,boolean)\n boolean == true ? integer * 0.5 : 0\nend", "def calculate_bonus(salary, give_bonus)\n return 0 unless give_bonus\n\n salary / 2\nend", "def calculate_bonus(amount, bonus)\n bonus ? amount / 2 : 0\nend", "def gross_salary(salary, bonus)\n bonus == true ? (salary += (salary*0.5)).to_i : salary.to_i\nend", "def bonus(i, boolean=false)\n return 0 unless boolean\n i / 2\nend", "def method(salary, eligible)\n eligible ? salary / 2 : 0\nend", "def calculate_bonus(int, bonus)\n if bonus\n p int / 2\n else\n p 0\n end\nend", "def calculate_bonus(num,pay)\n if pay; return num /2 else return 0 end\nend", "def bonus_time(salary, bonus)\n salary = (salary*10).to_i if bonus == true\n \"$#{salary}\"\nend", "def bonus_time(salary, bonus)\n bonus == true ? \"$#{salary *= 10}\" : \"$#{salary}\"\nend", "def bonus_time(salary, bonus)\n format(\"$%d\", bonus ? salary * 10 : salary)\nend", "def provide_mortgage_2?(salary, deposit, property_value) \n loan_amount = property_value - deposit\n min_deposit = property_value >= 650_000 ? 0.2 : 0.05 # ternary operator: expr ? value_if_true : value_if_false\n max_multiplier = 5 # how many annual incomes can be borrowed\n deposit >= property_value * min_deposit && salary * max_multiplier >= loan_amount\nend", "def bonus_time(salary, bonus)\n bonus ? \"$#{(salary*10).to_s}\" : \"$#{salary.to_s}\"\nend", "def bonus(multiplier)\n self.total_subsalary * multiplier\n end", "def provide_mortgage_2?(salary, deposit, property_value)\n loan_amount = property_value - deposit\n property_value >= 650000 ? min_deposit = 0.2 : min_deposit = 0.05 # 20%\n max_multiplier = 5 # how many annual incomes can be borrowed\n deposit >= property_value * min_deposit && \n salary * max_multiplier >= loan_amount\nend", "def provide_mortgage_4?(salary, deposit, property_value, bankrupt)\n loan_amount = property_value - deposit\n property_value >= 650000 ? min_deposit = 0.2 : min_deposit = 0.05 # 20%\n max_multiplier = 5 # how many annual incomes can be borrowed\n !bankrupt && deposit >= property_value * min_deposit && \n (salary * max_multiplier >= loan_amount || deposit >= property_value * 0.75)\nend", "def provide_mortgage_3?(salary, deposit, property_value)\n loan_amount = property_value - deposit\n property_value >= 650000 ? min_deposit = 0.2 : min_deposit = 0.05 # 20%\n max_multiplier = 5 # how many annual incomes can be borrowed\n deposit >= property_value * min_deposit && \n (salary * max_multiplier >= loan_amount || deposit >= property_value * 0.75)\nend", "def add_bonus(score, inspect_value, bonus_value = 5)\n if score > 0 && inspect_value == '1'\n return (bonus_value)\n end\n return 0\nend", "def provide_mortgage_3?(salary, deposit, property_value)\n loan_amount = property_value - deposit\n min_deposit = property_value >= 650_000 ? 0.2 : 0.05\n max_multiplier = 5 # how many annual income can be borrowed\n deposit >= property_value * min_deposit && (salary * max_multiplier >= loan_amount || deposit >= property_value * 0.75)\nend", "def provide_mortgage_4?(salary, deposit, property_value, bankrupt)\n return false if bankrupt\n loan_amount = property_value - deposit\n min_deposit = property_value >= 650_000 ? 0.2 : 0.05\n max_multiplier = 5 # how many annual income can be borrowed\n deposit >= property_value * min_deposit && (salary * max_multiplier >= loan_amount || deposit >= property_value * 0.75)\nend", "def bonus(multiplier)\n bonus = 0\n\n employees.each do |employee|\n bonus += (employee.salary) * multiplier\n if employee.is_a?(Manager)\n bonus += employee.bonus(multiplier)\n end\n end\n bonus\n end", "def paid?(amt)\n # Predicate methods should always return\n # true or false.\n amt.to_i > 0\nend", "def test_if_qualify(current_salary, monthly_payment)\n\tmonthly_salary = current_salary / 12\n\ttimes_greater = monthly_salary / monthly_payment\n\tif times_greater >= 2 \n\t\tanswer = true \n\telse\n\t\tanswer = false \n\tend\n\treturn answer\nend", "def is_discounted? #? means will return t/f \n price < 200\nend", "def bonus multiplier\n employee_salary = @underlings.reduce(0){|sum, employee|\n sum + employee.salary + (employee.class == Manager ? employee.sum_of_underlings : 0)\n }\n employee_salary * multiplier\n end", "def valid_salary(salary)\n salary > 0 && salary.to_s.to_i == salary\nend", "def calc_bottles(spend_amt)\n spend_amt.to_i/2\nend", "def is_discounted?\n discounted = false\n discounted = true if price.to_i < 10\n discounted\n end", "def probability (user_age, year_born, garlic_bread, insurance)\n if user_age <= 120 && year_born >= 1897 && garlic_bread == \"yes\" && insurance == \"yes\"\n p \"Probably not a vampire.\"\n elsif user_age >= 120 && year_born <= 1897 && (garlic_bread == \"no\" || insurance == \"no\")\n p \"Probably a vampire\"\n elsif user_age >= 120 && year_born <= 1897 && garlic_bread == \"no\" && insurance == \"no\"\n p \"Almost certainly a vampire\"\n else\n p \"Results inconclusive\"\n end\nend", "def movie_ticket_price(age, is_vip: false, is_wednesday: false)\n return price = 6.0 if is_wednesday\n return price = 7.5 if is_vip\n return price = 8.0 if age <= 12\n return price = 9.0 if age >= 60\n price = 12.00\nend", "def ternary(statement, true_result, false_result)\n statement && true_result || false_result\nend", "def disbursement_factor\n approved_amount == 0 ? 0 : disbursed_amount / approved_amount.to_f\n end", "def discounted?\n if price.to_f < 1000\n # return true\n # else\n # return false\n # end\n end\n end", "def is_discounted?\n price.to_f <= 2\n end", "def loan_calc(loan_amount,interest_rate,loan_term,loan_type)\n if loan_type.downcase == \"pi\"\n r = interest_rate/12\n n = loan_term*12\n d = ( ( ( (1+r)**n) - 1) / (r*(1+r)**n))\n result = loan_amount/d\n\n elsif loan_type.downcase == \"io\"\n r = interest_rate/12\n result = loan_amount * r\n end #end if\nend", "def calculate(t, fraud, type)\r\n#\t\tpp \"1\"\r\n\t\treturn 0.0 if type == 'billable' && self.bid_fee #if this fee is a bid fee and we are not looking at the bid fees then return 0, else continue on\r\n\t#\tpp \"2\"\r\n \t\r\n \tfee = self.fixed if self.price_type == 'F'\r\n \r\n fee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) if self.price_type == 'V' #calculate the fee\r\n \r\n return fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\r\n\t\t#if we get here we know we are dealing with a variable fee\r\n\t\t#puts (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min)\r\n\t#\tfee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) #calculate the fee\r\n\t#\tpp fee\r\n\t#\tpp \"3\"\r\n\t#\treturn fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\t\r\n\t\t#otherwise we need to determine the sign and threshold before we can return\r\n\t\tcase self.sign\r\n\t\t\twhen '>'\r\n\t\t\t #pp \">\"\r\n\t\t\t\treturn fee if t.amount > self.threshold\r\n\t\t\twhen '>='\r\n\t\t\t #pp \">=\"\r\n\t\t\t\treturn fee if t.amount >= self.threshold\r\n\t\t\twhen '<'\r\n\t\t\t #pp \"<\"\r\n\t\t\t\treturn fee if t.amount < self.threshold\r\n\t\t\twhen '<='\r\n\t\t\t #pp \"<=\"\r\n\t\t\t\treturn fee if t.amount <= self.threshold\r\n\t\t\telse\r\n\t\t\t #pp \"4\"\r\n\t\t\t\treturn 0.0\r\n\t\tend\r\n\t\t\r\n\t\t#if we get here then we have no idea what to do so just return 0\r\n\t\treturn 0.0\r\n\tend", "def getBonus\r\n @bonus = super.getSalario / (2*100)\r\n end", "def calc_am_flower_gift(user, target)\n $env.sunny? ? 1.5 : 1\n end", "def fow_bonus(unit)\n return 0\n end", "def speed_of_spread #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n # speed = 0.0\n speed = if @population_density >= 200\n 0.5\n elsif @population_density >= 150\n 1\n elsif @population_density >= 100\n 1.5\n elsif @population_density >= 50\n 2\n else\n 2.5\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\nend", "def age_num_conditional(age, sum, name, fav1, fav2, fav3) \r\n if age > sum\r\n \t\t\"Your age of #{age} is greater than #{sum}, Which is the sum of your favorite numbers.\"\r\n \telse \r\n \t\t\"Your age of #{age} is less than #{sum}, Which is the sum of your favorite numbers.\"\r\n\tend \r\nend", "def speed_of_spread #(population_density, state) #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n speed = 0.0\n\n if @population_density >= 200\n speed += 0.5\n elsif @population_density >= 150\n speed += 1\n elsif @population_density >= 100\n speed += 1.5\n elsif @population_density >= 50\n speed += 2\n else\n speed += 2.5\n end\n\n if @population_density\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end\n\nend", "def bmi\n\n print \"Enter your weight and height to calculate: \"\n\n weight = gets.chomp.to_f\n height = gets.chomp.to_f\n\n result = weight / (height * height)\n puts \"Your BMI is #{result}\"\n\n # if bmi < 18.5\n # puts \"underweight\"\n # elsif bmi >= 18.5 && bmi < 25.0\n # puts \"perfect\"\n # elsif bmi >= 25.0 && bmi < 30.0\n # puts \"overweight\"\n # else\n # puts \"tubby\"\n # end\nend", "def extra_cash(db, user_name)\r\n\t# determine extra monies (conditional on + amount)\r\n\tdifference = (current_income(db, user_name) - current_expenses(db, user_name))\r\n\tcache_bonus = difference if difference > 0 || 0\r\nend", "def salary_set?\n self.annual_salary != nil || self.hourly_rate != nil\n end", "def drink_milk(thirsty = true)\n return \"I am not thirsty\" if thirsty == false\nend", "def healthy? (tablespoons_of_butter, butter_calories = 102)\n (tablespoons_of_butter * butter_calories) < 75\nend", "def calculate_fee\n cost = (shooter.current_member? or join_psac) ? 15 : 20\n has_shooter = persisted? ? match.has_more_than_one_shooter?(shooter) : match.has_shooter?(shooter)\n if has_shooter\n cost = 3\n self.squad = 5\n end\n if join_psac\n cost += 30\n end\n self.fee = cost\n end", "def dog_age(age)\r\n if age <= 2\r\n return age * 10.5\r\n else\r\n return 21 + (age - 2) * 4\r\n end\r\nend", "def serve_drink(age, onBreak)\n if ((age >= 18) && (onBreak == false))\n return true\n else\n return false\n end\nend", "def speed_of_spread #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n # speed = 0.0\n speed = if @population_density >= 200\n 0.5\n elsif @population_density >= 150\n 1\n elsif @population_density >= 100\n 1.5\n elsif @population_density >= 50\n 2\n else\n 2.5\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\nend", "def fee\n (amount * 0.005) if amount\n end", "def bool_to_i(b)\n (b) ? 1 : 0\nend", "def discount100(bill)\n\t\tif bill>100\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "def defense_bonus(lv)\n (80 * 3 * lv.to_f / 2 + 250) / 100 + 5\n end", "def is_it_a_baby(age)\n age < 2 ? \"baby\" : \"not a baby\"\nend", "def speed_of_spread\n more_dense = @population_density >= 200\n dense = @population_density >= 150\n medium_dense = @population_density >= 100\n low_dense = @population_density >= 50#in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n speed = 0.0\n\n # if @population_density >= 200\n # speed += 0.5\n # elsif @population_density >= 150\n # speed += 1\n # elsif @population_density >= 100\n # speed += 1.5\n # elsif @population_density >= 50\n # speed += 2\n # else\n # speed += 2.5\n # end\n\n if more_dense\n speed += 0.5\n elsif dense\n speed += 1\n elsif medium_dense\n speed += 1.5\n elsif low_dense\n speed += 2\n else\n speed += 2.5\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end", "def assess_situation(danger_level, save_the_day, bad_excuse)\n if danger_level > 50\n p bad_excuse\n elsif danger_level > 10 && danger_level < 50\n p save_the_day\n else\n p \"Meh. Hard pass.\"\n end\nend", "def speed_of_spread #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n speed = 0.0\n# when @population_density += 50 then\n# speed -= 0.5\n#this is what I feel would work in some way, I just can't figure out the syntax\n\n if @population_density >= 200\n speed += 0.5\n elsif @population_density >= 150\n speed += 1\n elsif @population_density >= 100\n speed += 1.5\n elsif @population_density >= 50\n speed += 2\n else\n speed += 2.5\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end", "def natural_bonus\n 0\n end" ]
[ "0.91724765", "0.9143219", "0.9095274", "0.90872914", "0.9069101", "0.89350736", "0.89265174", "0.8810697", "0.8810228", "0.86985445", "0.85585463", "0.8485025", "0.8485025", "0.8485025", "0.8485025", "0.8485025", "0.84756905", "0.84292835", "0.84292835", "0.84292835", "0.84241974", "0.84132177", "0.84073716", "0.84069216", "0.84043545", "0.8386204", "0.8355411", "0.83396876", "0.8322901", "0.8304279", "0.82699496", "0.82583", "0.82444715", "0.82288206", "0.8169315", "0.8157287", "0.8156372", "0.8155986", "0.8031763", "0.80276436", "0.800644", "0.79834837", "0.7775539", "0.76121414", "0.74161524", "0.7341619", "0.720163", "0.70653105", "0.67939085", "0.66680384", "0.6456225", "0.6439319", "0.61788154", "0.60857975", "0.59186727", "0.57974136", "0.57881236", "0.5758418", "0.5713689", "0.5666445", "0.55891633", "0.5559743", "0.55370384", "0.54808056", "0.5471043", "0.5427801", "0.54012686", "0.53915685", "0.5387066", "0.53802025", "0.53649896", "0.5353667", "0.5321977", "0.53183013", "0.5312989", "0.5301165", "0.5297877", "0.5238394", "0.5230849", "0.522194", "0.5221885", "0.52133596", "0.5209983", "0.5209543", "0.51879483", "0.51785785", "0.5174632", "0.5168224", "0.5168042", "0.5158203", "0.514987", "0.51398474", "0.51358885", "0.5131083", "0.51242316", "0.51194555", "0.51037234", "0.50955975", "0.50886273", "0.5085609" ]
0.91687465
1
1131 => 211311 [2 1's][1 1's][1 3's][1 1's] repeat RLE in other terms
def digitcount(num) # Convert the number into an array, 1131 -> [1,1,3,1] so we can iterate through digits = num.to_s.chars.map(&:to_i) # Track the count of seen numbers count = 0 # Track the n-1 array value prev = nil # The resulting string result = '' # For each digit digits.each do |d| if prev == d # If it's the same number as we've seen before we should inc the counter count += 1 else # This isn't a match, so output the previous count and number, reset the counter and carry on result += count.to_s + prev.to_s if count > 0 count = 1 end # In the next loop iteration the previous is the current digit prev = d end # Return the result, don't forget the last digit we inspected return result += count.to_s + prev.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def luhns(a)\n\tb = a.to_s[0..-2].reverse.split(\"\").to_a.map{|v|v.to_i}\n\t(b.each_index{|i|i.even? ? b[i]=b[i]*2>9?b[i]*2-9:b[i]*2:i=i}.inject(:+)+a)%10==0\nend", "def letra_x(n)\n result = \"\" \n t = n-1\n (n).times do |i| \n n.times do |b| \n if t == b \n result += \"*\"\n elsif i == b\n result += \"*\"\n else\n result += \" \"\n end\n end \n t -= 1 \n result += \"\\n\"\n end\n result\nend", "def lexi(*args)\n digits = Array.new\n args.each { |x|\n digits << x\n }\n n = digits.length\n perms = Array.new\n i = 0\n n.times do\n perm = Array.new(n, 0)\n perm[0] = digits[i]\n j = 1\n i = j\n (n - j).times do\n perm[j] = digits[i]\n i += 1\n end\n i += 1\n perms << perm\n end\n perms\nend", "def lychrel(num)\n\n\tchain = num + num.to_s.reverse.to_i \t# define first number in the chain potentially leading to a palindrome\n\titer = 1\t\t# Define number of iterations variable\n\n\twhile chain.to_s != chain.to_s.reverse && iter <= 50\n\t\titer += 1\n\t\tchain = chain + chain.to_s.reverse.to_i\n\tend\n\n\tif iter > 50\n\t\treturn \"Lychrel\"\n\telse\n\t\treturn iter\n\tend\n\nend", "def rle(s)\n counts = []\n\n cur_char = ''\n cur_char_count = 0\n out = ''\n\n s.each_char do |c|\n if cur_char == ''\n cur_char = c\n cur_char_count = 1\n\n elsif cur_char == c\n cur_char_count += 1\n\n elsif cur_char != c\n counts.push('%s%s' % [cur_char_count, cur_char])\n cur_char = c\n cur_char_count = 1\n end\n end\n\n # Add remaining.\n counts.push('%s%s' % [cur_char_count, cur_char])\n\n out = counts.join('')\n\n return out\n\nend", "def ln_rek(x,n)\r\n\r\nend", "def busqueda6\n 9899.step(999999999999999999999,9899){|x|break (x) unless (p x).to_s =~ /[^0-2]/}\nend", "def letra_i(n)\n result = \"\"\n n.times do |i|\n if i == 0 || i == n-1\n n.times {result += \"*\"} \n else\n n.times do |b|\n if (n-1)/2 == b\n result += \"*\"\n else\n result += \" \"\n end\n end\n end \n result += \"\\n\" \n end \n result\nend", "def solve_zero_vs_six_vs_nine\n return if @arr[1].nil? || @arr[4].nil?\n\n #p \"1,4: #{@arr[1]},#{@arr[4]}\"\n\n @words.filter{|x| x.length == 6 && @hash[x].nil?}.each{|w|\n if @arr[4].chars.all?{|c| w.chars.include?(c)}\n solved(9, w)\n elsif @arr[1].chars.all?{|c2| w.chars.include?(c2)}\n solved(0, w)\n else\n solved(6, w)\n end\n }\n end", "def lexicograph(n)\n\tputs \"lexicograph(#{n})\"\n\tif n == 0\n\t\treturn [\"0\"]\n\tend\n\tresult = []\n\tprevious_ordering = lexicograph(n-1)\n\t0.upto(n) do |k|\n\t\t# puts \"k: #{k}\"\n\t\tprevious_ordering.each do |perm|\n\t\t\t# puts \"perm: #{perm}\"\n\t\t\tval = perm.clone\n\t\t\t(n-1).downto(k) do |i|\n\t\t\t\t# puts \"i: #{i}\"\n\t\t\t\tval.gsub!(i.to_s, (i+1).to_s)\n\t\t\tend\n\t\t\tresult << k.to_s + val\n\t\tend\n\tend\n\tputs \"returning #{n}\"\n\treturn result\nend", "def cracklepop1\n def aux x\n /[A-Z]+/i.match(x.to_s).to_s\n end\n (1..100).map do |i|\n x = i%3==0 ? 'crackle' : i\n i%5==0 ? (aux(x)+'pop') : x\n end\nend", "def Lexicographic(myString)\n\n origArray = myString.split(//)\n newArr = origArray.permutation.to_a\n counter = 1\n newArr.each do |x|\n if counter == 1000000\n print counter, \"--> \", x.join, \"\\n\"\n break\n else\n counter = counter + 1\n end\n end\nend", "def digit_replacement_cycle(n)\n return 0 unless prime?(n)\n s = n.to_s\n s.chars.uniq.map do |d|\n digit_replacement_cycle_length(s.gsub(d, \"*\"))\n end.max\n end", "def eureka(num)\n num_arr = num.to_s.split('').collect{ |x| x.to_i }\n i = 0\n num1 = num_arr.reverse\n result1 = 0\n result2 = 0\n while i < num_arr.length\n result1 += num1[i] * (10 ** i)\n result2 += num_arr[i] ** (i + 1)\n i += 1\n end\n result1 == result2\n end", "def letra_z(n)\n result = \"\"\n t = n-1\n n.times do |i| \n if i == 0 || i == n-1\n n.times {result += \"*\"} \n else \n n.times do |b| \n if t == b\n result += \"*\"\n else\n result += \" \"\n end\n end\n end \n t -= 1 \n result += \"\\n\" \n end \n result\nend", "def rotn(n, word)\n n.times do\n word.tr!('abcdefghijklmnopqrstuvwxyz',\n 'bcdefghijklmnopqrstuvwxyza')\n end\n word\nend", "def ordv\n large = Array.new([0,0,0,0,0,0,0,0,0,1])\n (1..7830457).each do |n|# digit represents ,2^n\n passover = 0\n 9.downto(0).each do |i|\n large[i] *= 2\n large[i] += passover\n if large[i] >= 10\n large[i] %= 10\n passover = 1\n else\n passover = 0\n end\n end\n end\n (28433 * large.join.to_i + 1)%100000000000\nend", "def nsrch(s,g)\n orig_s = s\n ss = s.to_s 2\n gs = g.to_s 2\n ops = []\n bits = gs.split(//)\n i = 0\n # Go through all bits of g.\n # If there are ones in the trailing part of ss, we\n # must get rid of them (Otherwise: 1001 -> 100, all digits match,\n # jump out of loop, make length equal by >>. Oops, it was an odd\n # number we just halved. So must check for ones.)\n while i < bits.size or ss[bits.size..-1].include? ?1\n b = bits[i]\n op = nil\n n = 0\n while ss[i,1] != b\n # Add zeroes to right to make length right and\n # to get the rightmost bit into an editable state.\n if ss.size < i+2 or s[0] == 1\n op = :*\n # Delete zeroes from right to make length right.\n elsif ss.size > i+2 and (s[0] == 0 and s[1] == 0)\n op = :/\n # Add 2 if length is ok and there are no zeroes to take out.\n # We are here because the second right-most bit is wrong.\n # Adding 2 flips it. It may also flip every bit we've just\n # went through, invalidating the invariant and thus we reset\n # the bit counter.\n else\n op = :+\n i = 0\n end\n ops << op\n s = case op\n when :+\n s + 2\n when :*\n s << 1\n when :/\n s >> 1\n end\n ss = s.to_s 2\n break if op == :+ # invariant may be bad,\n # must check before continuing\n end\n i += 1 unless op == :+\n end\n # take out extra zeroes on right\n r = s >> (ss.size-gs.size)\n ops.push *[:/]*(ss.size-gs.size)\n # and collect middle states using done ops\n a = [orig_s]\n ops.each{|op|\n a << case op\n when :*\n a.last * 2\n when :/\n a.last / 2\n when :+\n a.last + 2\n end\n }\n a\nend", "def modified_run_length_encode\n self.run_length_encode.inject([]) do |array, current|\n array << current if current[0] > 1\n array << current[-1] if current[0] == 1\n array\n end\n end", "def recursive_terms(n)\n all_ns << n\n # if we get 1111\n # we have 1111 and should then get 211 and then 31 and then 4\n # then continue from 1111 to 121 then 13\n # then continue from 1111 to 112\n # to find these terms, find the \n next_ns = convert_n_to_next_terms(n)\n next_ns.each do |next_n|\n all_ns << recursive_terms(next_n)\n end\n return all_ns.flatten.uniq\nend", "def english_number original_number\r\n current_number = original_number\r\n exploded_number = []\r\n # Convert number into an array of multiples of base units\r\n CONVERSIONS.each do |base_pair|\r\n if current_number >= base_pair[:number] * 2\r\n # Enter the multiple and the base unit as elements if necessary\r\n exploded_number << current_number / base_pair[:number]\r\n exploded_number << base_pair\r\n current_number %= base_pair[:number]\r\n elsif current_number >= base_pair[:number]\r\n # Enter just the base unit if there's no integer multiple\r\n exploded_number << base_pair\r\n current_number %= base_pair[:number]\r\n end\r\n # Otherwise enter nothing\r\n end\r\n # Eg array [{1000000}, 507, {1000}, 5, 100, 30, 7]\r\n # Reduce array to an English translation\r\n english_result = exploded_number.reduce([\"\",:start]) { |text_string, base_pair|\r\n # Add a space unless it's the start of the string\r\n text_string[0] += ' ' unless text_string[1] == :start\r\n # Convert current number to English if it's a multiple\r\n if base_pair.class == Integer\r\n text_string[0] += english_number(base_pair)\r\n text_string[1] = :multiple\r\n elsif base_pair[:number] >= ONE_PREFIX_BOUNDARY\r\n # Otherwise, if it's >= 100 and preceding unit is not a multiple add 'one'\r\n text_string[0] += 'one ' unless text_string[1] == :multiple\r\n text_string[0] += base_pair[:name]\r\n text_string[1] = :above_boundary\r\n else\r\n # Otherwise, if it's <100 and transitioning from >=100, add 'and'\r\n text_string[0] += 'and ' if text_string[1] == :above_boundary\r\n text_string[0] += base_pair[:name]\r\n text_string[1] = :below_boundary\r\n end\r\n text_string\r\n }[0]\r\n return english_result\r\nend", "def rpn_calculator(str)\nend", "def newman_conway(terms)\n raise ArgumentError if terms < 1\n\n solutions = [nil]\n\n (1..terms).each do |n|\n if n < 3\n solutions << 1\n else\n solutions << (solutions[solutions[n - 1]] + solutions[n - solutions[n - 1]])\n end\n end\n\n solutions.shift\n return solutions.join(\" \")\nend", "def construct(w)\n @word = \"~#{w}\" # Assimilate!\n @length = @word.length - 1 # Do not count the ~.\n @back = Array.new\n @back << 0 \n @back << 0\n s = 0\n (2..@length).each do |i|\n s = step(s,@word[i - 1])\n @back << s\n end\n end", "def lex_permutation(n, digits)\n fact = factorial(digits.size-1)\n lead_digit = n / fact\n count = lead_digit * fact\n perms = (digits - [lead_digit]).permutation.to_a\n ([lead_digit] + perms[n - count - 1]).join\nend", "def maxXor(arr, queries)\n # solve here\n # build a trie with each element of arr as leaf\n # binary tree left = \"0\", right = \"1\"\n # 30 levels\n trie_root = TrieNode.new\n arr.each do |x|\n p = trie_root\n xb = '%030b' % x\n xb.each_char do |bit|\n if bit == \"0\"\n # go left\n if p.left\n p = p.left\n else\n nn = TrieNode.new\n p.left = nn\n p = p.left\n end\n else\n # go right\n if p.right\n p = p.right\n else\n nn = TrieNode.new\n p.right = nn\n p = p.right\n end\n end\n end\n end\n ans_seq = []\n queries.each do |q|\n # walk down the trie to leaf\n leaf = \"\"\n p = trie_root\n qb = '%030b' % q\n qb.each_char do |bit|\n # prefer opposite of bit\n if bit == \"0\"\n # try go right (\"1\")\n if p.right\n p = p.right\n leaf << \"1\"\n else\n p = p.left\n leaf << \"0\" \n end\n else\n # try to go left (\"0\")\n if p.left\n p = p.left\n leaf << \"0\"\n else\n p = p.right\n leaf << \"1\"\n end\n end\n end\n a = leaf.to_i(2)\n ans_seq << (a^q)\n end\n return ans_seq\nend", "def repeater(word)\n word.chars.map { |char| char * 2 }.join\nend", "def f_1_4tel_rek(n)\r\n if !n.integer? || n < 1\r\n return false\r\n end\r\n\r\n def end_rek(i, s)\r\n if i > 0\r\n end_rek(i - 1, (1.0 / (i * (i + 1.0) * (i + 2.0))) + s)\r\n else\r\n return s\r\n end\r\n end\r\n return end_rek(n, 0)\r\nend", "def lucas_sequence(len)\nend", "def lychrel?(n, count = 0)\n return true if count == 50\n n += n.to_s.reverse.to_i\n n.to_s == n.to_s.reverse ? false : lychrel?(n, count+1)\nend", "def nbits_palindrome(n)\n return Array(0..9).map(&:to_s) if n == 1\n return ['00', 11, 22, 33, 44, 55, 66, 77, 88, 99].map(&:to_s) if n == 2\n\n res = []\n Array(0..9).each do |i|\n nbits_palindrome(n - 2).each do |m|\n res << i.to_s + m + i.to_s\n end\n end\n res\nend", "def look_and_say(n)\n prev = \"1\"\n curr = \"\"\n\n while(n > 1)\n i = 0\n\n while(i < prev.length)\n\n char = prev[i]\n count = count_digits(i, prev)\n i += count\n\n curr << count.to_s << char\n end\n\n prev = curr.dup\n curr = \"\"\n n -= 1\n end\n\n prev\nend", "def palindrome_chain_length(n)\r\n p new_n = n.digits.join.to_i\r\n\r\n if n.to_s.length == 1\r\n p 0\r\n else\r\n while new_n.to_s.reverse != new_n.to_s\r\n count = 0\r\n p new_n = n + new_n\r\n count +=1\r\n end\r\n end\r\n p count\r\nend", "def to_rpn(tokens, rpn)\n (OPERATORS.keys + [/\\\\(\\w+)/, /(^[-=^~|@`+;*:<.>?!%&_]+$)/]).each do |pattern|\n idx, ope = if pattern.is_a? Regexp\n idx = tokens.index{|token| (token.is_a? String) && (m = pattern.match(token)) }\n [ idx, idx && $~[1] ]\n else\n [ tokens.index(pattern), pattern ]\n end\n if idx\n to_rpn(tokens[0...idx], rpn)\n to_rpn(tokens[(idx + 1)...tokens.size], rpn)\n rpn << ope\n return\n end\n end\n rpn << tokens[0]\n end", "def make_hundred\n arr = [\"+\", \"-\", \"\"].repeated_permutation(8).to_a.map do |operators|\n ((1..9).to_a).zip(operators).flatten.compact\n end.map(&:join).select {|x| eval(x) == 100}\nend", "def solve(s)\n answer = \"\"\n arr = s.split('')\n hash = Hash.new(0)\n arr.each_with_index do |el, idx|\n if el.to_i >= 1\n if arr[idx + 1] == \"(\"\n el.to_i.times do \n if arr[idx + 2].to_i >= 1\n if arr[idx + 3] == \"(\"\n arr[idx + 2].to_i.times do \n answer += (arr[(idx + 4)...arr.index(\")\")].join(''))\n end\n end\n end\n answer += (arr[(idx + 2)...arr.index(\")\")].join(''))\n end\n \n # hash[arr[idx + 1]] += 1\n end\n end\n \n end\n return answer\nend", "def validate(n)\nl = n.to_s.length\ni = 0\nsplit = n.to_s.reverse.split(//).map!{|x|x.to_i}\ndestination = []\n l.times do\n if i.odd?\n if split[i] * 2 <= 9\n destination << split[i] * 2\n else\n destination << (split[i] * 2 - 9)\n end\n else \n destination << split[i] \n end\n i += 1\n end\n p destination\n if destination.reduce(:+) %10 == 0\n true\n else\n false\n end\nend", "def game_of_thrones string\n s1 = string.chars\n freq = Hash.new(0)\n count = 0\n\n s1.each{ |key| freq[key]+=1 }\n\n freq.each{ |k,v| count+=1 if v.odd? }\n\n puts count < 2 ? 'YES' : 'NO'\n \nend", "def euler29(n)\n terms = []\n 2.upto(n) do |i|\n 2.upto(n) do |j|\n if terms.include?(i ** j) == false\n terms << i ** j\n end\n end\n end\n \n terms.length\nend", "def simple_code(digits, stops = [1,2,3])\n stopre = /#{\"[#{stops}]\" if stops}/\n mkpool(digits, stops).reverse.inject(\"\") do |s,e| \n s =~ /#{e[0..-2]}#{stopre.source}/ ? s : s << e \n end\nend", "def pattern_repeat(n)\n last = [1, 1]\n counter = 0\n loop do\n last = [last.last, (last.first + last.last) % 10]\n break p \"#{counter}\" if last == [1, 1]\n counter += 1\n end\nend", "def triangular_word?(str)\n alpha = ('a'..'z').to_a\n sum = 0\n\n str.each_char do |char|\n sum += alpha.index(char) + 1\n end\n\n #tri_num = 1\n i = 1\n\n while i * (i + 1) / 2 < sum\n i += 1\n end\n\n i * (i + 1) / 2 == sum\n\nend", "def n4\n ret = []\n $base_words.each { |base_word|\n (0..9).each { |n|\n ret << \"#{n}#{base_word}\"\n }\n }\n return ret\n end", "def pals\n sum = 0\n\n 1.upto(1000000) do |num|\n n_array = num.to_s.split(\"\")\n \n next unless n_array == n_array.reverse\n\n b_array = num.to_s(2).split(\"\")\n\n next unless b_array == b_array.reverse\n\n puts \"#{num} is double base palindrome\"\n\n sum += num\n end\n sum\nend", "def single_number(nums)\n nums.reduce(&:^)\n #亦可 nums.reduce(:^)\nend", "def encode_repeating(my_string)\n return my_string if !my_string || my_string.length < 2\n current, check_next = 0, 1\n until current == my_string.length\n check_next += 1 while my_string[current] == my_string[check_next]\n repeats = check_next - current\n if repeats > 2\n my_string[current + 1] = repeats.to_s\n check_next -= my_string.slice!((current + repeats.to_s.length + 1)...check_next).length\n end\n current = check_next\n end\n return my_string\nend", "def distinct_subseq_ii(s)\n alphabets = ('a'..'z').to_a\n dict = Array.new(27, 0)\n mod = 10 ** 9 + 7\n total = 1\n s.chars.each do |char|\n index = alphabets.index(char) + 1\n combo = total * 2 - dict[index]\n dict[index] = total # if 'c' ever appears again, it will clash with the current combos.\n total = combo < 0 ? 0 + mod : combo % mod\n end\n total - 1 # subtract empty string\nend", "def my_version(lorem)\n points = proc { |word| word.chars.map { |l| l.ord - 96 }.sum }\n lorem.split.reduce do |memo, word|\n points.call(word) > points.call(memo) ? word : memo\n end\nend", "def is_rpar(latex, step)\n\tlatex[step+1..step+5].join == \"right)\"\nend", "def puf_syndrome\n \n end", "def term\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 25 )\n __MULTIPLICATIONDIVISIONOPERATORS12__ = nil\n\n begin\n # at line 751:5: factor ( MULTIPLICATIONDIVISIONOPERATORS factor )*\n @state.following.push( TOKENS_FOLLOWING_factor_IN_term_1181 )\n factor\n @state.following.pop\n # at line 751:12: ( MULTIPLICATIONDIVISIONOPERATORS factor )*\n while true # decision 28\n alt_28 = 2\n look_28_0 = @input.peek( 1 )\n\n if ( look_28_0 == MULTIPLICATIONDIVISIONOPERATORS )\n alt_28 = 1\n\n end\n case alt_28\n when 1\n # at line 751:13: MULTIPLICATIONDIVISIONOPERATORS factor\n __MULTIPLICATIONDIVISIONOPERATORS12__ = match( MULTIPLICATIONDIVISIONOPERATORS, TOKENS_FOLLOWING_MULTIPLICATIONDIVISIONOPERATORS_IN_term_1184 )\n # --> action\n #Regla 3 GC\n \t\t @stack_operators.push(__MULTIPLICATIONDIVISIONOPERATORS12__.text)\n \t\t \n # <-- action\n @state.following.push( TOKENS_FOLLOWING_factor_IN_term_1211 )\n factor\n @state.following.pop\n # --> action\n #Regla 5 GC / VS\n \t\t if(@stack_operators.last == '*' or\n \t\t @stack_operators.last == '/' or\n \t\t @stack_operators.last == '&&') then\n \t\t operator = @stack_operators.pop\n \t\t operand_b = @stack_operands.pop\n \t\t operand_a = @stack_operands.pop\n \t\t result = get_avail\n \t\t generate(operator, operand_a, operand_b, result)\n \t\t free_avail(operand_a)\n \t\t free_avail(operand_b)\n free_avail_const(operand_a)\n free_avail_const(operand_b)\n \t\t @stack_operands.push(result)\n \t\t @stack_types.push(resulting_type(@stack_types.pop, @stack_types.pop, operator))\n \t\t end\n \t\t \n # <-- action\n\n else\n break # out of loop for decision 28\n end\n end # loop for decision 28\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 25 )\n\n end\n \n return \n end", "def rampant_repeats(str, hash)\n\n new_str = \"\"\n\n str.each_char { |char| new_str += char * ( hash[char] || 1) }\n\n new_str\n\nend", "def solution(n)\n siblings = n.to_s.chars.each_slice(1).to_a\n siblings.sort {|x,y| -(x <=> y)}.join.to_i\nend", "def triangular_word?(word)\n encoded = encode(word)\n triangular_num?(encoded)\nend", "def toggle_lights(n)\n multipled_substring = []\n\n (1..n).each do |count|\n multiplier = 1\n\n loop do\n product = count * multiplier\n break if product > n\n multipled_substring << product\n multiplier += 1\n end\n end\n #multipled_substring\n\n final_result = []\n (1..n).each do |number|\n times_of_toggle = multipled_substring.count(number)\n \n final_result << number if times_of_toggle.odd?\n end\n p final_result\nend", "def transition_table(pattern, radix)\n table = Hash.new\n (0..pattern.length).each do |i|\n table[\"state:#{i}\"] = {pattern: pattern[0...i]}\n end\n\n (0...pattern.length).each do |i|\n radix.each do |char|\n str = table[\"state:#{i}\"][:pattern] + char\n discard_num = 0\n (i+1).downto(0) do |j|\n if table[\"state:#{j}\"][:pattern] == str.chars.drop(discard_num).join\n table[\"state:#{i}\"][char] = \"state:#{j}\"\n next\n end\n discard_num += 1\n end\n end\n end\n\n table\nend", "def compute(expr)\n\n\t\tj=0;\n\t\twhile j<=expr.size\n\t if !expr[j+1].nil?\n\t\t\t\tif expr[j+1].chr=='`' || expr[j+1].chr==\"'\"\n\t\t\t\t\t(expr[j].chr=='1') ? k=\"0\" : k=\"1\"\n\t\t\t\t\texpr=expr.slice(0,j).to_s+k+expr.slice(j+2..-1).to_s\n\t\t\t\t\t#j=j-1\n\t\t\t\tend\n\t end\n\t\t\tj+=1\n\t\tend\n\n\t\tj=0\n\t while(j<=expr.size)\n\t if !expr[j+1].nil?\n\t\t\t\tif (expr[j].chr=='0' || expr[j].chr=='1') && (expr[j+1].chr=='0' || expr[j+1].chr=='1')\n\t\t\t\t\t(expr[j].chr=='1' && expr[j+1].chr=='1') ? k=\"1\" : k=\"0\"\n\t\t\t\t\texpr=expr.slice(0,j).to_s+k+expr.slice(j+2..-1).to_s\n\t\t\t\t\t#j=j-1;\n\t\t\t\telsif (expr[j].chr=='0' || expr[j].chr=='1') && expr[j+1].chr=='^'\n\t\t\t\t\t(expr[j].chr==expr[j+2].chr) ? k=\"0\" : k=\"1\"\n\t\t\t\t\texpr=expr.slice(0,j).to_s+k+expr.slice(j+3..-1).to_s\n\t\t\t\t\t#j=j-1;\n\t\t\t\tend\n\t end\n\t\t\tj+=1\n\t\tend\n\t\tk=0\n\n\t\tj=0\n\t\twhile(j<expr.size)\n\t\t\tif expr[j].chr=='1'\n\t\t\t\tk=1\n\t\t\t\treturn k\n\t\t\tend\n\t\t\tj+=1\n\t\tend\n\t\treturn k\n\n\tend", "def sum_double_base_palindromes(range)\r\n range.select { |n| n.odd? && n.to_s.palindrome? && n.to_s(2).palindrome? }\r\n .reduce(:+)\r\nend", "def encode_repeating(my_string)\n\n return nil if my_string.nil?\n\n start = 0\n\n until my_string[start].nil?\n\n count = 1\n\n while my_string[start + count] == my_string[start]\n count += 1\n end\n\n if count < 3\n start += count\n else\n my_string[start + 1] = count.to_s\n my_string.slice!(start + 2, count - 2)\n start += 2\n end\n\n end\n\n return my_string\n\nend", "def permute_word(word)\n word2 = word.clone\n if word.length > 3\n p = crp(word.length - 2, 1)\n 1.upto(word.length - 2) {|i| word2[p[i]] = word[i]}\n end\n word2\nend", "def encode_repeating(my_string)\r\n i = 0\r\n j = 0\r\n letter = my_string[i]\r\n while i < my_string.length\r\n j += 1 while my_string[j + 1] == letter\r\n if j - i >= 2\r\n my_string[(i + 1)..j] = (j - i + 1).to_s\r\n end\r\n additional = 0\r\n additional = 1 if j > i\r\n i += 1 + additional\r\n j = i\r\n letter = my_string[i]\r\n end\r\n return my_string\r\nend", "def to_w # to_w is for 'to words'\n # Numbers up to 20 are quite irregular. We need a specific block of code for tens\n tens = lambda do |x|\n if x < 20\n @@english_numbers[x.to_s.to_sym]\n else\n decs = x.to_s[0] + '0'\n units = x.to_s[-1]\n \"#{@@english_numbers[decs.to_sym]} #{@@english_numbers[units.to_sym]}\"\n end\n end\n # Use a recursive lambda to call itself as many times as needed until the whole number is written\n sentence = lambda do |num|\n num_length = num.to_s.length\n if num_length < 3 # If number is lower than 99 use tens block\n tens.call(num)\n else\n # Create a temporary hash to keep track of the magnitude of the piece of number we are working with\n new_structure = @@structure.select{|k,v| [k,v] if k<num_length}\n digits = new_structure[0][0]\n following_digits = (new_structure.length == 1) ? 2 : new_structure[1][0]\n word = new_structure[0][1]\n if num <= (10**digits - 1) # Get feeper into recursion if the number is smaller than the current order of magnitude\n sentence.call(num)\n else\n # Split the word into a part belonging to the current order of magnitude and a rest\n left = num.to_s[0..-(digits+1)].to_i\n rest = num.to_s[-digits..-1].to_i\n # Apply English grammar rules and exectute the same code recursively onto each side\n if rest == 0\n \"#{sentence.call(left)} #{word}\"\n elsif rest < 10**following_digits\n \"#{sentence.call(left)} #{word} and #{sentence.call(rest)}\" \n else\n \"#{sentence.call(left)} #{word} #{sentence.call(rest)}\"\n end\n end\n end\n end\n # Execute the recursive lambda\n sentence.call(self)\n end", "def perm_recur(ans=\"\",s)\n if s.length == 0\n return\n end\n\n if s.length == 1\n puts ans + s\n return\n end\n \n if s.length == 2\n puts ans + s[0] + s[1] \n puts ans + s[1] + s[0]\n return\n end\n\n (0..s.size-1).each do |l|\n new = s.chars.rotate(l).join('')\n element = new[0] \n rest = new[1..new.size-1]\n perm_recur(ans + element, rest)\n end\nend", "def test_score_a_word_with_recurring_tiles\n\t\t\"BOGO\".each_char { |x| @word.append x.to_sym }\n\t\tassert_equal 7, @word.score\n\tend", "def exp\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n __ADDITIONSUBSTRACTIONOPERATORS11__ = nil\n\n begin\n # at line 726:5: term ( ADDITIONSUBSTRACTIONOPERATORS term )*\n @state.following.push( TOKENS_FOLLOWING_term_IN_exp_1113 )\n term\n @state.following.pop\n # at line 726:10: ( ADDITIONSUBSTRACTIONOPERATORS term )*\n while true # decision 27\n alt_27 = 2\n look_27_0 = @input.peek( 1 )\n\n if ( look_27_0 == ADDITIONSUBSTRACTIONOPERATORS )\n alt_27 = 1\n\n end\n case alt_27\n when 1\n # at line 726:11: ADDITIONSUBSTRACTIONOPERATORS term\n __ADDITIONSUBSTRACTIONOPERATORS11__ = match( ADDITIONSUBSTRACTIONOPERATORS, TOKENS_FOLLOWING_ADDITIONSUBSTRACTIONOPERATORS_IN_exp_1116 )\n # --> action\n #Regla 2 GC\n @stack_operators.push(__ADDITIONSUBSTRACTIONOPERATORS11__.text)\n \n # <-- action\n @state.following.push( TOKENS_FOLLOWING_term_IN_exp_1143 )\n term\n @state.following.pop\n # --> action\n #Regla 4 GC / VS\n if(@stack_operators.last == '+' or\n @stack_operators.last == '-' or\n @stack_operators.last == '||' ) then\n operator = @stack_operators.pop\n operand_b = @stack_operands.pop\n operand_a = @stack_operands.pop\n result = get_avail\n generate(operator, operand_a, operand_b, result)\n free_avail(operand_a)\n free_avail(operand_b)\n free_avail_const(operand_a)\n free_avail_const(operand_b)\n @stack_operands.push(result)\n @stack_types.push(resulting_type(@stack_types.pop, @stack_types.pop, operator))\n end\n \n # <-- action\n\n else\n break # out of loop for decision 27\n end\n end # loop for decision 27\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n end\n \n return \n end", "def rampant_repeats(s, h)\n s.chars.map do |c|\n if h[c]\n c * h[c]\n else\n c\n end\n end.join(\"\")\nend", "def rail_encode(s,rail_count)\n phrase = s.dup\n rail_indexes = Array(0..(rail_count-1))\n rails = create_rails(rail_indexes)\n lines = build_lines(phrase,rails,rail_indexes)\n lines.values.reduce(:+)\nend", "def problem_57\n ret,n,d = 0,1,1\n 1000.times do |i|\n n,d = (n+2*d),(n+d)\n ret += 1 if n.to_s.length > d.to_s.length\n end\n ret\nend", "def persistence(n)\n multiples = []\n until n.to_s.chars.count < 2 do\n n = n.to_s.chars.map(&:to_i).inject(:*)\n multiples << n\n end\n multiples.count\nend", "def rampant_repeats(str, hash)\n n_str = ''\n str.each_char do |char|\n if hash.has_key?(char) \n n_str += char * hash[char]\n else\n n_str += char\n end\n end\n n_str\nend", "def encode_repeating(my_string)\n return nil if my_string.nil?\n return my_string if my_string.length <= 1\n\n i = 0\n j = 0\n k = 0\n while j <= i && i < my_string.length\n k = i\n if my_string[i] != my_string[i + 1]\n my_string[j] = my_string[i]\n\n else\n counter = 1\n while my_string[i] == my_string[i + 1]\n i += 1\n counter += 1\n end\n\n if counter == 2\n my_string[j] = my_string[k]\n my_string[j + 1] = my_string[k]\n else\n my_string[j] = my_string[k]\n my_string[j + 1] = counter.to_s\n end\n j += 1\n end\n j += 1\n i += 1\n end\n\n my_string[j...my_string.length] = \"\"\n return my_string\nend", "def refined_super_digit(n, k)\n \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 solve\n 1.upto(100).inject(:*).to_s.split('').map{|x| x.to_i}.inject(:+)\nend", "def prmutation(num)\n factrl(num)\nend", "def refined_super_digit(n, k)\n \nend", "def refined_super_digit(n, k)\n \nend", "def cal_sol(str)\n par1=0\n par2=0\n array = str.split('')\n return str if array.none?(%r{[/*/+-/(/)]})\n while array.any?('(')\n i=1\n while i<array.length\n if array[i]=='(' || array[i]==')'\n par1=par2\n par2=i\n end\n if array[par1]=='(' && array[par2]==')'\n array = (par1!=0 ? array[0..par1-1] : []).concat([cal_sol(array[par1+1..par2-1].join(''))]).concat(array[par2+1..array.length])\n i=par1\n par2=par1-1\n par1=par1-1\n end\n i+=1\n end\n end\n new_string = array.join('')\n numbers= new_string.split(%r{[/*/+-]})\n signs= new_string.split(%r{[^/*/+-]}).join('').split('')\n elements = []\n (numbers.length+signs.length).times do |i|\n if i%2==0\n elements.push(numbers[0])\n numbers.delete_at(0)\n else \n elements.push(signs[0])\n signs.delete_at(0)\n end\n end\n operations = ['/','*','-','+']\n operations.each do |ops|\n i=1\n while i<elements.length-1\n if elements[i]==ops\n new_value= [elements[i-1].to_f, elements[i+1].to_f].inject(ops.to_sym)\n puts new_value\n elements = (i>=2 ? elements[0..i-2] : []).concat([new_value]).concat(elements[i+2..elements.length])\n i-=1\n end\n i+=1\n end\n end\n elements[0].to_s\nend", "def five_digit_pattern()\r\n\treturn [\r\n\t\t\t[1, 0, 0, 0, 1],\r\n\t\t\t[0, 1, 0, 0, 1],\r\n\t\t\t[0, 0, 1, 0, 1],\r\n\t\t\t[0, 0, 0, 1, 1]\r\n\t\t ]\r\nend", "def solve_two_vs_three_vs_five\n return if @arr[1].nil? || @arr[6].nil?\n\n #p \"1,6: #{@arr[1]},#{@arr[6]}\"\n\n @words.filter{|x| x.length == 5 && @hash[x].nil?}.each{|w|\n if @arr[1].chars.all?{|c| w.chars.include?(c)}\n solved(3, w)\n elsif w.chars.all?{|c2| @arr[6].chars.include?(c2)}\n solved(5, w)\n else\n solved(2, w)\n end\n }\n end", "def n_squared(fish)\n long_boi = \"\"\n fish.each_with_index do |fish1, idx1|\n fish.each_with_index do |fish2, idx2|\n if idx2 > idx1\n long_boi = fish2 if fish2.length > fish1.length\n end\n end\n end\n long_boi\nend", "def do_process(ps )\n word = nil\n buf = \"\"\n tokens = ps.sentence.split(/[ \\t]/)\n \n for word in tokens do\n #문자열의 길이가 최대 허용치보다 길다면...\n if word.length() > REPEAT_CHAR_ALLOWED then\n repaedCnt = 0\n checkChar = word[0]\n \n buf << checkChar\n \n for i in 1..(word.length-1) do\n if checkChar == word[i] then\n if repaetCnt == (REPEAT_CHAR_ALLOWED-1) then\n buf << \" \"\n buf << word[i]\n repeatCnt = 0\n else\n buf << word[i]\n repeadCnt +=1\n end\n else\n if checkChar == \".\" then\n buf << \" \"\n end\n \n buf << word[i]\n checkChar = word[i]\n repeadCnt = 0\n end\n end\n else\n buf << word\n end\n buf << \" \"\n end\n ps.sentence=buf\n return ps\n end", "def test_seqence_valid18\n result = engine(\"Trump1%\")\n refute(result, \"'Trump1%' should not be valid because it is too short in length.\")\n end", "def pattern(n)\n (1..n).map{|x| \"#{x.to_s*x}\"}.join(\"\\n\")\nend", "def double_angle_string_literal!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 45)\n\n type = DOUBLE_ANGLE_STRING_LITERAL\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 500:4: '<<' ( . )* '>>'\n match(\"<<\")\n # at line 500:9: ( . )*\n loop do #loop 8\n alt_8 = 2\n look_8_0 = @input.peek(1)\n\n if (look_8_0 == ?>) \n look_8_1 = @input.peek(2)\n\n if (look_8_1 == ?>) \n alt_8 = 2\n elsif (look_8_1.between?(0x0000, ?=) || look_8_1.between?(??, 0xFFFF)) \n alt_8 = 1\n\n end\n elsif (look_8_0.between?(0x0000, ?=) || look_8_0.between?(??, 0xFFFF)) \n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 500:9: .\n match_any\n\n else\n break #loop 8\n end\n end\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__, 45)\n\n end", "def solution(n)\n n.to_s.reverse.scan(/\\d{1,3}/).join(',').reverse\nend", "def pirates_say_arrrrrrrrr(string)\n other_word = \"\"\n string.length.times do | index |\n if ((string[index].downcase.include? \"r\") && (string[index + 1] != nil))\n other_word << string[index + 1]\n end\n end\n\n return other_word\nend", "def pattern_bits\n str = bits.to_s(2)\n str = str.rjust(self.step_count, '0')\n str.chars.collect{|x|x=='1'}\n end", "def repeated_sub_pattern(str)\n smallest_str = smallest_str(str)\n multiplied = str.length / smallest_str\n str[0...smallest_str] * multiplied == str\nend", "def p206\n re = /1.2.3.4.5.6.7.8.9.0/\n max = Math.sqrt(1929394959697989990).floor\n\n # Round since only squares of multiples of 30 and 70 end with 9_0 (e.g. 900)\n i = round_up Math.sqrt(1020304050607080900).floor, 100\n while i < max\n p30 = (i+30) ** 2\n p70 = (i+70) ** 2\n\n if re === \"#{p30}\"\n return \"#{i+30}^2 = #{p30}\"\n elsif re === \"#{p70}\"\n return \"#{i+70}^2 = #{p70}\"\n end\n\n i += 100\n end\nend", "def f(n)\n # your code here\n result = []\n possibles = (2..n).flat_map{ |s| [*2..n].combination(s).map(&:join).to_a }\n p possibles\n possibles.each do |i|\n x = 0\n temp_arr = []\n temp = i.split('').map { |j| j.to_i }\n p temp\n while x < temp.length do \n if i[x + 1] != i[x] + 1 || i[x + 1] == nil\n temp_arr << i[x]\n end\n x += 1\n end\n result << temp_arr\n end\n result.length\nend", "def uniq_subs(word)\n subs = {}\n word.length.times do |i|\n (i...word.length).each do |j|\n if !subs[str[i..j]]\n subs[str[i..j]] = str[i..j]\n end\n end\n end\nend", "def kan2n2(s)\n case s.length\n when 1\n '〇一二三四五六七八九十'.index(s)\n when 2\n '〇一二三四五六七八九十'.index(s[1]) + 10\n else\n raise '21以上の数値に対応していません'\n end\n end", "def rampant_repeats(str, hash)\n str.chars.map { |c| hash.key?(c) ? c * hash[c] : c }.join\nend", "def newman_conway(num)\n raise ArgumentError if num <= 0\n f = []\n\n if num == 1\n return \"1\"\n elsif num == 2\n return \"1 1\"\n else \n f = [0,1,1]\n i = 3 \n\n while i <= num \n f << f[f[i - 1]] + f[i - f[i - 1]]\n i += 1\n end\n \n string_results = \"\"\n iteration = 0\n f = f[1..-1]\n\n f.each do |result|\n iteration +=1\n if f.length == iteration\n string_results += \"#{result}\"\n else\n string_results += \"#{result}\" + \" \"\n end\n end\n return string_results\n end\nend", "def manacher_algorithm(s)\n manacher_string = ['$','#']\n s.chars.each do |char|\n manacher_string.push(char,'#')\n end\n manacher_string.push '@'\n computed_count = [0]*manacher_string.length\n right = center = 0\n (1...manacher_string.size).each do |index|\n mirror = center * 2 - index\n \n if index < right\n computed_count[index] = [right - index, computed_count[mirror]].min\n end\n \n while(manacher_string[index + (1 + computed_count[index])] == manacher_string[index - (1 + computed_count[index])])\n computed_count[index] += 1\n end\n \n if index + computed_count[index] > right\n center = index\n right = index + computed_count[index] \n end\n end\n computed_count.reduce(0) {|s,count| s+=((count+1)/2)}\nend", "def split_to_polynomial_terms\n left_and_right_sides = @raw_arg.split(/=/)\n unless left_and_right_sides.length == 2\n exit_with_message \"Error: Invalid string.\\n\" \\\n \"The example of a valid equation: -578 * X^0 + 4 * X^1 - 9.3 * X^2 = 1 * X^0\"\n end\n left_side = left_and_right_sides[0].split(/(?=[-+])/)\n right_side = left_and_right_sides[1].split(/(?=[-+])/)\n\n left_side.each do |term|\n number = extract_number(term)\n degree = extract_degree(term)\n @polynomial_terms_list << PolynomialTerm.new(number, degree)\n end\n\n right_side.each do |term|\n number = extract_number(term) * (-1)\n degree = extract_degree(term)\n @polynomial_terms_list << PolynomialTerm.new(number, degree)\n end\n end", "def translate(word)\r\n vowels = \"aeio\".split('').to_a\r\n consonant = \"bcdfghjklmnpqrstuvwxyz\".split('').to_a \r\n answer = []\r\n \r\n while word.split(' ').length == 1 \r\n words = word.split('')\r\n until vowels.include?(words[0])\r\n words = words.rotate(1)\r\n end\r\n words << \"ay\"\r\n return words.join('')\r\n end # one word ^^\r\n \r\n if word.split(' ').length > 1 \r\n words = word.split(' ')\r\n end \r\n words.each do |i|\r\n if vowels.include?(i[0])\r\n i << \"ay\"\r\n answer << i\r\n #return answer\r\n end\r\n end\r\n \r\n words.each do |j|\r\n if consonant.include?(j[0])\r\n j = j.split('').rotate(1).join('') until vowels.include?(j[0])\r\n j = j + \"ay\"\r\n #return j\r\n #j << j #correct format for 1 consonant but it doesnt add to array\r\n answer << j\r\n end\r\n end\r\n \r\n return answer.join(' ')\r\n end", "def get_pandigitals\n return (0..9).to_a.permutation.map(&:join)\nend", "def iterate rule, seed\n \"00#{seed}00\".chars.each_cons(3).map { |c| rule[c.join.to_i 2] }.join\nend", "def rhymes\n depth = self.arpabet_transcription.split(' ').size\n results = []\n \n while depth > 1 && results.empty?\n depth -= 1\n pattern = \"*\" + self.arpabet_transcription.split(' ').reverse.take(depth).reverse.join(' ')\n results = Word.find_by_transcription_pattern(pattern)\n end\n \n results\n end" ]
[ "0.6155837", "0.61488706", "0.6107804", "0.5942966", "0.5905561", "0.5731302", "0.5687082", "0.5668494", "0.563021", "0.5614535", "0.5589821", "0.55776674", "0.5549196", "0.5512476", "0.54648834", "0.54565746", "0.5452719", "0.54345703", "0.54125106", "0.54118556", "0.54105645", "0.5410468", "0.5408362", "0.53876084", "0.5376779", "0.5350393", "0.53373", "0.5329611", "0.5320081", "0.5314057", "0.53052396", "0.52878857", "0.5283889", "0.5268603", "0.5264428", "0.526024", "0.5256811", "0.52565235", "0.525601", "0.52532005", "0.52477175", "0.524395", "0.5242174", "0.52370375", "0.52362293", "0.5228432", "0.52175987", "0.52169937", "0.521538", "0.5214192", "0.5214136", "0.5197795", "0.5195307", "0.5194303", "0.51911265", "0.5188451", "0.51869524", "0.51840127", "0.51837385", "0.5183146", "0.5182442", "0.5177398", "0.5176775", "0.5171206", "0.51674134", "0.5150494", "0.5146963", "0.5142426", "0.5129942", "0.5122818", "0.5120544", "0.51202285", "0.5118726", "0.5117868", "0.51167214", "0.51139706", "0.51139706", "0.5113196", "0.51124555", "0.5112414", "0.5109991", "0.5109714", "0.5105427", "0.5104247", "0.5102895", "0.5101997", "0.51009786", "0.5095483", "0.50948447", "0.50942045", "0.508944", "0.5085154", "0.5083993", "0.50831395", "0.50813067", "0.508034", "0.50791126", "0.50767624", "0.50754094", "0.5074211", "0.50735426" ]
0.0
-1
GET /roster_squares/1/edit edit the behavior squares available to a student
def edit @roster_square = RosterSquare.new @roster_squares = RosterSquare.all @student = Student.find_by_id(params[:id]) @student_squares = RosterSquare.where(student_id: @student.id) @not_student_squares = [] #Set the squares for the specific school @school_squares = Square.where(school_id: @student.school_id) @square = Square.find_by_id(params[:id]) @squares = Square.all if params[:remove_square] if params[:remove_square_id] != nil @roster_squares.delete(RosterSquare.find(params[:remove_square_id])) # flash[:success] = 'Roster square was successfully removed.' redirect_to "/roster_squares/#{params[:id]}/edit" end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_roster_square\n #Sets the edit page to the specified student\n @roster_squares = RosterSquare.all\n @student = Student.find(params[:id])\n end", "def edit\n respond_with(@sicoss_location)\n end", "def edit\n respond_with(@sicoss_situation)\n end", "def edit\n board_games\n locate_board_game\n title_collection\n render :edit\n end", "def update\n respond_to do |format|\n if @battle_roster.update(battle_roster_params)\n format.html { redirect_to @battle_roster, notice: 'Battle roster was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @battle_roster.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @roster = Roster.find(params[:id])\n\n respond_to do |format|\n if @roster.update_attributes(params[:roster])\n format.html { redirect_to @roster, :notice => 'Roster was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @roster.errors, :status => :unprocessable_entity }\n end\n end\n end", "def edit\n @student = find_student\n end", "def update\n @rooster = Rooster.find(params[:id])\n\n respond_to do |format|\n if @rooster.update_attributes(params[:rooster])\n format.html { redirect_to @rooster, notice: 'Rooster was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rooster.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @roster.update(roster_params)\n redirect_to @roster, notice: 'Roster was successfully updated.'\n else\n render action: 'edit'\n end\n end", "def update\n respond_to do |format|\n if @socio_rg.update(socio_rg_params)\n format.html { redirect_to @socio_rg, notice: 'Socio rg was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_rg.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n #Validate\n id = params[:id]\n @course = Course.find(id)\n requires({'role' => ['admin','faculty'],'course_id' => id})\n if(@course.nil?)\n flash[:error] = 'Something has gone horribly wrong. A system administrator has been contacted.'\n else\n student_ids = StudentInCourse.where(:course_id => id).collect(&:user_id)\n ta_ids = TaForCourse.where(:course_id => id).collect(&:user_id)\n \n @students = User.find_all_by_id(student_ids)\n @tas = User.find_all_by_id(ta_ids)\n end\n end", "def edit\n if current_user.is_school_admin?(params[:school_id])\n @participant = @school.participants.find(params[:id])\n @teams = @school.coreteams\n end\n \n respond_to do |format|\n if @participant\n format.js\n else\n format.js {render \"shared/save_failed\"}\n end\n end\n end", "def edit\n @student = Student.find(params[:id])\n render :edit\n end", "def edit\n \n end", "def update\n respond_to do |format|\n if @roster.update(roster_params)\n format.html { redirect_to @roster, notice: 'Roster was successfully updated.' }\n format.json { render :show, status: :ok, location: @roster }\n else\n format.html { render :edit }\n format.json { render json: @roster.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @roster.update(roster_params)\n format.html { redirect_to @roster, notice: 'Roster was successfully updated.' }\n format.json { render :show, status: :ok, location: @roster }\n else\n format.html { render :edit }\n format.json { render json: @roster.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n\t\t@course = Course.find(params[:id])\n\t\t@majors = @course.major\n\t\t@distributions = @course.distribution\n\t\t@minors = @course.minor\n\t\t@concentrations = @course.concentration\n\tend", "def edit\n @school = School.find(params[:id])\n end", "def update\n respond_to do |format|\n if @sight.update(sight_params)\n format.html { redirect_to @sight, notice: 'Sight was successfully updated.' }\n format.json { render :show, status: :ok, location: @sight }\n else\n format.html { render :edit }\n format.json { render json: @sight.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sight.update(sight_params)\n format.html { redirect_to @sight, notice: 'Sight was successfully updated.' }\n format.json { render :show, status: :ok, location: @sight }\n else\n format.html { render :edit }\n format.json { render json: @sight.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n\n end", "def edit\r\n \r\n end", "def update\n @tournament = @school.tournament\n respond_to do |format|\n if @school.update(school_params)\n format.html { redirect_to @tournament, notice: 'School was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @school.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def edit\r\n end", "def edit\n id = params[:id]\n @rock = Rock.find(id)\nend", "def update\n respond_to do |format|\n if @scool.update(scool_params)\n format.html { redirect_to @scool, notice: 'Scool was successfully updated.' }\n format.json { render :show, status: :ok, location: @scool }\n else\n format.html { render :edit }\n format.json { render json: @scool.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n @student = Student.find(params[:id])\n render :edit\n end", "def update\n respond_to do |format|\n if @roster_spot.update(roster_spot_params)\n format.html { redirect_to @roster_spot, notice: 'Roster spot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @roster_spot.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n @switchgearcombination = Switchgearcombination.find(params[:id])\n end", "def update\n respond_to do |format|\n if @sour.update(sour_params)\n format.html { redirect_to swits_path, notice: 'sour <3.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sour.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n\t\t# must have admin access or be in the course\n\tend", "def edit\n @game = Game.find(params[:id])\n end", "def update\n respond_to do |format|\n if @gig_roster.update(gig_roster_params)\n format.html { redirect_to @gig_roster, notice: 'Gig roster was successfully updated.' }\n format.json { render :show, status: :ok, location: @gig_roster }\n else\n format.html { render :edit }\n format.json { render json: @gig_roster.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n\n end", "def update\n @sundry_grn = SundryGrn.find(params[:id])\n\n respond_to do |format|\n if @sundry_grn.update_attributes(params[:sundry_grn])\n format.html { redirect_to @sundry_grn, :notice => 'Sundry grn was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sundry_grn.errors, :status => :unprocessable_entity }\n end\n end\n end", "def edit\n\t\t@student = Student.find(params[:id])\n\tend", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit \n end", "def edit \n end", "def edit\n set_student\n @courses = Course.all\n end", "def edit\n @student = current_student\n end", "def update\n respond_to do |format|\n if @shoe.update(shoe_params)\n format.html { redirect_to runner_shoes_path, notice: 'Zapatilla actualizada satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @shoe.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n\t\tstudent = Student.find_student_by_id(params[:id])\n\t\tdojos \t= Dojo.all_dojos\n\t\thtml = render_to_string partial: \"students/templates/student_modal\", locals: { dojos: dojos, student: student, current_dojo: session[:current_dojo]}\n\n\t\trender json: { html: html, status: true }\n\trescue Exception\n\t\trender :json => { :status => false } \n\tend", "def edit \n\t\t#will have template\n\t\t@champion = Champion.find(params[:id])\n\tend", "def update\n respond_to do |format|\n if @program_roster.update(program_roster_params)\n format.html { redirect_to @program_roster, notice: 'Program roster was successfully updated.' }\n format.json { render :show, status: :ok, location: @program_roster }\n else\n format.html { render :edit }\n format.json { render json: @program_roster.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @roster_system.update(roster_system_params)\n format.html { redirect_to @roster_system, notice: 'Roster system was successfully updated.' }\n format.json { render :show, status: :ok, location: @roster_system }\n else\n format.html { render :edit }\n format.json { render json: @roster_system.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit\n @studentwork = Studentwork.find(params[:id])\n @assignment = Assignment.find(params[:assignment_id])\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end" ]
[ "0.7591398", "0.6604159", "0.64801496", "0.64296114", "0.6410641", "0.6361647", "0.63563746", "0.6353334", "0.6278119", "0.6259901", "0.6250012", "0.62411696", "0.6158141", "0.61566734", "0.6146029", "0.6146029", "0.61211026", "0.61089665", "0.6098568", "0.6098052", "0.60527354", "0.6041511", "0.60323244", "0.60283697", "0.60283697", "0.60283697", "0.60283697", "0.60283697", "0.60283697", "0.60283697", "0.6008887", "0.600841", "0.5997291", "0.5992536", "0.5985357", "0.59813374", "0.5975484", "0.59704554", "0.5965705", "0.59644306", "0.5961662", "0.5952896", "0.594857", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.5944844", "0.59397733", "0.59397733", "0.5938277", "0.5935753", "0.59307677", "0.59280366", "0.59201497", "0.59038806", "0.58970463", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58959633", "0.58927447", "0.5892448", "0.5892448", "0.5892448", "0.5892448", "0.5892448", "0.5892448", "0.5892448", "0.5892448", "0.5892448", "0.5892448", "0.5892448", "0.5892448", "0.5892448" ]
0.7454045
1
Below are helpers methods that when called allow you to check certain fields that would otherwise be unavailable
def set_roster_id (roster_square) @roster_id = RosterSquare.find(roster_square.square_id).screen_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_fields\n %w[email author].each do |field|\n value = self.send(field)\n abort \"Hoe #{field} value not set. aborting\" if value.nil? or value.empty?\n end\n end", "def check_fields\n raise NotImplementedException\n end", "def check_fields\n fields = %w{ipaper_id ipaper_access_key}.inject([]){|stack, f| stack << \"#{name}##{f}\" unless column_names.include?(f); stack}\n raise ScribdFuError, \"These fields are missing: #{fields.to_sentence}\" if fields.size > 0\n end", "def check_fields\n columns= resource.model.column_names - AutoRest::AR_MAGIC_COLUMNS\n\n default_columns= columns.select { |attr| attr !~ /.*_count$/ }.map do |elem|\n [elem.intern, elem.titleize]\n end\n\n # For storing columns, I use an array and not a hash --i.e.: (:column => 'Title') -- \n # to ensure the order of the columns. I convert the params from linear array to \n # grouped array to alivianate user's data entry:\n # [[:col0, \"name0\"], [:col1, \"name1\"]] becomes [:col0, \"name0\", :col1, \"name1\"]\n \n # *TODO* This should be cleaned a little, because right now is a bit difficult\n # to remember the way the attributes for each view work.\n\n [:for_index, :for_new, :for_edit, :for_show].each do |key|\n arr= fields.send(key)\n exc= exclude_fields.send(key)\n\n if !arr # User has not supplied columns.\n arr= default_columns\n else\n # enum_for creates an enum from array, therefore protecting the original array contents.\n # each slice returns an array of specified elements: [1,2,3,4] => 1..4 => [[1,2],[3,4]]\n arr= arr.enum_for(:each_slice, 2).to_a\n end\n \n # Remove excluded fields.\n arr= arr.reject { |e| exc.map{|elem|elem.to_s}.include?(e[0].to_s) } if exc\n fields.send(\"#{key}=\", arr)\n end\n end", "def fields_missing_errors(*fields)\n !fields_have_errors(*fields)\n end", "def check fields, obj\r\n fields.each{ |field|\r\n if not obj.respond_to? field then\r\n return false\r\n end\r\n }\r\n return true\r\n end", "def has_invalid_fields?\n if invalids = invalid_fields(fields)\n say 'Invalid field name:', :red\n say \" #{invalids.join(\", \")}\"\n end\n end", "def check_required_fields(data)\r\n @field_names[1..-1].each do |f|\r\n raise(ArgumentError,\r\n 'A value for this field is required: %s' % f) if \\\r\n @field_requireds[@field_names.index(f)] and data[f].nil? \r\n end\r\n end", "def validation_error_check_discrepancies(ar, fields)\n\t\tmsgs = []\n\t\t# get the list of fields that have errors (err_fields)\n\t\terr_fields = []\n\t\tar.errors.each {|k,v| err_fields << k}\n\t\t# identify fields missing from the record’s errors \n\t\tmissing_errors = []\n\t\tfields.each do |field_name|\n\t\t\tmissing_errors << field_name unless err_fields.include?(field_name) #if ar.errors[field_name].blank?\n\t\tend\n\t\tif missing_errors.length > 0\n\t\t\tmsgs << \"missing validation error for fields #{missing_errors.join(', ')}\"\n\t\tend\n\t\t# identify unexpected fields in the record’s errors\n\t\tunexpected_errors = []\n\t\terr_fields.each do |field_name|\n\t\t\tunexpected_errors << field_name unless fields.include?(field_name)\n\t\tend\n\t\tif unexpected_errors.length > 0\n\t\t\tmsgs << \"unexpected errors for fields #{unexpected_errors.join(', ')}\"\n\t\tend\n\t\tif msgs.length > 0\n\t\t\tassert false, msgs.join(\".\\r\")\n\t\tend\n\tend", "def partial?; @unbound_fields.any?; end", "def is_none_fields\n\t\tunless self.designation!=\"none\" && self.department!=\"none\"\n\t\t\tself.errors[:none] << \"=> You can't create none role\"\n\t\tend\n\tend", "def all_required(data, fields)\t\t\n\t\tif fields.nil? == true\n\t\t\treturn true\n\t\tend\n\t\t@api_errmsg = Array.new\n\t\tfields = fields.split(',')\n\t\tflag = true\n\t\tfields.each do |name|\n\t\t\tif data[name].nil?\n\t\t\t @api_errmsg.push(name)\n\t\t\t flag = false\n\t\t\tend\n\t\tend\n\t\tif flag == true\n\t\t return true\n\t\tend\n\t\treturn false\n\tend", "def validate_required_fields\n user = new_record? ? author : current_journal.try(:user)\n\n required_attribute_names(user).each do |attribute|\n if /^\\d+$/.match?(attribute)\n attribute = attribute.to_i\n v = custom_field_values.detect {|v| v.custom_field_id == attribute}\n if v && Array(v.value).detect(&:present?).nil?\n errors.add(v.custom_field.name, l('activerecord.errors.messages.blank'))\n end\n else\n if respond_to?(attribute) && send(attribute).blank? && !disabled_core_fields.include?(attribute)\n next if attribute == 'category_id' && project.try(:issue_categories).blank?\n next if attribute == 'fixed_version_id' && assignable_versions.blank?\n\n #####\n # START PATCH\n next if attribute == 'typology_id' && !project.module_enabled?('typologies')\n next if attribute == 'typology_id' && project.typologies.blank?\n # END PATCH\n #####\n\n errors.add attribute, :blank\n end\n end\n end\n end", "def field_supplied( field )\n return false if field.blank?\n return false if BLANK_PLACEHOLDERS.include?( field )\n return true\n end", "def has_fields_for_ride?\n user.present? &&\n from_address.present? &&\n from_city.present? &&\n from_latitude.present? &&\n from_longitude.present? &&\n pickup_at.present?\n end", "def field?\n false \n end", "def required_fields\n required_fields = []\n ignore_fields = [:id, :date_entered, :date_modified]\n self.fields.each_value do |field|\n next if ignore_fields.include? field[\"name\"].to_sym\n required_fields << field[\"name\"].to_sym if field[\"required\"] == 1\n end \n required_fields\n end", "def required_fields\n required_fields = []\n ignore_fields = [:id, :date_entered, :date_modified]\n self.fields.each_value do |field|\n next if ignore_fields.include? field[\"name\"].to_sym\n required_fields << field[\"name\"].to_sym if field[\"required\"] == 1\n end \n required_fields\n end", "def check_against_input_for_specials(data)\r\n @field_names[1..-1].each do |f|\r\n raise(ArgumentError,\r\n 'You cannot input a value for this field: %s' % f) if \\\r\n @field_extras[@field_names.index(f)].has_key?('Calculated') \\\r\n or @field_extras[@field_names.index(f)].has_key?('Link_many') \\\r\n and not data[f].nil? \r\n end\r\n end", "def validate_fields(fields)\n if fields['email'] && fields['password']\n Success(fields)\n else\n Failure(:missing_fields)\n end\n end", "def validate_required\n [\n :project_name,\n :status,\n :requester_id,\n :subject_expert_id,\n :sponsor_id,\n :vision,\n :goal,\n :description,\n :scope,\n :advice_required,\n :program_id,\n :train_id,\n :funding_method,\n :cost_center,\n :funding_status,\n :budget_allocated,\n :priority,\n :start_date,\n :end_date,\n :risk_rating,\n :risks,\n :projected_revenue,\n ].each do |field|\n if self.attributes[field.to_s].nil? || self.attributes[field.to_s].blank?\n # intentionally vague!\n add_validation 'All fields are required to perform further validations'\n return false\n end\n end\n true\n end", "def document_has_required_fields?\n [value_field, reverse_shelfkey_field, shelfkey_field, combined_key_field].each do |field|\n return false if @original_document[field].blank?\n end\n true\n end", "def fields?; @fields; end", "def has_required_fields\n return unless format.is_a?(LocalPostal::Format)\n\n format.required_fields.each do |field|\n field_name = self.class.formatting_variables_lookup_table[field.to_sym]\n value = public_send(field_name)\n errors.add(field_name, 'is required') if \"#{value}\".empty?\n end\n end", "def design_data_filled_in?\n !self.description.blank? && \n !self.platform.blank? && \n !self.product_type.blank? && \n !self.project.blank? &&\n !self.design_directory.blank? &&\n !self.incoming_directory.blank?\n end", "def unconverted_fields?() @unconverted_fields end", "def check_values\n check_numericity\n check_zip_code\n end", "def has_field?(field_name); end", "def check_required_attributes\n attributes = DSL.attributes.values.select(&:required?)\n attributes.each do |attr|\n value = spec.send(attr.name)\n unless value && (!value.respond_to?(:empty?) || !value.empty?)\n if attr.name == :license\n results.add_warning('attributes', 'Missing required attribute ' \\\n \"`#{attr.name}`.\")\n else\n results.add_error('attributes', 'Missing required attribute ' \\\n \"`#{attr.name}`.\")\n end\n end\n end\n end", "def check_validity!\n # nothing\n end", "def missing_fields( response )\n missing = []\n if response && response['errors']\n response['errors'].each do |error|\n missing << error['field']\n end\n end\n return missing\n end", "def check_response_for_field(resp, field_name)\n if resp[field_name].nil? && resp['error'].nil?\n raise MissingExpectedFieldError\n end\n resp\n end", "def checkListingAttributeRequirements\n @mandatory_attributes_from_db.each do |mand_attr|\n @listing_data.each do |listing|\n if listing[mand_attr[:name].to_sym] == nil\n listing[mand_attr[:name].to_sym] = \"#mand_attr_missing\"\n listing[:invalid] = \"Mandatory attribute #{mand_attr[:name]} missing!\"\n @invalid_rows = true\n end\n\n # handle title\n if listing[:type] == \"renting\"\n end\n end\n end\n end", "def validate_fields\n # TODO: Define other fields that are required for projects\n %w[name].all? do |field|\n value = send(field)\n if value.nil? || value.size.zero?\n add_error \"Projects requires a '#{field}' field\"\n else\n true\n end\n end\n end", "def validate_exclusion_of(attr); end", "def required_fields\n if self.controller_name == \"registrations\"\n param_name = \"user\"\n elsif self.controller_name == \"merchants\"\n param_name = \"merchant\"\n else\n return\n end\n empty_fields = Array.new\n empty = false\n params[param_name].each_pair do |k, v|\n if v == \"\"\n empty_fields << k.gsub(\"_\", \" \")\n empty = true\n end\n end\n if empty == true\n (0..empty_fields.length - 3).each do |i|\n empty_fields[i] << \",\"\n end\n empty_fields.insert(-2, \"and\") unless empty_fields.length < 2\n field_list = empty_fields.join(\" \")\n message = \"You cannot leave empty fields. The field\" \n if empty_fields.length > 1\n message << \"s \"\n else\n message << \" \"\n end\n message << field_list \n if empty_fields.length > 1\n message << \" were left blank.\"\n else\n message << \" was left blank.\"\n end\n flash[:notice] = message\n redirect_to request.referrer\n else\n return\n end\n end", "def test_mandatory_field(field, fieldname)\n if field.nil?\n show_usage\n ui.fatal(\"You must specify a #{fieldname}\")\n exit 1\n end\n end", "def required_fields\n # \"cid\" is not required\n [\n \"byr\",\n \"ecl\",\n \"eyr\",\n \"hcl\",\n \"hgt\",\n \"iyr\",\n \"pid\",\n ]\nend", "def fixed_field_check(record)\n {\n multiple_no_008: multiple_no_008?(record),\n bad_005: bad_005?(record),\n bad_006: bad_006?(record),\n bad_007: bad_007?(record),\n bad_008: bad_008?(record),\n fixed_field_char_errors: fixed_field_char_errors?(record),\n leader_errors: leader_errors?(record)\n }\nend", "def field?(name)\n ! self[name].nil?\n end", "def fields_need_editing(obj) \n \teditable_fields(obj).select {|k,v| v == true }\n end", "def validate_fields\n for key in self.query_parameters.keys\n for column in eval(\"#{self.model_name}\").columns\n if key == column.name.to_sym\n if column.type == :boolean\n if self.query_parameters[key] == \"0\"\n self.query_parameters[key] = false\n else\n self.query_parameters[key] = true\n end\n end\n end\n end\n end\n end", "def validate_config_fields\n config_fields.each do |field|\n\n # Some fields can be blank\n next if name == \"crossref\" && [:username, :password].include?(field)\n next if name == \"pmc\" && [:journals, :username, :password].include?(field)\n next if name == \"mendeley\" && field == :access_token\n next if name == \"twitter_search\" && field == :access_token\n next if name == \"scopus\" && field == :insttoken\n\n errors.add(field, \"can't be blank\") if send(field).blank?\n end\n end", "def no_subfields?(**args)\n !any_subfields(args)\n end", "def check?(fields)\n @check.call(fields)\n end", "def check_response_for_field(resp, field_name)\n if resp[field_name].nil? && resp['error'].nil?\n raise MissingExpectedFieldError\n end\n resp\n end", "def exclusion_guard(arr)\n arr | required_fields\n end", "def assert_required(base_object, *fields)\n fields.each do |field|\n obj = base_object.dup\n setter = to_setter(field)\n\n obj.send(setter, nil)\n assert obj.invalid?, \"Validation allows nil value for #{field}.\"\n\n if obj.column_for_attribute(field) == :string\n obj.send(setter, \"\")\n assert obj.invalid?, \"Validation allows empty value for #{field}.\"\n end\n end\n end", "def immediate?; @unbound_fields.empty?; end", "def ensure_tracker_has_fields(tracker)\n tracker.custom_fields << @error_class_field unless tracker.custom_fields.include?(@error_class_field)\n tracker.custom_fields << @occurences_field unless tracker.custom_fields.include?(@occurences_field)\n tracker.custom_fields << @environment_field unless tracker.custom_fields.include?(@environment_field)\n end", "def required_you_track_fields_defined?(project)\n you_track_fields = []\n issues = []\n\n response = @connection.get(\"#{@path_prefix}rest/admin/project/#{project}/customfield\", { 'Cookie' => @cookie, 'Content-Type' => 'text/plain; charset=utf-8' })\n response_xml = REXML::Document.new(response.body)\n\n response_xml.elements.each('projectCustomFieldRefs/projectCustomField') do |element|\n you_track_fields << element.attributes[\"name\"]\n end\n\n YOU_TRACK_REQUIRED.each do |required_field|\n unless you_track_fields.include?(required_field)\n issues << \"Validation Error: Required field '#{required_field}' not found in YouTrack project\"\n end\n end\n\n issues\n end", "def test_should_have_missing_fields\n assert ! roles(:missing_person_id).valid?\n assert ! roles(:missing_client_id).valid?\n assert ! roles(:missing_title).valid?\n end", "def ok?\n [ :remote_addr, :price, :subscription_id, :transaction_id, :checksum , :jurnalo_user_id ].inject( true ){ |s,x| s && !(send(x).blank?) }\n end", "def fields\n missing_method :fields\n end", "def has_locationable_field?\n if latitude.blank? and longitude.blank? and address.blank?\n errors.add :base, 'You must fill in at least one field'\n end\n end", "def check_required_fields(options, locals)\n input_fields = options.values[0].inject({}){|r,(k,v)| r[k.to_s] = v; r}\n required_fields = locals['required']\n\n required_fields.each_pair do |k,v|\n unless input_fields.has_key?(k) \n raise MissingFieldError.new(\"#{k} is required\") if v.nil? \n options.values[0][k] = v \n end\n end\n return options\n end", "def assert_valid_fields(fields, unique)\n assert_kind_of 'options[:fields]', fields, Array\n\n if fields.empty? && unique == false\n raise ArgumentError, '+options[:fields]+ should not be empty if +options[:unique]+ is false'\n end\n\n fields.each do |field|\n case field\n when Symbol, String\n unless @properties.named?(field)\n raise ArgumentError, \"+options[:fields]+ entry #{field.inspect} does not map to a property in #{model}\"\n end\n\n when Property\n unless field.model == model && @properties.include?(field)\n raise ArgumentError, \"+options[:field]+ entry #{field.name.inspect} does not map to a property in #{model}\"\n end\n\n else\n raise ArgumentError, \"+options[:fields]+ entry #{field.inspect} of an unsupported object #{field.class}\"\n end\n end\n end", "def attribute_empty?(apicall, field)\n if (apicall[field.to_sym].nil? || apicall[field.to_sym].length < 1)\n return true\n else\n return false\n end\n end", "def validate_on_save(fields)\n raise ActsAsIcontact::ValidationError, \"privateName cannot contain spaces, quotes, slashes or brackets\" if fields[\"privateName\"] =~ /[\\s\\\"\\'\\/\\\\\\[\\]]/\n raise ActsAsIcontact::ValidationError, \"fieldType must be 'text' or 'checkbox'\" unless fields[\"fieldType\"] =~ /^(text|checkbox)$/\n end", "def ensure_wdl_keys\n [:namespace, :name, :snapshot].each do |attr|\n unless self.send(attr).present?\n errors.add(attr, 'cannot be blank')\n end\n end\n throw(:abort) if self.errors.any?\n end", "def pre_conversion_sanity_check()\r\n # Do a dry run of the bug conversion checking the mappings between BugZilla and FogBugz fields\r\n # If the FB API allowed creation of things like projects and priorities, this wouldn't be necessary\r\n missing_fields = []\r\n\r\n @bz_reader.each_bug do |bz_bug|\r\n verify_field_mappings(bz_bug, missing_fields)\r\n end\r\n\r\n missing_fields\r\n end", "def check_fields(stats, fields)\n temp = Array.new(fields)\n\ttemp.each { |x| temp.delete(x) if stats[\"#{x}\"] == \"\" }\nend", "def determine_useful_validations\n useful_checks = [\n useful_validations_for_qrda_type,\n useful_validations_for_measure_type\n # TODO: Add useful_validations_for_performance_rate\n ]\n useful_checks.inject(:&)\n end", "def attributes_that_should_not_be_in_database_field_names\n [\"id\", \"errors\"]\n end", "def are_node_basic_fields_valid?(node)\n err = []\n err << \"Node uid is not provided\" unless node['uid']\n\n err.any? ? fail_validation(node, err) : true\n end", "def expect_fields_to_be_blank\n expect(page).to have_field(\"Email\", with: \"\", type: \"email\")\n expect(find_field(\"Password\", type: \"password\").value).to be_nil\n expect(find_field(\"Password confirmation\", type: \"password\").value).to be_nil\n end", "def has_required_keys?(instance, required_keys, ignore_keys, indent: 3)\n success = true\n\n required_keys[\"name\"] = {\n \"type\" => \"String\",\n \"required\" => true\n }\n\n required_keys.each do |key, data|\n next if ignore_keys.include?(key)\n\n if !instance.key?(key)\n bad \"#{key} is missing\", indent: indent\n success = false\n end\n end\n\n success\n end", "def only_some_attributes_filled?(ar)\n ar.attributes_filled < AppConfig['contact_info.complete_percentage'].to_f\n end", "def has_errors?(field)\n !(object.nil? || object.errors[field].blank?)\n end", "def value_required?\n false\nend", "def check_fields\n params[:user] ||= {}\n \n if !params[:user][:email]\n errors = {email: [\"не может быть пустым\"]}\n render json: {msg: \"Укажите адрес эл. почты\", errors: errors}, status: 401\n elsif !params[:user][:password]\n errors = {password: [\"не может быть пустым\"]}\n render json: {msg: \"Укажите пароль\", errors: errors}, status: 401\n end\n end", "def required_state(opts)\n opts = check_params(opts,[:field_names])\n super(opts)\n end", "def has_field(field_name)\n\t\tend", "def verify#todo\n #if its a fault, then its a no for sure\n #otherwise make sure all the fields are the right type, and are initialized etc\n true\n end", "def check_exclude_fields\n=begin\n [:for_index, :for_new, :for_edit, :for_show].each do |key|\n exc= exclude_fields.send(key)\n next if exc # Leave user options if given.\n \n # By default, the foreign key of the parents are assigned on nested resources,\n # so i remove the from the default columns of new\n exclude_fields.send(\"#{key}=\", parent_ids) if key == :for_new && !parent_ids.empty?\n end\n=end\n # Because a single resource can have multiple resource parents,\n # this check is going to be done on \"runtime\" (ie remove the field for the \n # current parent, not all parents' fields)\n end", "def has_not_mandatory_params?\n !params[:email].present? || !params[:password].present?\n end", "def any_present?\n if name.blank? and phone.blank? and license_plate.blank?\n errors.add :base, \"You must fill in at least one field\"\n end\n end", "def error_fields\n\t\treturn self.missing | self.invalid.keys\n\tend", "def error_fields\n\t\treturn self.missing | self.invalid.keys\n\tend", "def required_fields\n []\n end", "def not_blank\n if (name.blank? and email.blank? and phone.blank?)\n errors.add(\"name, email, and phone cannot all be blank\")\n end\n end", "def has_required?\n false\n end", "def should_be_partially_valid_except(*attrs)\n invalid_attributes = []\n all_attrs = self.instance_variables.map {|iv| iv.gsub('@','')}\n # use the key names from @attributes for ActiveRecord objects\n all_attrs = self.attributes.keys if self.instance_variables.include?('attributes')\n attrs.each do |attr_name|\n invalid_attributes << attr_name.to_s\n end\n should_be_valid_on = all_attrs - invalid_attributes\n should_be_partially_valid_on(should_be_valid_on)\n end", "def check_params; true; end", "def has_fields?\n num_fields > 0\n end", "def field?\n true \n end", "def restrict_fields\n\n allowed_fields=User.new.attributes.keys\n @fields=allowed_fields & (params[:fields] || \"\").split(\",\")\n if @fields.present?\n @users=@users.select(@fields) \n else\n @fields=allowed_fields\n end \n end", "def validate_mandatory_fields\n validate_for_card unless self.cc_number.blank?\n validate_for_transaction_tag unless self.transaction_tag.blank?\n validate_for_track1 unless self.track1.blank?\n validate_for_track2 unless self.track2.blank?\n end", "def get_field_errors(actual, object_name, create_object)\n # Check that actual is a ruby dict\n unless actual.is_a? Hash\n return format('%s object: must be ruby hash', object_name)\n end\n\n # missing_list contains a list of all the required parameters that were\n # not passed. It is initialized to all required parameters.\n missing_list = @required_params[object_name].clone\n\n # For each key, if it is not required or optional, it is not allowed\n # If it is requried, remove that parameter from the missing_list, since\n # it is no longer missing\n # actual.each do |key, value|\n\n actual.each do |key, _value|\n if !@required_params[object_name].include?(key.to_s) && !@optional_params[object_name].include?(key.to_s)\n return format('%s object: invalid field: %s', object_name, key)\n end\n\n # Remove field from copied list if the field is in required\n if @required_params[object_name].include? key.to_s\n # missing_list.delete(key.to_s)\n missing_list.delete_at(missing_list.index(key.to_s))\n end\n end\n\n # If there is anything in missing_list, it is an absent required field\n # This only needs to be checked if the create_object flag is passed\n if create_object && !missing_list.empty?\n return format('%s object: missing required field(s): %s',\n object_name, missing_list.join(', '))\n end\n # No errors if we made it this far\n nil\n end", "def check_attributes\n if (@values == nil)\n puts \"Specify necessary informations: \"\n get_input_values\n @additions = Array.new()\n end\n #check_time_string\n end", "def passport_check(passport)\n compulsary_fields = [\"byr:\", \"iyr:\", \"eyr:\", \"hgt:\", \"hcl:\", \"ecl:\", \"pid:\"]\n compulsary_fields.each do |field|\n return false if !passport.include?(field)\n true\n end\nend", "def required_fields_valid?\n check_required\n errors.empty?\n end", "def required_fields_valid?\n check_required\n errors.empty?\n end", "def verify_nilness_params(yearly_cost, yearly_consumption, floor_space, heat_type, water_cooking_type, nb_residents)\n if yearly_cost.zero? # if he forgot the yearly cost\n false\n else\n if yearly_consumption.zero? # if the consumption is not entered, all the other field must be present\n if [floor_space, nb_residents].include?(0) || [heat_type, water_cooking_type].include?('')\n false\n else\n true\n end\n else\n true\n end\n end\n end", "def fields!\n @validators.keys.find_all { |key| @validators[key].is_a? ::Proc }\n end", "def check_for_nulls\n# if self.name.nil? && self.dynamic_type_id.nil?\n# flash[:notice] = \"You must fill in something !\"\n if self.dynamic_type_id.nil?\n self.dynamic_type_id = 3\n end\n if self.name.nil?\n self.name = \"please enter a name\"\n end\n# end\n end", "def valid_record?( record )\n !record[:name].nil? and !record[:type].nil? and !record[:value].nil? and\n !record[:name].empty? and !record[:type].empty? and !record[:value].empty?\nend", "def method_missing name, *args, &block\n if name.to_s =~ /^(.+)_fields$/\n self.fields.select {|f| f.data_type.to_s.parameterize.underscore == $1 } || super\n else \n super\n end\n end", "def valid?\n self.errors = []\n self.content_type.fields.each do |field|\n if field.required\n if self.dynamic_getter(field.name).blank?\n self.errors << field.name\n end\n end\n end\n self.errors.blank?\n end", "def verify_field_properties_settings(new_fieldname, fieldname_display, def_value, desc_text)\n fieldname_labels = @browser.find_elements(:xpath => \"//label[contains(text(), '#{new_fieldname}')]\")\n if fieldname_display.downcase.include? \"hidden\"\n fieldname_labels.should be_empty\n else\n fieldname_labels.should have_at_least(1).items\n end\n @browser.find_elements(:xpath => \"//input[@value='#{def_value}']\").should have_at_least(1).items\n @browser.find_elements(:xpath => \"//div[text()='#{desc_text}']\").should have_at_least(1).items\n end", "def field_provided?(key)\n return send(:\"#{key}_field_provided?\") if respond_to?(:\"#{key}_field_provided?\", true)\n\n !!@fields_provided[key]\n end" ]
[ "0.7315085", "0.72841805", "0.72831154", "0.7132645", "0.70112664", "0.69439703", "0.6943045", "0.6738752", "0.6680654", "0.66429436", "0.663504", "0.6619284", "0.6611587", "0.6587845", "0.655292", "0.6472988", "0.64482236", "0.64482236", "0.638695", "0.636603", "0.63548946", "0.63348347", "0.6331421", "0.6328062", "0.63168997", "0.6308365", "0.63041174", "0.6297203", "0.6280661", "0.6259941", "0.6242526", "0.62246865", "0.62232816", "0.6220113", "0.62176704", "0.6216709", "0.62150675", "0.6212504", "0.6197266", "0.61734456", "0.61551845", "0.6153419", "0.61408657", "0.6137843", "0.61374605", "0.6132838", "0.61261296", "0.6113298", "0.60994875", "0.6092916", "0.6066968", "0.60645187", "0.6061722", "0.60561067", "0.60285807", "0.6015698", "0.60099125", "0.6004533", "0.6003663", "0.59960437", "0.5995869", "0.59840715", "0.59671456", "0.59657824", "0.5962131", "0.59609854", "0.59559095", "0.5951636", "0.59478223", "0.59470356", "0.594696", "0.5946597", "0.59419477", "0.59353197", "0.5929161", "0.59283596", "0.5928292", "0.59248286", "0.59248286", "0.59242535", "0.59199744", "0.5919956", "0.5908439", "0.59049666", "0.5902123", "0.5896683", "0.58909464", "0.5883262", "0.58829355", "0.5878148", "0.5871721", "0.5870038", "0.5870038", "0.5865549", "0.5863811", "0.58621544", "0.5859181", "0.5855991", "0.5855564", "0.5851413", "0.58422303" ]
0.0
-1
Checks if the square is used for the specific student. Unused at the moment
def is_student_square(square) @is_square = false @student_squares.each do |student_square| if square.id == student_square.square_id @is_square = true break end if @is_square != true @is_square = false end end if @is_square == false @not_student_squares.push(square) end @is_square end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isSquare()\n\n truth = (@rowSize == @colSize) ? true : false\n truth\n\n end", "def square_available?(square)\n board.values.include?(square)\n end", "def square?()\n return (@height == @width) & (@type == \"rectangle\")\n end", "def valid_square?(pos)\n y, x = pos\n y.between?(0, @Y_DIM-1) && x.between?(0, @X_DIM-1)\n end", "def isSquareAttackedBy?(coord,colour, board)\n board.pieces[colour].each do |pieceType, listOfCoord|\n listOfCoord.each do |fromCoord, piece| \n m = Move.new(board, piece, coord, fromCoord)\n return true if isLegalMove?(m)\n end\n end\n return false\n end", "def student?\n false\n end", "def square? \n (@rows == @cols) && @rows > 0 ? true : false\n end", "def real_student?\n student? && !phantom\n end", "def is_square?(potential_sq_size,r_idx,c_idx,ltr_cache)\n if potential_sq_size == 1\n return true\n end\n index_distance = (potential_sq_size - 1)\n target_c_idx = c_idx - index_distance\n target_r_idx = r_idx - index_distance\n orig_idx = r_idx\n return false if target_c_idx < 0 || target_r_idx < 0\n while r_idx >= target_r_idx do\n rt_value = ltr_cache[r_idx][c_idx]\n left_value = ltr_cache[r_idx][target_c_idx]\n return false if rt_value == 0 || left_value == 0\n row_is_valid = (rt_value - left_value == index_distance)\n if row_is_valid\n puts \"ROW VALID r(#{r_idx}) c(#{c_idx}) --> r(#{r_idx}) c(#{target_c_idx})\"\n else\n return false\n end\n r_idx -= 1\n end\n puts \"SQUARE FOUND AT r(#{orig_idx}) c(#{c_idx})... size of #{potential_sq_size}\"\n return true\n end", "def check_side_square(piece)\n possible = false\n offset = @color == 'white' ? 1 : -1\n if piece.class.name == 'Pawn' && !my_piece?(piece) && piece.history.length == 2 && piece.ep_flag\n square = piece.history.last\n coord = parse_coord(square)\n possible = parse_square([coord[0] + offset, coord[1]])\n end\n possible\n end", "def student_only?(sfuid)\n result = roles sfuid\n if result.join(\"\").eql? \"undergrad\"\n return true\n end\n false\n end", "def full?\n available_squares.empty?\n end", "def free_to_take?(square)\n i = @@the_board.index(square)\n @@the_board\n @board[i] == @@the_board[i] && i\n end", "def check_square\n begin\n @colt_property.checkSquare(@colt_matrix)\n rescue java.lang.IllegalArgumentException\n raise \"rows != columns. Not square matrix\"\n end\n end", "def perfect_square?\n self == Math.sqrt(self).to_i ** 2\n end", "def square?\n width == height\n end", "def square?(style_name='original')\n geometry(style_name).square?\n end", "def exists_sq?(hx, hy)\n x, y = *hex_to_sq(hx, hy)\n x_is_inside = x >= 0 && x < @radius * 2 + 1 # Refactor this into constant SQ_LENGTH\n y_is_inside = y >= 0 && y < @radius * 2 + 1\n x_is_inside && y_is_inside\n end", "def is_square?(num)\n Math.sqrt(num).floor**2 == num\n end", "def coaches_student?(student)\n\t\tstudents.include?(student)\n\tend", "def square?\n height == width if !(width.blank? && height.blank?)\n end", "def student?\n if self.role and self.role == 4 \n true\n end\n end", "def is_square(x)\nx < 0 ? false : Math.sqrt(x) % 1 == 0\n \nend", "def square_valid?(refs)\n square = []\n\n refs.each do |ref|\n square << grid[ref[0]][ref[1]]\n end\n\n square.size == square.uniq.size ? true : false\n end", "def perfect_square?(num)\n\t(2..num).each do |i|\n if i*i == num\n return true\n end\n end\n return false\nend", "def perfect_square?(num)\n\t(1...num).each do |i|\n \tif i * i == num\n return true\n end\n end\n \treturn false\nend", "def isMine(x,y)\n @squares[x][y] == MINE_MARKER\n end", "def is_square(x)\n return false if x < 0 \n Math.sqrt(x) % 1 == 0 ? true : false\nend", "def board_is_correct?()\n _row_checker() && _column_checker() && _square_checker\n end", "def senior?\n\t\tgrade == 12\n\tend", "def critical_square(marker)\n initial = Square::INITIAL_MARKER\n check_lines_for_constellation(initial, marker, initial)\n end", "def student?\n student_id?\n end", "def is_square(x)\n return false if x < 0\n if Math.sqrt(x) % 1 == 0\n return true\n else\n return false\n end\nend", "def perfect_square?(num)\n (1..num).each do |i|\n if i * i == num\n return true\n end\n end\n return false\nend", "def check_row_availability_for_square(row, col)\n possible_for_row = []\n (0..8).each do |i|\n if (self[row, i].is_a? Element) && i != col\n possible_for_row |= calculate_possible_numbers_for_square(row, i)\n end\n end\n self[row, col].possibleNumbers - possible_for_row\n end", "def available_squares\n self.squares.select{|square| square == ' '}\n end", "def won?(player, square_number)\n get_containing(square_number).any? do |array|\n array.all? { |element| element.to_s.strip == player.piece }\n end\n end", "def perfect_square?(num)\n (1..num).each do |factor|\n if factor * factor == num\n return true\n end\n end\n \n return false\nend", "def can_access_student( student)\n # 2 ways to access all student: admin or access_all flag\n if (is_admin? || current_teacher.access_all_students)\n return true\n end\n\n # last gasp: check roster of accessible students\n find_student = RosterStudent.where( teacher_id: current_teacher.id, student_id: student.id)\n if ! find_student.blank?\n return true\n end\n\n false # nope - teacher cannot access this student's data\n end", "def is_student?\n student.nil?\n end", "def is_square(x)\n x < 0 ? false : (Math.sqrt(x) % 1).zero?\nend", "def is_authorized_for_student(student)\n return true if self.districtwide_access?\n\n return false if self.restricted_to_sped_students && !(student.program_assigned.in? ['Sp Ed', 'SEIP'])\n return false if self.restricted_to_english_language_learners && student.limited_english_proficiency == 'Fluent'\n return false if self.school.present? && self.school != student.school\n\n return true if self.schoolwide_access? || self.admin? # Schoolwide admin\n return true if self.has_access_to_grade_levels? && student.grade.in?(self.grade_level_access) # Grade level access\n return true if student.in?(self.students) # Homeroom level access\n false\n end", "def two_squares?(x,y)\n return on_home_row? && (x_diff(x) == 0) && (y_diff(y) == 2)\n end", "def square?(num)\n num >= 0 && (Math.sqrt(num) % 1).zero?\nend", "def board_status_legal(square, capture)\r\n if check?(square, capture)\r\n return :illegal_causes_check \r\n end\r\n true\r\n end", "def is_perfect_square(num)\n left = 0\n right = num / 2\n\nreturn true if num == 1\nwhile left + 1 < right\n mid = left + (right - left ) / 2\n midSqrd = mid*mid\n if midSqrd == num\n return true\n elsif midSqrd > num\n right = mid\n else\n left = mid\n end\nend\nreturn (left * left == num || right * right == num)\nend", "def perfect_square?(num)\n (1...num).each do |i|\n return true if i * i == num\n end\n false\nend", "def check_grades (name, final_student)\n\tif \n\t\tfinal_student[name] > 75\n\t\tputs \"Your final score is #{final_student[name]}. Congratulations, you passed!\"\n\telse\n\t\tputs \"Your final score is #{final_student[name]}. Sorry, you did not pass.\"\n\tend\nend", "def check_box_availability_for_square(row, col)\n possible_for_box = []\n (0..2).each do |row_iterator|\n (0..2).each do |col_iterator|\n if self[row_iterator + 3 * (row / 3), col_iterator + 3 * (col / 3)].is_a?(Element) && !((row_iterator + 3 * (row / 3) == row) && (col_iterator + 3 * (col / 3) == col))\n possible_for_box |= calculate_possible_numbers_for_square(row_iterator + 3 * (row / 3), col_iterator + 3 * (col / 3))\n end\n end\n end\n self[row, col].possibleNumbers - possible_for_box\n end", "def valid_squares(list_of_squares)\r\n\t\t#puts \"valid_squares\"\r\n\t\tsquares_to_check = @board.select {|k,v| list_of_squares.include? k}\r\n\t\t\r\n\t\tval_of_squares = squares_to_check.values\r\n\t\t#puts val_of_squares\r\n\t\tfiltered_array = val_of_squares.uniq {|item| \r\n\t\t\tif(item.value.strip != \"\" )\r\n\t\t\t\titem.value\r\n\t\t\telse\r\n\t\t\t\titem.position\r\n\t\t\tend\r\n\r\n\t\t}\r\n\t\tif filtered_array.count == 1\r\n\t\t\t#it is valid\r\n\t\t\treturn filtered_array[0]\r\n\t\tend\r\n\t\tnil\r\n\tend", "def square?\n column_size == row_size\n end", "def perfect_square?(num)\n (1..num).each do |factor|\n if factor * factor == num\n return true\n end\n end\n return false\nend", "def at_risk_square(marker)\n unmarked_square = nil\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if threatened_row?(squares, marker)\n line.each do |square|\n if @squares[square].unmarked?\n unmarked_square = square\n end\n end\n end\n end\n unmarked_square\n end", "def test_is_square_method\n rec = Rectangle.new(10, 10)\n assert_equal(true, rec.is_square?)\n assert_equal(false, Rectangle.new(10, 4).is_square?)\n end", "def check_col_availability_for_square(row, col)\n possible_for_col = []\n (0..8).each do |i|\n if (self[i, col].is_a? Element) && i != row\n possible_for_col |= calculate_possible_numbers_for_square(i, col)\n end\n end\n self[row, col].possibleNumbers - possible_for_col\n end", "def perfect_square?(num)\n (1..num).each do |p|\n if p * p == num\n return true\n end\n end\n return false\nend", "def solved?\n cols = @grid.transpose\n return false unless (0..8).all? {|i| check_cols(i) && check_row(i)}\n (0..2).each do |horiz| \n (0..2).each {|vert| return false unless check_square(horiz,vert)}\n end\n true\n end", "def valid_board?\n self.valid_rows? && self.valid_cols? && self.valid_squares?\n end", "def perfect_square?(num)\n (1..num).each do |fact|\n return true if fact*fact == num\n end\n return false\nend", "def group_valid?(sym)\n unless [ :row, :column, :block].include?(sym)\n raise ArgumentError.new(\"group_valid can only be called :row, :column or :block\")\n end\n grouped_syms = self.squares.group_by(&sym).values\n sum_truths = []\n grouped_syms.each do |group|\n values = group.map{|square| square.value}\n good_sum = values.sum == (0..self.size).sum\n no_dupes = values.uniq == values\n sum_truths.push(good_sum && no_dupes)\n end\n\n sum_truths.all?\n end", "def test_complete_square_true\n assert_equal(true, @c_sudoku_1.unit_complete?(@c_sudoku_1.squares[0]))\n end", "def student_team_requirements_met?\n # checks if the student has a team\n return false if @student.team.nil?\n # checks that the student's team has a topic\n return false if @student.team.topic.nil?\n\n # checks that the student has selected some topics\n @student.assignment.topics?\n end", "def already_smells?\n if self.robot.world.robots(&:moves).any? { |m| m.x == x && m.y == y && m.status == 0 }\n errors.add(:base, :already_smells)\n end\n end", "def winner?(letter=:X)\n win_arr = [letter, letter, letter]\n\n # check rows\n return true unless @squares.index(win_arr).nil?\n\n # check columns\n return true unless @squares.index(win_arr).nil?\n end", "def is_perfect_square?(num)\n return false if num < 1\n Math.sqrt(num) % 1 === 0\nend", "def perfect_square?(n)\n (1..n).each do |num|\n if num * num == n\n return true\n end\n end\n false\nend", "def check_sudoku(grid)\n return (check_rows(grid) and check_cols(grid) and check_squares(grid))\nend", "def check_win?(board)\n total_squares = board.length * board[0].length\n completed_squares = 0\n height = board.length\n width = board[0].length\n\n # Loop through each square of the board\n (0...height).each do |row|\n (0...width).each do |column|\n # Increment counter if square matches color\n completed_squares += 1 if board[row][column] == board[0][0]\n end\n end\n\n # Check if all of the squares are the same color\n if total_squares == completed_squares\n return true\n else\n return false\n end\nend", "def validity\n msg=\"\"\n valid=true\n unless self.default_location.nil?\n # test si la salle est deja allouee a une classe\n unless self.default_location.class_school.nil? || self.default_location.class_school==self\n msg=\"La salle est déja occupée (#{self.default_location.class_school.ident}) !!\"\n valid=false\n else\n if self.nb_max_student > self.default_location.location_nb_max_person\n msg=\"La salle est trop petite (#{self.default_location.location_nb_max_person}) !!\"\n valid=false\n end\n end\n end\n self.errors.add(:base, \"Class school is not valid:#{msg}\") unless valid\n valid\n end", "def include?(other_square)\n # top left\n @square.contains?(other_square.x1, other_square.y1) || \n # top right\n @square.contains?(other_square.x1, other_square.y2) || \n # bottom right\n @square.contains?(other_square.x1, other_square.y3) || \n # bottom left\n @square.contains?(other_square.x1, other_square.y4) \nend", "def logged_in_as_student?\n !current_student.nil?\n end", "def is_perfect_square(x)\n first=x\n second=x\n loop do\n third=(first+second/first)/2\n break if first<=third\n first=third\n end\n (first.floor**2==x) ? true : false\nend", "def valid_coordinate?(coordinate)\n @board_hash.include?(coordinate)\n end", "def in_middle_square?(board)\n board.middle_square.any? do |posn|\n @positions.include?(posn)\n end\n end", "def square_owner(x, y)\n return true if @board[x][y].empty?\n\n @board[x][y].last == 'b' ? :black : :white\n end", "def student_spaces?\n return host.seats > attending_students.length if has_host?\n false\n end", "def division_grade_consistency\n return false if self.student.nil? || self.team.nil?\n if self.student.junior? && self.team.junior?\n return true\n elsif !self.student.junior? && !self.team.junior? \n return true\n else \n errors.add(:student, \"'s grade is inappropriate for this team\")\n end\n end", "def has_square_sum(num)\n\nend", "def is_perfect_square(num)\n return true if num < 2\n\n left = 2\n right = num / 2\n\n while left <= right\n x = left + (right - left) / 2\n guess_squared = x * x\n return true if guess_squared == num\n\n if guess_squared > num\n right = x - 1\n else\n left = x + 1\n end\n end\n\n false\nend", "def is_perfect_sequare(num)\n Math.sqrt(num).divmod(1)[1] == 0\nend", "def has_students?\n !students.empty?\n end", "def has_students?\n !students.empty?\n end", "def smelly?\n !smells.empty?\n end", "def passed?\n @grade >= 2.0\n end", "def perfect_square?(num)\n (1..num).each do |factor| # two dots means include the end item\n if factor * factor == num\n\t return true # omitting this will result in the false output lisitng the range e.g. 1..12\n\tend\nend\n\nputs perfect_square?(5) #=> false\nputs perfect_square?(12) #=> false\nputs perfect_square?(30) #=> false\nputs perfect_square?(9) #=> true\nputs perfect_square?(25) #=> true", "def unempty?(squares)\n squares_between = Array.new(squares.length) { |i| chess_board[squares[i]] }\n\n squares_between.each do |square|\n square = square.dig('square')\n\n return true if !square.include?(' ')\n end\n\n false\n end", "def check_valid?(coordinates)\n valid = false\n x = coordinates[0]\n y = coordinates[1]\n if (x > 0 && x <= @size) && (y > 0 && y <= @size)\n if @game_board[coord_to_array(coordinates)] == \" \"\n valid = true\n else\n puts \"\\nLocation already taken! Please try again.\"\n end\n else\n puts \"\\nInput does not fit parameters of the board. Please try again.\"\n end\n return valid\n end", "def perfect_square?(n)\n\tm = Math.sqrt(n).floor\n\tm * m == n\nend", "def square?(num)\r\n a = Math.sqrt(num)\r\n a * a == num\r\nend", "def perfect_square(num)\n\n return true if num == 1\n\n (1...num).any?{|n| num == n*n}\n\nend", "def ifPerfectSquare(num)\n\tif num<0 then\n\t\treturn false\n\telsif num==0 then\n\t\treturn true\n\tend\n\tleft = 0\n\tright = num\n\twhile left<=right do\n\t\tmid = left+(right-left)/2\n\t\tsquare = mid**2\n\t\tif square==num then\n\t\t\treturn true\n\t\telsif square<num then\n\t\t\tleft = mid+1\n\t\telse\n\t\t\tright = mid-1\n\t\tend\n\tend\n\treturn false\nend", "def available_square_id\n @board = build_board\n square = @board.sample\n puts '-' * 90\n puts square\n while square != nil\n square = @board.sample\n end\n computer_square_id = @board.index(square)\n end", "def perfect_square?(num)\n (1...num).each{|ele| return true if ele * ele == num }\n false\nend", "def full?\n @squares.flatten.index(nil).nil?\n end", "def valid_student_uin\n if student && uin.blank?\n errors.add(:uin, 'must be provided for students')\n return\n elsif !student && !uin.blank?\n errors.add(:uin, 'cannot be supplied for non-students')\n return\n elsif !student && uin.blank?\n return\n end\n\n errors.add(:uin, 'must only contain numbers') unless uin.split('').all? { |c| /^[0-9]$/.match?(c) }\n errors.add(:uin, 'must be a length of 9') if uin.length != 9\n end", "def valid?\n\t\tarea != 0\n\tend", "def ensure_valid_student_for_class_list!(student_id, workspace_id)\n # Check that the educator is authorized to see the grade and school for this student\n student = Student.find(student_id)\n raise Exceptions::EducatorNotAuthorized unless queries.is_authorized_for_grade_level_now?(student.school_id, student.grade)\n\n # Check that they gave a valid `workspace_id` and that it matches\n # the school and grade level for the student they're asking about.\n class_list = queries.read_authorized_class_list(workspace_id)\n raise Exceptions::EducatorNotAuthorized if class_list.nil?\n raise Exceptions::EducatorNotAuthorized if class_list.school_id != student.school_id\n raise Exceptions::EducatorNotAuthorized if class_list.grade_level_next_year != GradeLevels.new.next(student.grade)\n\n student\n end", "def validation(board, xblks, yblks)\n # row in valid\n\n \tfor x in 0..board.length-1\n \t\tcol = Array.new\n \t\trow = Array.new(board[x]) #need new array not modify board via reference\n\t\tblock = Array.new(board.length) {Array.new}\n \t\tfor y in 0..board.length-1\n if (board[y][x] != 0)\n\n \t\t\t\tcol.concat([board[y][x]])\n\t\t\tend\n\n\t\t\tputs [y, x]\n \t\t\tputs \"\"\n\t\t\tif (board[x][y] != 0)\n \t\t\t\tblk = (x/xblks).floor + yblks * (y/yblks).floor\n\t\t\t\tblock[blk-1].concat([board[x][y]])\n\t\t\tend\n \t \tend\n\t\trow.delete(0)\n\n \t\tif (col.uniq! != nil or row.uniq! != nil)\n\n\n\t\t\treturn false\n\t\tend\n\n\n \tend\n\n for each in block\n\t\tif each.uniq! != nil\n\t\t\treturn false\n\t\tend\n\tend\n\treturn true\n end", "def perfect_square?(x)\n Math.sqrt(x) % 1 == 0\nend", "def student?\n roles.where(name: Ability.student_group_name).exists?\n end" ]
[ "0.65709186", "0.6449969", "0.6416244", "0.6334376", "0.63267237", "0.6305692", "0.62639636", "0.6201371", "0.6155469", "0.6153109", "0.61430776", "0.61420405", "0.6140051", "0.612233", "0.60141087", "0.5997237", "0.59910303", "0.598717", "0.59691674", "0.5961965", "0.59552824", "0.59468925", "0.5940462", "0.58771497", "0.5874204", "0.5869797", "0.5862673", "0.58422685", "0.58407545", "0.5831287", "0.5831259", "0.58265954", "0.58190066", "0.58048606", "0.5804845", "0.58027816", "0.5792086", "0.5787903", "0.5786636", "0.5778721", "0.5772096", "0.577208", "0.5739243", "0.57306546", "0.57265806", "0.5713765", "0.57038444", "0.570167", "0.5699972", "0.56932974", "0.56916237", "0.5686635", "0.56793684", "0.5664245", "0.5659287", "0.5646777", "0.56397974", "0.56315887", "0.5630989", "0.5627867", "0.56255215", "0.5624148", "0.56170225", "0.56131136", "0.5605507", "0.5598927", "0.55966747", "0.5595394", "0.55947125", "0.5591611", "0.55895406", "0.5584094", "0.55779755", "0.55766994", "0.5575951", "0.5572845", "0.5568197", "0.5567398", "0.5561868", "0.55603373", "0.55574536", "0.55574536", "0.5553461", "0.55433774", "0.55423486", "0.55297595", "0.55115944", "0.55088097", "0.55028456", "0.5501196", "0.54983157", "0.54930717", "0.5488929", "0.54888237", "0.5488326", "0.5478183", "0.547507", "0.5468429", "0.54627967", "0.5456384" ]
0.8055263
0
Use callbacks to share common setup or constraints between actions.
def set_roster_square #Sets the edit page to the specified student @roster_squares = RosterSquare.all @student = Student.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 roster_square_params params.require(:roster_square).permit(:square_id, :student_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
GET /recipes GET /recipes.json
def index @recipes = Recipe.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipes # /v1/user/:id/recipes (GET)\n recipes = ::Recipe.all\n render json: recipes, :each_serializer => RecipeSmallSerializer, root: false, status: 200\n end", "def index\n @recipes = Recipe.all\n render json: @recipes\n end", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def index\n @recipes = Recipe.all\n respond_to do |format|\n format.html {}\n format.json { render json: @recipes }\n end\n end", "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end", "def index\n @recipes = Recipe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipes }\n end\n end", "def show(id) \n response = request(:get, \"/recipes/#{id}.json\")\n response.first[1]\n end", "def list\n \n recipes = Recipe.all\n render :json => recipes.to_json\n\n end", "def ingredients_by_recipe\n recipe = Recipe.find(params[:id])\n render json: recipe.ingredients\n end", "def index\n recipes = current_user.recipes\n render json: { recipes: recipes}.to_json, status: :ok\n end", "def get_recipes(section)\n # Example: https://terraria.gamepedia.com/index.php?title=Recipes/Iron_Anvil&action=raw\n @connection.get '/index.php', {\n 'title' => \"Recipes/#{section}\",\n 'action' => 'raw'\n }\n end", "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end", "def show\n recipe = Recipe.find(params[:id])\n # recipes = Recipe.find_by(params[:id])\n # render json: recipe\n render json: recipe\n end", "def show\n\n recipe = Recipe.find(params[:id])\n render :json => recipe.to_json\n\n end", "def index\n render json: Recipe.all\n end", "def show\n render json: @recipe\n end", "def show\n @data = @recipe.read(params[:id])\n render json: @data\n end", "def show\n @ingredient = Ingredient.find_by_url_slug(params[:id])\n @ingredient = Ingredient.find(params[:id]) if @ingredient.nil?\n @recipes = @ingredient.recipes.order('created_at DESC')\n logger.debug @recipes.inspect\n respond_to do |format|\n format.html {render :layout => 'wall'}\n format.json { render json: @ingredient }\n end\n end", "def index\n\t\t@recipes = Recipe.where(user_id: session[:user_id])\n\t\tif @recipes\n\t\t\trender json: @recipes.to_json(:include => [:inventories])\n\t\telse\n\t\t\tflash[:error] = \"You haven't saved any recipes yet! Search now :)\"\n\t\t\trender status: 400, nothing: true\n\t\tend\n\tend", "def show\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def index\n # @recipes = Recipe.all\n end", "def get_json\n recipe_json = File.read('./recipes.json')\n @json_recipes = JSON.parse(recipe_json)\n end", "def show\n\t\t@recipe = Recipe.find(params[:id])\n\t\tif @recipe \n\t\t\trender json: @recipe.to_json(:include => [:inventories])\n\t\telse\n\t\t\trender status: 400, nothing: true\n\t\tend\n\tend", "def index\n @recipes = RecipeCacheService.list(per_page: per_page_param, page: page_param)\n end", "def show\n @recipe = current_user.recipes.find(params[:id])\n @instructions = @recipe.instructions\n @ingredients = @recipe.ingredients\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def show\n respond_to do |format|\n format.html {}\n format.json { render json: @recipe }\n end\n end", "def index\n recipe_items = current_user.recipes.includes(recipe_items: :ingredient).find(params[:recipe_id]).recipe_items\n render json: { recipe_items: recipe_items}.to_json(include: :ingredient), status: :ok\n end", "def recipes\n @recipes ||= []\n end", "def show\n # accept the params\n # go to the db and get the correct recipe for that param\n p params[:id]\n @recipe = Recipe.find_by(id: params[:id])\n @ingredients = @recipe.ingredients.split(\", \").map {|ingredient| ingredient.capitalize}\n # send this to the view\n # show that data to the user\n render 'show.json.jb'\n end", "def get_from_npr(user_ingredients)\n raw_response=RestClient.get('http://api.npr.org/query?id=1139&fields=title,teaser,storyDate,byline,text&date&searchTerm=' + user_ingredients + '&dateType=story&output=JSON&apiKey=MDE5MDExNzc1MDE0MzA0MDE1NTViZDViOQ001')\n response = JSON.load(raw_response)\n\n if response[\"list\"][\"story\"] == nil\n puts \"Your search did not find any recipes...\"\n else\n recipes = response[\"list\"][\"story\"].map do |recipe|\n Recipe.new(\n title = recipe[\"title\"][\"$text\"],\n teaser = recipe[\"teaser\"][\"$text\"],\n link = recipe[\"link\"].first[\"$text\"],\n storyDate = recipe[\"storyDate\"][\"$text\"]\n )\n end\n end\n\nend", "def show\r\n\r\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/information\")\r\n\r\n http = Net::HTTP.new(url.host, url.port)\r\n http.use_ssl = true\r\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request = Net::HTTP::Get.new(url)\r\n request[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"] # hidden API key\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response = http.request(request)\r\n @recipe = JSON.parse response.read_body # gets the recipe\r\n\r\n p url_ingredients = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/ingredientWidget.json\")\r\n\r\n http_ingredients = Net::HTTP.new(url_ingredients.host, url_ingredients.port)\r\n http_ingredients.use_ssl = true\r\n http_ingredients.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request_ingredients = Net::HTTP::Get.new(url_ingredients)\r\n request_ingredients[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"]\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response_ingredients = http.request(request_ingredients)\r\n # puts response_ingredients.read_body\r\n @ingredients = JSON.parse # data is a string (which looks like a hash -> convert to hash) response_ingredients.read_body\r\n p \"RECIPES\"\r\n # p @recipe\r\n p \"INGREDIENTS\"\r\n p @ingredients\r\n\r\n end", "def index\n @recipes = (!params[:recipe].blank?)? Recipe.where(\"id in (\" + params[:recipe] + \")\") : Recipe.all\n @recipes_json = Recipe.where(\"title ilike ?\", \"%#{params[:q]}%\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: custom_json_for(@recipes_json)}\n end\n end", "def findrecipes\n\t\t@hide_menu = true\n puts \"In Find Recipes\"\n #this is where the data for the searching of recipes gets routed into\n input = params['query'].inspect\n\n ingreds = input.split(',')\n\n input = ingreds.join(\"%2C\")\n #this is the api \n url = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/findByIngredients?fillIngredients=false&ingredients=\" + input + \"&limitLicense=false&number=5&ranking=1\"\n\n res = Unirest.get url,\n headers:{\n \"X-Mashape-Key\" => \"UpZLcnOR83mshtXvuIOPFXBkfhn5p1UWi1ejsnsTLWoVXrOppm\",\n \"Accept\" => \"application/json\"\n }\n\n recipes = res.body\n #for each recipe that gets returned, the following information is routed into the recipe results page\n recipes.each do |recipe|\n url2 = url2 = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/\" + recipe['id'].to_s + \"/information?includeNutrition=false\"\n\n res2 = Unirest.get url2,\n headers:{\n \"X-Mashape-Key\" => \"UpZLcnOR83mshtXvuIOPFXBkfhn5p1UWi1ejsnsTLWoVXrOppm\",\n \"Accept\" => \"application/json\"\n }\n\n price = (\"$\" + (0.01 * res2.body['pricePerServing']).to_s)[0..5]\n\n recipe['price'] = price\n #this is the price of a recipe per serving\n\n end\n\n @recipeData = recipes\n render template: \"recipes/data\"\n end", "def recipe_info_for(id)\n response = Faraday.get(\"https://api.spoonacular.com/recipes/#{id}/information?includeNutrition=true&apiKey=#{spoonacular_key}\")\n JSON.parse response.body\n end", "def show\n if recipe\n render json: recipe\n else \n render json: {message: 'Recipe not found'}\n end\n end", "def all\n # returns all recipes\n @recipes\n end", "def show\n @food_recipe = FoodRecipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food_recipe }\n end\n end", "def show\n respond_with Recipe.find(params[\"id\"])\n end", "def recipes\n @ingredient = Ingredient.find(params[:id])\n \n respond_to do |format|\n format.html do\n @recipes = @ingredient.recipes.paginate(:page => params[:page], :order => 'name', :per_page => 5)\n end # recipes.html.haml\n format.xml do\n @recipes = @ingredient.recipes\n render :xml => @recipes\n end\n end\n end", "def user\n\t\t@recipes = Recipe.find_by_user_id(params[:id])\n\t\trespond_with @recipes\n\tend", "def show\n @recipe = Recipe.find(params[:id])\n @recipeIngredients = RecipeIngredient.where(:recipeId => params[:id])\n @ingredients = Ingredient.where(:id => @recipeIngredients.select(:ingredientId))\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def list\n display_recipes\n end", "def index\n @recipes = Recipe.render_all\n end", "def show\n @recipe = EdemamApiWrapper.show_recipe(params[:uri])\n end", "def get_recipe_titles(user_ingredients)\n \n search_params = 'http://www.recipepuppy.com/api/?i=' + user_ingredients.join(\",\")\n \n\n recipes = []\n search_string = RestClient.get(search_params)\n search_hash = JSON.parse(search_string)\n relevant_recipes = search_hash[\"results\"]\n relevant_recipes.collect do |recipe|\n recipes << recipe[\"title\"].strip\n end\n \n recipes\nend", "def by_ingredient\n # If ingredient exists, find recipes that use it\n if Ingredient.exists?(params[:id])\n ingredient = Ingredient.find(params[:id])\n recipes = Recipe.recipes_of_ingredient(params[:id])\n else\n recipes = Recipe.all\n end\n\n # Render json\n render json: {recipes: recipes}, status: 200 \n end", "def index\n @recipe_list = Recipe.where(category_id: params[:category_id])\n # Looks in recipe where the key, category_id is equal to the endpoint\n\n if @recipe_list.empty?\n render :json => {\n :error => 'Oops, no recipes yet! Add some now.'\n }\n else\n render :json => {\n :response => \"successful\",\n :data => @recipe_list\n }\n end\n end", "def index\n @ingredient_recipes = IngredientRecipe.all\n end", "def list_ingredients\n rid = params[:id]\n items = Aws.get_ingredients_from_db(rid)\n render :json => items\n end", "def get_recipe(id)\n recipe = Recipe.find(id)\n url = \"https://api2.bigoven.com/recipe/steps/#{recipe.id}?&api_key=#{ENV['API_KEY']}\"\n uri = URI(url)\n response = Net::HTTP.get(uri)\n # puts response\n\n JSON.parse(response)[\"Ingredients\"].each do |ingredient|\n # recipe.ingredients.create!(\n if (!Ingredient.exists?(ingredient[\"IngredientID\"])) \n Ingredient.create!(\n id: ingredient[\"IngredientID\"],\n name: ingredient[\"Name\"],\n html_name: ingredient[\"HTMLName\"]\n )\n end\n end\n\n if (recipe.recipe_ingredients.count > 0)\n recipe.recipe_ingredients.destroy_all\n recipe.save\n recipe.reload\n end\n\n JSON.parse(response)[\"Ingredients\"].each do |ingredient|\n \n # if (!recipe.recipe_ingredients.find_by(ingredient_id: ingredient[\"IngredientID\"]))\n recipe.recipe_ingredients.create!(\n ingredient_id: ingredient[\"IngredientID\"],\n quantity: ingredient[\"Quantity\"],\n display_quantity: ingredient[\"DisplayQuantity\"],\n unit: ingredient[\"Unit\"],\n metric_quantity: ingredient[\"MetricQuantity\"],\n metric_display_quantity: ingredient[\"MetricDisplayQuantity\"],\n metric_unit: ingredient[\"MetricUnit\"],\n preparation_notes: ingredient[\"PreparationNotes\"]\n )\n # end\n end\n \n recipe.steps = ''\n steps = JSON.parse(response)[\"Steps\"]\n steps.each do |step|\n step != steps.last ? recipe.steps += step[\"Text\"] + '$' : recipe.steps += step[\"Text\"]\n # recipe.steps += step[\"Text\"] + ','\n end\n \n recipe.save\n end", "def all\n @recipes\n end", "def all\n @recipes\n end", "def all\n @recipes\n end", "def show\n @recipe_all = RecipeAll.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_all }\n end\n end", "def create\n recipe = Recipe.create(recipe_params)\n render json: recipe\n end", "def read_json\n recipes_json = File.read('JSON/recipes.json')\n recipe_hash = JSON.parse(recipes_json)\n return recipe_hash\nend", "def userRecipe\n @user_id = params[:id]\n @user = User.find_by(id: @user_id)\n @recipes = Recipe.where(user_id: @user_id)\n end", "def getRecipeByTag\n begin\n @recipe = Recipe.where('tags ILIKE ?', '%'+params[:tag]+'%').all\n\n if !@recipe.empty?\n render json: { status: 'SUCCESS', message: 'Loaded recipe!', data: @recipe }, status: :ok\n else\n render json: { status: 'SUCCESS', message: 'No recipe found', data: {} }, status: :not_found\n end\n rescue\n render json: { status: 'ERROR', message: 'Error loading recipe', data: {} }, status: :not_found\n end\n end", "def show\n @recipe_ingredient = Recipe_ingredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end", "def index\n per_page = params[:per_page]&.to_i || DEFAULT_PER_PAGE\n page = params[:page]&.to_i || DEFAULT_PAGE\n query = params[:query] || \"\"\n\n queries = query.split(\",\").map { |q| \"%#{q.downcase.strip}%\" }\n recipe_ids = []\n \n if queries.present?\n queries.each do |q|\n tmp_recipe_ids = Ingredient.where('UNACCENT(LOWER(name)) ILIKE UNACCENT(?)', q)\n .pluck(:recipe_id)\n .uniq\n\n excluded_ids = []\n excluded_ids = recipe_ids - tmp_recipe_ids | tmp_recipe_ids - recipe_ids unless recipe_ids.empty?\n \n recipe_ids = (recipe_ids + tmp_recipe_ids) - excluded_ids\n end\n end\n \n recipes = Recipe.where(id: recipe_ids).order('rate DESC NULLS LAST').order(id: :asc)\n .page(page)\n .per(per_page)\n \n render json: {\n meta: {\n total_recipes: recipes.total_count,\n total_pages: recipes.total_pages,\n per_page: per_page,\n query: query,\n page: page\n }, \n recipes: recipes.map { |recipe| ::RecipeJson.new(recipe: recipe).to_h }\n }\n end", "def show\n @recipe = Recipe.find(params[:id])\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def index\n\n @recipes = Recipe.all\n @recipe = current_user.recipes.new if can? :new, Recipe\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipes }\n end\n end", "def index\n @recipes = Recipe.all\n @recipe = Recipe.new \n end", "def index\n unless params[:tag].blank?\n @recipes = current_user.recipes.tagged_with(params[:tag]).order(\"created_at desc\").page(params[:page]).per(10)\n else\n @recipes = current_user.recipes.order(\"created_at desc\").page(params[:page]).per(10) \n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipes }\n end\n end", "def show\n @recipe_ingredient = RecipeIngredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end", "def show\n @meal = Meal.find(params[:meal_id]) if params[:meal_id]\n @recipe = @meal.recipes.find(params[:id]) if @meal\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def scrape_recipe(ingredient)\n @recipes_array = []\n @ingredient = ingredient\n url = \"https://www.allrecipes.com/search/results/?search=#{@ingredient}\"\n html_file = URI.open(url).read\n html_doc = Nokogiri::HTML(html_file)\n html_doc.search('.card__detailsContainer').each do |element|\n title = element.search('.card__title').first.text.strip\n description = element.search('.card__summary').first.text.strip\n rating = element.search('.review-star-text').text.strip.slice(/(\\d.?\\d*)/)\n url = element.search('.card__titleLink').first.attribute('href').value\n\n @recipes_array << {\n title: title,\n description: description,\n rating: rating,\n url: url\n }\n end\n @recipes_array\n end", "def show\n\t\t@recipe = Recipe.find(params[:id])\n\tend", "def find_recipe\n @recipe = Recipe.find(params[:id])\n end", "def index\n @recipe = Recipe.new\n @recipes = current_user.recipes.page(params[:page]).per(15)\n end", "def show\n @recipe = Recipe.find(params[:id])\n @nutrition_info = NutritionInfo.where( \"recipe_id = ?\", @recipe.id ).first\n @inventory_items = []\n @recipe.inventory_items.each do |inventory_item|\n @inventory_items << inventory_item\n end\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def getRecipeByIngredientsList\n begin\n ingredientsList = params[:ingredients].split(\",\")\n\n @recipe = []\n ingredientsList.each do |ingredient|\n @recipe.push(Recipe.where('ingredients ILIKE ?', '%'+ingredient+'%').all)\n end\n \n if !@recipe.empty?\n render json: { status: 'SUCCESS', message: 'Loaded recipe!', data: @recipe }, status: :ok\n else\n render json: { status: 'SUCCESS', message: 'No recipe found', data: {} }, status: :not_found\n end\n rescue\n render json: { status: 'ERROR', message: 'Error loading recipe', data: {} }, status: :not_found\n end\n end", "def index\n @recipes = Recipe.where(nil)\n if params[:recipe].present?\n filtering_params(params).each do |key, value|\n @recipes = @recipes.public_send(key, value) if value.present?\n end\n end\n end", "def getRecipeByName\n begin\n @recipe = Recipe.find_by(name: params[:name])\n\n if @recipe.present?\n render json: { status: 'SUCCESS', message: 'Loaded recipe!', data: @recipe }, status: :ok\n else\n render json: { status: 'SUCCESS', message: 'No recipe found', data: {} }, status: :not_found\n end\n rescue\n render json: { status: 'ERROR', message: 'Error loading recipe', data: {} }, status: :not_found\n end\n end", "def index \n recipes = Recipe.all\n #render will return the object back in json format so that it can be used by the frontend\n render json: recipes, except: [:created_at, :updated_at]\n end", "def show\n @title = 'Categories'\n @recipes = @category.recipes.each{|c| [c.name, c.id] }\n end", "def index \n recipeIngredients = RecipeIngredient.all\n #render will return the object back in json format so that it can be used by the frontend\n render json: recipeIngredients\n end", "def index\n @page_title = \"All Recipes\"\n @recipes = Recipe.all\n end", "def index\n @meal_recipes = MealRecipe.all\n end", "def show\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_category }\n end\n end", "def index\n @recipes = Recipe.search(params[:search])\n @ingredients = Ingredient.all\n end" ]
[ "0.8315941", "0.76739687", "0.76456314", "0.75547504", "0.7492078", "0.7476003", "0.74459517", "0.7393438", "0.7300475", "0.7273354", "0.72657275", "0.7214473", "0.7162102", "0.71540695", "0.7122386", "0.71124816", "0.7101849", "0.70503086", "0.69963014", "0.6985436", "0.6985171", "0.69701636", "0.69150996", "0.6897325", "0.68297285", "0.681682", "0.67840844", "0.6779935", "0.6757738", "0.67491", "0.6737886", "0.6731784", "0.672209", "0.67178035", "0.669967", "0.6644709", "0.6636941", "0.6590566", "0.65848976", "0.65803665", "0.65395725", "0.6525429", "0.6517328", "0.6506425", "0.65063167", "0.65016615", "0.64833033", "0.6473663", "0.6472108", "0.6465809", "0.6462389", "0.6462389", "0.6462389", "0.6460808", "0.6459485", "0.6450219", "0.64471495", "0.64408576", "0.6421248", "0.6404808", "0.6397196", "0.63956076", "0.63956076", "0.63956076", "0.63956076", "0.63956076", "0.6394012", "0.6390857", "0.6387274", "0.63818216", "0.63596964", "0.6352204", "0.6340071", "0.63337255", "0.6330549", "0.63175994", "0.62997496", "0.62933815", "0.62865657", "0.6285007", "0.628193", "0.62812424", "0.6272897", "0.62586695", "0.62569636", "0.62539816" ]
0.7057095
29
GET /recipes/1 GET /recipes/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipes # /v1/user/:id/recipes (GET)\n recipes = ::Recipe.all\n render json: recipes, :each_serializer => RecipeSmallSerializer, root: false, status: 200\n end", "def show(id) \n response = request(:get, \"/recipes/#{id}.json\")\n response.first[1]\n end", "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end", "def show\n recipe = Recipe.find(params[:id])\n # recipes = Recipe.find_by(params[:id])\n # render json: recipe\n render json: recipe\n end", "def show\n\n recipe = Recipe.find(params[:id])\n render :json => recipe.to_json\n\n end", "def index\n @recipes = Recipe.all\n render json: @recipes\n end", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def show\n @data = @recipe.read(params[:id])\n render json: @data\n end", "def index\n @recipes = Recipe.all\n respond_to do |format|\n format.html {}\n format.json { render json: @recipes }\n end\n end", "def index\n @recipes = Recipe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipes }\n end\n end", "def ingredients_by_recipe\n recipe = Recipe.find(params[:id])\n render json: recipe.ingredients\n end", "def show\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def show\n @ingredient = Ingredient.find_by_url_slug(params[:id])\n @ingredient = Ingredient.find(params[:id]) if @ingredient.nil?\n @recipes = @ingredient.recipes.order('created_at DESC')\n logger.debug @recipes.inspect\n respond_to do |format|\n format.html {render :layout => 'wall'}\n format.json { render json: @ingredient }\n end\n end", "def show\n render json: @recipe\n end", "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end", "def show\n # accept the params\n # go to the db and get the correct recipe for that param\n p params[:id]\n @recipe = Recipe.find_by(id: params[:id])\n @ingredients = @recipe.ingredients.split(\", \").map {|ingredient| ingredient.capitalize}\n # send this to the view\n # show that data to the user\n render 'show.json.jb'\n end", "def show\n\t\t@recipe = Recipe.find(params[:id])\n\t\tif @recipe \n\t\t\trender json: @recipe.to_json(:include => [:inventories])\n\t\telse\n\t\t\trender status: 400, nothing: true\n\t\tend\n\tend", "def index\n recipes = current_user.recipes\n render json: { recipes: recipes}.to_json, status: :ok\n end", "def show\n respond_with Recipe.find(params[\"id\"])\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n @recipes = Recipe.all\n end", "def index\n render json: Recipe.all\n end", "def show\n respond_to do |format|\n format.html {}\n format.json { render json: @recipe }\n end\n end", "def show\n @recipe = Recipe.find(params[:id])\n end", "def list\n \n recipes = Recipe.all\n render :json => recipes.to_json\n\n end", "def index\n # @recipes = Recipe.all\n end", "def get_recipes(section)\n # Example: https://terraria.gamepedia.com/index.php?title=Recipes/Iron_Anvil&action=raw\n @connection.get '/index.php', {\n 'title' => \"Recipes/#{section}\",\n 'action' => 'raw'\n }\n end", "def show\n recipe_id = params[:id].to_i\n @recipe = Recipe.find(recipe_id)\n end", "def show\n @food_recipe = FoodRecipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food_recipe }\n end\n end", "def show\n @recipe = current_user.recipes.find(params[:id])\n @instructions = @recipe.instructions\n @ingredients = @recipe.ingredients\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def show\n if recipe\n render json: recipe\n else \n render json: {message: 'Recipe not found'}\n end\n end", "def show\r\n\r\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/information\")\r\n\r\n http = Net::HTTP.new(url.host, url.port)\r\n http.use_ssl = true\r\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request = Net::HTTP::Get.new(url)\r\n request[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"] # hidden API key\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response = http.request(request)\r\n @recipe = JSON.parse response.read_body # gets the recipe\r\n\r\n p url_ingredients = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/ingredientWidget.json\")\r\n\r\n http_ingredients = Net::HTTP.new(url_ingredients.host, url_ingredients.port)\r\n http_ingredients.use_ssl = true\r\n http_ingredients.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request_ingredients = Net::HTTP::Get.new(url_ingredients)\r\n request_ingredients[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"]\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response_ingredients = http.request(request_ingredients)\r\n # puts response_ingredients.read_body\r\n @ingredients = JSON.parse # data is a string (which looks like a hash -> convert to hash) response_ingredients.read_body\r\n p \"RECIPES\"\r\n # p @recipe\r\n p \"INGREDIENTS\"\r\n p @ingredients\r\n\r\n end", "def show\n\t\t@recipe = Recipe.find(params[:id])\n\tend", "def find_recipe\n @recipe = Recipe.find(params[:id])\n end", "def show\n @recipe = Recipe.find(params[:id])\n @recipeIngredients = RecipeIngredient.where(:recipeId => params[:id])\n @ingredients = Ingredient.where(:id => @recipeIngredients.select(:ingredientId))\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def recipe_info_for(id)\n response = Faraday.get(\"https://api.spoonacular.com/recipes/#{id}/information?includeNutrition=true&apiKey=#{spoonacular_key}\")\n JSON.parse response.body\n end", "def set_recipe\n @recipe = RecipeApi.find(params[:id])\n end", "def show\n @recipe_ingredient = Recipe_ingredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end", "def by_ingredient\n # If ingredient exists, find recipes that use it\n if Ingredient.exists?(params[:id])\n ingredient = Ingredient.find(params[:id])\n recipes = Recipe.recipes_of_ingredient(params[:id])\n else\n recipes = Recipe.all\n end\n\n # Render json\n render json: {recipes: recipes}, status: 200 \n end", "def find_recipe\n @recipe = Recipe.find(params[:id])\n end", "def show\n @meal = Meal.find(params[:meal_id]) if params[:meal_id]\n @recipe = @meal.recipes.find(params[:id]) if @meal\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def get_json\n recipe_json = File.read('./recipes.json')\n @json_recipes = JSON.parse(recipe_json)\n end", "def show\n @recipe_ingredient = RecipeIngredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end", "def show\n @recipe = EdemamApiWrapper.show_recipe(params[:uri])\n end", "def getRecipeByName\n begin\n @recipe = Recipe.find_by(name: params[:name])\n\n if @recipe.present?\n render json: { status: 'SUCCESS', message: 'Loaded recipe!', data: @recipe }, status: :ok\n else\n render json: { status: 'SUCCESS', message: 'No recipe found', data: {} }, status: :not_found\n end\n rescue\n render json: { status: 'ERROR', message: 'Error loading recipe', data: {} }, status: :not_found\n end\n end", "def index\n @recipes = RecipeCacheService.list(per_page: per_page_param, page: page_param)\n end", "def index\n\t\t@recipes = Recipe.where(user_id: session[:user_id])\n\t\tif @recipes\n\t\t\trender json: @recipes.to_json(:include => [:inventories])\n\t\telse\n\t\t\tflash[:error] = \"You haven't saved any recipes yet! Search now :)\"\n\t\t\trender status: 400, nothing: true\n\t\tend\n\tend", "def show\n @recipe_all = RecipeAll.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_all }\n end\n end", "def get_recipe(id)\n recipe = Recipe.find(id)\n url = \"https://api2.bigoven.com/recipe/steps/#{recipe.id}?&api_key=#{ENV['API_KEY']}\"\n uri = URI(url)\n response = Net::HTTP.get(uri)\n # puts response\n\n JSON.parse(response)[\"Ingredients\"].each do |ingredient|\n # recipe.ingredients.create!(\n if (!Ingredient.exists?(ingredient[\"IngredientID\"])) \n Ingredient.create!(\n id: ingredient[\"IngredientID\"],\n name: ingredient[\"Name\"],\n html_name: ingredient[\"HTMLName\"]\n )\n end\n end\n\n if (recipe.recipe_ingredients.count > 0)\n recipe.recipe_ingredients.destroy_all\n recipe.save\n recipe.reload\n end\n\n JSON.parse(response)[\"Ingredients\"].each do |ingredient|\n \n # if (!recipe.recipe_ingredients.find_by(ingredient_id: ingredient[\"IngredientID\"]))\n recipe.recipe_ingredients.create!(\n ingredient_id: ingredient[\"IngredientID\"],\n quantity: ingredient[\"Quantity\"],\n display_quantity: ingredient[\"DisplayQuantity\"],\n unit: ingredient[\"Unit\"],\n metric_quantity: ingredient[\"MetricQuantity\"],\n metric_display_quantity: ingredient[\"MetricDisplayQuantity\"],\n metric_unit: ingredient[\"MetricUnit\"],\n preparation_notes: ingredient[\"PreparationNotes\"]\n )\n # end\n end\n \n recipe.steps = ''\n steps = JSON.parse(response)[\"Steps\"]\n steps.each do |step|\n step != steps.last ? recipe.steps += step[\"Text\"] + '$' : recipe.steps += step[\"Text\"]\n # recipe.steps += step[\"Text\"] + ','\n end\n \n recipe.save\n end", "def index\n recipe_items = current_user.recipes.includes(recipe_items: :ingredient).find(params[:recipe_id]).recipe_items\n render json: { recipe_items: recipe_items}.to_json(include: :ingredient), status: :ok\n end", "def user\n\t\t@recipes = Recipe.find_by_user_id(params[:id])\n\t\trespond_with @recipes\n\tend", "def userRecipe\n @user_id = params[:id]\n @user = User.find_by(id: @user_id)\n @recipes = Recipe.where(user_id: @user_id)\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end", "def index\n @recipes = (!params[:recipe].blank?)? Recipe.where(\"id in (\" + params[:recipe] + \")\") : Recipe.all\n @recipes_json = Recipe.where(\"title ilike ?\", \"%#{params[:q]}%\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: custom_json_for(@recipes_json)}\n end\n end", "def index\n @recipes = Recipe.all\n @recipe = Recipe.new \n end", "def create\n recipe = Recipe.create(recipe_params)\n render json: recipe\n end", "def index\n @recipe_list = Recipe.where(category_id: params[:category_id])\n # Looks in recipe where the key, category_id is equal to the endpoint\n\n if @recipe_list.empty?\n render :json => {\n :error => 'Oops, no recipes yet! Add some now.'\n }\n else\n render :json => {\n :response => \"successful\",\n :data => @recipe_list\n }\n end\n end", "def show\n recipe = EdamamApiWrapper.show_recipe(params[:id])\n if recipe == nil\n flash[:error] = \"Recipe does not exist. Please do a new recipes search.\"\n redirect_to root_path\n else\n @recipe = recipe\n end\n end", "def show\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_category }\n end\n end", "def index\n render 'recipes/index'\n end", "def findrecipes\n\t\t@hide_menu = true\n puts \"In Find Recipes\"\n #this is where the data for the searching of recipes gets routed into\n input = params['query'].inspect\n\n ingreds = input.split(',')\n\n input = ingreds.join(\"%2C\")\n #this is the api \n url = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/findByIngredients?fillIngredients=false&ingredients=\" + input + \"&limitLicense=false&number=5&ranking=1\"\n\n res = Unirest.get url,\n headers:{\n \"X-Mashape-Key\" => \"UpZLcnOR83mshtXvuIOPFXBkfhn5p1UWi1ejsnsTLWoVXrOppm\",\n \"Accept\" => \"application/json\"\n }\n\n recipes = res.body\n #for each recipe that gets returned, the following information is routed into the recipe results page\n recipes.each do |recipe|\n url2 = url2 = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/\" + recipe['id'].to_s + \"/information?includeNutrition=false\"\n\n res2 = Unirest.get url2,\n headers:{\n \"X-Mashape-Key\" => \"UpZLcnOR83mshtXvuIOPFXBkfhn5p1UWi1ejsnsTLWoVXrOppm\",\n \"Accept\" => \"application/json\"\n }\n\n price = (\"$\" + (0.01 * res2.body['pricePerServing']).to_s)[0..5]\n\n recipe['price'] = price\n #this is the price of a recipe per serving\n\n end\n\n @recipeData = recipes\n render template: \"recipes/data\"\n end", "def recipes\n @ingredient = Ingredient.find(params[:id])\n \n respond_to do |format|\n format.html do\n @recipes = @ingredient.recipes.paginate(:page => params[:page], :order => 'name', :per_page => 5)\n end # recipes.html.haml\n format.xml do\n @recipes = @ingredient.recipes\n render :xml => @recipes\n end\n end\n end", "def get_from_npr(user_ingredients)\n raw_response=RestClient.get('http://api.npr.org/query?id=1139&fields=title,teaser,storyDate,byline,text&date&searchTerm=' + user_ingredients + '&dateType=story&output=JSON&apiKey=MDE5MDExNzc1MDE0MzA0MDE1NTViZDViOQ001')\n response = JSON.load(raw_response)\n\n if response[\"list\"][\"story\"] == nil\n puts \"Your search did not find any recipes...\"\n else\n recipes = response[\"list\"][\"story\"].map do |recipe|\n Recipe.new(\n title = recipe[\"title\"][\"$text\"],\n teaser = recipe[\"teaser\"][\"$text\"],\n link = recipe[\"link\"].first[\"$text\"],\n storyDate = recipe[\"storyDate\"][\"$text\"]\n )\n end\n end\n\nend", "def find_recipe\n \t\t@recipe = Recipe.friendly.find(params[:id])\n \tend", "def show\n @recipe = RecipeCacheService.find(params[:id])\n end", "def index\n @recipes = Recipe.render_all\n end", "def index\n @ingredient_recipes = IngredientRecipe.all\n end", "def show\n @recipe = Recipe.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @recipe }\n end\n end", "def set_recipe\n @recipe = Recipe.where(id: params[:id]).first\n render_404 unless @recipe\n end", "def read_json\n recipes_json = File.read('JSON/recipes.json')\n recipe_hash = JSON.parse(recipes_json)\n return recipe_hash\nend", "def show\n @recipe = Recipe.find(params[:id])\n @nutrition_info = NutritionInfo.where( \"recipe_id = ?\", @recipe.id ).first\n @inventory_items = []\n @recipe.inventory_items.each do |inventory_item|\n @inventory_items << inventory_item\n end\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def show\n @recipe = Recipe.find(params[:id])\n @ingredients = @recipe.ingredients\n @instructions_domain = @recipe.instruction_url_split\n @nutrition_info = @recipe.nutrition_informations\n @health_labels = @recipe.health_labels\n end", "def delete(id)\n request(:delete, \"/recipes/#{id}.json\")\n end", "def new\n @recipeingredient = Recipe_ingredient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end", "def list\n display_recipes\n end", "def list_ingredients\n rid = params[:id]\n items = Aws.get_ingredients_from_db(rid)\n render :json => items\n end", "def set_recipe\n @recipe = Recipe.find(params[:id])\n end", "def set_recipe\n @recipe = Recipe.find(params[:id])\n end", "def set_recipe\n @recipe = Recipe.find(params[:id])\n end", "def set_recipe\n @recipe = Recipe.find(params[:id])\n end", "def set_recipe\n @recipe = Recipe.find(params[:id])\n end", "def getRecipeByTag\n begin\n @recipe = Recipe.where('tags ILIKE ?', '%'+params[:tag]+'%').all\n\n if !@recipe.empty?\n render json: { status: 'SUCCESS', message: 'Loaded recipe!', data: @recipe }, status: :ok\n else\n render json: { status: 'SUCCESS', message: 'No recipe found', data: {} }, status: :not_found\n end\n rescue\n render json: { status: 'ERROR', message: 'Error loading recipe', data: {} }, status: :not_found\n end\n end", "def set_recipe\n @recipe = Recipe.find(params[:id])\n end", "def set_recipe\n @recipe = Recipe.find(params[:id])\n end" ]
[ "0.79414284", "0.790214", "0.75844485", "0.756833", "0.7435937", "0.7432573", "0.7403042", "0.7356558", "0.7325271", "0.7305129", "0.72860897", "0.726182", "0.723712", "0.71111596", "0.70902306", "0.7004932", "0.70041907", "0.69779086", "0.69637275", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.6949757", "0.69176924", "0.69135606", "0.69094366", "0.6907028", "0.69053125", "0.6894083", "0.6890568", "0.6852517", "0.6852079", "0.68328756", "0.68323183", "0.6799322", "0.6785318", "0.67711586", "0.6744038", "0.6737561", "0.67170906", "0.67065144", "0.67006236", "0.6694845", "0.6687984", "0.6682677", "0.66545105", "0.6632911", "0.66269714", "0.661954", "0.66153836", "0.6578738", "0.6575574", "0.6566427", "0.65469056", "0.6544494", "0.6544494", "0.6544494", "0.6544494", "0.6544494", "0.6543405", "0.65417534", "0.65059304", "0.6497512", "0.64965665", "0.64904445", "0.64779025", "0.64619064", "0.6451941", "0.6442731", "0.6437238", "0.64339733", "0.63870364", "0.6384307", "0.6346829", "0.63446105", "0.634192", "0.6331833", "0.6329156", "0.632741", "0.6316732", "0.6297295", "0.6285973", "0.6285182", "0.6285182", "0.6285182", "0.6285182", "0.6285182", "0.6279891", "0.6278118", "0.6276886" ]
0.0
-1
TODO: Use Acts as State Machine gem
def post_to_twitter if valid? ActiveRecord::Base.transaction do self.published = true self.published_at = DateTime.now save! tweet = client.update(text) self.tweet_id = tweet.id save! return true end else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state\n end", "def states; end", "def enter_state\n end", "def known_states; end", "def known_states; end", "def known_states; end", "def state\n @state\n end", "def from_states; end", "def from_states; end", "def game_state\n end", "def state\n object.state_code\n end", "def _lex_to_state_actions; end", "def _lex_to_state_actions; end", "def _lex_to_state_actions; end", "def _lex_to_state_actions; end", "def state\n @state\n end", "def state_machine()\n parse_sucess = false\n if event_block && optional_reset_block()\n # if event_block() && optional_reset_block() &&\n # optional_command_block() && state_list()\n parse_sucess = true\n end\n parse_sucess\n end", "def extra_state; end", "def before_state(state)\n end", "def print_state(machine)\n puts \"[#{machine[:stack]}, #{machine[:register]}]\"\nend", "def state\n @state\n end", "def state\n @current_state\n end", "def read_state\n end", "def name\n state_name\n end", "def initialize\n @state = :new\n end", "def state_code\n end", "def get_state\n@state.keys\nend", "def _lex_from_state_actions; end", "def _lex_from_state_actions; end", "def _lex_from_state_actions; end", "def _lex_from_state_actions; end", "def state_machine \r\n \r\n # Give the statemachine the statestore, its used in random walks etc\r\n @state_machine.adjacency_matrix=create_adjacency_matrix(@temp_transition_list)\r\n @state_machine.states_store=self.states_store\r\n\t\t@state_machine.guarded_actions=@guards\r\n return @state_machine\r\n end", "def state_code\n end", "def state_machine_details\n erb(:state_machines) if state_machines\nend", "def state\n @state.first\n end", "def state=(_arg0); end", "def state=(_arg0); end", "def state=(_arg0); end", "def state\n states.first\n end", "def state_machine\n @state_machine ||= RequestStateMachine.new(self, transition_class: ServiceTransition)\n end", "def state\n self[:ST]\n end", "def trigger!\n\treturn if (@next_state_name == nil)\n\n\tcurrent_state = nil\n current_state = @states.fetch(@current_state_name) unless @current_state_name.nil?\n\n\tnext_state = @states.fetch(@next_state_name)\n next_state_name = @next_state_name\n\n\t@next_state_name = nil\n\n\tcurrent_state.atexit if(current_state.respond_to?(:atexit))\n\t@current_state_name = next_state_name\n\tnext_state.atentry if(next_state.respond_to?(:atentry))\n end", "def current_state_number\n 1\n end", "def on_state_begin(state_id)\n end", "def state\n @game.state\n end", "def state\n object.human_state_name\n end", "def states\n raise \"You must override the states method.\"\n end", "def state\n self.well_info.state\n end", "def test_read_action_variables\n smc = a_guarded_state_machine\n \n smc.define_reader :logged_in do; @logged_in ;end\n sm = smc.state_machine\n sm.state=:HOME\n sm.click_log_in\n assert_equal(:LOG_IN_COMPLETE, sm.state , \"Check Logged in.\")\n puts\n puts \"Variables:\"\n puts sm.read_logged_in\n assert(sm.read_logged_in , \"Check logged in is accessible and true\")\n\n end", "def state\n status.state name\n end", "def live\r\n @state=1\r\n end", "def state\n @@states[@state]\n end", "def after_state(state)\n end", "def setup(state) ; end", "def next states\n raise \"Must be implemented by subclass\"\n end", "def define_state_predicate; end", "def state\n State.instance\n end", "def state_obj; @_hegemon_states[@_hegemon_state]; end", "def state\n data.state\n end", "def state\n data.state\n end", "def states; @_hegemon_states.keys; end", "def states\n\t[:shelf,:in_use,:borrowed,:misplaced,:lost]\nend", "def new_state\nnewID = @@nextID\n@@nextID += 1\n@state[newID] = true\n@transition[newID] = {}\nnewID\nend", "def define_state_accessor; end", "def game_state(game_id)\n\n end", "def write_state; end", "def write_state; end", "def add_state(v)\nunless has_state?(v)\n@state[v] = true\n@transition[v] = {}\nend\nend", "def gamestate\n\t\t@game_state\n\tend", "def execState\n findNextState\n current_state = @state_list[@state][@transition]\n\n @transition = eval \"#{@state}\"\n @history.push @state\n\n @finished = @state == :finish\n end", "def state\n data[:state]\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def state\n \n session[ flow_session_name ].fetch( state_session_name )\n \n end", "def state_machine(&blk)\n Builder.new(self).build(&blk)\n end", "def state\n info[:state]\n end", "def state\n @gameState.state\n end", "def state\r\n\t\t\t`#{BITS::BITSADMIN} /getstate {#{@id}}`\r\n\t\tend", "def state\n module_name = self.class.name.underscore.gsub!('skej/state_logic/','')\n @STATE_KEY ||= module_name.to_sym\n end", "def states\n []\n end", "def states\n []\n end", "def current_state\n find_state(@current_state_name)\n # TODO: add caching, i.e. with `@current_state ||= ...`\n end", "def new_state\n newID = @@nextID\n @@nextID += 1\n @state[newID] = true\n @transition[newID] = {}\n newID \n end", "def new_state\n newID = @@nextID\n @@nextID += 1\n @state[newID] = true\n @transition[newID] = {}\n newID \n end", "def new_state\n newID = @@nextID\n @@nextID += 1\n @state[newID] = true\n @transition[newID] = {}\n newID \n end", "def current_state_s\n self.current_state.to_s.humanize.downcase\n end", "def current_state_s\n self.current_state.to_s.humanize.downcase\n end", "def enter_state\n puts \"Entering #{self.class}\"\n execution_state = EXECUTION_STATE[:active]\n end", "def _lex_to_state_actions=(_arg0); end", "def _lex_to_state_actions=(_arg0); end", "def _lex_to_state_actions=(_arg0); end", "def _lex_to_state_actions=(_arg0); end", "def state_machine\n @state_machine ||= self.class.instantiate_state_machine_template\n end", "def has_state?(v)\n@state[v]\nend" ]
[ "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7597168", "0.7540766", "0.7316112", "0.7092373", "0.7092373", "0.7092373", "0.70001835", "0.68278223", "0.68278223", "0.6821809", "0.6787851", "0.6758319", "0.6758319", "0.6758319", "0.6758319", "0.6751224", "0.6627549", "0.6610691", "0.65635353", "0.65473354", "0.6533899", "0.6528743", "0.65180564", "0.6478275", "0.6475867", "0.64737016", "0.6471956", "0.64711183", "0.64711183", "0.64711183", "0.64711183", "0.6451194", "0.64384013", "0.64321935", "0.64222497", "0.6408518", "0.6408518", "0.6408518", "0.64021367", "0.6402012", "0.63815737", "0.6381381", "0.63800347", "0.6371505", "0.6361891", "0.63581854", "0.63581705", "0.6355987", "0.6354798", "0.6352952", "0.6349161", "0.634335", "0.6341474", "0.6339509", "0.6336989", "0.6299131", "0.62959135", "0.62631345", "0.62593436", "0.62593436", "0.62562233", "0.6255904", "0.62460935", "0.6244889", "0.6234869", "0.622574", "0.622574", "0.6223415", "0.6219517", "0.6217873", "0.6199659", "0.6190217", "0.6176126", "0.61712706", "0.61592585", "0.61562514", "0.6154861", "0.61393005", "0.6132905", "0.6132905", "0.61318976", "0.61267895", "0.61267895", "0.61267895", "0.6125303", "0.6125303", "0.6124715", "0.61070305", "0.61070305", "0.61070305", "0.61070305", "0.61042583", "0.609686" ]
0.0
-1
TODO: Use Acts as State Machine gem
def delete_from_twitter self.post_at = nil if valid? ActiveRecord::Base.transaction do self.published = false self.published_at = nil self.save! client.destroy_status(tweet_id) if tweet_id.present? end return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state\n end", "def states; end", "def enter_state\n end", "def known_states; end", "def known_states; end", "def known_states; end", "def state\n @state\n end", "def from_states; end", "def from_states; end", "def game_state\n end", "def state\n object.state_code\n end", "def _lex_to_state_actions; end", "def _lex_to_state_actions; end", "def _lex_to_state_actions; end", "def _lex_to_state_actions; end", "def state\n @state\n end", "def state_machine()\n parse_sucess = false\n if event_block && optional_reset_block()\n # if event_block() && optional_reset_block() &&\n # optional_command_block() && state_list()\n parse_sucess = true\n end\n parse_sucess\n end", "def extra_state; end", "def before_state(state)\n end", "def print_state(machine)\n puts \"[#{machine[:stack]}, #{machine[:register]}]\"\nend", "def state\n @state\n end", "def state\n @current_state\n end", "def read_state\n end", "def name\n state_name\n end", "def initialize\n @state = :new\n end", "def state_code\n end", "def get_state\n@state.keys\nend", "def _lex_from_state_actions; end", "def _lex_from_state_actions; end", "def _lex_from_state_actions; end", "def _lex_from_state_actions; end", "def state_machine \r\n \r\n # Give the statemachine the statestore, its used in random walks etc\r\n @state_machine.adjacency_matrix=create_adjacency_matrix(@temp_transition_list)\r\n @state_machine.states_store=self.states_store\r\n\t\t@state_machine.guarded_actions=@guards\r\n return @state_machine\r\n end", "def state_code\n end", "def state_machine_details\n erb(:state_machines) if state_machines\nend", "def state\n @state.first\n end", "def state=(_arg0); end", "def state=(_arg0); end", "def state=(_arg0); end", "def state\n states.first\n end", "def state_machine\n @state_machine ||= RequestStateMachine.new(self, transition_class: ServiceTransition)\n end", "def state\n self[:ST]\n end", "def trigger!\n\treturn if (@next_state_name == nil)\n\n\tcurrent_state = nil\n current_state = @states.fetch(@current_state_name) unless @current_state_name.nil?\n\n\tnext_state = @states.fetch(@next_state_name)\n next_state_name = @next_state_name\n\n\t@next_state_name = nil\n\n\tcurrent_state.atexit if(current_state.respond_to?(:atexit))\n\t@current_state_name = next_state_name\n\tnext_state.atentry if(next_state.respond_to?(:atentry))\n end", "def current_state_number\n 1\n end", "def on_state_begin(state_id)\n end", "def state\n @game.state\n end", "def state\n object.human_state_name\n end", "def states\n raise \"You must override the states method.\"\n end", "def state\n self.well_info.state\n end", "def test_read_action_variables\n smc = a_guarded_state_machine\n \n smc.define_reader :logged_in do; @logged_in ;end\n sm = smc.state_machine\n sm.state=:HOME\n sm.click_log_in\n assert_equal(:LOG_IN_COMPLETE, sm.state , \"Check Logged in.\")\n puts\n puts \"Variables:\"\n puts sm.read_logged_in\n assert(sm.read_logged_in , \"Check logged in is accessible and true\")\n\n end", "def state\n status.state name\n end", "def live\r\n @state=1\r\n end", "def state\n @@states[@state]\n end", "def after_state(state)\n end", "def setup(state) ; end", "def next states\n raise \"Must be implemented by subclass\"\n end", "def define_state_predicate; end", "def state\n State.instance\n end", "def state_obj; @_hegemon_states[@_hegemon_state]; end", "def state\n data.state\n end", "def state\n data.state\n end", "def states; @_hegemon_states.keys; end", "def states\n\t[:shelf,:in_use,:borrowed,:misplaced,:lost]\nend", "def new_state\nnewID = @@nextID\n@@nextID += 1\n@state[newID] = true\n@transition[newID] = {}\nnewID\nend", "def define_state_accessor; end", "def game_state(game_id)\n\n end", "def write_state; end", "def write_state; end", "def add_state(v)\nunless has_state?(v)\n@state[v] = true\n@transition[v] = {}\nend\nend", "def gamestate\n\t\t@game_state\n\tend", "def execState\n findNextState\n current_state = @state_list[@state][@transition]\n\n @transition = eval \"#{@state}\"\n @history.push @state\n\n @finished = @state == :finish\n end", "def state\n data[:state]\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def state\n \n session[ flow_session_name ].fetch( state_session_name )\n \n end", "def state_machine(&blk)\n Builder.new(self).build(&blk)\n end", "def state\n info[:state]\n end", "def state\n @gameState.state\n end", "def state\r\n\t\t\t`#{BITS::BITSADMIN} /getstate {#{@id}}`\r\n\t\tend", "def state\n module_name = self.class.name.underscore.gsub!('skej/state_logic/','')\n @STATE_KEY ||= module_name.to_sym\n end", "def states\n []\n end", "def states\n []\n end", "def current_state\n find_state(@current_state_name)\n # TODO: add caching, i.e. with `@current_state ||= ...`\n end", "def new_state\n newID = @@nextID\n @@nextID += 1\n @state[newID] = true\n @transition[newID] = {}\n newID \n end", "def new_state\n newID = @@nextID\n @@nextID += 1\n @state[newID] = true\n @transition[newID] = {}\n newID \n end", "def new_state\n newID = @@nextID\n @@nextID += 1\n @state[newID] = true\n @transition[newID] = {}\n newID \n end", "def current_state_s\n self.current_state.to_s.humanize.downcase\n end", "def current_state_s\n self.current_state.to_s.humanize.downcase\n end", "def enter_state\n puts \"Entering #{self.class}\"\n execution_state = EXECUTION_STATE[:active]\n end", "def _lex_to_state_actions=(_arg0); end", "def _lex_to_state_actions=(_arg0); end", "def _lex_to_state_actions=(_arg0); end", "def _lex_to_state_actions=(_arg0); end", "def state_machine\n @state_machine ||= self.class.instantiate_state_machine_template\n end", "def has_state?(v)\n@state[v]\nend" ]
[ "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7696144", "0.7597168", "0.7540766", "0.7316112", "0.7092373", "0.7092373", "0.7092373", "0.70001835", "0.68278223", "0.68278223", "0.6821809", "0.6787851", "0.6758319", "0.6758319", "0.6758319", "0.6758319", "0.6751224", "0.6627549", "0.6610691", "0.65635353", "0.65473354", "0.6533899", "0.6528743", "0.65180564", "0.6478275", "0.6475867", "0.64737016", "0.6471956", "0.64711183", "0.64711183", "0.64711183", "0.64711183", "0.6451194", "0.64384013", "0.64321935", "0.64222497", "0.6408518", "0.6408518", "0.6408518", "0.64021367", "0.6402012", "0.63815737", "0.6381381", "0.63800347", "0.6371505", "0.6361891", "0.63581854", "0.63581705", "0.6355987", "0.6354798", "0.6352952", "0.6349161", "0.634335", "0.6341474", "0.6339509", "0.6336989", "0.6299131", "0.62959135", "0.62631345", "0.62593436", "0.62593436", "0.62562233", "0.6255904", "0.62460935", "0.6244889", "0.6234869", "0.622574", "0.622574", "0.6223415", "0.6219517", "0.6217873", "0.6199659", "0.6190217", "0.6176126", "0.61712706", "0.61592585", "0.61562514", "0.6154861", "0.61393005", "0.6132905", "0.6132905", "0.61318976", "0.61267895", "0.61267895", "0.61267895", "0.6125303", "0.6125303", "0.6124715", "0.61070305", "0.61070305", "0.61070305", "0.61070305", "0.61042583", "0.609686" ]
0.0
-1
See files in the same directory: Given `helper_test.md`, returns `helper_modified.md`.
def number_questions_and_add_answer_templates(text) # Number the first question modified = "1." + text[1..-1] # Number the rest of the questions and add answer templates number = 1 new_question = /\n# [A-Z]/ answer_template = "\n<details><summary><b>Answer</b></summary>\n<p>\n\n``\n\n</p>\n</details>" divider = "\n\n---\n\n" modified.gsub!(new_question) do |str| number += 1 "#{answer_template}#{divider}#{number}. #{str[-1]}" end # Add answer template to the last question modified + answer_template end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def helper_files\n glob = Dir.glob(File.join(test_folder, \"helpers\", \"*/**/*\"))\n glob.reject { |f| File.directory?(f) }\n end", "def helper_files\n glob = File.join(\"helpers\", \"*/**/*\")\n Util.safe_glob(config[:test_base_path], glob).reject { |f| File.directory?(f) }\n end", "def helper_files\n glob = File.join(config[:test_base_path], 'helpers', '*/**/*')\n Dir.glob(glob).reject { |f| File.directory?(f) }\n end", "def md_erb_files\n Dir.glob(\"**/*.md.erb\").reject do |path|\n [\"license\", \"readme\"].any? do |str|\n path.downcase.ends_with? \"#{str}.md.erb\"\n end\n end\n end", "def find_readme repo_dir\n files = Dir.entries(repo_dir).sort\n files.each { |f| return f if f.downcase.include? 'readme' }\n return ''\nend", "def build_test_helper \n \n return if skip_method(__method__)\n \n puts \"build Rails test helper for #{model_name} in test/helpers\"\n filename = \"#{plural_table_name}_helper_test.rb\"\n\n template = File.read(template(\"rails/test/helper_test.rb\"))\n # #text = ERB.new(template, nil, '-').result(binding)\n text = Erubis::Eruby.new(template).evaluate( self )\n\n path = namespaced_path(\"test/helpers\",filename)\n write_artifact(path,text) \n end", "def to_markdown\n files = Dir.glob('**/*.html')\n files.each do |f|\n new_f = f.gsub 'html', 'markdown'\n system \"mv #{f} #{new_f}\" if File.file? f\n end\n end", "def test_should_create_a_helper_file\n run_generator %w(foo)\n assert_file \"#{javascripts_path}/helpers/foo.js.coffee\"\n end", "def testget_leveled_file_contentUselessLVL\n # If set to 1, nothing will be leveled.\n RCodeLeveler::set_level(1)\n lNewContent, lDiff = RCodeLeveler.get_leveled_file_content('RequiredFiles/SimpleFile')\n File.open(\"#{File.dirname(__FILE__)}/RequiredFiles/SimpleFile.rb\", 'r') do |iFile|\n assert_equal(iFile.readlines, lNewContent)\n end\n assert_equal(false, lDiff)\n end", "def get_content(file_path)\n puts \"getting markdown for: #{file_path}.md\\n\\n\"\n file = File.open(\"data/pages/#{file_path}.md\", \"r\")\n return file.read\nend", "def replace_readme(&block)\n remove_file 'README.doc'\n remove_file 'README.md'\n\n create_file 'README.md'\n append_file 'README.md', yield\nend", "def test_files\n `touch ../harness/test/foo ../harness/test/bar`\n f = @td.files\n assert_equal(2, f.length)\n assert(f.find \"foo\")\n assert(f.find \"bar\")\n end", "def path\n @absolute_path.sub(%r{^#{Slimdown.config.location}/(.*)\\.md}, '\\1')\n end", "def read_content(dir, magic_dir, matcher); end", "def target_path(source)\n source.\n sub(/^#{SRC_DIR}/, \"#{DST_DIR}\").\n sub(/\\.md$/, \".html\")\nend", "def example_markdown_targets()\n target_files = []\n\n example_dir = File.join(K4_ROOT, 'example')\n ext = 'md'\n filelist = FileList[File.join(example_dir, \"*.#{ext}\")]\n filelist.each do |source_path|\n source_basename = File.basename(source_path)\n next if source_basename =~ /^_/\n\n source_basename = source_basename.gsub(/#{ext}$/, 'html')\n target_path = File.join(example_dir, source_basename)\n # File.delete(target_path) if File.exists?(target_path)\n\n file(target_path) do |t, args|\n puts t.name\n src = File.read(source_path)\n compiler_ = MarkdownCompiler.new(@compiler)\n html_source = compiler_.to_slide(src)\n File.open(target_path, 'w') do |io|\n io.write(html_source)\n end\n end\n target_files << target_path\n end\n return target_files\n end", "def copy_markdown_files\n %w[AUTHORS.md CODE_OF_CONDUCT.md TODO.md].map { |f| copy_file(f, f) }\n end", "def helper_target_dir\n helper_source_dir\n end", "def add_measure_readme(measures_dir, doc_templates_dir)\n puts 'Adding measure readmes'\n if measures_dir.nil? || measures_dir.empty?\n puts 'Measures dir is nil or empty'\n return true\n elsif doc_templates_dir.nil? || doc_templates_dir.empty?\n puts 'Measures files dir is nil or empty'\n return false\n end\n\n result = false\n readme_file = File.join(doc_templates_dir, 'README.md.erb')\n puts \"Readme file path: #{readme_file}\"\n\n raise \"Readme file not found '#{readme_file}'\" if !File.exist?(readme_file)\n\n measures = Dir[\"#{measures_dir}/**/measure.rb\"]\n if measures.empty?\n # also try nested 2-deep to support openstudio-measures\n measures = Dir[\"#{measures_dir}/**/**/measure.rb\"]\n end\n measures.each do |measure|\n next if File.exist?(\"#{File.dirname(measure)}/README.md.erb\")\n next if File.exist?(\"#{File.dirname(measure)}/README.md\")\n\n puts \"adding template README to #{measure}\"\n FileUtils.cp(readme_file, \"#{File.dirname(measure)}/README.md.erb\")\n end\n result = true\n return result\n end", "def testget_leveled_file_contentUselessLVLBlock\n # If set to 2, nothing will be leveled.\n RCodeLeveler::set_level(2)\n lNewContent, lDiff = RCodeLeveler.get_leveled_file_content('RequiredFiles/SimpleFileBlock')\n File.open(\"#{File.dirname(__FILE__)}/RequiredFiles/SimpleFileBlock.rb\", 'r') do |iFile|\n assert_equal(iFile.readlines, lNewContent)\n end\n assert_equal(false, lDiff)\n end", "def convertHtmlToMarkdown\n root = pathExports\n n = 1\n Pathname.glob(pathExports() + \"**/*.html\").each do |p|\n puts \"File \" + n.to_s + \": \" + p.to_s\n n = n + 1\n infile = p.to_s\n outfile = p.sub_ext(\".md\").to_s\n command = \"pandoc -f html -t markdown -o #{outfile} #{infile}\"\n puts command\n sh(command)\n end\nend", "def copy_test_files\n if options.deep_symbolize_keys[:test_framework] == 'minitest'\n template \"#{TEMPLATES_DIR}/test/test_helper.rb\", \"#{name}/test/test_helper.rb\"\n template \"#{TEMPLATES_DIR}/test/lib/newgem/test_newgem.rb\", \"#{name}/test/lib/#{name}/test_#{name}.rb\"\n else\n template \"#{TEMPLATES_DIR}/spec/spec_helper.rb\", \"#{name}/spec/spec_helper.rb\"\n template \"#{TEMPLATES_DIR}/spec/lib/newgem/newgem_spec.rb\", \"#{name}/spec/lib/#{name}/#{name}_spec.rb\"\n end\n end", "def fs_to_doc_path(fs_path)\n fs_path.gsub /(README)?\\.md$/, \"\"\n end", "def testget_leveled_file_contentNoLVL\n RCodeLeveler::set_level(2)\n lNewContent, lDiff = RCodeLeveler.get_leveled_file_content('RequiredFiles/SimpleFileWithNoLVL')\n File.open(\"#{File.dirname(__FILE__)}/RequiredFiles/SimpleFileWithNoLVL.rb\", 'r') do |iFile|\n assert_equal(iFile.readlines, lNewContent)\n end\n assert_equal(false, lDiff)\n end", "def test_create_example_file\n sample_file='maml.yml'\n FileUtils.rm sample_file if File.exists? sample_file\n Maml::create_sample\n assert File.exists?(sample_file), \"create_sample_file\"\n end", "def make_me_some_markdown\n\tputs \"write the name of the markdown file\"\n\tfile = gets.chomp.downcase\n\tputs `touch #{file}.md`\nend", "def test_files\n code_files_in(tests_dir, CPP_EXTENSIONS)\n end", "def markdown\n return if changed_markdown_files.empty?\n\n output = `mdl #{changed_markdown_files.join(' ')}`\n return if output&.empty?\n\n heading('Markdown Linter', output)\n end", "def extension\n 'md'\n end", "def prepare_helpers\n base = File.join(test_folder, \"helpers\")\n\n helper_files.each do |src|\n dest = File.join(sandbox_path, src.sub(\"#{base}/\", \"\"))\n debug(\"Copying #{src} to #{dest}\")\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest, preserve: true)\n end\n end", "def build_mdlinks\n return unless options.Build_Markdown_Links\n\n puts_cyan \"Middlemac is creating `#{options.File_Markdown_Links}`.\"\n\n files_array = []\n out_array = []\n longest_shortcut = 0\n longest_path = 0\n\n Dir.glob(\"#{app.source}/Resources/**/*.erb\").each do |fileName|\n\n # Remove all file extensions and make a shortcut\n base_name = fileName\n while File.extname(base_name) != '' do\n base_name = File.basename( base_name, '.*' )\n end\n next if base_name.start_with?('_') # || base_name == 'index'\n\n if base_name == 'index'\n shortcut = \"[#{File.split(File.split(fileName)[0])[1]}_index]:\"\n\n else\n shortcut = \"[#{base_name}]:\"\n end\n\n # Make a fake absolute path\n path = Pathname.new(fileName).relative_path_from(Pathname.new(app.source))\n path = File::SEPARATOR + File.join(File.dirname(path), base_name) + '.html'\n\n # Get the title, if any\n metadata = YAML.load_file(fileName)\n title = (metadata.is_a?(Hash) && metadata.key?('title')) ? metadata['title'] : ''\n\n files_array << { :shortcut => shortcut, :path => path, :title => title }\n\n longest_shortcut = shortcut.length if shortcut.length > longest_shortcut\n longest_path = path.length if path.length > longest_path\n\n end\n\n files_array = files_array.sort_by { |key| [File.split(key[:path])[0], key[:path]] }\n files_array.uniq.each do |item|\n item[:shortcut] = \"%-#{longest_shortcut}.#{longest_shortcut}s\" % item[:shortcut]\n\n if item[:title].length == 0\n out_array << \"#{item[:shortcut]} #{item[:path]}\"\n else\n item[:path] = \"%-#{longest_path}.#{longest_path}s\" % item[:path]\n out_array << \"#{item[:shortcut]} #{item[:path]} \\\"#{item[:title]}\\\"\"\n end\n end\n\n File.open(options.File_Markdown_Links, 'w') { |f| out_array.each { |line| f.puts(line) } }\n\n end", "def get_relevant_notes_file(a_path)\n if a_path.children.include?(a_path + NOTES_FILENAME)\n return a_path + NOTES_FILENAME\n else\n if a_path == HOME_PATH\n return HOME_PATH + NOTES_FILENAME\n else\n here = a_path.parent\n if '/' == here.to_s\n return HOME_PATH + NOTES_FILENAME\n else\n return get_relevant_notes_file(here)\n end\n end\n end\nend", "def test_index\n create_document(\"about.md\") # setup necessary data\n create_document(\"changes.txt\")\n\n get \"/\"\n \n assert_equal(200, last_response.status)\n assert_equal(\"text/html;charset=utf-8\", last_response[\"Content-Type\"])\n assert_includes(last_response.body, \"about.md\")\n assert_includes(last_response.body, \"changes.txt\")\n\n end", "def readme(builder)\n file = builder.repo.root.children.find do |val|\n val =~ /readme/i\n end\n\n return unless file\n file.safe_copy(builder.repo.cache_dir, {\n :root => file.parent\n })\n end", "def test_for(file)\n base = File.basename(file)\n extension = File.extname(base)\n dir = File.dirname(file)\n dir_array = dir.split('/')\n if extension == '.rb' and dir_array.first=='test'\n return file\n end\n if extension == '.rb'\n base_without_extension = base[0, base.size - extension.size]\n test_file = base_without_extension + '_test' + extension\n else\n test_file = base + '_test.rb'\n end\n dir_array[0]='test'\n case dir_array[1]\n when 'controllers'\n dir_array[1] = 'functional'\n when 'models'\n dir_array[1] = 'unit'\n end\n test_dir = dir_array.join('/')\n return File.join(test_dir, test_file)\n end", "def markdown_cheatsheet\n File.read(Rails.root.join('markdown.md'))\n end", "def help\n path = Dir[src_path('README')].first || Dir[src_path('README.md')].first || Dir[src_path('README.markdown')].first\n if path\n File.read path\n end\n end", "def readme\n template 'README.md.erb', 'README.md'\n # This is here, because if --skip_tests is added, it skips running the gitignore function\n # => since all projects have a readme this should just overwrite the gitignore file\n copy_file 'dotfiles/gitignore', '.gitignore', force: true\n end", "def modified_files\n `git diff --cached --name-only --diff-filter=ACM --ignore-submodules=all`.split \"\\n\"\n end", "def test_change_file_patch\n gemfile = bake_testing_gem\n\n patches = []\n patches << bake_change_file_patch\n\n # Creates new patched gem in @gems_dir\n patcher = Gem::Patcher.new(gemfile, @gems_dir)\n patched_gem = patcher.patch_with(patches, @options)\n\n # Unpack\n package = Gem::Package.new patched_gem\n package.extract_files @gems_dir\n\n assert_equal patched_file, file_contents('foo.rb')\n end", "def remove_section_markdown_file(file_name)\n if File.exists? \"./web/source/markdown/#{file_name}.md.erb\"\n `rm ./web/source/markdown/#{file_name}.md.erb`\n end\n end", "def all_application_helpers\n extract = /^#{Regexp.quote(helpers_dir)}\\/?(.*)_helper.rb$/\n Dir[\"#{helpers_dir}/**/*_helper.rb\"].map { |file| file.sub extract, '\\1' }\n end", "def document_snippet(doc)\n ret = nil\n File.open(\"./test 90/#{doc}\", \"r\") do |f|\n f.seek(12)\n ret = f.read(50)\n end\n return ret\nend", "def modified_files; end", "def override_test_helper\n if config.dig(\"test_suite\") == \"minitest\"\n template \"templates/minitest_test_helper.tt\", \"test/test_helper.rb\", force: true\n else\n template \"templates/rspec_test_helper.tt\", \"spec/rails_helper.rb\", force: true\n end\n end", "def get_content_path\r\n if ENV[\"RACK_ENV\"] != \"test\"\r\n File.expand_path(\"..\", __FILE__) + \"/content_files\"\r\n else\r\n File.expand_path(\"..\", __FILE__) + \"/test/content_files\"\r\n end\r\nend", "def locate(*args)\n # TODO this will be a security hole, since ../ will likely work\n File.expand_path(File.join(basedir, args[0] + '.md'))\n end", "def test_files\n get_folder_files(TESTS_PATH)\n end", "def helper_files\n source_dir = File.join(Dir.pwd, \"lib/drydock/jobs\", helper_source_dir)\n if Dir.exists?(source_dir)\n Dir[source_dir + \"/*\"]\n else\n []\n end\n end", "def test_get_content_for\n end", "def test_new_file_patch\n @options[:strip] = 0\n \n gemfile = bake_testing_gem\n\n patches = []\n patches << bake_new_file_patch\n\n # Create a new patched gem in @gems_dir\n patcher = Gem::Patcher.new(gemfile, @gems_dir)\n patched_gem = patcher.patch_with(patches, @options)\n\n # Unpack\n package = Gem::Package.new patched_gem\n package.extract_files @gems_dir\n\n assert_equal original_file, file_contents('bar.rb')\n end", "def test_dirs(desc, dir1, dir2)\n\n test_missing_files(desc, dir1, dir2)\n\n dir_files(dir1).each do |file|\n file2 = file.sub(dir1, dir2)\n if File.exist?(file2)\n if diff = diff_file(file, file2)\n @failures << {\n desc: \"#{desc}\\nDiff of file: #{file.sub(dir1+'/', '')}\\n\",\n result: format_diff(diff)\n }\n pout 'F'.red\n else\n pout '.'.green\n end\n end\n end\nend", "def modified_files(options)\n flags = '--cached' if options[:staged]\n refs = options[:refs]\n subcmd = options[:subcmd] || 'diff'\n\n `git #{subcmd} --name-only -z --diff-filter=ACM --ignore-submodules=all #{flags} #{refs}`.\n split(\"\\0\").\n map(&:strip).\n reject(&:empty?).\n map { |relative_file| File.expand_path(relative_file) }\n end", "def test_files\n Dir.open(TESTS_CODE) do |dir|\n dir.entries.grep(/^#{TEST_PREFIX}/)\n end\nend", "def fixture_contents(fixture)\n fixture_file = Dir.entries(fixture_path).find { |e| /^#{fixture}$|#{fixture}\\.[a-z]/.match?(e) }\n File.read(\"#{fixture_path}/#{fixture_file}\")\nend", "def analyse_modified_files\n modified_files = Config.feature_branch_collection.where(SourceControlSystem::Git.modified_files)\n analysed_modules = AnalysedModulesCollection.new(modified_files.map(&:path), modified_files)\n Config.root = Config.compare_root_directory\n report(analysed_modules)\n end", "def application_helpers\n copy_file \"app/helpers/layout_helper.rb\"\n copy_file \"app/helpers/retina_image_helper.rb\"\n copy_file \"app/helpers/meta_tag_helper.rb\"\nend", "def read_drafts(dir); end", "def modified_files(options)\n flags = '--cached' if options[:staged]\n refs = options[:refs]\n subcmd = options[:subcmd] || 'diff'\n\n `git #{subcmd} --name-only -z --diff-filter=ACMR --ignore-submodules=all #{flags} #{refs}`.\n split(\"\\0\").\n map(&:strip).\n reject(&:empty?).\n map { |relative_file| File.expand_path(relative_file) }\n end", "def include_generated(file_name, opts={})\n File.read(\"#{@md_output_dir}/#{file_name}\") unless hide_content?(opts)\n end", "def test_file_size_differs\n TestHelper::FillContents($source_dir, {\n 'A.txt' => {\n type: 'file',\n contents: 'SuperLongFileThatHasLotsOfStuff',\n }\n })\n TestHelper::FillContents($backup_dir, {\n 'A.txt' => {\n type: 'file',\n contents: 'ShortFile',\n }\n })\n expected_results = {\n items_processed: 2,\n similarities: 1,\n differences: 1,\n skipped: 0,\n errors: 0,\n }\n actual_results = TestHelper::RunVerification(\n [$source_dir, $backup_dir]\n )\n assertResultsAsExpected(expected_results, actual_results)\n end", "def find_all_generated_release_notes\n Dir[\"#{File.dirname(@erb_file)}/markdown/Rel_Notes_*.md*\"]. # some are .md, some are .md.erb\n map { |f| File.basename(f).split('.').first }. # eg Rel_Notes_3_11_6\n sort_by { |f| f.split('_').map(&:to_i) }. # eg [0, 0, 3, 11, 6]\n reverse # newest first\n end", "def test_change_file_with_fuzz_patch\n @options[:fuzz] = 2\n \n gemfile = bake_testing_gem\n\n patches = []\n patches << bake_change_file_with_fuzz_patch\n\n # Creates new patched gem in @gems_dir\n patcher = Gem::Patcher.new(gemfile, @gems_dir)\n patched_gem = patcher.patch_with(patches, @options)\n\n # Unpack\n package = Gem::Package.new patched_gem\n package.extract_files @gems_dir\n\n assert_equal patched_file_with_fuzz, file_contents('foo.rb')\n end", "def modified_files(options); end", "def modified_files(options); end", "def files_for_erb\n return Dir.chdir( base ) { Dir.glob( '*.erb' ) }\n end", "def analyse_modified_files\n modified_files = ::RubyCritic::Config\n .feature_branch_collection\n .where(::RubyCritic::SourceControlSystem::Git.modified_files)\n ::RubyCritic::AnalysedModulesCollection.new(modified_files.map(&:path),\n modified_files)\n ::RubyCritic::Config.root = \"#{::RubyCritic::Config.root}/compare\"\n end", "def erb_path\n \"#{File.dirname(__FILE__)}/markdown_doc.erb\"\n end", "def local_modifications(dir = nil, options = {})\n fail \"The #{self.class} driver does not support the local_modifications method!\"\n end", "def test_dry_run\n @options[:dry_run] = true\n\n gemfile = bake_testing_gem\n\n patches = []\n patches << bake_change_file_patch\n\n # Creates new patched gem in @gems_dir\n patcher = Gem::Patcher.new(gemfile, @gems_dir)\n patched_gem = patcher.patch_with(patches, @options)\n\n # Unpack\n package = Gem::Package.new patched_gem\n package.extract_files @gems_dir\n\n # Still the same\n assert_equal original_file, file_contents('foo.rb')\n end", "def src_filelist\n FileList['lib/**/*.rb'].concat ['README.rdoc']\nend", "def test_readme\n get '/readme'\n assert last_response.body.include?('this is my readme')\n end", "def diff_gitignore\n system(\"diff .gitignore ~/code/tmpl/gitignore-gem\")\n end", "def diff_gitignore\n system(\"diff .gitignore ~/code/tmpl/gitignore-gem\")\n end", "def main_files\n retrieve_files_in_main_dir\n end", "def doc_to_fs_path(doc_path)\n if doc_path.end_with?(\"/\") || doc_path == \"\"\n \"#{doc_path}README.md\"\n else\n \"#{doc_path}.md\"\n end\n end", "def patch(patch)\n File.read(\"spec/fixtures/#{patch}.patch\")\nend", "def convert_file(content,user,filename,format)\n name = name_cleaner(filename)\n Dir.glob(\"public/docs/#{user.id.to_s}_*\") do |my_file|\n File.delete(my_file)\n end\n new_file_name = \"#{user.id.to_s}_#{name}.#{format}\"\n Tempfile.open(['pandoc','.html'], Rails.root.join('public/docs') ) do |f|\n f.print(content)\n f.flush\n system(\"pandoc -s -S #{f.path} -o public/docs/#{new_file_name}\")\n f.unlink\n end\n return {filename: new_file_name, filepath: \"public/docs/#{new_file_name}\" } \n end", "def on_file_changed(content, out, path)\n SpacewalkHtmlClean.generate_diff(content, out, path)\n end", "def scrubbed_html_file_name\n self.mydirectory + \"scrubbed.html\"\n end", "def readme_file\n if @package.readme and @package.readme != \"\"\n tfile = Tempfile.new('readme') \n File.open(tfile, 'w') { |f| f.puts @package.readme }\n tfile.path\n else\n nil\n end\n end", "def now_at_fs_resolution\n test_filename = \"#{Dir.pwd}/deleteme\"\n FileUtils.touch test_filename\n File.atime(test_filename)\nend", "def file_content_match?\n @fixture.full_files.zip(@local.full_files).all? do |fixture_file, local_file|\n if File.directory?(fixture_file)\n File.directory?(local_file)\n else\n !File.directory?(local_file) && IO.read(fixture_file) == IO.read(local_file)\n end\n end\n end", "def test_reuse_single_file\n CheckFile @writer, @ioservice, @adlers, 'test tests test ', ['test ', 'tests', ' ', 'test ']\n end", "def show_readme\n readme 'lib/generators/cms/fortress/templates/README'\n end", "def helper_path\n @helper_path ||= File.join(Mutton.template_path, 'helpers')\n end", "def file_modifications_plan__sample\n timestamp = time__now_strftime_default\n [\n [ # first modification:\n \"/tmp/file_modifications_plan__sample.#{timestamp}\",\n \"Adding timestamp=#{timestamp}\\n\"\n ],\n ]\n end", "def assert_generated_helper_test_for(name, parent = \"ActionView::TestCase\")\n path = \"test/unit/helpers/#{name.to_s.underscore}_helper_test\"\n # Have to pass the path without the \"test/\" part so that class_name_from_path will return a correct result\n class_name = class_name_from_path(path.gsub(/^test\\//, ''))\n\n assert_generated_class path,parent,class_name do |body|\n yield body if block_given?\n end\n end", "def calculate_last_updated_at(md_name:, pages_path:)\n files = Dir[\"#{pages_path}/snippet/#{md_name}/**/*\"] + [\"#{pages_path}/#{md_name}.md.erb\"]\n files.map { |file| File.mtime(file) }.max\n end", "def add_to_path(d)\n Dir.entries(d).each do |f|\n next if f == '.' || f == '..'\n file= File.join(d, f)\n if File.directory?(file)\n add_to_path(file)\n elsif f.end_with?('test.rb')\n require(file)\n end\n end\nend", "def prepare_helpers\n base = File.join(config[:test_base_path], \"helpers\")\n\n helper_files.each do |src|\n dest = File.join(sandbox_suites_dir, src.sub(\"#{base}/\", \"\"))\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest, preserve: true)\n end\n end", "def functionals_changed(test_changed_files, t)\n changed_controllers = []\n changed_functional_tests = []\n changed_view_directories = Set.new\n test_changed_files.each do |file|\n controller_match = file.match(/app\\/controllers\\/(.*).rb/)\n if controller_match\n changed_controllers << controller_match[1]\n end\n\n view_match = file.match(/app\\/views\\/(.*)\\/.+\\.erb/)\n if view_match\n changed_view_directories << view_match[1]\n end\n\n functional_test_match = file.match(/test\\/functional\\/(.*).rb/)\n if functional_test_match\n changed_functional_tests << functional_test_match[1]\n end\n end\n\n test_files = FileList['test/functional/**/*_test.rb'].select{|file| changed_controllers.any?{|controller| file.match(/test\\/functional\\/#{controller}_test.rb/) }} +\n FileList['test/functional/**/*_test.rb'].select{|file| changed_view_directories.any?{|view_directory| file.match(/test\\/functional\\/#{view_directory}_controller_test.rb/) }} +\n FileList['test/functional/**/*_test.rb'].select{|file|\n (changed_functional_tests.any?{|functional_test| file.match(/test\\/functional\\/#{functional_test}.rb/) } ||\n test_changed_files.any?{|changed_file| file==changed_file })\n }\n\n test_files = test_files.uniq\n test_files = test_files.reject{ |f| Smokescreen.critical_tests.include?(f) }\n\n t.libs << \"test\"\n t.verbose = true\n if !test_files.empty?\n t.test_files = test_files\n else\n t.test_files = []\n end\n end", "def get_note(opts={})\n type = opts.fetch(:type, 'md')\n contents = opts[:contents]\n contents = opts[:content] if opts.has_key?(:content) and not contents\n begin\n filename = File.join(tmp_directory, \"#{self.object_id}.#{type}\")\n i = 0\n while File.exist?(filename)\n filename = File.join(tmp_directory, \"#{self.object_id}#{i}.#{type}\")\n i += 1\n end\n raise \"ENV['EDITOR'] not set\" unless ENV['EDITOR']\n File.open(filename, \"w\") {|f| f.print contents}\n `#{ENV['EDITOR']} #{filename}`\n contents = File.read(filename)\n ensure\n puts \"Cleaning up temp file and exiting ...\"\n FileUtils.rm_f(filename)\n end\n end", "def convert_require_helpers(file)\n @command.gsub_file(file, /\\bsystem_helper\\b/, 'application_system_test_case')\n @command.gsub_file(file, /\\b(rails_helper|spec_helper)\\b/, 'test_helper')\n @command.gsub_file(file, /require (['\"]?)rspec\\1/, \"require 'minitest/autorun'\")\n end", "def preview_names(offset)\n Dir.foreach('.') do |item|\n next if item == '.' or item == '..' or item == 'numberFix.rb'\n fullname = modify_item(item, offset)\n puts fullname\n end\nend", "def test_seenewfiles\n server = nil\n testdir, pattern, tmpfile = mktestdir\n\n\n newfile = File.join(testdir, \"newfile\")\n\n # go through the whole schtick again...\n file = nil\n checks = Puppet::Network::Handler.fileserver::CHECKPARAMS\n\n assert_nothing_raised {\n\n server = Puppet::Network::Handler.fileserver.new(\n\n :Local => true,\n\n :Config => false\n )\n }\n\n assert_nothing_raised {\n server.mount(testdir, \"test\")\n }\n\n list = nil\n sfile = \"/test/\"\n assert_nothing_raised {\n list = server.list(sfile, :manage, true, false)\n }\n\n # create the new file\n File.open(newfile, \"w\") { |f|\n 3.times { f.puts rand(100) }\n }\n\n newlist = nil\n assert_nothing_raised {\n newlist = server.list(sfile, :manage, true, false)\n }\n\n # verify the list has changed\n assert(list != newlist)\n\n # and verify that we are specifically seeing the new file\n assert(newlist =~ /newfile/)\n end", "def create!\n new_file = \"#{next_number}-#{strip_title}.md\"\n @path = File.join(@dir, new_file)\n File.open(@path, 'w') do |file|\n file.write initial_content\n end\n\n new_file\n end", "def file_fixture(path)\n return File.expand_path(File.join(File.dirname(__dir__), \"test\", \"fixtures\", \"files\", path))\nend", "def file_fixture(path)\n return File.expand_path(File.join(File.dirname(__dir__), \"test\", \"fixtures\", \"files\", path))\nend", "def file_fixture(path)\n return File.expand_path(File.join(File.dirname(__dir__), \"test\", \"fixtures\", \"files\", path))\nend", "def find_readme\n\t\tfile = self.project_files.find {|file| file =~ /^README\\.(md|rdoc)$/ }\n\t\tif file\n\t\t\treturn Pathname( file )\n\t\telse\n\t\t\tself.prompt.warn \"No README found in the project files.\"\n\t\t\treturn DEFAULT_README_FILE\n\t\tend\n\tend" ]
[ "0.62671226", "0.60273993", "0.60212994", "0.59757805", "0.5852637", "0.56840265", "0.5517935", "0.5509494", "0.5456811", "0.5443863", "0.54235363", "0.53968596", "0.5389566", "0.53659165", "0.5333496", "0.52943134", "0.52478755", "0.52107805", "0.5208", "0.51974064", "0.51842195", "0.51839924", "0.51735526", "0.51666045", "0.51584613", "0.51566744", "0.51349586", "0.5130414", "0.51297593", "0.51280314", "0.5124902", "0.5115484", "0.5111016", "0.5107314", "0.5103526", "0.51009303", "0.5092461", "0.5092184", "0.5088692", "0.50714946", "0.5065749", "0.50574106", "0.5044215", "0.50435925", "0.5043008", "0.50317895", "0.50203025", "0.50194603", "0.5019354", "0.50157416", "0.50121397", "0.5010377", "0.5004423", "0.49866545", "0.49811533", "0.49731532", "0.49685213", "0.4965453", "0.49644622", "0.49532962", "0.49483", "0.49319485", "0.49289203", "0.49266982", "0.49266982", "0.491671", "0.4907445", "0.49038547", "0.48968968", "0.48870572", "0.4882154", "0.4881145", "0.4878448", "0.4878448", "0.48760852", "0.48699984", "0.4857743", "0.48486772", "0.48461714", "0.48378068", "0.48281786", "0.48264974", "0.48222727", "0.4819046", "0.48179415", "0.4807118", "0.48044944", "0.48043326", "0.48033288", "0.47991246", "0.4798524", "0.4798027", "0.4797489", "0.47960693", "0.47926116", "0.47924027", "0.4785477", "0.47783983", "0.47783983", "0.47783983", "0.47734964" ]
0.0
-1
Get an Array of all scripts that have been imported into the Plot.
def imported_scripts @imported_scripts ||= [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scripts\n @parts.values.map(&:script).compact\n end", "def list_all_scripts\n scripts = []\n\n Hook.hooks(event_instance.class).each_value do |klass|\n scripts.concat(list_scripts(klass))\n end\n\n scripts\n end", "def scripts\n @scripts\n end", "def scripts\n Dir.glob(File.join(script_dir, \"*.rb\")).inject([]) do |a, e|\n Kernel.load(e)\n a + [initialize_script(e)]\n end\n end", "def scripts\n SCRIPTS\n end", "def script_list\n Dir['script/*'].map{|f| File.basename(f, '.*')}\nend", "def js_dependencies_array\n if scripts != :none\n get_vendor_scripts\n get_gem_scripts\n end\n @js_array\n end", "def scripts\n script_tag(fancyviews.included_scripts.map do |name, js|\n \"\\n/* -- #{name} -- */\\n\" + js\n end.join)\n end", "def imported\n @imported ||= []\n end", "def imported\n @imported ||= []\n end", "def script_aliases\n arr = Array.new\n @script_aliases.each do |key, value|\n arr.push(key)\n end\n return arr\n end", "def all_javascript_paths\n all_paths = []\n all_paths += @javascripts\n all_paths += @background_scripts\n all_paths += @content_scripts.map { |cs| cs.javascripts }.compact\n all_paths.flatten.uniq\n end", "def scripts\n @scripts ||= @options[:scripts].try(:to_sym)\n end", "def find_scripts(dir)\n scripts = []\n\n dir = File.expand_path(dir)\n Dir.glob(File.join(dir, \"**/*.rb\")).reject{|f| f[\"/spec/\"] || f[\"/specs/\"] || f[\"/test/\"] || f[\"/tests/\"]}.map do |script_file|\n scripts << script_file\n end\n\n scripts\n end", "def javascripts_from_plugins\n Dir.glob(\"vendor/plugins/*/assets/javascripts/*.js\").select{|s| !s.include? \"vendor/plugins/alchemy\"}.inject(\"\") do |acc, s|\n filename = File.basename(s)\n plugin = s.split(\"/\")[2]\n acc << javascript_include_tag(filename, :plugin => plugin)\n end\n end", "def scripts\n @content_for_scripts.to_s\n end", "def load_scripts\n $log.info(\"ScriptManager.initilize\") { \"Loading scripts.\" }\n\n noload = Bot::Conf[:core][:noload]\n\n Dir.glob(\"scripts/*.rb\").each do |file|\n\n unless noload == nil\n # I realize we are pulling the name out twice. Deal with it.\n next if noload.keys.include? file.match(\"scripts/(.+).rb\")[1].to_sym\n end\n\n $log.debug(\"ScriptManager.initilize\") { \"Loading #{file}\" }\n load_file file\n\n end\n end", "def get_all_data\n Hash[*File.read(\"#{@path}scripts/data\").split(/[, \\n]+/)]\n end", "def urls\n URI.extract(self.script)\n end", "def scripts_previously_run(scripts)\n if scripts.empty? || !@db.schema_schema_evolution_manager_exists?\n []\n else\n sql = \"select filename from %s.%s where filename in (%s)\" % [Db.schema_name, @table_name, \"'\" + scripts.join(\"', '\") + \"'\"]\n @db.psql_command(sql).strip.split\n end\n end", "def load_scripts\n $log.info('ScriptManager.initilize') { 'Loading scripts.' }\n\n noload = Bot::Conf[:core][:noload]\n\n Dir.glob(\"#{SCRIPTS_PATH}/*.rb\").each do |file|\n\n unless noload == nil\n # I realize we are pulling the name out twice. Deal with it.\n next if noload.keys.include? file.match(\"#{SCRIPTS_PATH}/(.+).rb\")[1].to_sym\n end\n\n $log.debug(\"ScriptManager.initilize\") { \"Loading #{file}\" }\n load_file file\n\n end\n end", "def pre_scripts\n @pre_scripts ||= user_data_as_array('pre_script')\n @pre_scripts\n end", "def load_all\n scripts.each do |name, script|\n redis.script 'load', script.content\n end\n end", "def all_unique_imports\n files.map(&:all_imports).flatten.uniq\n end", "def loadScripts\n load \"su2dslib/preferences.rb\"\n load \"su2dslib/exportbase.rb\"\n load \"su2dslib/interface.rb\"\n load \"su2dslib/numeric.rb\"\n load \"su2dslib/material.rb\"\n load \"su2dslib/radiance_entities.rb\"\n load \"su2dslib/radiancescene.rb\"\n load \"su2dslib/location.rb\"\n load \"su2dslib/resultsgrid.rb\"\nend", "def build_all_external_scripts\n html = \"\"\n result = Mokio::ExternalScript.all\n unless result.blank?\n result.each do |position|\n html = build_common(position)\n end\n end\n html.html_safe\n end", "def js_files\n [\n vue_lib_js, mixins_js, filters_js, components_js,\n pages_js, config_js\n ].flatten!\n end", "def all_scripts(scripts_array)\n scripts_array.each do |script|\n run_script script\n end\n end", "def installed_assets()\n installed = Array.new()\n asset_on_segment_historys.each do |hist|\n if !hist.assets.first.nil?\n asset = Asset.find_by_guid(hist.assets.first.g_u_i_d)\n installed << asset unless asset.asset_on_segment_history.nil?\n end\n end\n return installed\n end", "def get_imports (path)\n imports = []\n puts \"path: #{path}\"\n for line in `otool -L '#{path}'`.split(\"\\n\")\n if line =~ /^\\t(.*)\\s*\\(.*\\)$/\n import = Pathname.new($1.rstrip)\n if import.basename != path.basename\n imports << import\n end\n end\n end\n return imports\nend", "def sources\n []\n end", "def script_aliases\n @hash[\"ScriptAlias\"].keys\n end", "def get_gem_scripts\n unless gmaps4rails_pipeline_enabled?\n @js_array << '/javascripts/gmaps4rails/gmaps4rails.base.js' unless scripts == :api\n @js_array << case map_provider\n when \"yandex\" then '/javascripts/gmaps4rails/gmaps4rails.yandex.js'\n when \"openlayers\" then '/javascripts/gmaps4rails/gmaps4rails.openlayers.js'\n when \"mapquest\" then '/javascripts/gmaps4rails/gmaps4rails.mapquest.js'\n when \"bing\" then '/javascripts/gmaps4rails/gmaps4rails.bing.js'\n else '/javascripts/gmaps4rails/gmaps4rails.googlemaps.js'\n end\n end\n end", "def post_scripts\n @post_scripts ||= user_data_as_array('post_script')\n @post_scripts\n end", "def monitored_paths\n paths = Dir['**/*'].select do |path|\n @script.patterns.any? {|p| path.match(p) }\n end\n paths.push(@script.path).compact!\n paths.map {|path| Pathname(path).expand_path }\n end", "def files\n modules = (changed?) ? tag_configuration_plugins.collect {|p| p.plugin.modules} : \n plugins.collect {|p| p.modules}\n modules << Plugin::JshubCore.instance.modules\n modules.flatten!\n modules.sort!\n modules.uniq.collect { |m| m.name }\n end", "def injected_javascripts\n @javascript_codes || []\n end", "def runtime_specific_gems\n []\n end", "def index\n authorize(Script)\n @scripts = Script.order(started_at: :desc).page params[:page]\n end", "def importsText\n @imps.to_a.map{|k| \"import #{k};\"}.sort.join(\"\\n\")\n end", "def all_extensions\n r = []\n manager.Get.each do |ext|\n r << ext\n end\n r\n end", "def get_vendor_scripts\n case map_provider\n when \"yandex\" then @js_array << YANDEX\n when \"openlayers\" then @js_array << OPENLAYERS\n when \"mapquest\" then @js_array << \"#{MAPQUEST}?key=#{provider_key}\"\n when \"bing\" then @js_array << BING\n else #case googlemaps which is the default\n @js_array << \"#{GOOGLE}&sensor=false&client=#{client}&key=#{provider_key}&libraries=geometry#{google_libraries}&#{google_map_i18n}\"\n @js_array << \"#{GOOGLE_EXT}tags/infobox/1.1.9/src/infobox_packed.js\" if custom_infowindow_class\n @js_array << \"#{GOOGLE_EXT}tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js\" if do_clustering\n @js_array << \"#{GOOGLE_EXT}trunk/richmarker/src/richmarker-compiled.js\" if rich_marker\n end\n end", "def included_sources\n return @included_sources\n end", "def assets\n @assets ||= []\n end", "def index\n @scripts = Script.all\n end", "def index\n @scripts = Script.all\n end", "def index\n @scripts = Script.all\n end", "def include_default_scripts\n includes = []\n\n includes << javascript_include_tag(:application) if assets_exists? \"application.js\"\n\n default_asset_paths.each do |path|\n if assets_exists? \"#{path}.js\"\n includes << javascript_include_tag(path)\n end\n end\n \n includes << content_for(:scripts)\n includes.join(\"\\n\").html_safe\n end", "def unprocessed_files\n Dir.glob(@data_location + '/*.jl').sort\n end", "def list_script\n ret = @uri.listscript\n render plain: ret[:message]\n end", "def load_scripts!\n scripts_dir = File.expand_path @config['blur']['scripts_dir']\n script_file_paths = Dir.glob File.join scripts_dir, '*.rb'\n\n # Sort the script file paths by file name so they load by alphabetical\n # order.\n #\n # This will make it possible to create a script called '10_database.rb'\n # which will be loaded before '20_settings.rb' and non-numeric prefixes\n # will be loaded after that.\n script_file_paths = script_file_paths.sort do |a, b|\n File.basename(a) <=> File.basename(b)\n end\n\n script_file_paths.each { |script_path| load_script_file script_path }\n\n initialize_superscripts\n\n emit :scripts_loaded\n end", "def get_js root_dir\n file_paths = []\n\n Find.find(root_dir) do |path|\n file_paths << path if path =~ /.*\\.js$/\n end\n\n return file_paths\n end", "def sources\n s = Set.new\n experiments.each { |experiment| s.merge(experiment.sources) }\n s.to_a\n end", "def sources #:nodoc:\n @sources.map{ |source| source.call }.flatten\n end", "def mergeScripts\n result = Builtins.maplist(@pre) do |p|\n p = Builtins.add(p, \"type\", \"pre-scripts\")\n deep_copy(p)\n end\n result = Convert.convert(\n Builtins.union(result, Builtins.maplist(@post) do |p|\n p = Builtins.add(p, \"type\", \"post-scripts\")\n deep_copy(p)\n end),\n :from => \"list\",\n :to => \"list <map>\"\n )\n result = Convert.convert(\n Builtins.union(result, Builtins.maplist(@chroot) do |p|\n p = Builtins.add(p, \"type\", \"chroot-scripts\")\n deep_copy(p)\n end),\n :from => \"list\",\n :to => \"list <map>\"\n )\n result = Convert.convert(\n Builtins.union(result, Builtins.maplist(@init) do |p|\n p = Builtins.add(p, \"type\", \"init-scripts\")\n deep_copy(p)\n end),\n :from => \"list\",\n :to => \"list <map>\"\n )\n result = Convert.convert(\n Builtins.union(result, Builtins.maplist(@postpart) do |p|\n p = Builtins.add(p, \"type\", \"postpartitioning-scripts\")\n deep_copy(p)\n end),\n :from => \"list\",\n :to => \"list <map>\"\n )\n deep_copy(result)\n end", "def importer_names\n importers.map{|e| e.const_name }\n end", "def required_assets\n @required_assets ||= []\n end", "def script path\r\n imported_script = source.export(path)\r\n if imported_script.nil?\r\n raise LoadError.new(\"cannot load script -- #{path}\")\r\n end\r\n if !@working_scripts.include?(imported_script) and !imported_scripts.include?(imported_script)\r\n @working_scripts.push imported_script\r\n # @hack Arguments need to be in different order if source returns proc\r\n if imported_script.read.kind_of?(Proc)\r\n stage &imported_script.read\r\n else\r\n stage imported_script.read, imported_script.absolute_path\r\n end\r\n @working_scripts.pop\r\n imported_scripts.push imported_script\r\n true\r\n else\r\n false\r\n end\r\n end", "def pre_ruby_scripts\n @pre_ruby_scripts ||= user_data_as_array('pre_ruby_script')\n @pre_ruby_scripts\n end", "def referenced_modules\n # TODO: check content type before scanning\n content.scan(/\\s*(include|extend)\\s+([A-Za-z0-9_\\.]*)/).map { |_, m| m }.uniq\n end", "def load_libs\n loadQueue = []\n Pathname.glob './lib/*.rb' do |script|\n require script.to_s\n scriptfolder = Pathname.new(script.to_s.gsub('.rb', ''))\n next if not scriptfolder.directory?\n\n loadQueue += scriptfolder.children(true).find_all {|file| file.to_s[-3..-1] == '.rb'}\n end\n \n # load the children\n loadQueue.each {|file| require file.to_s }\n end", "def manifest_dependencies()\n as_bundle = Bundle.fromProject(self)\n as_bundle.nil? ? [] : as_bundle.bundles.collect{|b| b.resolve}.compact + as_bundle.imports.collect {|i| i.resolve}.flatten\n end", "def objects\n @static_libraries.map { |l| l.path }\n end", "def read_javascripts\n js = @javascript_list.map do |filename|\n case filename\n when :jquery\n File.read(File.join(Slidize::javascript_directory, \"jquery-1.5.min.js\"))\n else\n File.read(File.join(@theme_path, filename))\n end\n end\n js.join(\"\\n\")\n end", "def load_imports\n while fn = @pending_imports.shift\n next if @imported.member?(fn)\n ext = File.extname(fn)\n loader = @loaders[ext] || @default_loader\n loader.load(fn)\n @imported << fn\n end\n end", "def require_paths\n raw_data['require_paths'] || []\n end", "def enumerate_scripts\n Dir.glob(\"**/*\").\n reject { |f| File.directory?(f) }.\n select { |f| File.extname(f) == \".rb\" }.\n map do |filename|\n stat = File.stat(filename)\n\n OpenStruct.new(\n id: SecureRandom.uuid,\n path: filename,\n absolute_path: File.expand_path(filename),\n virtual_url: \"#{ROOT_URL}/#{filename}\",\n size: stat.size,\n last_modified_time: stat.mtime\n )\n end\n end", "def script\n @script ||= (Dir.glob(root+'/**/parts.js').first || Dir.glob(root+'/**/parts.js.coffee').first)\n end", "def include_individual_javascripts(bundles=[])\n tags = []\n bundles.each do |bundle| \n tags.concat bundle.files.map { |js| javascript_include_tag(js.path) }\n end\n tags.join(\"\\n\")\n end", "def extensions\n []\n end", "def extensions\n []\n end", "def plugins\n\n\t\tif @plugins.length == 0\n\t\t\treturn []\n\t\tend\n\n\t\treturn @plugins\n\tend", "def addons\n []\n end", "def page_script(context={}, page)\n \n scripts = []\n\n # Front-end custom resources\n unless page.admin_page\n if template=ContentManagerSystem::Template.find_by_name('javascript_resources') && \n !template.text.empty?\n scripts.concat(template.text.split(','))\n end \n if template=ContentManagerSystem::Template.find_by_name('javascript_app') && \n !template.text.empty?\n scripts << '/js/app.js'\n end\n end\n \n return scripts\n\n end", "def available_plugins\n @plugins.keys\n end", "def plugins\n @plugin_list\n end", "def names\n $LOAD_MANAGER.keys\n end", "def all_javascripts\n Dir.entries('public/js').inject(\"\") do |all_js, js|\n if js =~ /\\.js$/\n all_js << \"<script src='/js/#{js}' type='text/javascript'></script>\"\n end\n all_js\n end\n end", "def available_includes\n []\n end", "def addins\n @addins ||= []\n end", "def externals\n return lexical_externals.keys\n end", "def components_js\n Dir[src_path.join('components', '**', '*.js').to_s]\n end", "def any_visible_assigned_scripts?\n user_scripts.where(\"assigned_at\").\n map {|user_script| Script.where(id: user_script.script.id, hidden: 'false')}.\n flatten.\n any?\n end", "def files\n return [] unless meta?\n filename = meta['path'] + '/' + meta['filename']\n [\n Inch::Utils::CodeLocation.new('', filename, meta['lineno'])\n ]\n end", "def to_a\n if metadata[:included]\n metadata[:included].map { |uri| @environment.load(uri) }\n else\n [self]\n end\n end", "def all_stylesheet_paths\n all_paths = []\n all_paths += @stylesheets\n all_paths += @content_scripts.map { |cs| cs.stylesheets }.compact\n all_paths.flatten.uniq\n end", "def sources\n @sources.names\n end", "def plugins\n @plugins\n end", "def assets_metadata\n scripts_by_prefix.each_with_object([]) do |(prefix, script), assets|\n unless source_maps_by_prefix.key?(prefix)\n Rails.logger.info(\"Found script without source map: #{script}\")\n next\n end\n\n assets << AssetMetadata.new(script, source_maps_by_prefix[prefix])\n end\n end", "def index\n @jv_scripts = JvScript.all\n end", "def read_js_funcs \n Dir[\"#{@mjs_path}/_*.mjs\"].each do | file |\n fname = File.basename(file).sub(/^_(\\w+).mjs/, '\\1')\n\n open(file) do | f |\n @js_funcs[fname] = f.readlines\n end \n end\n end", "def list_addons\n Dir.glob(\"/var/lib/apollo/addons/*.gem\")\n end", "def plugins\n @plugins ||= []\n end", "def import(*globs)\n globs.each do |glob|\n #if File.relative?(glob)\n # dir = Dir.pwd #session.root #File.dirname(caller[0])\n # glob = File.join(dir, glob)\n #end\n Dir[glob].each do |file|\n next unless File.file?(file) # add warning\n next if @scripts.include?(file)\n @scripts << file\n module_eval(File.read(file), file)\n end\n end\n end", "def import(*globs)\n globs.each do |glob|\n #if File.relative?(glob)\n # dir = Dir.pwd #session.root #File.dirname(caller[0])\n # glob = File.join(dir, glob)\n #end\n Dir[glob].each do |file|\n next unless File.file?(file) # add warning\n next if @scripts.include?(file)\n @scripts << file\n module_eval(File.read(file), file)\n end\n end\n end", "def policy_executables\n Array(settings['external_policy_executable'])\n end", "def script_path\n @script_paths ||= Pathname.new(source_dir).join(data['script_path'] || './scripts').to_s\n end", "def script\n @elements.map { |e|\n (e && !e.hidden? && !e.readonly? && e.respond_to?(:script))? e.script : ''\n }.join(\"\")\n end", "def add_scripts(scripts, chart_scripts)\n s = ''\n scripts.map do |script|\n s += %(\n <script src=\"assets/#{script}\"></script>)\n end\n chart_scripts.map do |script|\n s += %(\n <script src=\"#{script}\"></script>)\n end\n s\nend", "def unloaded_libraries\n (Boson::BareRunner.all_libraries - Boson.libraries.map {|e| e.name }).sort\n end" ]
[ "0.74343014", "0.7068649", "0.690905", "0.68276185", "0.6801287", "0.6754027", "0.6659049", "0.64578724", "0.6320397", "0.6320397", "0.62072533", "0.60786325", "0.60341024", "0.60105026", "0.59371144", "0.59022814", "0.58862406", "0.5868887", "0.5866156", "0.58411753", "0.5839483", "0.5831118", "0.57845736", "0.57766426", "0.5725113", "0.5712721", "0.5700497", "0.5692455", "0.56920964", "0.56815344", "0.56514615", "0.5640598", "0.56398964", "0.56330216", "0.55649287", "0.55636865", "0.5549255", "0.5543385", "0.5543351", "0.5518984", "0.5510412", "0.5498273", "0.5479612", "0.5469882", "0.54483837", "0.54483837", "0.54483837", "0.5446808", "0.54316044", "0.54274213", "0.5417492", "0.5417092", "0.5411019", "0.54086894", "0.54028606", "0.54012203", "0.53763556", "0.5371684", "0.53672844", "0.53460646", "0.5345339", "0.53367877", "0.53343505", "0.53149974", "0.5305667", "0.52956647", "0.5290711", "0.5285178", "0.52838606", "0.5273259", "0.5273259", "0.52711993", "0.5260825", "0.5249902", "0.52371925", "0.5228812", "0.52233326", "0.52141654", "0.5214054", "0.521161", "0.52020645", "0.518617", "0.51859295", "0.5185313", "0.5185251", "0.5181426", "0.5174158", "0.5173003", "0.5172424", "0.5170816", "0.51654524", "0.515973", "0.51589966", "0.5151222", "0.5151222", "0.5149335", "0.5147247", "0.51441115", "0.51375395", "0.512294" ]
0.80782133
0
Get an Array of the Plot's current Syntaxes.
def syntaxes playbook.syntaxes end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_syntaxes\n uri = URI.parse(\"#{BASE_URL}/syntaxes\")\n response = JSON.parse(@client.get(uri).body)\n return response['syntaxes'].map { |obj| Pastee::Syntax.new(obj) } if response['success']\n\n throw_error(response)\n end", "def syntax(tokens)\n tokens = expect(:\".syntax\", tokens)\n if id?(tokens[0])\n name = tokens[0]\n tokens.shift\n else\n fail \"syntax NAME\"\n end\n r = [:\".syntax\", name]\n\n while tokens[0] != :\".end\"\n eq, tokens = equation(tokens)\n #pp eq\n if eq\n r << eq\n else\n break\n end\n end\n\n tokens = expect(:\".end\", tokens)\n return r\n end", "def syntax_errors\n (@syntax_errors ||= [])\n end", "def getAllTexts intervalRange\n texts = [[]]\n curr_alts = []\n # Go through the interval token by token. It is indexed by token, \n # not by character\n intervalRange.each do |j|\n tok = @tokens.get(j)\n\n # If the text is parsed code or whitespace\n if (tok.channel == 0 || tok.channel == 1)\n texts.each do |text|\n text << tok.getText\n end\n\n # Get directives\n elsif (tok.channel == 2)\n d = strip_directive(tok)\n # TODO make sure combinations of alts are handled\n case d.command\n when\"ALT\"\n # Trigger creation of alternative magnet\n curr_alts << []\n texts.each do |text|\n curr_alt = Array.new(text)\n curr_alt << d.arg\n curr_alts.last << curr_alt\n end\n when \"ENDALT\"\n texts << curr_alts.pop\n end\n end\n end\n\n ret = texts.map {|t| t.join}\n # puts \"Ret\"\n # pp ret\n return ret\n end", "def current_snippets\n self[Vim.evaluate('&filetype')]\n end", "def tokens\n return @tokens\n end", "def augments_syntax_tokens\n attributes.fetch(:augmentsSyntaxTokens)\n end", "def expressions\n return @expressions\n end", "def characters_array # That's a terrible name.\n convert_to_chars\n highlight_squares\n self.rows\n end", "def highlighted_lines(options)\n JSON.parse('{' + options.to_s + '}')['hl_lines'] || []\n end", "def tokens\n @tokens ||= []\n end", "def lines\n @transcript_lines\n end", "def get_syntax(id)\n uri = URI.parse(\"#{BASE_URL}/syntaxes/#{id}\")\n response = JSON.parse(@client.get(uri).body)\n return Pastee::Syntax.new(response['syntax']) if response['success']\n\n throw_error(response)\n end", "def extract_highlights_from(code, options)\n code.gsub!(%r[\\{% highlight (.+) %\\}]) do\n enumerable = eval($1.strip)\n enumerable = (Enumerable === enumerable)? enumerable : nil\n options.merge!({:highlight_lines => enumerable}) if enumerable\n ''\n end\n [code.strip, options]\n end", "def get_directives ctx\n directives = []\n this_starting_tok = ctx.getSourceInterval.a\n\n i = this_starting_tok - 1\n curr_tok = i > 0 ? @tokens.get(i) : nil\n while curr_tok && curr_tok.channel != 0\n if curr_tok.channel == 2\n directives << curr_tok\n end\n\n i -= 1\n curr_tok = i > 0 ? @tokens.get(i) : nil\n end\n\n return directives\n end", "def rebuild_syntax\n\t\t\t@syntax = []\n\t\t\tline = []\n\t\t\tcurrent = ''\n\t\t\ttext = buffer.data\n\t\t\t\t \n\t\t\tCodeRay.scan_stream(text, filetype) do |k, a|\n\t\t\t\tif a==:space || a==:plain || a==:content || a==:comment then\n\t\t\t\t\tk.each_char do |c|\n\t\t\t\t\t\tif c==\"\\n\" then\n\t\t\t\t\t\t\tunless current.empty? then\n\t\t\t\t\t\t\t\tcurrent.symbol_type = a\n\t\t\t\t\t\t\t\tline.push current \n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t@syntax.push line\n\n\t\t\t\t\t\t\tline = []\n\t\t\t\t\t\t\tcurrent = ''\n\t\t\t\t\t\t\tcurrent.symbol_type = a\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcurrent << c\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\telsif k==:open || k==:close\n\t\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\tk.symbol_type = a\n\t\t\t\t\tline.push k\n\t\t\t\tend\n\n\t\t\t\tif !current.empty? then\n\t\t\t\t\tcurrent.symbol_type = a\n\t\t\t\t\tline.push current\n\t\t\t\t\tcurrent =''\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t@syntax.push line unless line.empty?\n\n\t\tend", "def syntax(syntax = nil)\n @syntax = syntax if syntax\n @syntax\n end", "def ast\n @ast ||= Syntax::Parser.parse_file(path)\n end", "def exec_env_selected_text\n content = []\n\n each_selected_line do |y, fx, tx|\n content << get(\"#{y}.#{fx}\", \"#{y}.#{tx}\")\n end\n\n content.join(\"\\n\")\n end", "def syntax\n t = @cmd_args\n t = [[t]] if !t.is_a? Array\n\n args = [] \n count = 0\n t.each do |expected_array|\n count += 1\n if count == 1\n str = \"Syntax: #{@cmd_name}\"\n else\n str = \" #{@cmd_name}\"\n end\n expected_array.each do |expected|\n # each expected arg.\n str += case expected\n when :arg_none then \"\"\n when :arg_dir! then \" <direction>\"\n when :arg_str! then \" <string literal>\"\n when :arg_word!then \" <word>\"\n when :arg_int! then \" <#>\"\n when :arg_obj_inv! then \" <item>\"\n when :arg_obj_room! then \" <item>\"\n when :arg_obj_inv_or_room! then \" <item>\"\n when :arg_class! then \" <Class>\"\n when :arg_player_in_game! then \" <player in game>\"\n when :arg_player_offline! then \" <any player>\"\n when :arg_actor_room! then \" <npc/player>\"\n when String then \" \" + expected \n else \"\"\n \n end\n end \n args << str\n end\n return args\n end", "def referenced_y_axis_names\n selected_series.map {|s| s[:y_axis]}.compact\n end", "def tokens\n @grammar.keys\n end", "def tokens ; self.class.tokens ; end", "def compileexpressionlist\n\n end", "def syntax_highlighter(html)\n doc = Nokogiri::HTML(html)\n doc.search(\"//pre[@lang]\").each do |pre|\n pre.replace Albino.colorize(pre.text.rstrip, pre[:lang])\n end\n doc.to_s\n end", "def values_array\n [@name, @expression.value]\n end", "def to_s\n \"#<syntax:#{ @name }>\"\n end", "def all_cur_definitions\n result = []\n @mutex.synchronize do\n @tool_data.each_value do |td|\n tool = td.cur_definition\n result << tool unless tool.nil?\n end\n end\n result\n end", "def current_context_to_array\n #p self.current_context\n case\n when self.current_context.kind_of?(Array)\n self.current_context.map { |item| item.keys }.join(' ') # TODO to be tested with join \"\\n\"\n when self.current_context.kindof?(Hash)\n self.current_context.keys.join(' ')\n else\n self.current_context.current_context_to_array\n end\n end", "def array (sexp, level)\n return '[]' if sexp.empty?\n\n code, work = \"\", []\n\n until sexp.empty?\n splat = sexp.first.first == :splat\n part = process sexp.shift, :expression\n\n if splat\n if work.empty?\n code += (code.empty? ? part : \".concat(#{part})\")\n else\n join = \"[#{work.join ', '}]\"\n code += (code.empty? ? join : \".concat(#{join})\")\n code += \".concat(#{part})\"\n end\n work = []\n else\n work << part\n end\n end\n\n unless work.empty?\n join = \"[#{work.join ', '}]\"\n code += (code.empty? ? join : \".concat(#{join})\")\n end\n\n code\n end", "def emotions\n @emotions\n end", "def series\n []\n end", "def code_snippet(file, line)\n s = []\n if File.file?(file)\n source = source(file)\n radius = 2 # TODO: make customizable (number of surrounding lines to show)\n region = [line - radius, 1].max ..\n [line + radius, source.length].min\n\n s = region.map do |n|\n {n => source[n-1].chomp}\n end\n end\n return s\n end", "def code_snippet(file, line)\n s = []\n if File.file?(file)\n source = source(file)\n radius = 2 # TODO: make customizable (number of surrounding lines to show)\n region = [line - radius, 1].max ..\n [line + radius, source.length].min\n\n s = region.map do |n|\n {n => source[n-1].chomp}\n end\n end\n return s\n end", "def parse_positions(line)\n positions = bracket_positions(line)\n positions.flatten\n end", "def canonical_syntax_strings\n @canonical_syntax_strings ||= flag_syntax.map(&:canonical_str)\n end", "def get_all_tokens()\n return self.corpus.all_tokens\n end", "def help\n lines = []\n end", "def symbols() @symbols end", "def get_tokens\n\t\treturn @tokens\n\tend", "def highlighter; end", "def highlighter; end", "def to_a\n a = []\n \n @collection.each do |e|\n a << e.style \n end\n \n return a\n end", "def tokens\n @tokens ||= texts.map do |value|\n GoogleTranslateDiff::Tokenizer.tokenize(value)\n end\n end", "def expression_bodies\n expression_bodies_arr = Array.new\n @expressions.each do |expression|\n expression_bodies_arr << expression.body\n end\n return expression_bodies_arr\n end", "def enable_syntax_highlighting_as_you_type\n raise 'Syntax highlighting only supported on 1.9.3+' unless RUBY_VERSION >= '1.9.3'\n\n # Use coolline with CodeRay for syntax highlighting as you type.\n # Only works on >= 1.9.3 because coolline depends on io/console.\n\n require 'coolline'\n require 'coderay'\n\n Pry.config.input = Coolline.new do |c|\n c.transform_proc = proc do\n CodeRay.scan(c.line, :ruby).term\n end\n\n c.completion_proc = proc do\n word = c.completed_word\n Object.constants.map(&:to_s).select { |w| w.start_with? word }\n end\n end\n end", "def commands\n unless defined? @commands\n @commands = []\n end\n return @commands\n end", "def lines\n self\n end", "def to_a\n _evaluated_nodes\n end", "def axes\n return @axes\n end", "def symbols\n each_symbol.to_a\n end", "def gowords_array(txt)\n self.gowords ||= self.array_with_stopwords(txt).map do |token|\n cleaned_token = self.clean_token(token)\n self.stopwords.include?(cleaned_token) ? nil : cleaned_token.blank? ? nil : token\n end.compact\n end", "def assign_highlighter_options!; end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def inline_styles\n parser.css(\"style\").to_a\n end", "def notes\n notes_range.to_a.map(&:to_s)\n end", "def getyx\n y = []\n x = []\n @stdscr.getyx(y, x)\n [y[0], x[0]]\n end", "def tokens\n @tokens.dup\n end", "def lines; [to_s]; end", "def make_command_list\n @list = SES::ExternalText::Languages\n end", "def all_axes\n @structure.all_axes\n end", "def getAST\n return @ast\n end", "def context_at_location(position)\n lines = text.split(\"\\n\")\n line = lines[position.line]\n return [] if line.nil? || line.strip.length.zero?\n\n LineContext.for(line, position.character)\n end", "def tokens\n self.entries\n end", "def getAST()\n return @ast\n end", "def commands\n @commands ||= []\n end", "def lines\n @lines ||= line_codes.map {|l| Line.get(l)}\n end", "def get_selection\n return [@tvpq.selection.selected[4].xlink]\n end", "def syntax\n\t\t\t\t:scss\n\t\t\tend", "def etymology_particles\n %i[p1 p2 p3 p4 p5 xx]\n end", "def getgraphics(*)\n super.to_s\n end", "def raw_codewords\n @raw_codewords\n end", "def to_a\n [left, bottom, tip, top, right]\n end", "def command_list\n options[:commands] || SimpleFormEpicEditor::EpicEditorInput.configuration.commands\n end", "def decoration_tokens\n @decoration_tokens ||= begin\n dt = Tml::Tokenizers::Decoration.new(label)\n dt.parse\n dt.tokens\n end\n end", "def get_symbols\n\t\treturn @symbols\n\tend", "def to_commands_sa(formatter)\n return [ formatter.to_command_s(self) ]\n end", "def symbols\n @symbol_set.symbols\n end", "def highlights; end", "def highlights; end", "def highlights; end", "def lint\n []\n end", "def array_paragraphs fragments\n [fragments]\n end", "def selection\n\t\t\t$ruvim.editor.selection\n\t\tend", "def highlighter_prefix; end", "def highlighter_prefix; end", "def lifts_array\n array2 = []\n self.lifts.each do |lift|\n array2 << lift.chart_info_for_lift\n end\n array2\n end", "def current_schemata\n extension :pg_array\n metadata_dataset.select(Sequel::function(:current_schemas, false).\n cast('varchar[]')).single_value.map(&:to_sym)\n end", "def getyx\n Ncurses.getyx(pointer)\n end", "def all\n s = []\n unless @list.empty?\n s << \"Auto-display expressions now in effect:\nNum Enb Expression\"\n @list.each do |display|\n s << display.format\n end\n end\n s\n end", "def commands\r\n @help_commands\r\n end", "def lex\n r = []\n while (tok = @lexer.lex).kind != T::EOF\n r.push(tok)\n end\n r\n end", "def lines\n @lines ||= begin\n code.gsub(/\\r/,'').split(\"\\n\").collect do |line|\n line.strip!\n next nil if line == \"\" || line.start_with?('#')\n line\n end.compact\n end\n end" ]
[ "0.6616718", "0.5914168", "0.58122456", "0.5598634", "0.54084706", "0.52474123", "0.5245073", "0.51947457", "0.51875925", "0.5181786", "0.51713645", "0.50887334", "0.5070031", "0.5057521", "0.5021981", "0.5012417", "0.49847165", "0.49529937", "0.49337205", "0.49230424", "0.49218914", "0.49079236", "0.48897862", "0.4863218", "0.48631227", "0.48626438", "0.48552126", "0.48516026", "0.48514658", "0.48349208", "0.48251247", "0.4812837", "0.48097745", "0.48097745", "0.48075974", "0.4806604", "0.4798692", "0.4795293", "0.47795153", "0.4776569", "0.47756755", "0.47756755", "0.47728586", "0.47674155", "0.47629538", "0.47614893", "0.47448984", "0.4733812", "0.4733422", "0.472764", "0.4714802", "0.47087577", "0.47047427", "0.4701279", "0.4701279", "0.4701279", "0.4701279", "0.4701279", "0.4701279", "0.4701279", "0.4701279", "0.4688232", "0.46859324", "0.46769473", "0.4676134", "0.46699324", "0.46694732", "0.46480292", "0.4644888", "0.46401522", "0.46390563", "0.46336544", "0.4628581", "0.46267518", "0.4608521", "0.46019846", "0.459434", "0.45901576", "0.45849285", "0.458466", "0.4576414", "0.45759186", "0.45751804", "0.45574442", "0.45538244", "0.45502982", "0.45502982", "0.45502982", "0.45479932", "0.45434836", "0.45282444", "0.45201844", "0.45201844", "0.45187065", "0.4513733", "0.45123515", "0.45072615", "0.45042107", "0.4503672", "0.4500855" ]
0.64173704
1
Prepare the Plot for the next turn of gameplay. This method is typically called by the Engine that manages game execution.
def ready playbook.freeze @running = true # Call the initial state to make sure it's set initial_state call_ready call_player_ready p_subplots.each { |s| s.ready } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_drawing\n calculate_spread\n calculate_increment\n sort_data if @sort # Sort data with avg largest values set first (for display)\n set_colors\n normalize\n setup_graph_measurements\n sort_norm_data if @sorted_drawing # Sort norm_data with avg largest values set first (for display)\n end", "def configurePlot\n end", "def plot; end", "def draw_next_phase\n if (@color_pair)\n if Ncurses.respond_to?(:color_set)\n @window.color_set(@color_pair, nil)\n else\n @window.attrset(Ncurses.COLOR_PAIR(@color_pair))\n end\n end\n if (DRAWING_PROCS[@current_phase].call(@window,@y,@x))\n @current_phase += 1\n self\n end\n end", "def draw_next_phase\n if (@color_pair)\n if Ncurses.respond_to?(:color_set)\n @window.color_set(@color_pair, nil)\n else\n @window.attrset(Ncurses.COLOR_PAIR(@color_pair))\n end\n end\n @window.mvaddstr(@y, @x, \"O\")\n end", "def set_plot\n @plot = Plot.friendly.find(params[:id])\n end", "def plot\n\n # Remove all elements from the dashboard. This could be changed in future releases\n # of the library.\n B.delete_all\n\n if (!@runned )\n run\n clean\n runned = true\n else\n re_run\n end\n\n end", "def set_plot\n @plot = Plot.find(params[:id])\n end", "def set_plot\n @plot = Plot.find(params[:id])\n end", "def set_plot\n @plot = Plot.find(params[:id])\n end", "def set_plot\n @plot = Plot.find(params[:id])\n end", "def begin_figure\n # do nothing\n end", "def re_run\n\n # scrpt will have the javascript specification\n scrpt = String.new\n\n # add bootstrap container if it wasn't specified by the user\n @scene.create_grid((keys = @charts.keys).size, keys) if !@scene.specified?\n scrpt << @scene.bootstrap\n\n # add charts\n @charts.each do |name, chart|\n # add the chart specification\n scrpt << chart.js_spec if !chart.nil?\n end\n \n # render all charts\n scrpt += \"dc.renderAll();\"\n\n # sends a message to the gui to execute the given script\n @bridge.send(:gui, :executeScript, scrpt)\n \n end", "def begin_figure\n @legend_keys = []\n @legend_labels = []\n end", "def create\n @plot = Plot.new(plot_params)\n @plot.story = @current_story\n\n respond_to do |format|\n if @plot.save\n set_linked_characters( @plot )\n\n format.html { redirect_to [ @current_story, @plot ], notice: 'Plot was successfully created.' }\n format.json { render :show, status: :created, location: @plot }\n else\n format.html { render :new }\n format.json { render json: @plot.errors, status: :unprocessable_entity }\n end\n end\n end", "def setup\n size(displayWidth, displayHeight)\n text_font create_font(\"SanSerif\",20)\n colorMode(HSB,360,100,100,60)\n @w, @h = width/2.0, height/2.0\n stroke_width 1 ; no_stroke\n frame_rate 100\n background 0\n plot_text\n\n fill(100,100,100,100)\n @trajectories = get_trajectories 1\n @delay = [0] * 100 # heuristically found.\n end", "def plot!\n return plot if plot && plot.valid? && plot.file_exists?\n plot.destroy if (plot)\n f = ExtendedArgumentationFramework::Framework.new(graph_representation, auto_generate_nodes: true)\n file = ExtendedArgumentationFramework::Plotter.new(f, plot_acceptability: false, edges_style: 'dir=back style=dashed').to_png\n p=Plot.create(filename: \"#{Plot::BASE_URL}/#{file}\", object: self)\n p\n end", "def prepare\n puts \"Preparing #{@date.to_s}\"\n @graphic = ImageList.new\n \n #set background color\n bg_color = @color_scheme['main']\n @graphic.new_image(@calendar.width, @calendar.height) { self.background_color = bg_color }\n \n #add cloud background\n cloud = @graphic.read('cloud.png')\n \n #add daily tasks\n everyday_tasks\n dot\n weekly_task\n dot\n todos\n dot\n \n #add the date at the top\n date_header\n dot\n \n #add the special event\n special_event\n dot\n end", "def processPartialUpdate(viewer)\n # In this demo, we just need to redraw the chart\n drawChart(viewer)\n end", "def setup_graph_measurements\n setup_caps_heights\n setup_margins\n setup_graph_area\n end", "def prepare\n self.output_title\n end", "def create_graphics\n super\n draw_wanted_data\n end", "def tick_initialize\n initialize_tiles\n loading_label = {\n x: 640,\n y: 400,\n text: \"Reticulating Splines...\",\n size_enum: 0,\n alignment_enum: 1,\n r: 255,\n g: 255,\n b: 255,\n a: 255\n }\n @args.outputs.background_color = [0, 0, 0]\n @args.outputs.labels << loading_label\n @args.outputs.solids << { x: 320, y: 300, w: 640 * initialization_percent, h: 50, r: 0, g: 255, b: 0, a: 255 }\n @args.outputs.borders << { x: 320, y: 300, w: 640, h: 50, r: 255, g: 255, b: 255, a: 255 }\n end", "def setup\n\n #Start timer\n every(1000) { @time_limit -= 1 }\n\n #Load the images for the bar\n @image_1 = Image[\"ruby.png\"]\n @image_2 = Image[\"player_life.png\"]\n @image_3 = Image[\"minClock.png\"]\n\n #Create score text\n @score_text = Text.create(\"\", :size => 30, :x => 920, :y => -2, :color => Color::YELLOW)\n\n #Create life text\n @life_text = Text.create(\"\", :size => 30, :x => 28, :y => -2, :color => Color::GREEN)\n\n #Create time text\n @time_text = Text.create(\"\", :size => 30, :x => 488, :y => -2, :color => Color::WHITE)\n\n end", "def setup\n\t\ttext_font create_font(\"SanSerif\",10);\n\t\t# size(1920,1080) #JackRabbit\n\t\tsquare = [1080] * 2 + [P3D] # 800\n\t\t@w,@h = [square[0]/2] * 2\n\t\tsize(*square) ; @bs = [height,width].min\n\t\t@i, @t = [0] * 2 ; background(0)\n\t\t@colors = (0..3).map{|i|rand(255)}\n\t\tframe_rate 50 ; colorMode(HSB,360,100,100)\n\t\tno_fill() ; lights() ; no_stroke\n\n\t\tfile = \"#{FILES_PATH}/processed_history.csv\"\n\n\t\tloc_type_pair = DATA\n\t\t@with_type = CSV.read(file).map do |line|\n\t\t\ttype = loc_type_pair.detect{|loc,type| loc == line[1]}[1]\n\t\t\tline[4] = type ; line\n\t\tend\n\tend", "def draw\n unless @track_result.nil?\n draw_play()\n end \n draw_btns()\n draw_stuff()\n draw_background()\n draw_albums(@albums)\n display_tracks()\n @info_font.draw(\"mouse_x: #{mouse_x}\", 200, 50, ZOrder::UI, 1.0, 1.0, Gosu::Color::WHITE)\n @info_font.draw(\"mouse_y: #{mouse_y}\", 350, 50, ZOrder::UI, 1.0, 1.0, Gosu::Color::WHITE)\n end", "def start_export( img_width, img_height)\n @width ||= img_width # If they be nil\n @height ||= img_height\n \n x_factor, y_factor = (@width / img_width.to_f), (@height / img_height.to_f) \n \n @stash = @exporter\n @exporter = Tracksperanto::Tool::Scaler.new(@exporter, :x_factor => x_factor, :y_factor => y_factor)\n super\n end", "def set_plot_point\n @plot_point = PlotPoint.find(params[:id])\n end", "def draw\n @background.draw(0, -200, 0)\n @marco_name.draw(0, 0, 0)\n @marco_score.draw($window.width - 170, 0, 0)\n super\n @msj_name.draw\n @msj_score.draw\n\n # condiciones para que aparesca o no la meta del nivel\n if @score == 15\n create_meta(ramdon_location) unless @meta_on\n Plataforma2.all.select do |e|\n e.x == @plataforma_meta.x && e.y == @plataforma_meta.y\n end.first.destroy unless @meta_on\n \n @meta_on = true\n @msj_name.y = 15\n @mensaje.draw\n @mensaje2.draw\n end\n end", "def draw\n # TODO Left label\n # TODO Bottom labels and markers\n # @graph_bottom\n # Calculations are off 800x???\n\n @colors.reverse!\n\n draw_title\n\n @margin = 30.0\n @thickness = @raw_rows / 6.0\n @right_margin = @margin\n @graph_left = @title_width * 1.3 rescue @margin # HACK Need to calculate real width\n @graph_width = @raw_columns - @graph_left - @right_margin\n @graph_height = @thickness * 3.0\n\n # Background\n @d = @d.fill @colors[0]\n @d = @d.rectangle(@graph_left, 0, @graph_left + @graph_width, @graph_height)\n\n [:high, :low].each_with_index do |indicator, index|\n next unless @options.has_key?(indicator)\n @d = @d.fill @colors[index + 1]\n indicator_width_x = @graph_left + @graph_width * (@options[indicator] / @maximum_value)\n @d = @d.rectangle(@graph_left, 0, indicator_width_x, @graph_height)\n end\n\n if @options.has_key?(:target)\n @d = @d.fill @font_color\n target_x = @graph_left + @graph_width * (@options[:target] / @maximum_value)\n half_thickness = @thickness / 2.0\n @d = @d.rectangle(target_x, half_thickness, target_x + half_thickness, @thickness * 2 + half_thickness)\n end\n\n # Value\n @d = @d.fill @font_color\n @d = @d.rectangle(@graph_left, @thickness, @graph_left + @graph_width * (@value / @maximum_value), @thickness * 2)\n\n @d.draw(@base_image)\n end", "def draw\n @background_image.draw 0, 0, ZOrder::BACKGROUND\n case @game_settings.current_screen\n when \"start\"\n start_screen\n when \"levels\"\n levels_screen\n when \"gameover\"\n game_over_screen\n when \"game\"\n @deck.deal_cards! @playing_cards\n\n if @game_settings.is_cpu_player_enabled\n @subtitle_font.draw_text \"Computer:\", 645, 215, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n @subtitle_font.draw_text \"Score : #{@computer_signal.score}\", 645, 245, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n end\n\n # Computer messages\n if @true_mes\n @subtitle_font.draw_text \"I found a set!\", 645, 275, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n if @computer_signal.score > @p1.score\n @subtitle_font.draw_text \"#{@computer_signal.mean_msg}\", 645, 305, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n end\n end\n\n @subtitle_font.draw_text \"Still trying!\", 645, 275, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK if @trying_mes\n\n @subtitle_font.draw_text \"Oops not a set!\", 645, 275, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK if @false_mes\n\n # Creates players if need be.\n if !@players_created\n @p1 = Player.new 1 if @game_settings.p1_init\n @p2 = Player.new 2 if @game_settings.p2_init\n @players_created = true\n end\n\n Gosu.draw_rect 640,0,280,480,Gosu::Color::GRAY,ZOrder::UI\n\n @subtitle_font.draw_text \"Player 1 Statistics:\", 645, 0, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n if @p1.set_times.length > 0\n \t@subtitle_font.draw_text \"Fastest time to find a set: #{@p1.set_times.at 0}\", 645, 30, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \t@subtitle_font.draw_text \"Slowest time to find a set: #{@p1.set_times.at -1}\", 645, 60, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \t@subtitle_font.draw_text \"Average time to find a set: #{@p1.time_sum / @p1.set_times.length}\", 645, 90, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n else\n \t@subtitle_font.draw_text \"No sets found yet\", 645, 30, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n end\n @subtitle_font.draw_text \"Hints used: #{@p1.hints_used}\", 645, 120, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK if @game_settings.are_hints_enabled\n @subtitle_font.draw_text \"Score: #{@p1.score}\", 645, 150, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n @subtitle_font.draw_text \"Total Game Time: #{@game_timer.current}\", 645, 490, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \n if @game_settings.p2_init\n @subtitle_font.draw_text \"Player 2 Statistics:\", 645, 280, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \tif @p2.set_times.length > 0\n \t @subtitle_font.draw_text \"Fastest time to find a set: #{@p2.set_times.at 0}\", 645, 310, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \t @subtitle_font.draw_text \"Slowest time to find a set: #{@p2.set_times.at -1}\", 645, 340, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \t @subtitle_font.draw_text \"Average time to find a set: #{@p2.time_sum / @p2.set_times.length}\", 645, 370, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \telse\n \t @subtitle_font.draw_text \"No sets found yet\", 645, 310, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \tend\n \t@subtitle_font.draw_text \"Score: #{@p2.score}\", 645, 430, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n end\n\n num_cols = @playing_cards.length / 3\n count, x_offset, y_offset, x_between, y_between = 0, 5, 35, 90, 135\n (0...3).each do |row|\n (0...num_cols).each do |col|\n @playing_cards[count].image.draw(x_offset + x_between*col, y_offset + y_between*row, ZOrder::CARDS, 0.15, 0.15)\n count += 1\n end\n end\n\n # Prints out hints\n @hint.each do |card_index|\n # initial card corner values.\n left_x ,right_x, top_y, bottom_y = 5, 85, 40, 160\n\n # Highlight for hints\n draw_rect left_x + x_between*(card_index % num_cols), top_y + y_between*(card_index / num_cols),80,10,Gosu::Color::BLACK,ZOrder::CARDS\n draw_rect left_x + x_between*(card_index % num_cols), top_y + y_between*(card_index / num_cols),10,130,Gosu::Color::BLACK,ZOrder::CARDS\n draw_rect left_x + x_between*(card_index % num_cols), bottom_y + y_between*(card_index / num_cols),80,10,Gosu::Color::BLACK,ZOrder::CARDS\n draw_rect right_x + x_between*(card_index % num_cols), top_y + y_between*(card_index / num_cols),10,130,Gosu::Color::BLACK,ZOrder::CARDS\n end\n\n #TO MOVE RECTANGLE:\n # X POSITION = @currentCardIndex % numCols\n # Y POSITION = @currentCardIndex / numCols\n if @game_settings.p1_init\n x_movement = x_offset + (x_between/2.4) + x_between*(@p1.current_card_index % num_cols)\n y_movement = y_offset + (y_between/2) + y_between*(@p1.current_card_index / num_cols)\n\n # Draws current position\n draw_rect x_movement, y_movement, 20, 20, Gosu::Color::CYAN,ZOrder::CARDS\n\n # Draws current selected values\n @p1.chosen_cards_indexes.each {|index| draw_rect(x_offset + (x_between/2.4) + (x_between)*(index % num_cols), y_offset + (y_between/2) + y_between*(index / num_cols), 20, 20, Gosu::Color::CYAN, ZOrder::CARDS)}\n end\n if @game_settings.p2_init\n x_movement = x_offset + (x_between/2.4) + x_between*(@p2.current_card_index % num_cols)\n y_movement = (y_between/2) + y_between*(@p2.current_card_index / num_cols)\n\n # Draws current position\n draw_rect x_movement, y_movement, 20, 20, Gosu::Color::FUCHSIA, ZOrder::CARDS\n\n # Draws current selected values\n @p2.chosen_cards_indexes.each {|index| draw_rect(x_offset + (x_between/2.4) + (x_between)*(index % num_cols), (y_between/2) + y_between*(index / num_cols), 20, 20, Gosu::Color::FUCHSIA, ZOrder::CARDS)}\n end\n end\n end", "def drawChart()\n # The moving average periods selected by the user.\n avgPeriod1 = 0\n avgPeriod1 = params[\"movAvg1\"].to_i\n avgPeriod2 = 0\n avgPeriod2 = params[\"movAvg2\"].to_i\n\n if avgPeriod1 < 0\n avgPeriod1 = 0\n elsif avgPeriod1 > 300\n avgPeriod1 = 300\n end\n\n if avgPeriod2 < 0\n avgPeriod2 = 0\n elsif avgPeriod2 > 300\n avgPeriod2 = 300\n end\n\n # We need extra leading data points in order to compute moving averages.\n extraPoints = 20\n if avgPeriod1 > extraPoints\n extraPoints = avgPeriod1\n end\n if avgPeriod2 > extraPoints\n extraPoints = avgPeriod2\n end\n\n # Get the data series to compare with, if any.\n compareKey = (params[\"CompareWith\"] || \"\").strip\n @compareData = nil\n if getData(compareKey, extraPoints)\n @compareData = @closeData\n end\n\n # The data series we want to get.\n tickerKey = (params[\"TickerSymbol\"] || \"\").strip\n if !getData(tickerKey, extraPoints)\n return errMsg(\"Please enter a valid ticker symbol\")\n end\n\n \n\n # Check if there is any valid data\n if extraPoints >= @timeStamps.length\n # No data - just display the no data message.\n return errMsg(\"No data available for the specified time period\")\n end\n\n # In some finance chart presentation style, even if the data for the latest day is\n # not fully available, the axis for the entire day will still be drawn, where no\n # data will appear near the end of the axis.\n # if @resolution < 86400\n # # Add extra points to the axis until it reaches the end of the day. The end of\n # # day is assumed to be 16:00 (it depends on the stock exchange).\n # lastTime = @timeStamps[@timeStamps.length - 1]\n # extraTrailingPoints = ((16 * 3600 - lastTime % 86400) / @resolution).to_i\n # 0.upto(extraTrailingPoints - 1) do |i|\n # @timeStamps.push(lastTime + @resolution * (i + 1))\n # end\n # end\n\n #\n # At this stage, all data are available. We can draw the chart as according to\n # user input.\n #\n\n #\n # Determine the chart size. In this demo, user can select 4 different chart sizes.\n # Default is the large chart size.\n #\n width = 780\n mainHeight = 255\n indicatorHeight = 80\n\n size = params[\"ChartSize\"]\n if size == \"S\"\n # Small chart size\n width = 450\n mainHeight = 160\n indicatorHeight = 60\n elsif size == \"M\"\n # Medium chart size\n width = 620\n mainHeight = 215\n indicatorHeight = 70\n elsif size == \"H\"\n # Huge chart size\n width = 1000\n mainHeight = 320\n indicatorHeight = 90\n end\n\n # Create the chart object using the selected size\n m = ChartDirector::FinanceChart.new(width)\n\n # Set the data into the chart object\n m.setData(@timeStamps, @highData, @lowData, @openData, @closeData, @volData,\n extraPoints)\n #debugger\n #\n # We configure the title of the chart. In this demo chart design, we put the\n # company name as the top line of the title with left alignment.\n #\n m.addPlotAreaTitle(ChartDirector::TopLeft, tickerKey)\n\n # We displays the current date as well as the data resolution on the next line.\n resolutionText = \"\"\n if @resolution == 30 * 86400\n resolutionText = \"Monthly\"\n elsif @resolution == 7 * 86400\n resolutionText = \"Weekly\"\n elsif @resolution == 86400\n resolutionText = \"Daily\"\n elsif @resolution == 900\n resolutionText = \"15-min\"\n end\n\n m.addPlotAreaTitle(ChartDirector::BottomLeft, sprintf(\n \"<*font=arial.ttf,size=8*>%s - %s chart\", m.formatValue(Time.new,\n \"mmm dd, yyyy\"), resolutionText))\n\n # A copyright message at the bottom left corner the title area\n m.addPlotAreaTitle(ChartDirector::BottomRight,\n \"<*font=arial.ttf,size=8*>(c) Advanced Software Engineering\")\n\n #\n # Add the first techical indicator according. In this demo, we draw the first\n # indicator on top of the main chart.\n #\n addIndicator(m, params[\"Indicator1\"], indicatorHeight)\n\n #\n # Add the main chart\n #\n m.addMainChart(mainHeight)\n\n #\n # Set log or linear scale according to user preference\n #\n if params[\"LogScale\"] == \"1\"\n m.setLogScale(true)\n end\n\n #\n # Set axis labels to show data values or percentage change to user preference\n #\n if params[\"PercentageScale\"] == \"1\"\n m.setPercentageAxis()\n end\n\n #\n # Draw any price line the user has selected\n #\n mainType = params[\"ChartType\"]\n if mainType == \"Close\"\n m.addCloseLine(0x000040)\n elsif mainType == \"TP\"\n m.addTypicalPrice(0x000040)\n elsif mainType == \"WC\"\n m.addWeightedClose(0x000040)\n elsif mainType == \"Median\"\n m.addMedianPrice(0x000040)\n end\n\n #\n # Add comparison line if there is data for comparison\n #\n if @compareData != nil\n if @compareData.length > extraPoints\n m.addComparison(@compareData, 0x0000ff, compareKey)\n end\n end\n\n #\n # Add moving average lines.\n #\n addMovingAvg(m, params[\"avgType1\"], avgPeriod1, 0x663300)\n addMovingAvg(m, params[\"avgType2\"], avgPeriod2, 0x9900ff)\n\n #\n # Draw candlesticks or OHLC symbols if the user has selected them.\n #\n if mainType == \"CandleStick\"\n m.addCandleStick(0x33ff33, 0xff3333)\n elsif mainType == \"OHLC\"\n m.addHLOC(0x008800, 0xcc0000)\n end\n\n #\n # Add parabolic SAR if necessary\n #\n if params[\"ParabolicSAR\"] == \"1\"\n m.addParabolicSAR(0.02, 0.02, 0.2, ChartDirector::DiamondShape, 5, 0x008800,\n 0x000000)\n end\n\n #\n # Add price band/channel/envelop to the chart according to user selection\n #\n bandType = params[\"Band\"]\n if bandType == \"BB\"\n m.addBollingerBand(20, 2, 0x9999ff, 0xc06666ff)\n elsif bandType == \"DC\"\n m.addDonchianChannel(20, 0x9999ff, 0xc06666ff)\n elsif bandType == \"Envelop\"\n m.addEnvelop(20, 0.1, 0x9999ff, 0xc06666ff)\n end\n\n #\n # Add volume bars to the main chart if necessary\n #\n if params[\"Volume\"] == \"1\"\n m.addVolBars(indicatorHeight, 0x99ff99, 0xff9999, 0xc0c0c0)\n end\n\n #\n # Add additional indicators as according to user selection.\n #\n addIndicator(m, params[\"Indicator2\"], indicatorHeight)\n addIndicator(m, params[\"Indicator3\"], indicatorHeight)\n addIndicator(m, params[\"Indicator4\"], indicatorHeight)\n\n return m\n end", "def args\n plot_coordinates = []\n all_scenarios.each do |scenario|\n line = {\n x: all_years_sequenced,\n y: y_values_grouped_by_secnario_id_sequenced[scenario.id],\n name: scenario.name,\n hoverinfo: 'none',\n line: {color: scenario.colour.hex}\n }\n plot_coordinates << line\n end\n plot_coordinates\n end", "def next_generation!\n @grid = next_generation\n end", "def clear_figure!\n @subplots_list = [Rubyplot::SubPlot.new(1, 1, 1)]\n @no_subplot = true\n @tasks = []\n @x_title = ''\n @y_title = ''\n @x_range = [0, 0]\n @y_range = [0, 0]\n @origin = [0, 0]\n @x_tick_count = :default\n @y_tick_count = :default\n @title = nil\n @title_shift = 0\n @text_font = :default\n @grid = true\n @bounding_box = true\n @x_axis_padding = :default\n @y_axis_padding = :default\n @active_subplot = @subplots_list[0]\n end", "def draw\n\t\t\t\tprotect_runtime_errors do\n\t\t\t\t\t# render the selected state\n\t\t\t\t\t# (it has been rendered before, so it should render now without errors)\n\t\t\t\t\tunless @history_cache.nil?\n\t\t\t\t\t\t# render the states\n\t\t\t\t\t\t# puts \"history: #{@history_cache.size} - #{@history_cache.collect{|x| !x.nil?}.inspect}\"\n\t\t\t\t\t\t\n\t\t\t\t\t\t# TODO: render to FBO once and then render that same state to the screen over and over again as long as @time_travel_i is unchanged\n\t\t\t\t\t\t# currently, framerate is down to ~30fps, because this render operation is expensive.\n\t\t\t\t\t\t\n\t\t\t\t\t\t# State 0 is not renderable, because that is before the first update runs. Without the first update, the first draw will fail. Just skip state 0. Later, when we attempt to compress history by diffs, state 0 may come in handy.\n\t\t\t\t\t\trender_onion_skin(\n\t\t\t\t\t\t\t@history_cache[1..(@time_travel_i-1)], ONION_SKIN_STANDARD_COLOR,\n\t\t\t\t\t\t\t@history_cache[@time_travel_i], ONION_SKIN_NOW_COLOR,\n\t\t\t\t\t\t\t@history_cache[@forecast_range], ONION_SKIN_ERROR_COLOR\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t# @history_cache[@time_travel_i].draw @window\n\t\t\t\t\t\t\n\t\t\t\t\t\t# ^ currently the saved state is rendering some UI which shows what the current TurnCounter values are. This is going to have weird interactions with onion skinning. Should consider separating UI drawing from main entity drawing.\n\t\t\t\t\t\t# (or maybe onion-skinning the UI will be cool? idk)\\\t\t\t\t\t\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t@ui.draw @window, @wrapped_object, @history_cache, @turn\n\t\t\t\tend\n\t\t\tend", "def draw\n @player.draw\n if @twoplayer\n @player2.draw\n else\n @bot.draw\n end\n @ball.draw\n @wall.draw\n @score.draw\n @help.draw\n end", "def step\n # Draw everything\n @image.draw @screen\n end", "def getchart()\n # Use random table to generate a random series. The random table is set to 1 col x\n # 51 rows, with 9 as the seed\n rantable = ChartDirector::RanTable.new(9, 1, 51)\n\n # Set the 1st column to start from 100, with changes between rows from -5 to +5\n rantable.setCol(0, 100, -5, 5)\n\n # Get the 1st column of the random table as the data set\n data = rantable.getCol(0)\n\n # Create a XYChart object of size 600 x 300 pixels\n c = ChartDirector::XYChart.new(600, 300)\n\n # Set the plotarea at (50, 35) and of size 500 x 240 pixels. Enable both the\n # horizontal and vertical grids by setting their colors to grey (0xc0c0c0)\n c.setPlotArea(50, 35, 500, 240).setGridColor(0xc0c0c0, 0xc0c0c0)\n\n # Add a title to the chart using 18 point Times Bold Itatic font.\n c.addTitle(\"LOWESS Generic Curve Fitting Algorithm\", \"timesbi.ttf\", 18)\n\n # Set the y axis line width to 3 pixels\n c.yAxis().setWidth(3)\n\n # Add a title to the x axis using 12 pts Arial Bold Italic font\n c.xAxis().setTitle(\"Server Load (TPS)\", \"arialbi.ttf\", 12)\n\n # Set the x axis line width to 3 pixels\n c.xAxis().setWidth(3)\n\n # Set the x axis scale from 0 - 50, with major tick every 5 units and minor tick\n # every 1 unit\n c.xAxis().setLinearScale(0, 50, 5, 1)\n\n # Add a blue layer to the chart\n layer = c.addLineLayer2()\n\n # Add a red (0x80ff0000) data set to the chart with square symbols\n layer.addDataSet(data, 0x80ff0000).setDataSymbol(ChartDirector::SquareSymbol)\n\n # Set the line width to 2 pixels\n layer.setLineWidth(2)\n\n # Use lowess for curve fitting, and plot the fitted data using a spline layer with\n # line width set to 3 pixels\n c.addSplineLayer(ChartDirector::ArrayMath.new(data).lowess().result(), 0x0000ff\n ).setLineWidth(3)\n\n # Set zero affinity to 0 to make sure the line is displayed in the most detail\n # scale\n c.yAxis().setAutoScale(0, 0, 0)\n\n # Output the chart\n send_data(c.makeChart2(ChartDirector::PNG), :type => \"image/png\",\n :disposition => \"inline\")\n end", "def update(visualizer)\r\n #check for spontaneous splits\r\n for _, value in $CRN.reactions.select { |key, val| key == [self] }\r\n if rand($MIN_TICS / visualizer.minFramesValue * value[0]).round == 0\r\n visualizer.split([self], value[1])\r\n end\r\n end\r\n self.x += self.v[:x]\r\n self.y += self.v[:y]\r\n end", "def setup_graph_measurements\n @marker_caps_height = setup_marker_caps_height\n @title_caps_height = setup_title_caps_height\n @legend_caps_height = setup_legend_caps_height\n\n margin_on_right = graph_right_margin\n @graph_right = @raw_columns - margin_on_right\n @graph_left = setup_left_margin\n @graph_top = setup_top_margin\n @graph_bottom = setup_bottom_margin\n\n @graph_width = @raw_columns - @graph_left - margin_on_right\n @graph_height = @graph_bottom - @graph_top\n end", "def setup_display\n gameboard.build_display\n build_white_side\n build_black_side\n end", "def draw\n @headers[@game_state_model::players[@game_state_model.player_turn_state]::player_color].draw(@x, @y, 35)\n\n if @game_state_model.player_turn_state == 0\n @ico_one.draw(@x + 143, @y + 20, 35)\n elsif @game_state_model::players[@game_state_model.player_turn_state]::ai == nil\n @ico_two.draw(@x + 143, @y + 20, 35)\n else \n @ico_ai.draw(@x + 143, @y + 20, 35)\n end\n\n @tiles[@game_state_model::players[0]::player_color].draw(@x + 10, @y + 8, 35)\n @tiles[@game_state_model::players[1]::player_color].draw(@x + 10, @y + 48, 35)\n # @block_purple.draw(@x + 10, @y + 5, 1)\n # @block_green.draw(@x + 10, @y + 45, 1)\n @question.draw\n @cancel.draw\n @font.draw(\"#{@game_state_model::players[0]::name}\", 50, @y + 7, 35, 1.0, 1.0, 0xff_ffffff)\n @font.draw(\"Wins: #{@game_state_model::players[0]::score}\", 50, @y + 22, 35, 1.0, 1.0, 0xff_ffffff)\n @font.draw(\"#{@game_state_model::players[1]::name}\", 50, @y + 47, 35, 1.0, 1.0, 0xff_ffffff)\n @font.draw(\"Wins: #{@game_state_model::players[1]::score}\", 50, @y + 62, 35, 1.0, 1.0, 0xff_ffffff)\n end", "def _make_plots_evt(dataset,pars)\n cind = @canvases.length\n canvas = ::TCanvas.new(\"compare_canvas_#{cind}\",'',25 + 50*cind,\n\t\t\t 25,500,500)\n canvas.Divide(2,2) \n canvas.cd(1)\n dataset.read_in_amps(PWA::ParIDs.max_id,:acc)\n dname = dataset.name\n # data\n title,num_bins,min,max,bins = dataset.histo_bins(@kvs,pars,:unwtd,:data,@condition)\n h_data = TH2F.new(\"h_#{dataset.name}_data\",'data',num_bins[0],min[0],\n\t\t\tmax[0],num_bins[1],min[1],max[1])\n bins.each_index{|i| \n\tbins[i].each_index{|j| h_data.SetBinContent(i+1,j+1,bins[i][j])}\n }\n h_data.GetXaxis.SetTitle title[0]\n h_data.GetYaxis.SetTitle title[1]\n h_data.Draw 'colz'\n data_integral = h_data.Integral\n data_min = h_data.GetMinimum\n data_max = h_data.GetMaximum\n @histos.push h_data\n gPad.Update\n # acc \n canvas.cd(2)\n title,num_bins,min,max,bins = dataset.histo_bins(@kvs,pars,:unwtd,:acc,@condition)\n h_acc = TH2F.new(\"h_#{dataset.name}_acc\",'acc(unwtd)',num_bins[0],min[0],\n\t\t max[0],num_bins[1],min[1],max[1])\n bins.each_index{|i| \n\tbins[i].each_index{|j| h_acc.SetBinContent(i+1,j+1,bins[i][j])}\n }\n h_acc.GetXaxis.SetTitle title[0]\n h_acc.GetYaxis.SetTitle title[1]\n acc_integral = h_acc.Integral\n h_acc.Scale(data_integral/acc_integral) if(acc_integral > 0)\n h_acc.SetMinimum data_min\n h_acc.SetMaximum data_max\n h_acc.Draw 'colz' \n @histos.push h_acc\n gPad.Update\n # wtd acc\n canvas.cd 3\n dataset.read_in_norm(:acc)\n y = dataset.calc_yield(pars,'.',:acc)\n title,num_bins,min,max,bins = dataset.histo_bins(@kvs,pars,'.',:acc,@condition)\n h_acc_wt = TH2F.new(\"h_#{dataset.name}_acc_wt\",'acc(wtd)',num_bins[0],\n\t\t\t min[0],max[0],num_bins[1],min[1],max[1])\n bins.each_index{|i| \n\tbins[i].each_index{|j| h_acc_wt.SetBinContent(i+1,j+1,bins[i][j])}\n }\n h_acc_wt.GetXaxis.SetTitle title[0]\n h_acc_wt.GetYaxis.SetTitle title[1]\n acc_integral_wt = h_acc_wt.Integral\n h_acc_wt.Scale(y/acc_integral_wt) if(acc_integral_wt > 0)\n h_acc_wt.SetMinimum data_min\n h_acc_wt.SetMaximum data_max\n h_acc_wt.Draw 'colz' \n @histos.push h_acc_wt\n gPad.Update\n # chi^2 \n canvas.cd 4\n h_chi2 = TH2F.new(\"h_#{dataset.name}_chi2\",'#chi^{2}',num_bins[0],min[0],\n\t\t\tmax[0],num_bins[1],min[1],max[1])\n h_chi2.GetXaxis.SetTitle title[0]\n h_chi2.GetYaxis.SetTitle title[1]\n 1.upto(bins.length){|i|\n\t1.upto(bins[i-1].length){|j|\n\t data = h_data.GetBinContent(i,j)\n\t derr = h_data.GetBinError(i,j)\n\t acc = h_acc_wt.GetBinContent(i,j)\n\t aerr = h_acc_wt.GetBinError(i,j)\n\t if(aerr > 0 and derr > 0)\n\t chi2 = ((data-acc)**2)/(aerr**2 + derr**2)\n\t chi2 *= -1 if(acc > data)\n\t h_chi2.SetBinContent(i,j,chi2)\n\t end\n\t}\n }\n h_chi2.Draw 'colz' \n @histos.push h_chi2\n gPad.Update\n #\n canvas.cd\n @canvases.push canvas\n end", "def endgame_render\n self.grid.flatten.each {|space| space.visible = true }\n render\n end", "def getchart()\n #\n # We use a random number generator to simulate the data from 9:30am to 4:30pm\n # with one data point every 4 minutes. The total number of points during that\n # period is 106. (7 hours x 15 points/hour + 1)\n #\n noOfPoints = 106\n\n # Assume we have not reached the end of the day yet, and only 85 points are\n # available. Create a random table object of 1 col x 85 rows, using 9 as seed.\n rantable = ChartDirector::RanTable.new(9, 1, 85)\n\n # Set the 1st column to start with 1800 and with random delta from -5 to 5.\n rantable.setCol(0, 1800, -5, 5)\n\n # Get the data as the 1st column of the random table\n data = rantable.getCol(0)\n\n # The x-axis labels for the chart\n labels = [\"-\", \"10am\", \"-\", \" \", \"-\", \"12am\", \"-\", \" \", \"-\", \"2pm\", \"-\", \" \", \"-\",\n \"4pm\", \"-\"]\n\n #\n # Now we obtain the data into arrays, we can start to draw the chart using\n # ChartDirector\n #\n\n # Create a XYChart object of size 180 x 180 pixels with a blue background\n # (0x9c9cce)\n c = ChartDirector::XYChart.new(180, 180, 0x9c9cce)\n\n # Add titles to the top and bottom of the chart using 7.5pt Arial font. The text\n # is white 0xffffff on a deep blue 0x31319C background.\n c.addTitle2(ChartDirector::Top, \"STAR TECH INDEX 2003-01-28\", \"arial.ttf\", 7.5,\n 0xffffff, 0x31319c)\n c.addTitle2(ChartDirector::Bottom, \"LATEST STI:1809.41 (+14.51)\", \"arial.ttf\",\n 7.5, 0xffffff, 0x31319c)\n\n # Set the plotarea at (31, 21) and of size 145 x 124 pixels, with a pale yellow\n # (0xffffc8) background.\n c.setPlotArea(31, 21, 145, 124, 0xffffc8)\n\n # Add custom text at (176, 21) (top right corner of plotarea) using 11pt Times\n # Bold Italic font/red (0xc09090) color\n c.addText(176, 21, \"Chart Demo\", \"timesbi.ttf\", 11, 0xc09090).setAlignment(\n ChartDirector::TopRight)\n\n # Use 7.5 pts Arial as the y axis label font\n c.yAxis().setLabelStyle(\"\", 7.5)\n\n # Set the labels on the x axis by spreading the labels evenly between the first\n # point (index = 0) and the last point (index = noOfPoints - 1)\n c.xAxis().setLinearScale(0, noOfPoints - 1, labels)\n\n # Use 7.5 pts Arial as the x axis label font\n c.xAxis().setLabelStyle(\"\", 7.5)\n\n # Add a deep blue (0x000080) line layer to the chart\n c.addLineLayer(data, 0x000080)\n\n # Output the chart\n send_data(c.makeChart2(ChartDirector::PNG), :type => \"image/png\",\n :disposition => \"inline\")\n end", "def graph(t)\n xZero = @xSize / 2\n yZero = @ySize / 2\n x0Scale = -PI\n xNScale = PI\n y0Scale = 1.0\n yNScale = -1.0\n delta = 0.05\n\n\n Curses.timeout = 0 # non-blocking key input so the animation continues\n Curses.stdscr.keypad(true) # enable arrow keys (required for pageup/down)\n while TRUE\n t.clear\n\n #Draw Zero Axes\n t.line(xZero, 0, xZero, @ySize-1)\n t.line(0, yZero, @xSize-1, yZero)\n\n 0.upto(@xSize-1) do |x|\n xr = ((x.to_f / @xSize.to_f) * (xNScale - x0Scale)) + x0Scale\n yr = Math.sin(xr)\n y = (((yr - y0Scale) / (yNScale - y0Scale)) * @ySize).to_i\n #puts \"#{x}, #{y} = #{xr}, #{yr}\"\n t.set(x, y)\n end\n\n # Draw Curve\n\n\n t.render\n yRange = yNScale - y0Scale\n xRange = xNScale - x0Scale\n case Curses.getch\n when Curses::Key::UP\n y0Scale += yRange * delta\n yNScale += yRange * delta\n when Curses::Key::DOWN\n y0Scale -= yRange * delta\n yNScale -= yRange * delta\n when Curses::Key::RIGHT\n x0Scale += xRange * delta\n xNScale += xRange * delta\n when Curses::Key::LEFT\n x0Scale -= xRange * delta\n xNScale -= xRange * delta\n # when 10 then do_something # enter\n when ?+\n x0Scale += xRange * delta\n xNScale -= xRange * delta\n y0Scale += yRange * delta\n yNScale -= yRange * delta\n when ?-\n x0Scale -= xRange * delta\n xNScale += xRange * delta\n y0Scale -= yRange * delta\n yNScale += yRange * delta\n when ?q then return # quit\n end\n end\nend", "def plot_strategy(data,compare_data)\n your_color = ['#C7E6F2','#70D2E5', '#44BBDF']\n name = ['L1 Questions', 'L2 Questions', 'L3 Questions']\n comparison_color = ['#D9D9D9', '#B2B2B2', '#8C8C8C']\n @yours = PlotGraph::Graphs.percentage name, data, your_color, \"Strategy over the days\", \"No of questions attended\"\n @yours_compare = PlotGraph::Graphs.percentage name, data, your_color, 200, \"Strategy over the days\", \"No of questions attended\"\n @comparison = PlotGraph::Graphs.percentage name, compare_data, comparison_color, 200, \"Strategy over the days\", \"No of questions attended\"\n @comparison = [@yours_compare, @comparison]\n end", "def plot_data\n clear_lines\n @buffer.keys.each { |k| plot_data_line(k, @buffer[k]) }\n end", "def work(drawer)\n while(p = drawer.get_point) do\n x, y = p[0], p[1]\n @s.puts \"m #{ITERATIONS} #{x} #{y}\\n\"\n @s.flush\n iter = @s.readline.to_i\n drawer.plot(p,iter) \n end\n end", "def start\n\t\tprint_series_leaderboard #shows the series leaderboard status\n\t\tturn_number=0\n\t\twhile turn_number<9 do\n\t\t\tturn_number=turn_number+1\n\t\t\tprint_board\n\t\t\tplayer_on_turn=get_player_on_turn(turn_number)\n\t\t\tputs \"#{player_on_turn.name}(#{player_on_turn.marker}) its your turn\"\n\t\t\tchoice = get_valid_empty_cell\n\t\t\tupdate_cell_status(turn_number,choice)\n\t\t\tplayer_on_turn.consider(@game_cell_vectors[choice])\n\t\t\tif player_on_turn.is_winner==true then\n\t\t\t\tprint_board\n\t\t\t\tplayer_on_turn.declare_winner\n\t\t\t\tbreak\n\t\t\tend\n\t\t\tif turn_number==9\n\t\t\t\tputs \"Game resulted in Draw\"\n\t\t\tend\t\n\t\tend\n\tend", "def update_title\n\n # Update the logo sprite\n @logo_sprite.update\n\n # And the prompt label(s)\n drift_x = @args.grid.center_x + 15.randomize(:ratio, :sign)\n drift_y = 400 + 5.randomize(:ratio, :sign)\n\n @prompt.each_with_index do |label, idx|\n\n # If we're stationary, pick a new random location to drift to\n label.movable_location(drift_x, drift_y - (idx * 75), 30) unless label.movable_moving?\n\n # And lastly, update it\n label.update\n\n end\n\n # And see if the user clicks on the button\n @button_sprite.update\n if @args.inputs.mouse.click &&\n @args.inputs.mouse.click.point.x.between?(@args.grid.center_x - 128, @args.grid.center_x + 128) &&\n @args.inputs.mouse.click.point.y.between?(128, 192)\n\n # Set the timer running from this point\n @args.state.vertices.start_tick = @args.tick_count\n\n # Set the shape count to zero\n @args.state.vertices.shape_count = 0\n\n # Start the right music\n @audio_handler.play('vertices/sounds/play.ogg')\n\n # And flag ourselves as running\n @args.state.vertices.running = true\n\n end\n\n end", "def draw\n @grid.draw\n show_info\n end", "def setup_grid(skip_render, skip_set_pieces)\n @grid = Array.new(8) { Array.new(8) { EmptySquare.new } }\n unless skip_set_pieces\n set_major_minor\n set_pawns\n end\n\n render unless skip_render\n end", "def set_finish_point\n self.reload\n if circle == \"1\"\n lp = points.first\n tracksegments.last.points.create(:longitude => lp.longitude, \n :latitude => lp.latitude, \n :elevation => lp.elevation)\n logger.info \"Finish point appended\"\n end\n end", "def draw\n return unless @radar_scan && @known_items\n\n Services::ScreenDraw.new(\n results: @results,\n width: @radar_scan.width,\n height: @radar_scan.height\n ).run\n end", "def start_export( img_width, img_height)\n set_residual_factor\n @w, @h = (img_width * x_factor).to_i.abs, (img_height * y_factor).to_i.abs\n super(@w, @h)\n end", "def update_visualization(point)\n\t\t\t\t\n\t\t\tend", "def prepare_charts #:nodoc:\n count = 0\n charts = []\n\n # We sort the charts by row and column but that isn't strictly required.\n #\n rows = @charts.keys.sort\n rows.each do |row|\n cols = @charts[row].keys.sort\n cols.each do |col|\n charts.push(@charts[row][col])\n count += 1\n end\n end\n\n @charts = {}\n @charts_array = charts\n count\n end", "def show\n @chart_data0 = make_chart_data(@progress.company_name,0)\n @chart_data1 = make_chart_data(@progress.company_name,1)\n @chart_data2 = make_chart_data(@progress.company_name,2)\n end", "def plot_script(counter = false)\n [\"set term png\",\n (if counter\n \"set output \\\"#{base}/#{counter}.png\\\"\" # \"set output \\\"#{base}/group.png\\\"\"\n else\n \"set output \\\"#{base}/group.png\\\"\"\n end),\n \"set pm3d\",\n # \"set pm3d map\",\n \"splot \\\"#{self.data_file(counter)}\\\" with pm3d title 'fitness' \"].join(\"\\n\")\n end", "def makeChart(*options)\n\ndisplay = \"\n<div class='charts last'>\n\n<div class='left'>\n\n\n<div id='placeholder' style='width:400px;height:200px;'></div>\n<div id='overview' style='width:400px;height:50px'></div>\n<p id='overviewLegend' style='margin-left:10px'></p>\n\n<p> Try zooming. Click and drag to select a zone.</p>\n</div>\n\n<div class='right'>\n\nWeight Chart<br/>\n<div id='miniWeight' style='width:350px;height:100px;'></div>\nWater Chart<br/>\n<div id='miniWater' style='width:350px;height:100px;'></div>\n\n\nCalories Eaten<br/>\n<div id='miniCalorie' style='width:350px;height:100px;'></div>\nFitness (Calories burned not to include resting metabolism)<br/>\n<div id='miniFitness' style='width:350px;height:100px;'></div><br/>\n\nMeasurements (Total inches)<br/>\n<div id='miniMeasures' style='width:350px;height:100px;'></div>\n\n\n</div>\n\n\n\n\n<div class='last'></div>\n<script id='source' language='javascript' type='text/javascript'>\n\n\n$(function () {\nvar options = {\n xaxis: { mode: 'time' },\n selection: { mode: 'x' },\n legend: { \n show: true, \n container: $('#overviewLegend'),\n noColumns: 2,\n }\n};\n\nvar options_overview = {\n xaxis: { mode: 'time' },\n selection: { mode: 'x' },\n legend: { show: false}\n};\n\n\nvar plot = $.plot($('#placeholder'), \n[ #{@chartable.to_chart } ], options);\n\n\n\n\nvar overview = $.plot($('#overview'), \n[ #{@chartable.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\n\n\n\n\nvar overview_1 = $.plot($('#miniWeight'), \n[ #{@miniWeight.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\nvar overview_2 = $.plot($('#miniWater'), \n[ #{@miniWater.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\nvar overview_3 = $.plot($('#miniCalorie'), \n[ #{@miniCalorie.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\nvar overview_4 = $.plot($('#miniFitness'), \n[ #{@miniFitness.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\nvar overview_5 = $.plot($('#miniMeasures'), \n[ #{@miniMeasures.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\n// now connect the two\nvar internalSelection = false;\n\n$('#placeholder').bind('selected', function (event, area) {\n // do the zooming\n plot = $.plot($('#placeholder'), \n [#{@chartable.to_chart}],\n $.extend(true, {}, options, {\n xaxis: { min: area.x1, max: area.x2 }\n }));\n \n if (internalSelection)\n return; // prevent eternal loop\n internalSelection = true;\n overview.setSelection(area);\n internalSelection = false;\n});\n\n$('#overview').bind('selected', function (event, area) {\n if (internalSelection)\n return;\n internalSelection = true;\n plot.setSelection(area);\n internalSelection = false;\n});\n\n\n});\n</script>\n\"\n\nend", "def _draw_panel\n @apotomo_emit_raw_view = true\n render :view => param(:panel)\n end", "def play\n t0_setup\n row_to_find\n\n for @it in 1..12\n unless @over == true\n iterate_and_check\n big_input_array\n big_result_array\n plot_game\n defeat\n end\n end\n\n end", "def draw\n return if map.nil?\n\n # Draw overall score\n scores = Gameplay::Scoring.scores_for_map(map)\n @previous_valid_total_score = scores.values.min if scores.values.all?\n\n IO::FontManager.font(30).draw_text('SCORE', 50, 18, 1, 1.0, 1.0,\n Gosu::Color::BLACK)\n IO::FontManager.font(70).draw_text(@previous_valid_total_score,\n 50, 50, 1, 1.0, 1.0,\n scores.values.all? ? Gosu::Color::BLACK : Gosu::Color::GRAY)\n\n # Draw individual station scores\n scores.each.with_index do |(station, score), i|\n Gosu.draw_rect(i * 50 + 170, 70, 40, 40,\n Entities::StationObject::BACKGROUND_COLORS[station], 10)\n\n @previous_valid_scores[station] = score unless score.nil?\n\n IO::FontManager.font(25).draw_text_rel(@previous_valid_scores[station],\n i * 50 + 190, 90, 10, 0.5, 0.5,\n 1, 1, !score.nil? \\\n ? Entities::StationObject::TEXT_COLORS[station]\n : Entities::StationObject::INACTIVE_TEXT_COLORS[station])\n end\n\n # Draw a medal for the overall score\n medal = map.metadata.medal_for(@previous_valid_total_score) || 'none'\n medal_img = IO::ImageManager.image(\"medal_#{medal}\".to_sym)\n\n medal_img.draw(170, 10, 10)\n\n # Draw the next level button, if necessary\n if medal != 'none'\n @next_level_button.draw_element(10)\n @next_level_button.enabled = true\n IO::FontManager.font(25).draw_text(\"Next\\nLevel\",\n @next_level_button.point.x + 10, 25, 10, 1, 1, 0xFF000000)\n else\n @next_level_button.enabled = false\n end\n end", "def newGameSetup\r\n @experienceInt = 0 #Starting experience.\r\n @experience.clear { para(\"EXP: \" + @experienceInt.to_s, @style_stats) }\r\n @tierInt = 1 #Starting tier.\r\n @tier.clear{ para(\"TIER: \" + @tierInt.to_s, @style_stats) }\r\n @durability.clear { para(\"DUR: \" + @durabilityInt.to_s, @style_stats) }\r\n\r\n @oreTotal = Array.new(@tiers, 0) #Total number of ores for each tier.\r\n @oreRemaining = Array.new(@tiers, 0) #Remaining number of ores for each tier.\r\n @tierExp = Array.new(@tiers) #Total experience available for each tier of ore.\r\n @tile = Array.new(@columns){Array.new(@rows)} #Declares the 2D array to represent the grid.\r\n @hiddenCount = @columns * @rows\r\n @endState.clear\r\n\r\n #Generates the grid of buttons\r\n @board.clear do\r\n stack(width: (@columns * @tile_size)) do\r\n background(\"#000000\") #Sets the background to black.\r\n border(\"#CE8\", strokewidth: 1)\r\n\r\n (0..@rows-1).each do |row|\r\n flow(width: 1.0) do\r\n (0..@columns-1).each do |col|\r\n @btn = button(width: @tile_size, height: @tile_size) {\r\n mineTile(col,row)\r\n }\r\n @tile[col][row] = Tile.new(@btn)\r\n end\r\n end\r\n end\r\n end\r\n end\r\n\r\n @endGame = false\r\n\r\n generateOres #Generates the ores into the grid.\r\n calculateAdjacent #Calculates all adjacent values of every tile.\r\n\r\nend", "def getchart()\n # The (x, y) data for the first line\n dataX0 = [20, 90, 40, 30, 12]\n dataY0 = [10, 40, 75, 54, 20]\n\n # The (x, y) data for the second line\n dataX1 = [10, 40, 75, 54, 60]\n dataY1 = [50, 90, 40, 30, 10]\n\n # Create a XYChart object of size 450 x 450 pixels\n c = ChartDirector::XYChart.new(450, 450)\n\n # Set the plotarea at (55, 65) and of size 350 x 300 pixels, with white background\n # and a light grey border (0xc0c0c0). Turn on both horizontal and vertical grid\n # lines with light grey color (0xc0c0c0)\n c.setPlotArea(55, 65, 350, 300, 0xffffff, -1, 0xc0c0c0, 0xc0c0c0, -1)\n\n # Add a legend box at (50, 30) (top of the chart) with horizontal layout. Use 12\n # pts Times Bold Italic font. Set the background and border color to Transparent.\n c.addLegend(50, 30, false, \"timesbi.ttf\", 12).setBackground(\n ChartDirector::Transparent)\n\n # Add a title to the chart using 18 pts Times Bold Itatic font\n c.addTitle(\"Reaction Path\", \"timesbi.ttf\", 18)\n\n # Add a title to the y axis using 12 pts Arial Bold Italic font\n c.yAxis().setTitle(\"Temperature (Celcius)\", \"arialbi.ttf\", 12)\n\n # Set the y axis line width to 3 pixels\n c.yAxis().setWidth(3)\n\n # Add a title to the x axis using 12 pts Arial Bold Italic font\n c.xAxis().setTitle(\"Pressure (Pa)\", \"arialbi.ttf\", 12)\n\n # Set the x axis line width to 3 pixels\n c.xAxis().setWidth(3)\n\n # Add a red (0xff3333) line layer using dataX0 and dataY0\n layer1 = c.addLineLayer(dataY0, 0xff3333, \"Compound AAA\")\n layer1.setXData(dataX0)\n\n # Set the line width to 3 pixels\n layer1.setLineWidth(3)\n\n # Use 9 pixel square symbols for the data points\n layer1.getDataSet(0).setDataSymbol(ChartDirector::SquareSymbol, 9)\n\n # Add custom text labels to the first and last point on the scatter plot using\n # Arial Bold font\n layer1.addCustomDataLabel(0, 0, \"Start\", \"arialbd.ttf\")\n layer1.addCustomDataLabel(0, 4, \"End\", \"arialbd.ttf\")\n\n # Add a green (0x33ff33) line layer using dataX1 and dataY1\n layer2 = c.addLineLayer(dataY1, 0x33ff33, \"Compound BBB\")\n layer2.setXData(dataX1)\n\n # Set the line width to 3 pixels\n layer2.setLineWidth(3)\n\n # Use 11 pixel diamond symbols for the data points\n layer2.getDataSet(0).setDataSymbol(ChartDirector::DiamondSymbol, 11)\n\n # Add custom text labels to the first and last point on the scatter plot using\n # Arial Bold font\n layer2.addCustomDataLabel(0, 0, \"Start\", \"arialbd.ttf\")\n layer2.addCustomDataLabel(0, 4, \"End\", \"arialbd.ttf\")\n\n # Output the chart\n send_data(c.makeChart2(ChartDirector::PNG), :type => \"image/png\",\n :disposition => \"inline\")\n end", "def draw\n visit_header\n questionnaire_items\n end", "def branch subplot_class = Gamefic::Subplot, introduce: nil, next_cue: nil\n subplot = subplot_class.new(self, introduce: introduce, next_cue: next_cue)\n p_subplots.push subplot\n subplot\n end", "def getchart()\n # The x and y coordinates of the grid\n dataX = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]\n dataY = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]\n\n # The values at the grid points. In this example, we will compute the values using\n # the formula z = sin((x - 0.5) * 2 * pi) * sin((y - 0.5) * 2 * pi)\n dataZ = Array.new((dataX.length) * (dataY.length))\n 0.upto(dataY.length - 1) do |yIndex|\n y = (dataY[yIndex] - 0.5) * 2 * 3.1416\n 0.upto(dataX.length - 1) do |xIndex|\n x = (dataX[xIndex] - 0.5) * 2 * 3.1416\n dataZ[yIndex * (dataX.length) + xIndex] = Math.sin(x) * Math.sin(y)\n end\n end\n\n # Create a SurfaceChart object of size 720 x 540 pixels\n c = ChartDirector::SurfaceChart.new(720, 540)\n\n # Add a title to the chart using 20 points Times New Roman Italic font\n c.addTitle(\"Quantum Wave Function\", \"timesi.ttf\", 20)\n\n # Set the center of the plot region at (360, 245), and set width x depth x height\n # to 360 x 360 x 270 pixels\n c.setPlotRegion(360, 245, 360, 360, 270)\n\n # Set the elevation and rotation angles to 20 and 30 degrees\n c.setViewAngle(20, 30)\n\n # Set the data to use to plot the chart\n c.setData(dataX, dataY, dataZ)\n\n # Spline interpolate data to a 80 x 80 grid for a smooth surface\n c.setInterpolation(80, 80)\n\n # Set surface grid lines to semi-transparent black (dd000000)\n c.setSurfaceAxisGrid(0xdd000000)\n\n # Set contour lines to semi-transparent white (80ffffff)\n c.setContourColor(0x80ffffff)\n\n # Add a color axis (the legend) in which the left center is anchored at (645,\n # 270). Set the length to 200 pixels and the labels on the right side. Use smooth\n # gradient coloring.\n c.setColorAxis(645, 270, ChartDirector::Left, 200, ChartDirector::Right\n ).setColorGradient()\n\n # Set the x, y and z axis titles using 10 points Arial Bold font\n c.xAxis().setTitle(\"x/L(x)\", \"arialbd.ttf\", 10)\n c.yAxis().setTitle(\"y/L(y)\", \"arialbd.ttf\", 10)\n c.zAxis().setTitle(\"Wave Function Amplitude\", \"arialbd.ttf\", 10)\n\n # Output the chart\n send_data(c.makeChart2(ChartDirector::JPG), :type => \"image/jpeg\",\n :disposition => \"inline\")\n end", "def reset_game\n\t\t#Reset the board\n\t\treset_board\n\t\t\n\t\t# Reset the Points\n\t\t@points_player1 = 0\n\t\t@points_player2 = 0\n\t\t\n\t\t@hud_player1.set_text(\"Player X: \"+@points_player1.to_s)\n\t\t@hud_player2.set_text(\"Player O: \"+@points_player2.to_s)\n\t\t\n\t\t# Setting the X Player to start\n\t\t@playerx = true\n\t\t@current_player.set_text \"Player: X\"\n\tend", "def home\n @heading = 0.0\n @xy = [0.0, 0.0]\n @pen_is_down = false\n end", "def update_visualization(point)\n\t\t\n\tend", "def update_visualization(point)\n\t\t\n\tend", "def update_visualization(point)\n\t\t\n\tend", "def update_visualization(point)\n\t\t\n\tend", "def draw\n self.results.to_a.each do |result|\n result.value = 0.5\n result.save!\n end\n end", "def draw_basic_plot(params) \n jitter = params[:jitter]\n grouplist = params[:grouplist]\n snp_list = params[:snp_list]\n x_start = params[:x_start]\n y_start = params[:y_start]\n stat_max = params[:stat_max]\n stat_min = params[:stat_min]\n data_key = params[:data_key]\n plot_labels = params[:plot_labels]\n title = params[:title]\n precision = params[:precision]\n rotate = params[:rotate] || false\n size_mult = params[:size_mult] || 1\n prefix_title = params[:prefix_title] || \"\"\n lci_key = params[:lci_key] || nil\n uci_key = params[:uci_key] || nil\n \n x = @box_size\n xmin = x\n ymin = 0\n ymax = @box_size*9 * size_mult\n y_interval = ymax-ymin\n # set stat_min to be zero\n stat_interval = stat_max - stat_min\n\n value_x = xmin * 0.7 + (@box_size * Math.sqrt(2)*0.25)/2\n \n fill_opacity = 0.9\n if Shape.get_grayscale\n fill_opacity = 1.0\n end\n \n # draw box (change to triangle) with correct color\n snp_list.included_snps.each do |snp_index|\n draw_separator = true\n snp = snp_list.snps[snp_index]\n \n #draw_separation(x_start, y_start, 0, ymax, value_x) unless lci_key\n\n # store points here for output\n points = Array.new\n lines = Array.new\n\n grouplist.groups.each do |group|\n if snp.results.has_key?(group.name)\n result = snp.results[group.name]\n if !result.values[data_key] or result.values[data_key] !~ /\\d/\n next\n end\n box_y_start = ((stat_max-result.values[data_key].to_f) / stat_interval) * y_interval\n\n if rotate\n box_y_start = y_interval - box_y_start\n end\n\n if !group.highlighted\n points << Circle.new(value_x, box_y_start, @box_size * Math.sqrt(2)*0.125, group.colorstr)\n else\n # create triangle here\n points << create_diamond(box_y_start, value_x, 1.0, group.colorstr)\n end\n \n # create a line if there is a confidence interval\n if result.values[uci_key]\n draw_separator = false\n uci_y = ((stat_max-result.values[uci_key].to_f) / stat_interval) * y_interval\n lci_y = ((stat_max-result.values[lci_key].to_f) / stat_interval) * y_interval\n if rotate\n uci_y = y_interval - uci_y\n lci_y = y_interval - lci_y\n end \n\n points.last.interval = Line.new([value_x,value_x], [lci_y,uci_y], group.colorstr)\n end\n \n end\n\n end\n draw_separation(x_start, y_start, 0, ymax, value_x)# if draw_separator\n # sort by y-midpoint\n points.sort! {|x,y| y.ymidpoint <=> x.ymidpoint}\n #lines.sort! {|x,y| y.ymidpoint <=> x.ymidpoint} unless lines.empty?\n\n # those points that overlap significantly\n if jitter\n adjust_horizontal(points, y_interval)\n end\n\n\t # iterate through points and draw all of them\n\t points.each do |point|\n if point.interval \n point.interval.xpoints[0] = point.interval.xpoints[1] = point.xmidpoint\n @canvas.g.translate(x_start,y_start) do |check|\n check.styles(:stroke_width=>2)\n point.interval.draw(check)\n end\n end \n \t end\n\n\t points.each do |point|\n \t @canvas.g.translate(x_start,y_start) do |check|\n \t check.styles(:stroke_width=>1, :fill_opacity=>fill_opacity)\n \t point.draw(check)\n \t end \n end\n \n value_x = label_step(value_x)\n end\n\n if plot_labels\n if rotate\n x_label_start = value_x + x_start+ @box_size * 0.4 \n else\n x_label_start = x_start \n end\n\n if size_mult >= 1\n write_plot_labels(x_label_start, y_start, ymax, stat_max, stat_min, y_interval, 0, prefix_title+title, false, precision, rotate)\n else\n write_plot_labels(x_label_start, y_start, ymax, stat_max, stat_min, y_interval, 0, prefix_title+title,\n false, precision, rotate, 5)\n end\n end\n end", "def draw(options)\n csv = Roo::CSV.new(options['csv'])\n budgets = extract_available_budgets(csv.column(options['budgets_col']))\n normalized_deadlines = normalize_deadlines(csv, extract_available_deadlines(csv, options), options)\n\n budgets.each_index do |i|\n budget = budgets[i]\n scores_for_budget = []\n first_exp_score_row = i*options['budgets']+1\n last_exp_score_row = first_exp_score_row + options['budgets'] - 1\n\n (first_exp_score_row...last_exp_score_row).each do |exp_row|\n scores_for_budget.push(csv.cell(exp_row+1, options['exp_score_col']).to_f)\n end\n\n Gnuplot.open do |gp|\n Gnuplot::Plot.new(gp) do |plot|\n plot.terminal 'png'\n plot.output File.expand_path(\"../Exponential_score_#{budget}.png\", __FILE__)\n\n plot.title \"Score for budget = #{budget}\"\n plot.xlabel 'Normalized deadline'\n plot.ylabel 'Exponential score'\n plot.xrange '[0:1]'\n\n plot.data << Gnuplot::DataSet.new([normalized_deadlines, scores_for_budget]) do |ds|\n ds.with = 'linespoints'\n ds.linewidth = 4\n ds.notitle\n end\n end\n end\n end\nend", "def game_play\n until game_over\n graphic\n guess\n end\n end", "def plot\n if( @itemList.length > 0 ) \n configurePlot()\n \n plotcmds = Array.new()\n \n @itemList.each { |item| plotcmds.push( item.command() ) }\n fullcmd = @plotcmd + \" \" + plotcmds.join(\", \")\n writeln( fullcmd )\n \n @itemList.each { |item| item.pipein( @gnuplot ) }\n @gnuplot.flush()\n else\n puts \"No items to plot\"\n end\n end", "def view_review_charts\n @courses = Course.all #pertaining to one instructor\n #stores the list of all graphs being represented on the page\n @review_graphs = REVIEW_GRAPHS\n\n @selected_course = nil\n @selected_graph = nil\n\n display = params[:display]\n if params[:course_list]\n @course_list = params[:course_list]\n else\n @course_list = []\n end\n\n if display and display[:graph_type] and !display[:graph_type].empty?\n @selected_graph = display[:graph_type]\n else\n @selected_graph = params[:graph_type]\n end\n if display and display[:course] and !display[:course].empty?\n @selected_course = display[:course]\n else\n @selected_course = params[:course_id]\n end\n\n #check if the selected course from the dropdown is part of the list. If the course does not already exist, add it to the list.\n if !@course_list.include?(@selected_course)\n @course_list << @selected_course\n end\n\n if @selected_graph and @selected_course\n @assignments = Hash.new\n\n @course_list.each do |course|\n @assignments[course] = Assignment.get_assignments_for_course(course)\n end\n\n assignments_for_graph = []\n\n if params[:assignment_ids] then\n assignments_for_graph = []\n params[:assignment_ids].each do |id|\n assignments_for_graph << Assignment.find_by_id(id)\n end\n else\n @assignments.each do |course,assignments|\n assignments.each do |assignment|\n assignments_for_graph << assignment\n end\n end\n end\n\n @selected_assignments = assignments_for_graph\n\n #fetch the required data sets for the graph selected from the drop down and populate the data sets\n #call the appropriate graph rendering functions and the function that will render the table for the given data sets\n if assignments_for_graph and !assignments_for_graph.empty? then\n\n dataset1, dataset2, dataset3, dataset4, assignment_names, dataset1_name, dataset2_name, dataset3_name, dataset4_name =populate_data_sets(assignments_for_graph, @selected_graph)\n #draw_line_graph(@selected_graph, dataset1, dataset2, assignment_names, dataset1_name, dataset2_name)\n if(dataset3)\n if(dataset4)\n draw_line_graph(@selected_graph, dataset1, dataset2,dataset3, dataset4, assignment_names, dataset1_name, dataset2_name, dataset3_name, dataset4_name)\n generate_table(@selected_graph, dataset1, dataset2,dataset3, dataset4, assignment_names, dataset1_name, dataset2_name, dataset3_name, dataset4_name)\n else\n draw_line_graph(@selected_graph, dataset1, dataset2, dataset3, nil, assignment_names, dataset1_name, dataset2_name, dataset3_name, \"\")\n generate_table(@selected_graph, dataset1, dataset2, dataset3, nil, assignment_names, dataset1_name, dataset2_name, dataset3_name, \"\")\n end\n else\n draw_bar_graph(@selected_graph, dataset1, dataset2, assignment_names, dataset1_name, dataset2_name)\n generate_table(@selected_graph, dataset1, dataset2, nil, nil, assignment_names, dataset1_name, dataset2_name, \"\", \"\")\n end\n end\n end\n end", "def draw\n process_result 0.5\n end", "def initialize(plots)\n @t = FigureMaker.default\n @margin = 0.025\n\n plots.each do |plot|\n t.def_figure(plot.title) { exec_plot(plot) }\n end\n\n end", "def setup \n size 200, 200 \n @y = 100 \n stroke 255\n no_loop\nend", "def draw_play_data(x, line, width)\n y = line * line_height\n draw_playtime(x, y, width)\n max_story = $game_system.max_story\n draw_data_gauge(x, y + line_height, width / 2, Vocab::pi_storyboard, player.storymode, max_story, :percentage)\n x2 = x + width / 2\n w2 = width / 2\n #TODO: impostare il numero massimo di quest come da scritpt delle missioni\n draw_data_gauge(x2, y + line_height, w2, Vocab::pi_quests, player.quests, 50, :divisor)\n end", "def draw\n @graphics.draw\n @script.draw\n end", "def step\n @seed.text = @row.cells\n \n @canvas.append do\n image width, CELL_HEIGHT do\n @row.draw(self)\n end\n end\n @canvas.scroll_top = @canvas.scroll_max\n \n @row = @row.next\n end", "def draw(x_position, y_position)\n $app.fill(rgb(255,255,255))\n\t$app.title(@number)\n #$app.oval(x_position * Game::PIECE_SIZE + Game::PIECE_SIZE, y_position * Game::PIECE_SIZE + Game::PIECE_SIZE, \n # Game::PIECE_SIZE * Game::PIECE_SCALE_FACTOR)\n #update the coordinates of the piece\n @x = x_position\n @y = y_position\n end", "def draw\n end", "def setup\n size(640, 360)\n color_mode(RGB, 255, 255, 255, 100)\n @w = width + 16\n @xspacing = 8\n @maxwaves = 5\n @theta = 0.0\n @amplitudes = Array.new(@maxwaves) { random(10, 30) }\n @dx = Array.new(@maxwaves) do |i|\n period = random(100, 300)\n (TWO_PI / period) * @xspacing\n end\n\n @yvalues = Array.new(@w/@xspacing)\nend", "def plot(opts = {}, &block)\n\t\t\tdefault_opts = {:type => DOMAIN_COLORED_PLOT, :color => ChunkyPNG::Color::BLACK,\n\t\t\t\t:vert => DLINES, :horz => DLINES}\n\t\t\topts = default_opts.merge(opts)\n\t\t\tif opts[:type] == DOMAIN_COLORED_PLOT and @size > 0\n\t\t\t\twarn \"Warning in #{self.class}::plot: DOMAIN_COLORED_PLOT will overdraw existing #{@size} plots. Draw 1st for correct behavior.\"\n\t\t\tend\n\t\t\tcase opts[:type]\n\t\t\t\twhen DOMAIN_COLORED_PLOT then plotDCPlot(opts, &block)\n\t\t\t\twhen COMPLEX_CONTOUR_PLOT then plotCCPlot(opts, &block)\n\t\t\t\telse raise RangeError, \"Invalid plot type #{opts[:type]}.\"\n\t\t\tend\n\t\t\t@size += 1\n\t\tend", "def play_multi_year_charts\n Current.setting.reset!\n\n Current.setting.api_session_id = @scenario.id\n\n if params[:input] && (input = InputElement.find_by_key(params[:input]))\n Current.setting.last_etm_page = play_url(*input.url_components)\n @interface = Interface.new(*input.url_components)\n end\n\n @interface.variant = Interface::LiteVariant.new\n\n play\n end", "def draw(pv)\n # Get and draw in-view constellation lines\n win = App::WIN.window\n if App::Settings.show_constellations\n # Project all the line points into projection view\n # code\n @members.each do |con|\n new_proj_set = []\n con.cart_world_set.each do |line|\n new_proj_line = []\n line.each do |point|\n newpoint = pv * point\n new_proj_line << newpoint\n end\n new_proj_set << new_proj_line\n end\n con.cart_proj_set = new_proj_set\n end\n # Get all the lines containing points that are in the current screen\n # code\n on_screen_lines = []\n @members.each do |con|\n con.cart_proj_set.each do |line|\n line.each do |point|\n if point[0,0].between?(-1,1) && point[1,0].between?(-1,1) && point[2,0].between?(0,1)\n on_screen_lines << line\n end\n end\n end\n end\n on_screen_lines.uniq!\n # Draw lines between all those points and the previous and next points,\n # if they exist.\n # There's going to be a lot of duplication here, but it's small so clean\n # it up later.\n # Drop any points that have negative x and y values\n # code\n # Iterate through each line, calculate on-screen coords, then run those\n # through the Bresenham algorithm. Add all those points to another array,\n # dropping any that are negative x and y\n points_to_draw = []\n on_screen_lines.each do |line|\n line.each.with_index do |point, i|\n if line[i+1]\n x0, y0 = MyStarsConstellationLine.screen_coords(win,point) \n x1, y1 = MyStarsConstellationLine.screen_coords(win,line[i+1]) \n points_to_draw += Stars3D.create_points(x0,y0,x1,y1)\n end\n end \n end \n points_to_draw.uniq!\n points_to_draw.each do |point|\n if (point[:y].between?(0,win.maxy-1)) && (point[:x].between?(0,win.maxx-1))\n win.setpos(point[:y], point[:x])\n win.addstr(\"·\")\n end\n end\n end\n end", "def prepare_each_run\n # puts \"prepare_each_run called\"\n if @initial_run\n @interval_index = 0\n @initial_run = false\n end\n end", "def post_initialize(params)\n @planner_color_1 = params[:planner_color_1] || ::DotGrid::Color.new(\"CCCCCC\")\n @planner_color_2 = params[:planner_color_2] || ::DotGrid::Color.new(\"0099FF\")\n @grid_color = params[:grid_color] || ::DotGrid::Color.new(\"B3B3B3\")\n @dot_weight = params[:dot_weight] || 1.5\n @spacing = params[:spacing] ? params[:spacing].mm : 5.mm\n add_pattern(::DotGrid::Pattern::SquareGrid.new(params.merge!(:bounds => square_grid_bounds, grid_color: @planner_color_1)))\n add_pattern(::DotGrid::Pattern::DotGrid.new(params.merge!(:bounds => dot_grid_bounds)))\n end", "def flush\n @gnuplot.flush\n end", "def create\n if user_signed_in?\n @user = User.find(current_user)\n end \n @cemetery = Cemetery.friendly.find(params[:cemetery_id])\n\n @plot = Plot.new(plot_params)\n @plot.cemetery_id = @cemetery.id\n\n respond_to do |format|\n if @plot.save\n format.html { redirect_to cemetery_plots_path, notice: 'Plot was successfully created.' }\n format.json { render :show, status: :created, location: @plot }\n else\n format.html { render :new }\n format.json { render json: @plot.errors, status: :unprocessable_entity }\n end\n end\n end", "def getchart()\n # The XY data of the first data series\n dataX0 = [50, 55, 37, 24, 42, 49, 63, 72, 83, 59]\n dataY0 = [3.6, 2.8, 2.5, 2.3, 3.8, 3.0, 3.8, 5.0, 6.0, 3.3]\n\n # The XY data of the second data series\n dataX1 = [50, 55, 37, 24, 42, 49, 63, 72, 83, 59]\n dataY1 = [1.6, 1.8, 0.8, 0.5, 1.3, 1.5, 2.3, 2.4, 2.9, 1.5]\n\n # Create a XYChart object of size 450 x 420 pixels\n c = ChartDirector::XYChart.new(450, 420)\n\n # Set the plotarea at (55, 65) and of size 350 x 300 pixels, with white background\n # and a light grey border (0xc0c0c0). Turn on both horizontal and vertical grid\n # lines with light grey color (0xc0c0c0)\n c.setPlotArea(55, 65, 350, 300, 0xffffff, -1, 0xc0c0c0, 0xc0c0c0, -1)\n\n # Add a legend box at (50, 30) (top of the chart) with horizontal layout. Use 12\n # pts Times Bold Italic font. Set the background and border color to Transparent.\n c.addLegend(50, 30, false, \"timesbi.ttf\", 12).setBackground(\n ChartDirector::Transparent)\n\n # Add a title to the chart using 18 point Times Bold Itatic font.\n c.addTitle(\"Server Performance\", \"timesbi.ttf\", 18)\n\n # Add titles to the axes using 12 pts Arial Bold Italic font\n c.yAxis().setTitle(\"Response Time (sec)\", \"arialbi.ttf\", 12)\n c.xAxis().setTitle(\"Server Load (TPS)\", \"arialbi.ttf\", 12)\n\n # Set the axes line width to 3 pixels\n c.yAxis().setWidth(3)\n c.xAxis().setWidth(3)\n\n # Add a scatter layer using (dataX0, dataY0)\n c.addScatterLayer(dataX0, dataY0, \"Server AAA\", ChartDirector::DiamondSymbol, 11,\n 0x008000)\n\n # Add a trend line layer for (dataX0, dataY0)\n c.addTrendLayer2(dataX0, dataY0, 0x008000).setLineWidth(3)\n\n # Add a scatter layer for (dataX1, dataY1)\n c.addScatterLayer(dataX1, dataY1, \"Server BBB\", ChartDirector::TriangleSymbol, 9,\n 0x6666ff)\n\n # Add a trend line layer for (dataX1, dataY1)\n c.addTrendLayer2(dataX1, dataY1, 0x6666ff).setLineWidth(3)\n\n # Output the chart\n send_data(c.makeChart2(ChartDirector::PNG), :type => \"image/png\",\n :disposition => \"inline\")\n end", "def dmpXYPlot(k,x,y)\n if(@sustainedMode && @preValue[k])\n @workstrm[k] << x << \" \" << @preValue[k] << \"\\n\" ;\n end\n @workcount[k] += 1;\n @workstrm[k] << x << \" \" << y << \"\\n\" ;\n\n @preValue[k] = y ;\n end" ]
[ "0.596435", "0.554813", "0.5506805", "0.5471333", "0.53879887", "0.53865236", "0.52942634", "0.52837384", "0.52837384", "0.52837384", "0.52837384", "0.52761114", "0.52709645", "0.52677715", "0.5199208", "0.51697457", "0.51651394", "0.51200175", "0.511894", "0.5058235", "0.5053509", "0.5019596", "0.50174993", "0.5009458", "0.49781117", "0.49566677", "0.49524572", "0.49281758", "0.49278718", "0.49254867", "0.49203137", "0.4917556", "0.49155545", "0.49051628", "0.4898559", "0.488066", "0.4873195", "0.48683694", "0.4853839", "0.48464313", "0.48328614", "0.48293206", "0.48288262", "0.48190206", "0.48177105", "0.48098847", "0.48085862", "0.4806183", "0.48025593", "0.4791655", "0.47916308", "0.47730377", "0.47585738", "0.47543317", "0.47441956", "0.4738741", "0.473808", "0.47329617", "0.4732552", "0.47320592", "0.47254103", "0.4707273", "0.47046718", "0.46877503", "0.4682822", "0.4680556", "0.4671585", "0.46707317", "0.46701697", "0.46637514", "0.4659927", "0.46587762", "0.46586898", "0.46586898", "0.46586898", "0.46586898", "0.46483532", "0.46414843", "0.46376613", "0.46316096", "0.46303397", "0.46254808", "0.4614903", "0.46118268", "0.45976853", "0.4588203", "0.45861", "0.4583632", "0.45783773", "0.45762205", "0.4575925", "0.45701817", "0.45688176", "0.45638937", "0.4563679", "0.4553064", "0.45528153", "0.4552328", "0.45488596", "0.45485026" ]
0.47269943
60
Update the Plot's current turn of gameplay. This method is typically called by the Engine that manages game execution.
def update entities.each { |e| e.flush } call_before_player_update p_players.each { |p| p.performed nil p.scene.update } p_entities.each { |e| e.update } call_player_update call_update p_subplots.each { |s| s.update unless s.concluded? } p_subplots.delete_if { |s| s.concluded? } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def play_turn\n board.render\n pos = get_pos\n decision = get_decision\n if decision == \"r\"\n board.reveal(pos)\n elsif decision == \"f\"\n board.flag(pos)\n else\n @saved_board = board.to_yaml\n end\n end", "def update\n if dash?\n unless $game_temp.syn_state == \"idle\"\n set_graphic(@character_name + StandWalkRun::Run_sprite_suffix) if StandWalkRun::Use_run_sprite\n @run_points -= 1\n @move_speed = StandWalkRun::Run_speed\n syn_player_update\n end\n else\n @move_speed = StandWalkRun::Walk_speed\n $game_temp.syn_state == \"\"\n syn_player_update\n end\n end", "def update_turning_ball\n @ball.update_anim\n end", "def update\n\t\t\t\tprotect_runtime_errors do\n\t\t\t\t\tif @clear_history\n\t\t\t\t\t\t@history_cache = nil \n\t\t\t\t\t\tGC.start\n\t\t\t\t\tend\n\t\t\t\t\t# puts \"loader: update\"\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t# -- update files as necessary\n\t\t\t\t\tdynamic_load @files[:body]\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tputs \"current turn: #{@turn}\"\n\t\t\t\t\t@time_travel_i = @turn\n\t\t\t\t\t\n\t\t\t\t\tsignal = @wrapped_object.update @window, @turn\n\t\t\t\t\t\n\t\t\t\t\t@history.save @turn, @wrapped_object\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif signal == :finished\n\t\t\t\t\t\tputs \"saving history to file...\"\n\t\t\t\t\t\tFile.open(@window.data_dir/'history.log', \"w\") do |f|\n\t\t\t\t\t\t\tf.puts @history\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tself.finish()\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t# if you hit certain counter thresholds, you should pause for a bit, to slow execution down. that way, you can get the program to run in slow mo\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t# # jump the execution back to an earlier update phase\n\t\t\t\t\t# # (this is basically a goto)\n\t\t\t\t\t# i = @wrapped_object.update_counter.current_turn\n\t\t\t\t\t# if i > 30\n\t\t\t\t\t# \t @wrapped_object.update_counter.current_turn = 1\n\t\t\t\t\t# \t @wrapped_object.regenerate_update_thread!\n\t\t\t\t\t# end\n\t\t\t\t\t@ui.update @window, self, @wrapped_object, turn_number()\n\t\t\t\tend\n\t\t\tend", "def update\n if dash?\n if Input.dir4 == 0\n $game_player.set_graphic($game_player.old_character_name, $game_player.character_index)\n end\n unless $game_temp.syn_state == \"idle\"\n set_graphic(@character_name + StandWalkRun::Run_sprite_suffix, 0) if StandWalkRun::Use_run_sprite\n @run_points -= 1\n syn_player_update\n end\n else\n syn_player_update\n end\n end", "def turn\n puts \"Turn #{@board.count_turn + 1}, player #{get_current_player.name} choose:\"\n @board.play_turn\n end", "def update\n super\n if BattleManager.in_turn?\n process_event\n process_action\n end\n BattleManager.judge_win_loss unless BattleManager.victory_phase?\n if BattleManager.victory_phase?\n if @victory_score.done and @victory_score.active\n sfx = CP::VICTORY::IMAGE_SFX\n vol = CP::VICTORY::SFX_VOL\n pit = CP::VICTORY::SFX_PIT\n RPG::SE.new(sfx, vol, pit).play unless sfx.nil?\n @victory_score.active = false\n @victory_item.active = true\n end\n end\n end", "def update\n super\n refresh if @cw_data.include?(:playtime) && Graphics.frame_count / Graphics.frame_rate != @total_sec\n end", "def draw_next_phase\n if (@color_pair)\n if Ncurses.respond_to?(:color_set)\n @window.color_set(@color_pair, nil)\n else\n @window.attrset(Ncurses.COLOR_PAIR(@color_pair))\n end\n end\n if (DRAWING_PROCS[@current_phase].call(@window,@y,@x))\n @current_phase += 1\n self\n end\n end", "def update\n\t\t@turn = @turn == 'X' ? 'O' : 'X'\n\t\t\n\t\tb = getUserInput\n\t\t\n\t\tif b == \"quit\"\n\t\t\t@running = false\n\t\telse\n\t\t\tsetElement(2, 2, @turn)\n\t\tend\n\tend", "def update\n if @step_count == 20 # 3 times / s\n @board.step!\n @step_count = 0\n else\n @step_count += 1\n end\n end", "def view_turn\n Display.draw_board(@cur_board, @player_white, @player_black)\n Display.move_info(@turn, @player_to_move, FileReader.get_move(\"#{@turn}#{@player_to_move}\", @data))\n end", "def new_turn\n # Update whose turn it is\n increment_player_idx\n\n puts \"It's #{@players[@current_player_idx].name}'s turn.\"\\\n \" (#{@players[@current_player_idx].marker}'s)\"\n end", "def turn\n marker = @turn_count.even? ? marker = \"X\" : marker = \"O\"\n move\n print \"Current board: \"\n show_board\n @player +=1\n end", "def update\r\n # タイマー作動中なら可視に設定\r\n self.visible = $game_system.timer_working\r\n # タイマーを再描画する必要がある場合\r\n if $game_system.timer / 60 != @total_sec # Graphics.frame_rate\r\n # トータル秒数を計算\r\n @total_sec = $game_system.timer / 60#Graphics.frame_rate\r\n # タイマー表示用の文字列を作成\r\n min = @total_sec / 60\r\n sec = @total_sec % 60\r\n # タイマーを描画\r\n self.text = sprintf(\"%02d:%02d\", min, sec)\r\n end\r\n end", "def update(t)\n @turn = t\n strategy()\n end", "def draw\n\t\t\t\tprotect_runtime_errors do\n\t\t\t\t\t# render the selected state\n\t\t\t\t\t# (it has been rendered before, so it should render now without errors)\n\t\t\t\t\tunless @history_cache.nil?\n\t\t\t\t\t\t# render the states\n\t\t\t\t\t\t# puts \"history: #{@history_cache.size} - #{@history_cache.collect{|x| !x.nil?}.inspect}\"\n\t\t\t\t\t\t\n\t\t\t\t\t\t# TODO: render to FBO once and then render that same state to the screen over and over again as long as @time_travel_i is unchanged\n\t\t\t\t\t\t# currently, framerate is down to ~30fps, because this render operation is expensive.\n\t\t\t\t\t\t\n\t\t\t\t\t\t# State 0 is not renderable, because that is before the first update runs. Without the first update, the first draw will fail. Just skip state 0. Later, when we attempt to compress history by diffs, state 0 may come in handy.\n\t\t\t\t\t\trender_onion_skin(\n\t\t\t\t\t\t\t@history_cache[1..(@time_travel_i-1)], ONION_SKIN_STANDARD_COLOR,\n\t\t\t\t\t\t\t@history_cache[@time_travel_i], ONION_SKIN_NOW_COLOR,\n\t\t\t\t\t\t\t@history_cache[@forecast_range], ONION_SKIN_ERROR_COLOR\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t# @history_cache[@time_travel_i].draw @window\n\t\t\t\t\t\t\n\t\t\t\t\t\t# ^ currently the saved state is rendering some UI which shows what the current TurnCounter values are. This is going to have weird interactions with onion skinning. Should consider separating UI drawing from main entity drawing.\n\t\t\t\t\t\t# (or maybe onion-skinning the UI will be cool? idk)\\\t\t\t\t\t\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t@ui.draw @window, @wrapped_object, @history_cache, @turn\n\t\t\t\tend\n\t\t\tend", "def draw_next_phase\n if (@color_pair)\n if Ncurses.respond_to?(:color_set)\n @window.color_set(@color_pair, nil)\n else\n @window.attrset(Ncurses.COLOR_PAIR(@color_pair))\n end\n end\n @window.mvaddstr(@y, @x, \"O\")\n end", "def turn\n current_move = current_player.move(@board)\n current_token = current_player.token\n if self.board.valid_move?(current_move)\n self.board.update(current_move, current_player)\n self.board.display\n # binding.pry\n else\n turn\n end\n end", "def change_turn\n @turn = @turn >= 'X' ? 'O' : 'X'\n @turn_played += 1\n end", "def set_turn(team)\n @turn = team\n @spriteset.update\n change_music(@turn) \n phase_picture = TBS_Phase_Sprite.new(@turn)\n while not phase_picture.disposed?\n Graphics.update\n $game_map.update(false)\n phase_picture.update\n @spriteset.update\n end\n end", "def window_update()\n if $game_party != nil\n @ucLocation.cValue.text = $game_map.name\n \n @total_sec = Graphics.frame_count / Graphics.frame_rate\n hour = @total_sec / 60 / 60\n min = @total_sec / 60 % 60\n sec = @total_sec % 60\n \n @ucTime.cLabel.text = sprintf(MENU_CONFIG::TIME_PATTERN, hour, min, sec)\n @ucGold.cLabel.text = $game_party.gold\n end\n refresh()\n end", "def window_update()\n if $game_party != nil\n @ucLocation.cValue.text = $game_map.name\n \n @total_sec = Graphics.frame_count / Graphics.frame_rate\n hour = @total_sec / 60 / 60\n min = @total_sec / 60 % 60\n sec = @total_sec % 60\n \n @ucTime.cLabel.text = sprintf(MENU_CONFIG::TIME_PATTERN, hour, min, sec)\n @ucGold.cLabel.text = $game_party.gold\n end\n refresh()\n end", "def play_game\n @board.print_board\n until @quit || @restart || gameover?\n cell = take_turn(@current_player)\n if !cell.nil?\n coordinates = get_coordinates(cell)\n change_board(coordinates) if valid_cell?(coordinates)\n end\n @current_player = switch_player(@current_player)\n @board.print_board unless @restart || @quit\n end\n reset_board if @restart\n ending_screen if gameover?\n\n end", "def increment_game\n change_turn\n @turn += 1 if @player_to_move == \"w\"\n end", "def update(guess, accuracy)\n # for every update, show board\n rows[current_row] = make_row(guess, accuracy)\n self.current_row += 1\n\n show_board(self)\n end", "def draw\n @player.draw\n if @twoplayer\n @player2.draw\n else\n @bot.draw\n end\n @ball.draw\n @wall.draw\n @score.draw\n @help.draw\n end", "def update(board)\n current_captures(board)\n current_moves(board)\n end", "def perform\n @turn += 1\n if @turn%2 != 0\n slot = players[0].play(@board)\n else\n slot = players[1].play(@board)\n end\n @board.update_board(slot, @turn.even? ? 2 : 1)\n end", "def draw\n @game.state.views.each do |view|\n view.draw\n end\n end", "def update_phase4_step2\n if @active_battler.is_a?(Game_Actor)\n $game_temp.battle_actor_index = @active_battler.index\n @status_window.refresh\n end\n large_party_update_phase4_step2\n end", "def update_score()\r\n @score += GAME_PRESET[\"score_increment\"]\r\n end", "def draw\n\t\t@currentState.draw\n\tend", "def play_cycle\n play\n earn_achievements\n end_game\n end", "def update_turn_display(current_player, turn)\n @turn_display_input[0] = \"#{current_player.team.capitalize}'s Turn (#{turn})\"\n end", "def turnover\n puts \"---> Turnover\"\n change_of_possession\n end", "def update\n\t\tif @swimming\n\t\t\tcurr_time = Gosu::milliseconds\n\t\t\tif (curr_time - @prev_time).abs > @animation_update_interval\n\t\t\t\tincrement_swim_tile_index\n\t\t\t\t@prev_time = curr_time\n\t\t\t\t@@swim_sound.play\n\t\t\tend\n\t\telsif face_left?\n\t\t\t@tile_idx = 0\n\t\telse\n\t\t\t@tile_idx = 3\n\t\tend\n\n\t\tmove_party_horn\n\t\t@party_horn.update\n\tend", "def update\n if @counter == 30\n self.x += 1\n elsif @counter == 60\n self.x -= 1\n @counter = 0\n end\n @counter += 1\n end", "def update\n @player = @player.get_state\n self.run\n self\n end", "def update\n update_animation\n end", "def update\n if @counter == 30\n self.x -= 1\n elsif @counter == 60\n self.x += 1\n @counter = 0\n end\n @counter += 1\n end", "def play_game\r\n \r\n Console_Screen.cls #Clear the display area\r\n \r\n #Call on the method responsible for collecting the player's move\r\n playerMove = get_player_move\r\n \r\n #Call on the method responsible for generating the computer's move\r\n computerMove = get_computer_move\r\n \r\n #Call on the method responsible for determining the results of the game\r\n result = analyze_results(playerMove, computerMove)\r\n \r\n #Call on the \r\n gameCount = game_count\r\n\r\n #Call on the method responsible for displaying the results of the game\r\n display_results(playerMove, computerMove, result)\r\n \r\n end", "def update_visualization(point)\n\t\t@move_action.update_visualization(point)\n\tend", "def step\n if @game_over\n game_over!\n @event_handler.update\n else\n # background for playing field and hud\n @screen.fill :black\n @screen.fill [50,50,50], Rect.new(Configuration.screen[:hud_rect])\n\n @event_handler.update\n @hud.update @clock.framerate.ceil, @round, @enemies.length, @money, @lives+1, @round_timer\n\n update_timer\n restock_enemies! if @restock_enemies > 0\n\n @the_path.draw @screen # Draw the enemy path.\n @enemies.draw @screen # Draw the enemies.\n @towers.draw @screen # Draw all set towers.\n @grid_highlighter.draw @screen # Draw the nifty semi-transparent highlighter below the mouse.\n @hud.draw @screen # draw the HUD\n end\n\n @screen.update() # Refresh the screen.\n end", "def play_turn\n @board.place_mark(@current_player.get_move, @current_player.mark)\n switch_players!\n end", "def start_game\n puts 'GAME STARTED'\n until @is_game_over\n @count_turns += 1\n @board.draw_board\n @board.update_board(@controller.get_input)\n game_over?\n end\n puts @count_turns\n end_game\n end", "def turn\n puts \"Round #{@board.turn_count}\"\n input = current_player.move(@board)\n if @board.valid_move?(input)\n @board.cells[input.to_i - 1] = current_player.token\n @board.display\n else\n turn\n end\n end", "def updateGamesPlayed\n @gamesPlayed += 1\n end", "def advance_turn!\n\t\tboard_history << @board.clone\n\t\t@current_player = (@current_player == hunter ? @prey : @hunter)\n\t\t@current_turn += 1\n\tend", "def turn\n input = current_player.move(board)\n if board.valid_move?(input)\n board.update(input, current_player)\n board.display\n else\n board.display\n turn\n end\n end", "def update\n super\n update_bitmap # Update HP Graphic\n update_screen # Update the position the graphic should be displayed\n end", "def draw()\n\t\tself.score() ? self.score() == self.opponent.score() : false\n\tend", "def play\n\t\tshow\n\t\twhile true\n\t\t\trow, col = input\n\t\t\tupdate row, col\n\t\t\tshow\n\n\t\t\tif is_a_winner?\n\t\t\t\tputs \"Player #{@player} won!\"\n\t\t\t\tbreak\n\t\t\telsif is_a_tie?\n\t\t\t\tputs \"Game is tied!\"\n\t\t\t\tbreak\n\t\t\tend\n\n\t\t\tswitch_players\n\t\tend\n\tend", "def update\n\t\tif @player_moved\n\t\t\t@prawn.swimming = true\n\t\telse\n\t\t\tdrift \n\t\t\t@prawn.swimming = false\n\t\tend\n\n\t\tif !@moved_y_axis && !is_plane\n\t\t\tstabilise\n\t\t\t@has_moved = true\n\t\tend\n\n\t\tcheck_bounds\n\n\t\t@prawn.update\n\t\t@player_moved = @moved_y_axis = false\n\tend", "def draw\n @headers[@game_state_model::players[@game_state_model.player_turn_state]::player_color].draw(@x, @y, 35)\n\n if @game_state_model.player_turn_state == 0\n @ico_one.draw(@x + 143, @y + 20, 35)\n elsif @game_state_model::players[@game_state_model.player_turn_state]::ai == nil\n @ico_two.draw(@x + 143, @y + 20, 35)\n else \n @ico_ai.draw(@x + 143, @y + 20, 35)\n end\n\n @tiles[@game_state_model::players[0]::player_color].draw(@x + 10, @y + 8, 35)\n @tiles[@game_state_model::players[1]::player_color].draw(@x + 10, @y + 48, 35)\n # @block_purple.draw(@x + 10, @y + 5, 1)\n # @block_green.draw(@x + 10, @y + 45, 1)\n @question.draw\n @cancel.draw\n @font.draw(\"#{@game_state_model::players[0]::name}\", 50, @y + 7, 35, 1.0, 1.0, 0xff_ffffff)\n @font.draw(\"Wins: #{@game_state_model::players[0]::score}\", 50, @y + 22, 35, 1.0, 1.0, 0xff_ffffff)\n @font.draw(\"#{@game_state_model::players[1]::name}\", 50, @y + 47, 35, 1.0, 1.0, 0xff_ffffff)\n @font.draw(\"Wins: #{@game_state_model::players[1]::score}\", 50, @y + 62, 35, 1.0, 1.0, 0xff_ffffff)\n end", "def update_score\n if @round_won\n @player.increment_rounds_won\n else\n @player.increment_rounds_lost\n end\n end", "def player_turn(turn)\n get_player_input\n compare_guesses\n update_board(turn)\n system 'clear'\n display_board(turn)\n end", "def update\n super\n # update_bitmap # Not needed for now\n update_screen # Update the position the graphic should be displayed\n # update_frame # Update the frame count (if wanted later)\n end", "def play\n\t\t@current_turn = 0\n\t\t@current_player = @hunter\n\t\tplayers.each{|p| p.write(game_parameters)}\n\t\tuntil is_game_over?\n\t\t\tpre_turn_wall_count = @walls.size\n\t\t\treport_state_to_spectators\n\t\t\t@current_player.take_turn\n\t\t\t# Only print the board every 10 turns or if a wall was added or removed\n\t\t\tprint_minified_board() if @current_turn%10 == 0 || @walls.size != pre_turn_wall_count\n\t\t\tadvance_turn!\n\t\t\tprint \"#{@current_turn} \"\n\t\tend\n\t\tresult = report_winner\n\t\tcleanup_players!\n\t\tcleanup_spectators!\n\t\tresult\t# Returns this so the EvasionServer can save results\n\tend", "def window_update(enemy, scan_mode)\n if enemy != nil\n @scan_mode = scan_mode\n @ucEnemyGraphic.enemy = enemy\n end\n refresh()\n end", "def update\n n = $seconds_per_tick\n @time += n\n\n @ticks_to_update_clock -= 1\n\n if @ticks_to_update_clock == 0\n @ticks_to_update_clock = (60 / $seconds_per_tick).to_i\n @text.text = to_s\n end\n\n if !@time.day? and @old_hour != @time.hour\n @sun_shining_mask.color.opacity = sun_mask_opacity\n @old_hour = @time.hour\n end\n end", "def update_graphics\n case @animation_state\n when 0\n animation_phase_1\n when 1\n if $pokemon_party.nuzlocke.enabled? && !@graveyard.empty?\n animation_phase_2\n else\n @animation_state += 1\n end\n when 2\n animation_phase_3\n when 3\n # Every animation is finished so there's only two things to update\n update_turning_ball\n update_end_stars_anim\n end\n end", "def draw\n @updated_blocks.each do |block|\n block.draw(self, [@x_viewport, @y_viewport].to_vec2d)\n end\n @player.draw(self, [@x_viewport, @y_viewport].to_vec2d)\n @font.draw(\"Score: #{@player.score}\", 10, 10, ZOrder::UI,\n 1.0, 1.0, Gosu::Color::WHITE)\n end", "def game_play\n until game_over\n graphic\n guess\n end\n end", "def play_full_game\n Display.clear_screen\n Display.draw_board(@cur_board, @player_white, @player_black)\n Display.game_start_ui\n fast_forward(@data[\"moves\"].keys[-1], true)\n Display.draw_board(@cur_board, @player_white, @player_black)\n Display.game_end_ui(determine_winner)\n end", "def draw\n return if map.nil?\n\n # Draw overall score\n scores = Gameplay::Scoring.scores_for_map(map)\n @previous_valid_total_score = scores.values.min if scores.values.all?\n\n IO::FontManager.font(30).draw_text('SCORE', 50, 18, 1, 1.0, 1.0,\n Gosu::Color::BLACK)\n IO::FontManager.font(70).draw_text(@previous_valid_total_score,\n 50, 50, 1, 1.0, 1.0,\n scores.values.all? ? Gosu::Color::BLACK : Gosu::Color::GRAY)\n\n # Draw individual station scores\n scores.each.with_index do |(station, score), i|\n Gosu.draw_rect(i * 50 + 170, 70, 40, 40,\n Entities::StationObject::BACKGROUND_COLORS[station], 10)\n\n @previous_valid_scores[station] = score unless score.nil?\n\n IO::FontManager.font(25).draw_text_rel(@previous_valid_scores[station],\n i * 50 + 190, 90, 10, 0.5, 0.5,\n 1, 1, !score.nil? \\\n ? Entities::StationObject::TEXT_COLORS[station]\n : Entities::StationObject::INACTIVE_TEXT_COLORS[station])\n end\n\n # Draw a medal for the overall score\n medal = map.metadata.medal_for(@previous_valid_total_score) || 'none'\n medal_img = IO::ImageManager.image(\"medal_#{medal}\".to_sym)\n\n medal_img.draw(170, 10, 10)\n\n # Draw the next level button, if necessary\n if medal != 'none'\n @next_level_button.draw_element(10)\n @next_level_button.enabled = true\n IO::FontManager.font(25).draw_text(\"Next\\nLevel\",\n @next_level_button.point.x + 10, 25, 10, 1, 1, 0xFF000000)\n else\n @next_level_button.enabled = false\n end\n end", "def update_screen\n unless self.disposed?\n self.x = screen_x \n self.y = screen_y\n self.z = self.y + 64 + (@is_moving ? 1 : 0)\n end\n end", "def update\n if !@parent.active?\n @pauseScreen.applyOn(@parent)\n end\n if @game.currentGuess.grid==@game.correction && @tutoEnd\n @victoryScreen.applyOn(@parent,0,true)\n @game.delete_observers\n end\n end", "def start_game\n\t\tself.game_is_started = true\n send_update\n end", "def play_turn\n move = @current_player.get_move\n switch_players!\n @board.place_mark(move, :X)\n end", "def draw\n self.results.to_a.each do |result|\n result.value = 0.5\n result.save!\n end\n end", "def draw\n if @winner == Const::GAME_ON\n @game.draw\n @o_board.draw\n elsif @winner == Const::GAME_LOST\n @font.draw(Const::GAME_LOST_CAPTION,\n @window.width / 2 - 170, @window.height / 2 - 30, 0)\n else\n @font.draw(Const::GAME_WON_CAPTION,\n @window.width / 2 - 170, @window.height / 2 - 30, 0)\n end\n end", "def update_board(turn)\n @board[turn][0] = @matches\n @board[turn][1] = @code_breaker_input\n end", "def play_game\r\n\r\n Console_Screen.cls #Clear the display area\r\n\r\n #Call on the method responsible for collecting the player's move\r\n playerMove = get_player_move\r\n\r\n #Call on the method responsible for generating the computer's move\r\n computerMove = get_computer_move\r\n\r\n #Call on the method responsible for determining the results of the game\r\n result = analyze_results(playerMove, computerMove)\r\n\r\n #CAll on the method responsible for ingrementing the game count\r\n game_Count\r\n\r\n #Call on the method responsible for displaying the results of the game\r\n display_results(playerMove, computerMove, result)\r\n\r\n end", "def next_round\n sleep(1)\n puts \"\\n----- NEW TURN -----\"\n self.players.rotate!\n round_gameplay\n end", "def process_computer_turn\n \tself.current_player = @player\n \tputs \"My Move, playing #{computer_symbol}\"\n \tcomputer_move = self.get_computer_move\n \tchange_state(computer_symbol,computer_move)\n \tcomputer_move\n end", "def update\r\n #\r\n # Register a tick with our rather standard tick/framerate counter. \r\n # Returns the amount of milliseconds since last tick. This number is used in all update()-calls.\r\n # Without this self.fps would return an incorrect value.\r\n # If you override this in your Chingu::Window class, make sure to call super.\r\n #\r\n @milliseconds_since_last_tick = @fps_counter.register_tick\r\n \r\n intermediate_update\r\n end", "def update(visualizer)\r\n #check for spontaneous splits\r\n for _, value in $CRN.reactions.select { |key, val| key == [self] }\r\n if rand($MIN_TICS / visualizer.minFramesValue * value[0]).round == 0\r\n visualizer.split([self], value[1])\r\n end\r\n end\r\n self.x += self.v[:x]\r\n self.y += self.v[:y]\r\n end", "def draw\r\n @game_objects.draw\r\n end", "def update_move\n update_last_coordinate\n @point.update_move\n update_placement\n move_animation(diff_x, diff_y)\n end", "def update_2prev(player,i)\n if i == 2\n @game_scores[player - 1][-2] = 20 + @frame_scores[player - 1][i][0]\n # puts \"line #{__LINE__} - 2prev:\\t#{@game_scores[player - 1].inspect}\"\n else\n @game_scores[player - 1][-2] = @game_scores[player - 1][-3] + 20 + @frame_scores[player - 1][i][0]\n # puts \"line #{__LINE__} - 2prev:\\t#{@game_scores[player - 1].inspect}\"\n end \nend", "def update_2prev(player,i)\n if i == 2\n @game_scores[player - 1][-2] = 20 + @frame_scores[player - 1][i][0]\n # puts \"line #{__LINE__} - 2prev:\\t#{@game_scores[player - 1].inspect}\"\n else\n @game_scores[player - 1][-2] = @game_scores[player - 1][-3] + 20 + @frame_scores[player - 1][i][0]\n # puts \"line #{__LINE__} - 2prev:\\t#{@game_scores[player - 1].inspect}\"\n end \nend", "def increment_turn\n @players.rotate!\n end", "def update\n @timer.update(Window.fps)\n case @scene\n when 'intro'\n update_intro\n when 'level'\n update_level\n when 'transition'\n update_transition\n when 'credits'\n update_credits\n end\n end", "def update\n @currentFrame += 1\n self.updateElements\n if !@totalFrames.nil? && @totalFrames >= 0 && @currentFrame >= @totalFrames\n self.restart\n end\n end", "def turn\n\t\toutputStatus\n\t\tif @guesses_left < 10\n\t\t\tsaveGame if save?\n\t\tend\n\t\tletter = getLetter\n\t\tif checkLetter(letter)\n\t\t\treplaceLetter(letter)\n\t\telse\n\t\t\twrongGuess(letter)\n\t\tend\n\tend", "def play\n start = Time.now\n until @board.won?\n @player ? round_player : round_ai\n @attempts += 1\n sleep(2)\n system(\"cls\")\n @board.render\n end\n finish = Time.now\n time_to_finish = finish - start\n declare_win(time_to_finish)\n end", "def update\n self.caption = \"Tennis - [FPS: #{Gosu::fps.to_s}]\"\n if not @game_over\n # Move the game objects around.\n @player.update\n if @twoplayer\n @player2.update\n else\n @bot.update\n end\n @ball.update\n # No need to call update on wall, since it doesn't move :-)\n end\n end", "def update_screen\n @screen.update()\n end", "def update\r\n return if $BTEST\r\n @time = $game_variables[LTS::TIME_VARIABLE_ID]\r\n if @time >= 1440\r\n @time %= 1440\r\n end\r\n @hour = @time/60\r\n @minute = @time%60\r\n $game_variables[LTS::HOUR_VARIABLE_ID] = @hour unless LTS::HOUR_VARIABLE_ID == nil\r\n $lts_time = sprintf(\"%02d:%02d\", @hour, @minute)\r\n if $lts_event_tone\r\n update_tone(0) if $lts_map_data[$game_map.map_id].part_outside?\r\n else\r\n $game_map.screen.start_tone_change(Tone.new(0,0,0,0),0)\r\n update_tone(0) if $lts_map_data[$game_map.map_id].outside?\r\n end\r\n end", "def compute_turn\n\t@game.next_meter_reading_turn\n end", "def update\n if button_down? Gosu::Button::KbEscape then\n do_exit\n end\n if @waiting then\n @waiting = @waiting - (Gosu::milliseconds - @time)\n @time = Gosu::milliseconds\n if @waiting.to_i <= 0 then\n @waiting = nil\n advance\n end\n return\n end\n @script.advance\n end", "def update\r\n\t\t#creo una clase juego con la matriz que ya cree\r\n\t\t@Juego=Juego.new(@a.tablero,@x1,@y1)\r\n\t\t@Juego.turno!\r\n\t\t@NoTurno += 1\r\n\t\tputs \"numero de turno: #{@NoTurno}\"\t\t\r\n\t\t\r\n\tend", "def increment_win\n self.games_won += 1 \n increment_games_played\n end", "def turn\n victory = false\n while victory == false do\n player_place\n @board.show_board\n end\n end", "def play_turn\n move_info = FileReader.get_move(\"#{@turn}#{@player_to_move}\", @data) \n @cur_board.move_piece(move_info)\n end", "def computer_guess_turn\n feedback_engine\n sleep 2.5\n puts \"The computer is thinking...\"\n computer_change_guess\n puts \"Guess Board: #{@guess_board.state}\"\n end", "def update\n @ship.update\n @needs_redraw ||= @ship.needs_redraw?\n end", "def game_turns\n @turn_obj.play_turn(solution, mode, @computer_solve_obj) until @turn_obj.game_over(@turn_obj.results,mode)\n end", "def update\n if @playing\n\n # Advance the frame\n unless elapsed_time <= (@frame_time || @defaults[:frame_time])\n @current_frame += 1\n restart_time\n end\n\n # Reset to the starting frame if all frames played\n if @current_frame > @last_frame\n @current_frame = @first_frame\n unless @loop then stop end\n end\n\n set_frame\n end\n end", "def change_turn\n @turn += 1\n @this_players_turn = @players.reject{|x| x == @this_players_turn}[0]\n take_turn(@this_players_turn)\n end" ]
[ "0.6222782", "0.62025565", "0.6129455", "0.6088473", "0.6061912", "0.60595727", "0.6029764", "0.6022649", "0.59729767", "0.58718914", "0.5867517", "0.58624524", "0.585256", "0.5841424", "0.5809253", "0.5805975", "0.5755483", "0.575347", "0.5752374", "0.5742185", "0.5738354", "0.5729801", "0.5729801", "0.5707919", "0.5673821", "0.56651914", "0.56631285", "0.5658471", "0.5656935", "0.56492424", "0.56482816", "0.5633969", "0.56321114", "0.5629001", "0.56244695", "0.56186026", "0.5617276", "0.5607348", "0.5606561", "0.5599555", "0.55964625", "0.5584833", "0.55834734", "0.55783767", "0.5572785", "0.5561586", "0.5561538", "0.5559658", "0.55505186", "0.5549778", "0.55496645", "0.554836", "0.5545223", "0.55257744", "0.552342", "0.5517586", "0.55077374", "0.5507729", "0.55061275", "0.54975", "0.54886645", "0.5488445", "0.54883313", "0.54865974", "0.5477301", "0.54646236", "0.54623735", "0.5459206", "0.54545194", "0.54453754", "0.54437697", "0.5435572", "0.54353696", "0.5432216", "0.54268116", "0.54163903", "0.5414102", "0.5412545", "0.54108965", "0.540991", "0.5408968", "0.5408968", "0.54075944", "0.5405448", "0.5404287", "0.53981465", "0.5395481", "0.53919864", "0.53838336", "0.5383747", "0.5381732", "0.5380638", "0.53747743", "0.5374443", "0.5373291", "0.53726065", "0.53629553", "0.5362332", "0.5355411", "0.53536123", "0.5350116" ]
0.0
-1
Load a script into the current Plot. This method is similar to Kernelrequire, except that the script is evaluated within the Plot's context via stage.
def script path imported_script = source.export(path) if imported_script.nil? raise LoadError.new("cannot load script -- #{path}") end if !@working_scripts.include?(imported_script) and !imported_scripts.include?(imported_script) @working_scripts.push imported_script # @hack Arguments need to be in different order if source returns proc if imported_script.read.kind_of?(Proc) stage &imported_script.read else stage imported_script.read, imported_script.absolute_path end @working_scripts.pop imported_scripts.push imported_script true else false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def script(script_file)\n load script_file\n\n self\n end", "def load_script(name)\r\n script = File.read(name)\r\n eval script, binding, name\r\nend", "def script_load(script); end", "def load_script(path)\n eval(load_data(path))\nend", "def load_script(debug)\n @file_path = @path\n @load_path = File.expand_path @path\n\n load_error unless loadable? @load_path\n load_file\n\n # HACK we use __send__ here so that the method inliner\n # doesn't accidentally inline a script body into here!\n MAIN.__send__ :__script__\n CodeLoader.loaded_hook.trigger!(@path)\n end", "def load_script(file); end", "def plot_script script, filename=nil, title=nil\n # stub method to enable documentation in yard\n end", "def load (scriptPath)\n @examRip.instance_eval( File.read( scriptPath ) , scriptPath, 1)\n end", "def run_script_stage2(script)\n eval(IO.read(script))\n end", "def set_script\n @script = Script.find(params[:id] || params[:script_id])\n end", "def script\n @script ||= Script.initialize_from_path(path: \"#{resource_path}/script\",\n client: @client)\n end", "def set_script\n @script = Script.find(params[:id])\n end", "def set_script\n @script = Script.find(params[:id])\n end", "def set_script\n @script = Script.find(params[:id])\n end", "def load_script(friendly_name, script, add_only_to_this_st=nil)\n if add_only_to_this_st.is_a?(ServerInterface) or add_only_to_this_st.is_a?(Server)\n sts = [ ServerTemplate.find(resource_id(add_only_to_this_st.server_template_href)) ]\n elsif add_only_to_this_st.is_a?(ServerTemplate)\n sts = [ add_only_to_this_st ]\n elsif add_only_to_this_st.nil?\n sts = @server_templates\n end\n sts.each { |st|\n @scripts_to_run[resource_id(st)] = {} unless @scripts_to_run[resource_id(st)]\n @scripts_to_run[resource_id(st)][friendly_name] = script\n raise \"FATAL: Script #{a[1]} not found\" unless @scripts_to_run[resource_id(st)][friendly_name]\n }\n end", "def script(name)\n @loaded_recipes ||= []\n self.load name\n @loaded_recipes << script\n end", "def set_script\n @script = Script.find(params[:script_id]) if params[:script_id]\n end", "def load_script_file file_path\n load file_path, true\n rescue Exception => e\n warn \"The script `#{file_path}' failed to load\"\n warn \"#{e.class}: #{e.message}\"\n warn ''\n warn 'Backtrace:', '---', e.backtrace\n end", "def set_script\n @script = Script.find(params[:id])\n end", "def add_script_to_evaluate_on_load(script_source:)\n {\n method: \"Page.addScriptToEvaluateOnLoad\",\n params: { scriptSource: script_source }.compact\n }\n end", "def spawn\n\t\t\tputs \"loading ruby script: #{@exec}\"\n\t\t\tdaemonize('load') do |command|\n\t\t\t\tcmd = Shellwords.split(command)\n\t\t\t\tfile = cmd.shift\n\n\t\t\t\t# reset ARGV\n\t\t\t\tObject.instance_eval{ remove_const(:ARGV) }\n\t\t\t\tObject.const_set(:ARGV, cmd)\n\n\t\t\t\t# reset $0\n\t\t\t\t$0 = file\n\n\t\t\t\t# reset $*\n\t\t\t\t$*.replace(cmd)\n\n\t\t\t\tload file\n\n\t\t\t\t# make sure we exit if loaded file won't\n\t\t\t\texit 0\n\t\t\tend\n\t\tend", "def set_script\n @script = Script.find(params[:script_id])\n end", "def set_script\n @script = Script.get_from_cache(params[:script_id]) if params[:script_id]\n end", "def set_script\n @script = Script.get_from_cache(params[:script_id]) if params[:script_id]\n end", "def load(path)\n Rscons.application.silent_configure = true\n script_contents = File.read(path, mode: \"rb\")\n TopLevelDsl.new(self).instance_eval(script_contents, path, 1)\n end", "def initialize(script)\n @script = File.expand_path(script)\n @mount = File.basename(script, '.rb')\n @requires = nil\n load_app\n end", "def script\n @script ||= Script.new(self)\n end", "def script(&block)\n\t\t\t@script = block\n\t\tend", "def load(file)\n path = expand_path(file)\n runtime.run(path) if path\n end", "def script(name, param = nil)\n self.script_request.new(self.seed, name, param)\n end", "def set_script\n @script = current_user.scripts.find(params[:id])\n end", "def load\n if File.exist?(@path) && !self.loaded?\n @source = File.read(@path)\n context = Context.new(self)\n eval @source, context.binding, @path.to_s, 1\n @loaded = true\n end \n end", "def script(key, *args)\n return true unless respond_to?(\"script_#{key}\")\n\n eval(self.public_send(\"script_#{key}\"))\n end", "def load(filename)\n run \"load #{OptArg.quote(filename)}\"\n nil\n end", "def script(name)\n @loaded_recipes ||= []\n require name\n @loaded_recipes << name\n end", "def load_scripts!\n scripts_dir = File.expand_path @config['blur']['scripts_dir']\n script_file_paths = Dir.glob File.join scripts_dir, '*.rb'\n\n # Sort the script file paths by file name so they load by alphabetical\n # order.\n #\n # This will make it possible to create a script called '10_database.rb'\n # which will be loaded before '20_settings.rb' and non-numeric prefixes\n # will be loaded after that.\n script_file_paths = script_file_paths.sort do |a, b|\n File.basename(a) <=> File.basename(b)\n end\n\n script_file_paths.each { |script_path| load_script_file script_path }\n\n initialize_superscripts\n\n emit :scripts_loaded\n end", "def eval(script)\n context.eval(script)\n end", "def loadScripts\n load \"su2dslib/preferences.rb\"\n load \"su2dslib/exportbase.rb\"\n load \"su2dslib/interface.rb\"\n load \"su2dslib/numeric.rb\"\n load \"su2dslib/material.rb\"\n load \"su2dslib/radiance_entities.rb\"\n load \"su2dslib/radiancescene.rb\"\n load \"su2dslib/location.rb\"\n load \"su2dslib/resultsgrid.rb\"\nend", "def interpret\n eval File.read(@path), binding\n nil\n end", "def set_script\n @script = Script.find(params[:id])\n # @automatic = Automatic.find(script_params[:template_id])\n end", "def load\n eval(@data, TOPLEVEL_BINDING, @filename)\n end", "def start_script\n self.class.start_script play_root\n end", "def script(options = {}, &block)\n execute do |task|\n script = model.create_script(task, &block)\n script.prepare\n script.step\n end\n model.create_script(self, &block)\n end", "def run_script! name, options=nil, &block\n options ||= {}\n\n script_path = File.join self.scripts_path, name.to_s\n @shell.call script_path, options, &block\n end", "def load_file filename\n unless File.exists? filename\n raise \"File #{filename} does not exist.\"\n end\n\n name = filename.match(\"scripts/(.+).rb\")[1]\n\n $log.debug(\"ScriptManager.load_file\") { \"Script file name: #{filename}\" }\n\n script = [\n \"class Script_#{name} < Script\",\n IO.read(filename),\n \"end\",\n \"Script_#{name}.new\"].join \"\\n\"\n\n if @scripts.has_key? name\n raise \"Attempted to load script that is already loaded.\"\n end\n\n begin\n @scripts[name] = eval script, nil, filename, 0\n rescue Exception => e\n $log.error(\"ScriptManager.load_file\") { \"Problem loading script #{name}. Clearing data and aborting...\" }\n\n if @scripts.has_key? name\n\n @scripts[name].unregister_script\n @scripts[name].unregister_commands\n @scripts[name].unregister_events\n\n @scripts.delete name\n\n end\n\n raise \"Problem loading script #{name}: #{e}: #{e.backtrace}\"\n end\n end", "def set_script\n @script = Script.find(params[:id])\n authorize(@script)\n end", "def load(name)\n Kernel.load name\nend", "def load_file filename\n unless File.exist? filename\n raise \"File #{filename} does not exist.\"\n end\n\n name = filename.match(\"#{SCRIPTS_PATH}/(.+).rb\")[1]\n\n $log.debug(\"ScriptManager.load_file\") { \"Script file name: #{filename}\" }\n\n script = [\n \"class Script_#{name} < Script\",\n \" def initialize\",\n IO.read(filename),\n \" end\",\n \"end\",\n \"Script_#{name}.new\"].join \"\\n\"\n\n if @scripts.key? name\n raise \"Attempted to load script that is already loaded.\"\n end\n\n begin\n @scripts[name] = eval script, nil, filename, 0\n\n Events.dispatch_for @scripts[name], :done_loading\n rescue Exception => e\n $log.error('ScriptManager.load_file') { \"Problem loading script #{name}. Clearing data and aborting...\" }\n\n if @scripts.key? name\n\n Events.delete_for @scripts[name]\n URL.delete_for @scripts[name] if defined? MODULE_LOADED_URL_HANDLER\n RegexHandlerManager.delete_for @scripts[name] if defined? MODULE_LOADED_REGEX_HANDLER\n\n @scripts[name].unregister_script\n @scripts[name].unregister_commands\n @scripts[name].unregister_events\n\n @scripts.delete name\n\n end\n\n raise \"Problem loading script #{name}: #{e}: #{e.backtrace}\"\n end\n end", "def generate_script\n init = Nyaplot.generate_init_code\n path = File.expand_path(\"../templates/static_script.erb\", __FILE__)\n template = File.read(path)\n ERB.new(template).result(binding)\n end", "def script\n @script || JavascriptObject.global_script\n end", "def eval script\n # native function. this stub is for documenting only\n end", "def eval_into(module_scope, &block)\n $RUBYJS__MODULE_SCOPE = module_scope\n $RUBYJS__LOADED ||= [] # avoids recursive loads\n\n $RUBYJS__EVAL = proc {|str|\n $RUBYJS__MODULE_SCOPE.module_eval(str)\n }\n\n # install \"require\" handler\n alias old_require require\n def require(file)\n ($RUBYJS__LOAD_PATH||['.']).each do |path|\n name = File.expand_path(File.join(path, file + \".rb\"))\n if File.exists?(name)\n if $RUBYJS__LOADED.include?(name)\n return false\n else\n $RUBYJS__LOADED << name\n STDERR.puts \"loading file: #{name}\" if $DEBUG\n $RUBYJS__EVAL.call(File.read(name)) \n \n #\n # load also platform specific file\n # load first matching platform\n #\n\n ($RUBYJS__PLATFORM||[]).each do |plat|\n plat_name = File.expand_path(File.join(path, file + \".\" + plat + \".rb\"))\n next unless File.exists?(plat_name)\n unless $RUBYJS__LOADED.include?(plat_name)\n $RUBYJS__LOADED << plat_name\n STDERR.puts \"loading platform specific file: #{plat_name}\" if $DEBUG\n $RUBYJS__EVAL.call(File.read(plat_name))\n break\n end\n end\n \n return true\n end\n else\n\tnext\n end\n end\n raise ::RuntimeError, \"require: #{file} not found\"\n end\n\n\n block.call($RUBYJS__EVAL)\n\n # change \"require\" handler back to original\n alias require old_require\nend", "def run\n Tapyrus::ScriptInterpreter.eval(Tapyrus::Script.new, self.dup)\n end", "def run_script\n Script.new(instructions, storage, self).execute\n end", "def load\n require \"#{so_name}\" or raise LoadError, \"require on #{so_name} failed\"\n end", "def load_script_from_index\n lines = File.readlines(index_filename)\n path = ENV['ALTERNATIVE_PATH'] || '.'\n lines.each do |filename|\n require(File.join(path, filename.chomp))\n end\n end", "def script(segment_name, variables={})\n path = File.expand_path(\"../#{stage_name}/#{segment_name}\", __FILE__)\n if File.exist?(path)\n script = File.read(path)\n if variables.keys.size > 0\n # inject variables into script if its bash script\n inline_variables = \"#!/usr/bin/env bash\\n\\n\"\n variables.each { |name, value| inline_variables << \"#{name}='#{value}'\\n\" }\n script.gsub!(\"#!/usr/bin/env bash\", inline_variables)\n\n # inject variables into script if its ruby script\n inline_variables = \"#!/usr/bin/env ruby\\n\\n\"\n variables.each { |name, value| inline_variables << \"ENV['#{name}'] = '#{value}'\\n\" }\n script.gsub!(\"#!/usr/bin/env ruby\", inline_variables)\n end\n script\n else\n Thor::Base.shell.new.say_status \"error\", \"Missing script lib/bosh-bootstrap/stages/#{stage_name}/#{segment_name}\", :red\n exit 1\n end\n end", "def eval_script filename, arguments\n proc = Proc.new {}\n eval(File.read(filename), proc.binding, filename)\nend", "def set_jv_script\n @jv_script = JvScript.find(params[:id])\n end", "def load\n Pry.initial_session_setup\n define_additional_commands\n\n Pry.config.hooks.add_hook(:when_started, :start_non_interactively) do |o, t, _pry_|\n non_interactive_mode(_pry_)\n end\n\n Pry.start(Pry.toplevel_binding,\n :input => @content,\n :input_stack => [StringIO.new(\"exit-all\\n\")])\n end", "def script_source(file_name)\n Template.new(LUA_PATHNAME).render(script_path(file_name))\n end", "def script\n @source\n end", "def load_scripts(path, file = nil)\n Dir[File.join(path, '*.rb')].sort.each do |filename|\n next unless File.basename(filename) =~ /^[0-9]{5}[ _].*/\n file&.puts(filename)\n require(filename)\n end\n rescue StandardError\n if Object.const_defined?(:Yuki) && Yuki.const_defined?(:EXC)\n Yuki::EXC.run($!)\n else\n raise\n end\n end", "def set_script\n @script = current_user.script\n end", "def load\n instance_eval File.read(@path).tap(&Gem::UNTAINT), @path, 1\n\n self\n end", "def set_script_template\n @script_template = ScriptTemplate.find(params[:id])\n end", "def require(options={})\n options[:require] = true\n load(options)\n end", "def run_script(script, opts = {}, &block)\n run_script_on(default, script, opts, &block)\n end", "def load!\n activate!\n\n @require_paths.each do |path|\n begin\n require path\n rescue LoadError => error\n log \"dm-visualizer: unable to load #{path}\"\n log \"dm-visualizer: #{error.message}\"\n end\n end\n\n @require_globs.each do |glob|\n @include_dirs.each do |dir|\n Dir[File.join(dir,glob)].each do |path|\n relative_path = path[(dir.length + 1)..-1]\n\n begin\n require relative_path\n rescue LoadError => error\n log \"dm-visualizer: unable to load #{relative_path} from #{dir}\"\n log \"dm-visualizer: #{error.message}\"\n end\n end\n end\n end\n\n deactivate!\n return true\n end", "def initialize(script)\n @script = script\n end", "def load_runner(app = T.unsafe(nil)); end", "def load_runner(app = T.unsafe(nil)); end", "def load_file\n fc = JFileChooser.new\n fc.setDialogTitle(\"Choose Ruby Script File\")\n if fc.showOpenDialog(@frame) == JFileChooser::APPROVE_OPTION\n @ruby_main.file fc.getSelectedFile.absolute_path\n else\n STDERR.puts \"Unrecognized Ruby Script File\"\n end\n end", "def preinst\n @package.get_script :preinst\n end", "def load\n\t\tsource = self.depfile.read\n\t\tself.instance_eval( source, self.depfile.to_s, 1 )\n\tend", "def require path\n JsObj.get(\"Ruby.require\").call path\n nil\nrescue\n super\nend", "def require path\n JsObj.get(\"Ruby.require\").call path\n nil\nrescue\n super\nend", "def run_script name, options=nil, &block\n options ||= {}\n run_script! name, options, &block rescue false\n end", "def add_script_to_evaluate_on_new_document(source:, world_name: nil)\n {\n method: \"Page.addScriptToEvaluateOnNewDocument\",\n params: { source: source, worldName: world_name }.compact\n }\n end", "def load_tool(relative_path)\n require \"#{VSCODE_SCRIPT_PATH}/tools/#{relative_path}\"\n end", "def initialize\n\n # call super to make @base_engine available\n super\n \n @engine = Proc.new do |options|\n\n # check if require should be relative or not\n req = (options[['relative']].is__null | options[['relative']].isTRUE) >> 0\n \n # load the content of the file in options.code\n options.code = GalaazUtil.inline_file(options.label >> 0, req)\n\n @base_engine.call(options)\n end\n \n # Add the include engine function for processing the rb block\n add(include: @engine)\n \n end", "def run_script(path, script, *cli_params)\n on primary :backend do |host|\n within path do\n unless test \" [ -e #{script} ] \"\n error I18n.t('resource.not_exists_on_host', resource: script, host: host.hostname, scope: :dkdeploy)\n next\n end\n\n with fetch(:typo3_environment_cli) do\n execute :php, script, *cli_params\n end\n end\n end\n end", "def launch_script(friendly_name, server, options = nil)\n raise \"No script registered with friendly_name #{friendly_name} for server #{server.inspect}\" unless script_to_run?(friendly_name, server)\n obj_behavior(server, :run_executable, @scripts_to_run[resource_id(server.server_template_href)][friendly_name], options)\n end", "def run_init_script; end", "def re_run\n\n # scrpt will have the javascript specification\n scrpt = String.new\n\n # add bootstrap container if it wasn't specified by the user\n @scene.create_grid((keys = @charts.keys).size, keys) if !@scene.specified?\n scrpt << @scene.bootstrap\n\n # add charts\n @charts.each do |name, chart|\n # add the chart specification\n scrpt << chart.js_spec if !chart.nil?\n end\n \n # render all charts\n scrpt += \"dc.renderAll();\"\n\n # sends a message to the gui to execute the given script\n @bridge.send(:gui, :executeScript, scrpt)\n \n end", "def load(playground, stack, file)\n raise \"Circular dependency detected: #{stack.join('=>')}=>#{file}\" if stack.include?(file)\n\n source = File.read(file)\n stack.push file\n id = File.basename(file, \".rb\").downcase.gsub(/\\W/, \"_\").to_sym\n context = Object.new\n context.instance_eval do\n extend Definition\n experiment = eval(source, context.new_binding(playground, id), file) # rubocop:todo Security/Eval\n raise NameError.new(\"Expected #{file} to define experiment #{id}\", id) unless playground.experiments[id]\n\n return experiment\n end\n rescue StandardError\n error = NameError.exception($!.message, id)\n error.set_backtrace $!.backtrace\n raise error\n ensure\n stack.pop\n end", "def load_file(path)\n send_cmd(\"load #{path}\")\n end", "def load_game\n require './game/setup.rb'\n end", "def scripts\n Dir.glob(File.join(script_dir, \"*.rb\")).inject([]) do |a, e|\n Kernel.load(e)\n a + [initialize_script(e)]\n end\n end", "def runInitScript \n \"runInitScript\" \n end", "def init_script\n @adapter.init_script\n end", "def load\n @bot_ip = @network.bot_ip(@config) # Helper to set bot_ip\n case @config['type']\n when 'script'\n @lang_settings = lang_settings(@config['language'])\n filename = \"#{@name}#{@lang_settings[:file_type]}\"\n load_docker(filename)\n write_script(filename)\n when 'container', 'docker'\n # load the docker container set in the config\n load_passive unless @config['listen_type'] == 'active'\n load_active if @config['listen_type'] == 'active'\n when 'api'\n load_api\n else\n raise \"Plugin: #{@name}: only 'script', 'container', and 'api' are known\"\n end\n help_load\n end", "def pig_load filename=nil\n filename ||= resource_name.to_s+'.tsv'\n cmd = [\n \"%-23s\" % self.to_s.gsub(/^.*\\W/, \"\"),\n \"= LOAD '#{filename}'\",\n \"AS ( rsrc:chararray,\", self.to_pig, ') ;',\n ].join(\" \")\n end", "def start\n unpack_scripts if File.exist?(DEFLATE_SCRIPT_PATH)\n # Load PSDK Scripts\n if File.exist?(index_filename)\n load_script_from_index\n else\n File.open(SCRIPT_INDEX_PATH, 'w') do |file|\n load_vscode_scripts(VSCODE_SCRIPT_PATH, file)\n end\n end\n # Load RMXP Scripts\n load_rmxp_scripts\n # Load Project Scripts\n load_vscode_scripts(PROJECT_SCRIPT_PATH) if index_filename == SCRIPT_INDEX_PATH\n end", "def pin_script(script)\n script = DevTools::PinnedScript.new(script)\n pinned_scripts << script\n\n devtools.page.enable\n devtools.runtime.evaluate(expression: script.callable)\n response = devtools.page.add_script_to_evaluate_on_new_document(source: script.callable)\n script.devtools_identifier = response.dig('result', 'identifier')\n\n script\n end", "def plugin_script\n @plugin_script ||= File.join(RAILS_ROOT, 'script', 'plugin')\n end", "def show\n @script_contents = \"\"\n if File.exist?(@job.script_path)\n @script_contents = File.open(@job.script_path, 'rb') {|f| f.read}\n end\n end", "def execute_app(app)\n load app\n end", "def evaluate(script, filename = nil, linenum = nil)\n return nil if script.nil?\n compiled_script = compile(script, filename, linenum)\n evaluate_compiled_script(compiled_script)\n end", "def script=(script)\n @script = script.to_s\n end" ]
[ "0.6849809", "0.68381834", "0.67507166", "0.67363286", "0.6653091", "0.6417115", "0.60755235", "0.6071626", "0.60593086", "0.5974236", "0.59297115", "0.59249145", "0.59249145", "0.59249145", "0.5741269", "0.57376105", "0.5728885", "0.5722586", "0.56824595", "0.5640526", "0.55933356", "0.5569585", "0.55480283", "0.55480283", "0.5536787", "0.553193", "0.5507585", "0.5503441", "0.54034775", "0.53982806", "0.53827715", "0.53772646", "0.5375879", "0.5349688", "0.53146476", "0.5311329", "0.5300717", "0.5293056", "0.52800757", "0.5273799", "0.52342194", "0.52204067", "0.52188903", "0.5218813", "0.521505", "0.52129567", "0.51967084", "0.51954705", "0.5194228", "0.5120631", "0.5095316", "0.50913745", "0.5073833", "0.5044176", "0.50416416", "0.5039856", "0.50000936", "0.4995468", "0.49793807", "0.4943906", "0.49316844", "0.49251533", "0.49222293", "0.49182165", "0.49102873", "0.49051508", "0.49034405", "0.49018383", "0.4895142", "0.4894166", "0.488514", "0.488514", "0.48795825", "0.48684612", "0.48592085", "0.48518115", "0.48518115", "0.48432568", "0.4842365", "0.48392662", "0.48392174", "0.4839115", "0.4836105", "0.48136175", "0.48105642", "0.48038235", "0.47929725", "0.4766634", "0.4761684", "0.47610983", "0.4759509", "0.47540155", "0.47521847", "0.47446746", "0.4732393", "0.47313404", "0.47249615", "0.47225186", "0.47167754", "0.47098848" ]
0.6213732
6
Show invalid properties with the reasons. Usually used together with valid?
def list_invalid_properties invalid_properties = super if @class_id.nil? invalid_properties.push('invalid value for "class_id", class_id cannot be nil.') end if @object_type.nil? invalid_properties.push('invalid value for "object_type", object_type cannot be nil.') end pattern = Regexp.new(/^$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) if !@uuid.nil? && @uuid !~ pattern invalid_properties.push("invalid value for \"uuid\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) if !@vdisk_id.nil? && @vdisk_id !~ pattern invalid_properties.push("invalid value for \"vdisk_id\", must conform to the pattern #{pattern}.") end invalid_properties end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @style.nil?\n invalid_properties.push('invalid value for \"style\", style cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n if !@name.nil? && @name.to_s.length > 31\n invalid_properties.push('invalid value for \"name\", the character length must be smaller than or equal to 31.')\n end\n\n pattern = Regexp.new(/^[a-zA-Z0-9\\-\\._:]+$/)\n if !@name.nil? && @name !~ pattern\n invalid_properties.push(\"invalid value for \\\"name\\\", must conform to the pattern #{pattern}.\")\n end\n\n pattern = Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n if !@static_wwpn_address.nil? && @static_wwpn_address !~ pattern\n invalid_properties.push(\"invalid value for \\\"static_wwpn_address\\\", must conform to the pattern #{pattern}.\")\n end\n\n pattern = Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n if !@wwpn.nil? && @wwpn !~ pattern\n invalid_properties.push(\"invalid value for \\\"wwpn\\\", must conform to the pattern #{pattern}.\")\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @is_object_icon.nil?\n invalid_properties.push('invalid value for \"is_object_icon\", is_object_icon cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n if @input_currency.nil?\n invalid_properties.push('invalid value for \"input_currency\", input_currency cannot be nil.')\n end\n\n if @sender.nil?\n invalid_properties.push('invalid value for \"sender\", sender cannot be nil.')\n end\n\n if @recipients.nil?\n invalid_properties.push('invalid value for \"recipients\", recipients cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @index.nil?\n invalid_properties.push('invalid value for \"index\", index cannot be nil.')\n end\n\n if @orientation.nil?\n invalid_properties.push('invalid value for \"orientation\", orientation cannot be nil.')\n end\n\n if @size.nil?\n invalid_properties.push('invalid value for \"size\", size cannot be nil.')\n end\n\n if @type.nil?\n invalid_properties.push('invalid value for \"type\", type cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @direction.nil?\n invalid_properties.push('invalid value for \"direction\", direction cannot be nil.')\n end\n\n if @shape.nil?\n invalid_properties.push('invalid value for \"shape\", shape cannot be nil.')\n end\n\n if @linear_angle.nil?\n invalid_properties.push('invalid value for \"linear_angle\", linear_angle cannot be nil.')\n end\n\n if @is_scaled.nil?\n invalid_properties.push('invalid value for \"is_scaled\", is_scaled cannot be nil.')\n end\n\n if @tile_flip.nil?\n invalid_properties.push('invalid value for \"tile_flip\", tile_flip cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n if @format.nil?\n invalid_properties.push('invalid value for \"format\", format cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end" ]
[ "0.76497203", "0.76497203", "0.76497203", "0.76497203", "0.7637422", "0.7637422", "0.7637422", "0.7637422", "0.7637422", "0.7637422", "0.7637422", "0.7637422", "0.7334807", "0.72685325", "0.7238964", "0.7231359", "0.72258264", "0.7208294", "0.71760833", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241", "0.7170241" ]
0.7356452
12
Check to see if the all the properties in the model are valid
def valid? return false if @class_id.nil? class_id_validator = EnumAttributeValidator.new('String', ["virtualization.VmwareVirtualDisk"]) return false unless class_id_validator.valid?(@class_id) return false if @object_type.nil? object_type_validator = EnumAttributeValidator.new('String', ["virtualization.VmwareVirtualDisk"]) return false unless object_type_validator.valid?(@object_type) compatibility_mode_validator = EnumAttributeValidator.new('String', ["notApplicable", "physicalMode", "virtualMode"]) return false unless compatibility_mode_validator.valid?(@compatibility_mode) disk_mode_validator = EnumAttributeValidator.new('String', ["persistent", "independent_persistent", "independent_nonpersistent", "nonpersistent", "undoable", "append"]) return false unless disk_mode_validator.valid?(@disk_mode) disk_type_validator = EnumAttributeValidator.new('String', ["flatDisk", "rdmDisk"]) return false unless disk_type_validator.valid?(@disk_type) sharing_validator = EnumAttributeValidator.new('String', ["sharingNone", "sharingMultiWriter"]) return false unless sharing_validator.valid?(@sharing) storage_allocation_type_validator = EnumAttributeValidator.new('String', ["notApplicable", "thin", "lazyZeroedThick", "eagerZeroedThick"]) return false unless storage_allocation_type_validator.valid?(@storage_allocation_type) return false if !@uuid.nil? && @uuid !~ Regexp.new(/^$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) return false if !@vdisk_id.nil? && @vdisk_id !~ Regexp.new(/^$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) true && super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_properties\n true\n end", "def validate_properties\n true\n end", "def validate\n super\n\n check_optional_property :collection, String\n check_optional_property :create, String\n check_optional_property :delete, String\n check_optional_property :flush, String\n check_optional_property :prefetch, String\n check_optional_property :request_to_query, String\n check_optional_property :resource_to_request_patch, String\n check_optional_property :return_if_object, String\n check_optional_property :self_link, String\n end", "def valid_attributes?\n true\n end", "def valid_attributes?\n attribute_errors.empty?\n end", "def valid?\n return false if @property_code.nil?\n return false if @property_name.nil?\n return false if @location.nil?\n return false if @total_price.nil?\n return false if @min_daily_rate.nil?\n return true\n end", "def validate_presence_of(klazz, properties)\r\n instance = klazz.new \r\n instance.should_not be_valid\r\n \r\n properties.each do |property| \r\n instance.errors.should be_invalid(property)\r\n err_properties = instance.errors[property]\r\n if err_properties.is_a? Array\r\n err_properties.include?(ActiveRecord::Errors.default_error_messages[:blank]).should be_true\r\n else\r\n err_properties.should == ActiveRecord::Errors.default_error_messages[:blank] \r\n end\r\n end \r\n end", "def validate_attributes!(attributes)\n invalid_properties = attributes.keys.map(&:to_s) - self.attributes.keys\n raise UndefinedPropertyError, \"Undefined properties: #{invalid_properties.join(',')}\" if invalid_properties.size > 0\n end", "def model_valid?\n true\n end", "def model_valid?\n true\n end", "def valid?\n self.errors = []\n self.content_type.fields.each do |field|\n if field.required\n if self.dynamic_getter(field.name).blank?\n self.errors << field.name\n end\n end\n end\n self.errors.blank?\n end", "def valid?\n validate\n @model.errors.on(:preferences).blank?\n end", "def validate_properties\n if @properties.keys.count > 0\n if @properties.key?(:label)\n unless @properties[:label] =~ /^[a-zA-Z][\\w|\\s]*$/\n raise 'property label validation error'\n end\n end\n\n if @properties.key?(:default_aggregate)\n unless @properties[:default_aggregate] =~ /^max$|^min$|^avg$|^count$/i\n raise 'property default_aggregate validation error'\n end\n end\n end\n end", "def validate_properties\n @properties.each do |property, values|\n valid_values = validate_values(property, values)\n\n if valid_values.is_a?(Array) && valid_values == [] || valid_values.nil?\n @properties.delete(property)\n else\n @properties[property] = valid_values\n end\n end\n end", "def validate\n valid?\n end", "def validate_attributes!(attributes)\n return attributes if attributes.blank?\n invalid_properties = attributes.keys.map(&:to_s) - self.attributes.keys\n invalid_properties.reject! { |name| self.respond_to?(\"#{name}=\") }\n fail UndefinedPropertyError, \"Undefined properties: #{invalid_properties.join(',')}\" if !invalid_properties.empty?\n end", "def is_valid; end", "def valid?\n # TODO validate nested objects\n output = super\n errors.empty? && output\n end", "def property_checks\n errors.add(:base, \"You can't have a Thing without properties\") if property_keys.empty?\n\n self.property_keys.each do |key|\n errors.add(:properties, \"'#{key}' is an invalid property for this List\") unless available_property_keys.include?(key)\n end\n end", "def valid_for_attributes( model, attributes )\n unless model.valid?\n errors = model.errors\n our_errors = Array.new\n errors.each { |attr,error|\n if attributes.include? attr\n our_errors << [attr,error]\n end\n }\n errors.clear\n our_errors.each { |attr,error| errors.add(attr,error) }\n return false unless errors.empty?\n end\n return true\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end", "def valid?\n return false if !super\n return false if @index.nil?\n return false if @orientation.nil?\n orientation_validator = EnumAttributeValidator.new('String', ['Horizontal', 'Vertical'])\n return false unless orientation_validator.valid?(@orientation)\n return false if @size.nil?\n size_validator = EnumAttributeValidator.new('String', ['Full', 'Half', 'Quarter'])\n return false unless size_validator.valid?(@size)\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['Title', 'Body', 'CenteredTitle', 'Subtitle', 'DateAndTime', 'SlideNumber', 'Footer', 'Header', 'Object', 'Chart', 'Table', 'ClipArt', 'Diagram', 'Media', 'SlideImage', 'Picture'])\n return false unless type_validator.valid?(@type)\n true\n end", "def validate\n validate_string_attributes\n @relations.map(&:validate)\n end", "def is_valid?\n end", "def run_validations\n true\n end", "def validate\n validate_params\n validate_colour\n validate_coordinates\n validate_dimension\n end", "def checkAttributeRequirements\n if @valid_attributes.empty?\n @error_text = \"No valid attributes found\"\n return false\n elsif (@mandatory_attributes_from_db & @valid_attributes) != @mandatory_attributes_from_db\n missing_attr = @mandatory_attributes_from_db - (@mandatory_attributes_from_db & @valid_attributes)\n\n x_attr_txt = \"\"\n missing_attr.each {|x_attr| x_attr_txt += x_attr[:name] + \", \"}\n @error_text = \"Mandatory attributes #{x_attr_txt[0..-3]} is/are missing\"\n return false\n end\n\n return true\n end", "def validations\n {}\n end", "def validatable?\n true\n end", "def validate\n validate_params\n validate_coordinates\n validate_colour\n validate_dimension\n end", "def validate_required\n [\n :project_name,\n :status,\n :requester_id,\n :subject_expert_id,\n :sponsor_id,\n :vision,\n :goal,\n :description,\n :scope,\n :advice_required,\n :program_id,\n :train_id,\n :funding_method,\n :cost_center,\n :funding_status,\n :budget_allocated,\n :priority,\n :start_date,\n :end_date,\n :risk_rating,\n :risks,\n :projected_revenue,\n ].each do |field|\n if self.attributes[field.to_s].nil? || self.attributes[field.to_s].blank?\n # intentionally vague!\n add_validation 'All fields are required to perform further validations'\n return false\n end\n end\n true\n end", "def validate\n validate_root\n validate_associated\n valid?\n end", "def validate\n true\n end", "def valid?\n return false if @id.nil?\n return false if @created.nil?\n return false if @modified.nil?\n return false if @company_name.nil?\n return false if @company_name.to_s.length < 1\n return false if @domain_name.nil?\n return false if @state.nil?\n state_validator = EnumAttributeValidator.new('String', [\"active\", \"deactivated\"])\n return false unless state_validator.valid?(@state)\n return false if @billing_email.nil?\n return false if @application_count.nil?\n return false if @user_count.nil?\n return false if @campaigns_active_count.nil?\n return false if @campaigns_inactive_count.nil?\n true\n end", "def valid?\n _errors_before = self.errors.dup\n _s = super\n validate_attributes\n _errors_before.each { |e| append_error(_errors_before,e) }\n self.errors.empty?\n end", "def valid?\n true\n end", "def validate!\n expected_props, required_props = @properties.keys, @required\n\n unless is_a?(Dialect) || is_a?(Template)\n expected_props = expected_props + INHERITED_PROPERTIES.keys\n end\n\n # It has only expected properties (exclude metadata)\n keys = self.keys - [:\"@context\"]\n keys = keys.reject {|k| k.to_s.include?(':')} unless is_a?(Dialect)\n raise \"#{type} has unexpected keys: #{keys - expected_props}\" unless keys.all? {|k| expected_props.include?(k)}\n\n # It has required properties\n raise \"#{type} missing required keys: #{required_props & keys}\" unless (required_props & keys) == required_props\n\n # Every property is valid\n keys.each do |key|\n value = self[key]\n is_valid = case key\n when :columns\n column_names = value.map(&:name)\n value.is_a?(Array) &&\n value.all? {|v| v.is_a?(Column) && v.validate!} &&\n begin\n # The name properties of the column descriptions must be unique within a given table description.\n column_names = value.map(&:name)\n raise \"Columns must have unique names\" if column_names.uniq != column_names\n true\n end\n when :commentPrefix then value.is_a?(String) && value.length == 1\n when :datatype then value.is_a?(String) && DATATYPES.keys.map(&:to_s).include?(value)\n when :default then value.is_a?(String)\n when :delimiter then value.is_a?(String) && value.length == 1\n when :dialect then value.is_a?(Dialect) && value.validate!\n when :doubleQuote then %w(true false 1 0).include?(value.to_s.downcase)\n when :encoding then Encoding.find(value)\n when :foreignKeys\n # An array of foreign key definitions that define how the values from specified columns within this table link to rows within this table or other tables. A foreign key definition is a JSON object with the properties:\n value.is_a?(Array) && value.all? do |fk|\n raise \"Foreign key must be an object\" unless fk.is_a?(Hash)\n columns, reference = fk['columns'], fk['reference']\n raise \"Foreign key missing columns and reference\" unless columns && reference\n raise \"Foreign key has extra entries\" unless fk.keys.length == 2\n raise \"Foreign key must reference columns\" unless Array(columns).all? {|k| self.columns.any? {|c| c.name == k}}\n raise \"Foreign key reference must be an Object\" unless reference.is_a?(Hash)\n\n if reference.has_key?('resource')\n raise \"Foreign key having a resource reference, must not have a schema\" if reference.has_key?('schema')\n # FIXME resource is a URL of a specific resource (table) which must exist\n elsif reference.has_key?('schema')\n # FIXME schema is a URL of a specific schema which must exist\n end\n # FIXME: columns\n true\n end\n when :format then value.is_a?(String)\n when :header then %w(true false 1 0).include?(value.to_s.downcase)\n when :headerColumnCount, :headerRowCount\n value.is_a?(Numeric) && value.integer? && value > 0\n when :length\n # Applications must raise an error if length, maxLength or minLength are specified and the cell value is not a list (ie separator is not specified), a string or one of its subtypes, or a binary value.\n raise \"Use if minLength or maxLength with length requires separator\" if self[:minLength] || self[:maxLength] && !self[:separator]\n raise \"Use of both length and minLength requires they be equal\" unless self.fetch(:minLength, value) == value\n raise \"Use of both length and maxLength requires they be equal\" unless self.fetch(:maxLength, value) == value\n value.is_a?(Numeric) && value.integer? && value > 0\n when :language then BCP47::Language.identify(value)\n when :lineTerminator then value.is_a?(String)\n when :minimum, :maximum, :minInclusive, :maxInclusive, :minExclusive, :maxExclusive\n value.is_a?(Numeric) ||\n RDF::Literal::Date.new(value).valid? ||\n RDF::Literal::Time.new(value).valid? ||\n RDF::Literal::DateTime.new(value).valid?\n when :minLength, :maxLength\n value.is_a?(Numeric) && value.integer? && value > 0\n when :name then value.is_a?(String) && !name.start_with?(\"_\")\n when :notes then value.is_a?(Array) && value.all? {|v| v.is_a?(Hash)}\n when :null then value.is_a?(String)\n when :predicateUrl then Array(value).all? {|v| RDF::URI(v).valid?}\n when :primaryKey\n # A column reference property that holds either a single reference to a column description object or an array of references.\n Array(value).all? do |k|\n self.columns.any? {|c| c.name == k}\n end\n when :quoteChar then value.is_a?(String) && value.length == 1\n when :required then %w(true false 1 0).include?(value.to_s.downcase)\n when :resources then value.is_a?(Array) && value.all? {|v| v.is_a?(Table) && v.validate!}\n when :schema then value.is_a?(Schema) && value.validate!\n when :separator then value.nil? || value.is_a?(String) && value.length == 1\n when :skipInitialSpace then %w(true false 1 0).include?(value.to_s.downcase)\n when :skipBlankRows then %w(true false 1 0).include?(value.to_s.downcase)\n when :skipColumns then value.is_a?(Numeric) && value.integer? && value >= 0\n when :skipRows then value.is_a?(Numeric) && value.integer? && value >= 0\n when :source then %w(json rdf).include?(value)\n when :\"table-direction\" then %w(rtl ltr default).include?(value)\n when :targetFormat, :templateFormat then RDF::URI(value).valid?\n when :templates then value.is_a?(Array) && value.all? {|v| v.is_a?(Template) && v.validate!}\n when :\"text-direction\" then %w(rtl ltr).include?(value)\n when :title then valid_natural_language_property?(value)\n when :trim then %w(true false 1 0 start end).include?(value.to_s.downcase)\n when :urlTemplate then value.is_a?(String)\n when :@id then @id.valid?\n when :@type then value.to_sym == type\n else\n raise \"?!?! shouldn't get here for key #{key}\"\n end\n raise \"#{type} has invalid #{key}: #{value.inspect}\" unless is_valid\n end\n\n self\n end", "def valid?\n return false if @subject_property.nil?\n return false if @proprietorship.nil?\n proprietorship_validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Sole\", \"Joint\"])\n return false unless proprietorship_validator.valid?(@proprietorship)\n return false if @surname.nil?\n return false if @forename.nil?\n return false if @middle_name.nil?\n return true\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"cond.HclStatusDetail\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"cond.HclStatusDetail\"])\n return false unless object_type_validator.valid?(@object_type)\n hardware_status_validator = EnumAttributeValidator.new('String', [\"Missing-Os-Driver-Info\", \"Incompatible-Server-With-Component\", \"Incompatible-Processor\", \"Incompatible-Os-Info\", \"Incompatible-Component-Model\", \"Incompatible-Firmware\", \"Incompatible-Driver\", \"Incompatible-Firmware-Driver\", \"Service-Unavailable\", \"Service-Error\", \"Unrecognized-Protocol\", \"Not-Evaluated\", \"Compatible\"])\n return false unless hardware_status_validator.valid?(@hardware_status)\n reason_validator = EnumAttributeValidator.new('String', [\"Missing-Os-Driver-Info\", \"Incompatible-Server-With-Component\", \"Incompatible-Processor\", \"Incompatible-Os-Info\", \"Incompatible-Component-Model\", \"Incompatible-Firmware\", \"Incompatible-Driver\", \"Incompatible-Firmware-Driver\", \"Service-Unavailable\", \"Service-Error\", \"Unrecognized-Protocol\", \"Not-Evaluated\", \"Compatible\"])\n return false unless reason_validator.valid?(@reason)\n software_status_validator = EnumAttributeValidator.new('String', [\"Missing-Os-Driver-Info\", \"Incompatible-Server-With-Component\", \"Incompatible-Processor\", \"Incompatible-Os-Info\", \"Incompatible-Component-Model\", \"Incompatible-Firmware\", \"Incompatible-Driver\", \"Incompatible-Firmware-Driver\", \"Service-Unavailable\", \"Service-Error\", \"Unrecognized-Protocol\", \"Not-Evaluated\", \"Compatible\"])\n return false unless software_status_validator.valid?(@software_status)\n status_validator = EnumAttributeValidator.new('String', [\"Incomplete\", \"Not-Found\", \"Not-Listed\", \"Validated\", \"Not-Evaluated\"])\n return false unless status_validator.valid?(@status)\n true && super\n end", "def core_attributes_valid\n core_attributes = [@rateable, @rater, @ratee, @rating_type]\n return if core_attributes.all? { |atr| atr.present? && atr.valid? }\n errors.add('message', 'Not all core attributes present and valid.')\n end", "def valid?\n super\n errors.empty?\n end", "def valid?\n \n if @account_id.nil?\n false\n elsif @campaign_id.nil?\n false\n elsif @csp_id.nil?\n false\n elsif @status.nil?\n false\n elsif @create_date.nil?\n false\n elsif @auto_renewal.nil?\n false\n elsif @brand_id.nil?\n false\n elsif @usecase.nil?\n false\n elsif @sub_usecases.nil?\n false\n elsif @description.nil?\n false\n elsif @embedded_link.nil?\n false\n elsif @embedded_phone.nil?\n false\n elsif @affiliate_marketing.nil?\n false\n elsif @number_pool.nil?\n false\n elsif @age_gated.nil?\n false\n elsif @direct_lending.nil?\n false\n elsif @subscriber_optin.nil?\n false\n elsif @subscriber_optout.nil?\n false\n elsif @subscriber_help.nil?\n false\n elsif @sample1.nil?\n false\n elsif @mock.nil?\n false\n else\n list_invalid_properties.length() == 0\n end\n end", "def valid?(metadata)\n validate.each do |attr|\n return false if metadata[attr.to_sym].nil? || metadata[attr.to_sym].zero?\n end\n end", "def is_valid\n return true\n end", "def validate_attrs\n @target.present? && !@target.errors.any? && @actor.present? && @action_key.present?\n end", "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n if !@name.nil? && @name.to_s.length > 31\n invalid_properties.push('invalid value for \"name\", the character length must be smaller than or equal to 31.')\n end\n\n pattern = Regexp.new(/^[a-zA-Z0-9\\-\\._:]+$/)\n if !@name.nil? && @name !~ pattern\n invalid_properties.push(\"invalid value for \\\"name\\\", must conform to the pattern #{pattern}.\")\n end\n\n pattern = Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n if !@static_wwpn_address.nil? && @static_wwpn_address !~ pattern\n invalid_properties.push(\"invalid value for \\\"static_wwpn_address\\\", must conform to the pattern #{pattern}.\")\n end\n\n pattern = Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n if !@wwpn.nil? && @wwpn !~ pattern\n invalid_properties.push(\"invalid value for \\\"wwpn\\\", must conform to the pattern #{pattern}.\")\n end\n\n invalid_properties\n end", "def valid_save?\n valid = true\n\n if self.name.nil? || self.name == \"\"\n valid = false\n end\n\n if self.general_info.nil? || self.general_info == \"\"\n valid = false\n end\n\n if self.technical_specs.nil? || self.technical_specs == \"\"\n valid = false\n end\n\n if self.where_to_buy.nil? || self.where_to_buy == \"\"\n valid = false\n end\n\n return valid\n end", "def valid?\n schema.validate(self)\n end", "def valid?\n reset_errors\n valid_date?\n valid_user?\n valid_activity_type?\n self.errors.empty?\n end", "def valid?\n validate\n end", "def product_attributes_must_not_be_empty\n\n\t\t# Instance\n\t\tproduct = Product.new\n\n\t\tassert product.invalid?\n\t\tassert product.errors[:title].any?\n\t\tassert product.errors[:description].any?\n\t\tassert product.errors[:price].any?\n\t\tassert product.errors[:image_url].any?\n\tend", "def valid?\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^psc_[a-zA-Z0-9]+$/)\n carrier_validator = EnumAttributeValidator.new('String', [\"USPS\"])\n return false unless carrier_validator.valid?(@carrier)\n return false if !@front_template_id.nil? && @front_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@back_template_id.nil? && @back_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@front_template_version_id.nil? && @front_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n return false if !@back_template_version_id.nil? && @back_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n object_validator = EnumAttributeValidator.new('String', [\"postcard\"])\n return false unless object_validator.valid?(@object)\n return false if @url.nil?\n return false if @url !~ Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.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 return false if !@description.nil? && @description.to_s.length > 255\n true\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"network.ElementSummary\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"network.ElementSummary\"])\n return false unless object_type_validator.valid?(@object_type)\n ethernet_switching_mode_validator = EnumAttributeValidator.new('String', [\"end-host\", \"switch\"])\n return false unless ethernet_switching_mode_validator.valid?(@ethernet_switching_mode)\n fc_switching_mode_validator = EnumAttributeValidator.new('String', [\"end-host\", \"switch\"])\n return false unless fc_switching_mode_validator.valid?(@fc_switching_mode)\n management_mode_validator = EnumAttributeValidator.new('String', [\"IntersightStandalone\", \"UCSM\", \"Intersight\"])\n return false unless management_mode_validator.valid?(@management_mode)\n thermal_validator = EnumAttributeValidator.new('String', [\"unknown\", \"ok\", \"upper-non-recoverable\", \"upper-critical\", \"upper-non-critical\", \"lower-non-critical\", \"lower-critical\", \"lower-non-recoverable\"])\n return false unless thermal_validator.valid?(@thermal)\n true && super\n end", "def valid?\n\t\t\t\ttrue\n\t\t\tend", "def validate\r\n validate! rescue false\r\n end", "def validate\n validate_string_attributes\n end", "def valid?\n self.errors = Mongomatic::Errors.new\n do_callback(:before_validate)\n check_required_fields\n validate\n do_callback(:after_validate)\n self.errors.empty?\n end", "def valid\n @valid\n end", "def valid_objects\n all_objects.select { |o| o.valid? }\n end", "def valid?\n return false if @summary.nil?\n return false if @summary.to_s.length > 100\n record_type_validator = EnumAttributeValidator.new('String', [\"ServiceTicket\", \"ProjectTicket\", \"ProjectIssue\"])\n return false unless record_type_validator.valid?(@record_type)\n return false if !@wbs_code.nil? && @wbs_code.to_s.length > 50\n return false if @company.nil?\n return false if !@site_name.nil? && @site_name.to_s.length > 50\n return false if !@address_line1.nil? && @address_line1.to_s.length > 50\n return false if !@address_line2.nil? && @address_line2.to_s.length > 50\n return false if !@city.nil? && @city.to_s.length > 50\n return false if !@state_identifier.nil? && @state_identifier.to_s.length > 50\n return false if !@zip.nil? && @zip.to_s.length > 12\n return false if !@contact_phone_number.nil? && @contact_phone_number.to_s.length > 20\n return false if !@contact_phone_extension.nil? && @contact_phone_extension.to_s.length > 15\n return false if !@contact_email_address.nil? && @contact_email_address.to_s.length > 250\n severity_validator = EnumAttributeValidator.new('String', [\"Low\", \"Medium\", \"High\"])\n return false unless severity_validator.valid?(@severity)\n impact_validator = EnumAttributeValidator.new('String', [\"Low\", \"Medium\", \"High\"])\n return false unless impact_validator.valid?(@impact)\n return false if !@external_x_ref.nil? && @external_x_ref.to_s.length > 100\n return false if !@po_number.nil? && @po_number.to_s.length > 50\n return false if !@automatic_email_cc.nil? && @automatic_email_cc.to_s.length > 1000\n sub_billing_method_validator = EnumAttributeValidator.new('String', [\"ActualRates\", \"FixedFee\", \"NotToExceed\", \"OverrideRate\"])\n return false unless sub_billing_method_validator.valid?(@sub_billing_method)\n knowledge_base_link_type_validator = EnumAttributeValidator.new('String', [\"ServiceTicket\", \"ProjectTicket\", \"ProjectIssue\", \"KnowledgeBaseArticle\", \"Time\", \"Activity\"])\n return false unless knowledge_base_link_type_validator.valid?(@knowledge_base_link_type)\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n bill_expenses_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expenses_validator.valid?(@bill_expenses)\n bill_products_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_products_validator.valid?(@bill_products)\n predecessor_type_validator = EnumAttributeValidator.new('String', [\"Ticket\", \"Phase\"])\n return false unless predecessor_type_validator.valid?(@predecessor_type)\n return true\n end", "def validate!\n true\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"vnic.FcIf\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"vnic.FcIf\"])\n return false unless object_type_validator.valid?(@object_type)\n return false if !@name.nil? && @name.to_s.length > 31\n return false if !@name.nil? && @name !~ Regexp.new(/^[a-zA-Z0-9\\-\\._:]+$/)\n return false if !@static_wwpn_address.nil? && @static_wwpn_address !~ Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n type_validator = EnumAttributeValidator.new('String', [\"fc-initiator\", \"fc-nvme-initiator\", \"fc-nvme-target\", \"fc-target\"])\n return false unless type_validator.valid?(@type)\n return false if !@wwpn.nil? && @wwpn !~ Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n wwpn_address_type_validator = EnumAttributeValidator.new('String', [\"POOL\", \"STATIC\"])\n return false unless wwpn_address_type_validator.valid?(@wwpn_address_type)\n true && super\n end", "def valid?\n validate_survivors and validate_items && validate_records\n end", "def valid?\n return false if @id.nil?\n return false if @next_send.nil?\n return false if @rrule.nil?\n return false if @session.nil?\n return false if @last_sent.nil?\n return false if @contact_name.nil?\n return false if @parameters.nil?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n return false unless type_validator.valid?(@type)\n return false if @summary.nil?\n return false if @text_parameters.nil?\n return false if @first_occurrence.nil?\n return false if @last_occurrence.nil?\n return false if @recipients_count.nil?\n return false if @timezone.nil?\n return false if @completed.nil?\n return false if @avatar.nil?\n return false if @created_at.nil?\n true\n end", "def valid?\n return false if !@description.nil? && @description.to_s.length > 255\n return false if @routing_number.nil?\n return false if @routing_number.to_s.length > 9\n return false if @routing_number.to_s.length < 9\n return false if @account_number.nil?\n return false if @account_number.to_s.length > 17\n return false if @account_type.nil?\n account_type_validator = EnumAttributeValidator.new('String', [\"company\", \"individual\"])\n return false unless account_type_validator.valid?(@account_type)\n return false if @signatory.nil?\n return false if @signatory.to_s.length > 30\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^bank_[a-zA-Z0-9]+$/)\n return false if !@signature_url.nil? && @signature_url !~ 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 return false if @date_created.nil?\n return false if @date_modified.nil?\n return false if @object.nil?\n object_validator = EnumAttributeValidator.new('String', [\"bank_account\"])\n return false unless object_validator.valid?(@object)\n true\n end", "def valid?\n true\n end", "def valid?\n true\n end", "def valid?\n true\n end", "def valid?\n true\n end", "def valid?\n return false if @id.nil?\n return false if @account_id.nil?\n return false if @organization_id.nil?\n return false if @product_id.nil?\n return false if @product_rate_plan_id.nil?\n return false if @name.nil?\n type_validator = EnumAttributeValidator.new('String', [\"Subscription\", \"FixedTerm\", \"Trial\"])\n return false unless type_validator.valid?(@type)\n return false if @state.nil?\n state_validator = EnumAttributeValidator.new('String', [\"Trial\", \"Provisioned\", \"Paid\", \"AwaitingPayment\", \"Cancelled\", \"Failed\", \"Expired\"])\n return false unless state_validator.valid?(@state)\n return false if @initial_period_start.nil?\n return false if @trial_end.nil?\n managed_by_validator = EnumAttributeValidator.new('String', [\"BillForward\", \"Stripe\"])\n return false unless managed_by_validator.valid?(@managed_by)\n return false if @version_start.nil?\n return false if @version_number.nil?\n return false if @current_time.nil?\n failed_payment_behaviour_validator = EnumAttributeValidator.new('String', [\"CancelSubscription\", \"None\"])\n return false unless failed_payment_behaviour_validator.valid?(@failed_payment_behaviour)\n return true\n end", "def validate_fields\n %w[email author].each do |field|\n value = self.send(field)\n abort \"Hoe #{field} value not set. aborting\" if value.nil? or value.empty?\n end\n end", "def valid?\n return false if @name.nil?\n return false if @name.to_s.length < 1\n return false if @timezone.nil?\n return false if @timezone.to_s.length < 1\n return false if @currency.nil?\n return false if @currency.to_s.length < 1\n case_sensitivity_validator = EnumAttributeValidator.new('String', [\"sensitive\", \"insensitive-uppercase\", \"insensitive-lowercase\"])\n return false unless case_sensitivity_validator.valid?(@case_sensitivity)\n campaign_priority_validator = EnumAttributeValidator.new('String', [\"universal\", \"stackable\", \"exclusive\"])\n return false unless campaign_priority_validator.valid?(@campaign_priority)\n exclusive_campaigns_strategy_validator = EnumAttributeValidator.new('String', [\"listOrder\", \"lowestDiscount\", \"highestDiscount\"])\n return false unless exclusive_campaigns_strategy_validator.valid?(@exclusive_campaigns_strategy)\n default_discount_scope_validator = EnumAttributeValidator.new('String', [\"sessionTotal\", \"cartItems\", \"additionalCosts\"])\n return false unless default_discount_scope_validator.valid?(@default_discount_scope)\n default_discount_additional_cost_per_item_scope_validator = EnumAttributeValidator.new('String', [\"price\", \"itemTotal\", \"additionalCosts\"])\n return false unless default_discount_additional_cost_per_item_scope_validator.valid?(@default_discount_additional_cost_per_item_scope)\n true\n end", "def valid?\n run_validation\n @errors.empty?\n end", "def valid?\n MANDATORY_ATTRIBUTES.each{|a| return false unless self[a]}\n true\n end", "def valid?\n return false if @id.nil?\n return false if @token.nil?\n return false if @tipo.nil?\n tipo_validator = EnumAttributeValidator.new('String', ['fatture', 'proforma', 'ordini', 'preventivi', 'ndc'])\n return false unless tipo_validator.valid?(@tipo)\n return false if @nome.nil?\n return false if @indirizzo_via.nil?\n return false if @indirizzo_cap.nil?\n return false if @indirizzo_citta.nil?\n return false if @indirizzo_provincia.nil?\n return false if @paese.nil?\n lingua_validator = EnumAttributeValidator.new('String', ['it', 'en', 'de'])\n return false unless lingua_validator.valid?(@lingua)\n return false if @piva.nil?\n return false if @cf.nil?\n return false if @numero.nil?\n return false if @valuta.nil?\n return false if @valuta_cambio.nil?\n return false if @prezzi_ivati.nil?\n return false if @importo_netto.nil?\n return false if @importo_iva.nil?\n return false if @importo_totale.nil?\n mostra_totali_validator = EnumAttributeValidator.new('String', ['tutti', 'netto', 'nessuno'])\n return false unless mostra_totali_validator.valid?(@mostra_totali)\n return false if @lista_articoli.nil?\n pa_tipo_cliente_validator = EnumAttributeValidator.new('String', ['PA', 'B2B'])\n return false unless pa_tipo_cliente_validator.valid?(@pa_tipo_cliente)\n pa_tipo_validator = EnumAttributeValidator.new('String', ['ordine', 'convenzione', 'contratto', 'nessuno'])\n return false unless pa_tipo_validator.valid?(@pa_tipo)\n pa_esigibilita_validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n return false unless pa_esigibilita_validator.valid?(@pa_esigibilita)\n true\n end", "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end", "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end", "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 50\n return false if @prefix_suffix_option.nil?\n prefix_suffix_option_validator = EnumAttributeValidator.new('String', [\"Prefix\", \"Suffix\"])\n return false unless prefix_suffix_option_validator.valid?(@prefix_suffix_option)\n return false if !@invoice_pre_suffix.nil? && @invoice_pre_suffix.to_s.length > 5\n application_units_validator = EnumAttributeValidator.new('String', [\"Amount\", \"Hours\", \"Incidents\"])\n return false unless application_units_validator.valid?(@application_units)\n application_cycle_validator = EnumAttributeValidator.new('String', [\"Contract2Weeks\", \"Contract4Weeks\", \"ContractYear\", \"CalendarMonth\", \"CalendarQuarter\", \"CalendarWeek\", \"ContractQuarter\", \"CalendarYear\"])\n return false unless application_cycle_validator.valid?(@application_cycle)\n return false if @employee_comp_rate.nil?\n employee_comp_rate_validator = EnumAttributeValidator.new('String', [\"Actual\", \"Hourly\"])\n return false unless employee_comp_rate_validator.valid?(@employee_comp_rate)\n return false if @employee_comp_not_exceed.nil?\n employee_comp_not_exceed_validator = EnumAttributeValidator.new('String', [\"Billing\", \"Percent\", \"Amount\"])\n return false unless employee_comp_not_exceed_validator.valid?(@employee_comp_not_exceed)\n return false if @invoicing_cycle.nil?\n invoicing_cycle_validator = EnumAttributeValidator.new('String', [\"CalendarYear\", \"ContractYear\"])\n return false unless invoicing_cycle_validator.valid?(@invoicing_cycle)\n return false if !@invoice_description.nil? && @invoice_description.to_s.length > 4000\n return false if @bill_time.nil?\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n return false if @bill_expenses.nil?\n bill_expenses_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expenses_validator.valid?(@bill_expenses)\n return false if @bill_products.nil?\n bill_products_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_products_validator.valid?(@bill_products)\n return true\n end", "def validate\n end", "def valid?\n return false if @to.nil?\n return false if @from.nil?\n carrier_validator = EnumAttributeValidator.new('String', [\"USPS\"])\n return false unless carrier_validator.valid?(@carrier)\n return false if @date_created.nil?\n return false if @date_modified.nil?\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^ltr_[a-zA-Z0-9]+$/)\n return false if !@template_id.nil? && @template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@template_version_id.nil? && @template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n return false if !@url.nil? && @url !~ Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.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 return false if @object.nil?\n object_validator = EnumAttributeValidator.new('String', [\"letter\"])\n return false unless object_validator.valid?(@object)\n return false if !@description.nil? && @description.to_s.length > 255\n return false if !@tracking_events.nil? && @tracking_events.length > 0\n address_placement_validator = EnumAttributeValidator.new('String', [\"top_first_page\", \"insert_blank_page\", \"bottom_first_page_center\", \"bottom_first_page\"])\n return false unless address_placement_validator.valid?(@address_placement)\n true\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def supports_validations?\n true\n end", "def valid?\n @errors = self.class.valid_against_schema?(self.class.json_schema, self)\n @errors.empty?\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def valid?\n return false if @first_name.nil?\n return false if @first_name.to_s.length > 30\n return false if !@last_name.nil? && @last_name.to_s.length > 30\n return false if !@address_line1.nil? && @address_line1.to_s.length > 50\n return false if !@address_line2.nil? && @address_line2.to_s.length > 50\n return false if !@city.nil? && @city.to_s.length > 50\n return false if !@state.nil? && @state.to_s.length > 50\n return false if !@zip.nil? && @zip.to_s.length > 12\n return false if !@country.nil? && @country.to_s.length > 50\n return false if !@security_identifier.nil? && @security_identifier.to_s.length > 184\n return false if !@title.nil? && @title.to_s.length > 100\n return false if !@school.nil? && @school.to_s.length > 50\n return false if !@nick_name.nil? && @nick_name.to_s.length > 30\n return false if !@significant_other.nil? && @significant_other.to_s.length > 30\n return false if !@portal_password.nil? && @portal_password.to_s.length > 15\n return false if !@portal_security_level.nil? && @portal_security_level > 6.0\n return false if !@portal_security_level.nil? && @portal_security_level < 1.0\n gender_validator = EnumAttributeValidator.new('String', [\"Male\", \"Female\"])\n return false unless gender_validator.valid?(@gender)\n presence_validator = EnumAttributeValidator.new('String', [\"Online\", \"DoNotDisturb\", \"Away\", \"Offline\", \"NoAgent\"])\n return false unless presence_validator.valid?(@presence)\n return true\n end", "def validated?; end", "def valid?\n return false if @name.nil?\n return false if @slug.nil?\n return false if @status.nil?\n status_validator = EnumAttributeValidator.new('String', ['enabled', 'disabled'])\n return false unless status_validator.valid?(@status)\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['digital', 'physical'])\n return false unless type_validator.valid?(@type)\n return false if @sku.nil?\n return false if @price.nil?\n availability_validator = EnumAttributeValidator.new('String', ['available', 'comingSoon', 'retired'])\n return false unless availability_validator.valid?(@availability)\n stock_status_validator = EnumAttributeValidator.new('String', ['available', 'alert', 'unavailable'])\n return false unless stock_status_validator.valid?(@stock_status)\n return false if @categories.nil?\n true\n end", "def valid?\n self.valid\n end", "def valid?\n true\n end", "def valid?\n true\n end", "def valid?\n true\n end", "def valid?\n true\n end" ]
[ "0.78992486", "0.78992486", "0.70971805", "0.70782334", "0.7032205", "0.7031276", "0.69510347", "0.6869891", "0.6858077", "0.6858077", "0.68287027", "0.6823878", "0.6820306", "0.68144894", "0.6794656", "0.6752167", "0.66843414", "0.6676546", "0.6667755", "0.66296124", "0.66184515", "0.6608204", "0.6599208", "0.6594276", "0.6584302", "0.6580472", "0.6578095", "0.6558585", "0.6555879", "0.6542414", "0.6536983", "0.6533884", "0.65315515", "0.65311855", "0.65267456", "0.65258855", "0.6520786", "0.65205675", "0.6511026", "0.6498394", "0.64966303", "0.64935124", "0.6491113", "0.64885867", "0.6479024", "0.6473706", "0.64679337", "0.6467217", "0.6461245", "0.64601135", "0.64553183", "0.64540446", "0.6447954", "0.64393955", "0.6434162", "0.64312094", "0.6428205", "0.6426148", "0.6412439", "0.64070046", "0.64044213", "0.6403482", "0.6399368", "0.63979715", "0.63858813", "0.63855004", "0.63855004", "0.63855004", "0.63855004", "0.63740236", "0.6367379", "0.63645166", "0.6362151", "0.63599974", "0.6357385", "0.63549066", "0.63549066", "0.63549066", "0.63549066", "0.6354845", "0.6354207", "0.6350302", "0.6344303", "0.6344303", "0.6344303", "0.6344303", "0.6344303", "0.6344303", "0.6344303", "0.6344303", "0.63435715", "0.63406414", "0.63344824", "0.6333158", "0.63313466", "0.63294095", "0.6327076", "0.63247603", "0.63247603", "0.63247603", "0.63247603" ]
0.0
-1
Custom attribute writer method checking allowed values (enum).
def class_id=(class_id) validator = EnumAttributeValidator.new('String', ["virtualization.VmwareVirtualDisk"]) unless validator.valid?(class_id) fail ArgumentError, "invalid value for \"class_id\", must be one of #{validator.allowable_values}." end @class_id = class_id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end", "def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end", "def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end", "def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end", "def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end", "def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end", "def valid?\n ENUM.include? @type.downcase.to_sym\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end", "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end", "def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end", "def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end", "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end", "def validate_exclusion_of(attr); end", "def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend", "def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end", "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end", "def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end", "def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end", "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "def status_enum=(status)\n write_attribute(:status, status)\n end", "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end", "def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end", "def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end", "def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end", "def enum?(field)\n !!self.enums[field.to_sym]\n end", "def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end", "def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end", "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end", "def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end", "def enum?\n true\n end", "def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end", "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end", "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end", "def enum?\n false\n end", "def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end", "def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end", "def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end", "def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end", "def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end", "def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end", "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end", "def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end", "def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end", "def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end", "def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end", "def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end", "def has_enums?\n !!eh_params[:has_enums]\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end", "def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end", "def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end", "def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end", "def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end", "def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end", "def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end", "def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end", "def allow_value_matcher; end", "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end", "def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end", "def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end", "def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end", "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end", "def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end", "def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end", "def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end", "def attr_bool_writer *symbols\n attr_writer *symbols\n end", "def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end", "def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end", "def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end", "def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end", "def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end", "def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end", "def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end", "def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end" ]
[ "0.7088127", "0.64820594", "0.6429773", "0.6227689", "0.61418885", "0.5809922", "0.57507086", "0.5743216", "0.5736045", "0.5708027", "0.57014966", "0.56777334", "0.5601988", "0.55947953", "0.55464065", "0.55371004", "0.55344343", "0.5528221", "0.5434983", "0.54312384", "0.5418137", "0.5379602", "0.53794384", "0.53794384", "0.53653747", "0.53513694", "0.53364015", "0.5330548", "0.5324624", "0.53222466", "0.5307476", "0.53004855", "0.52841866", "0.52784383", "0.52683413", "0.5265264", "0.525289", "0.52094126", "0.5189669", "0.5185224", "0.51700306", "0.5146029", "0.51444733", "0.51369494", "0.5134045", "0.5133414", "0.5130944", "0.51203525", "0.5117331", "0.5108703", "0.5108653", "0.5106191", "0.50937504", "0.50937504", "0.50840217", "0.5082524", "0.5074987", "0.50655115", "0.5064211", "0.505987", "0.50555235", "0.50513357", "0.5044483", "0.5041556", "0.5036054", "0.5031193", "0.5023556", "0.5019361", "0.49934402", "0.4989093", "0.49836317", "0.49754748", "0.49738207", "0.49702868", "0.49647367", "0.49602023", "0.4959052", "0.49577102", "0.49549797", "0.49535498", "0.49489576", "0.49489233", "0.4943718", "0.494183", "0.494042", "0.4935984", "0.49353147", "0.4934332", "0.49269903", "0.49202663", "0.49195725", "0.49171844", "0.49135497", "0.49132174", "0.4910008", "0.49098906", "0.49096495", "0.49090025", "0.49080157", "0.49024847", "0.49014568" ]
0.0
-1
Custom attribute writer method checking allowed values (enum).
def object_type=(object_type) validator = EnumAttributeValidator.new('String', ["virtualization.VmwareVirtualDisk"]) unless validator.valid?(object_type) fail ArgumentError, "invalid value for \"object_type\", must be one of #{validator.allowable_values}." end @object_type = object_type end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end", "def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end", "def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end", "def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end", "def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end", "def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end", "def valid?\n ENUM.include? @type.downcase.to_sym\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end", "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end", "def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end", "def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end", "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end", "def validate_exclusion_of(attr); end", "def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend", "def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end", "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end", "def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end", "def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end", "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "def status_enum=(status)\n write_attribute(:status, status)\n end", "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end", "def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end", "def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end", "def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end", "def enum?(field)\n !!self.enums[field.to_sym]\n end", "def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end", "def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end", "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end", "def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end", "def enum?\n true\n end", "def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end", "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end", "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end", "def enum?\n false\n end", "def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end", "def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end", "def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end", "def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end", "def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end", "def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end", "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end", "def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end", "def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end", "def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end", "def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end", "def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end", "def has_enums?\n !!eh_params[:has_enums]\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end", "def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end", "def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end", "def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end", "def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end", "def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end", "def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end", "def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end", "def allow_value_matcher; end", "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end", "def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end", "def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end", "def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end", "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end", "def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end", "def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end", "def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end", "def attr_bool_writer *symbols\n attr_writer *symbols\n end", "def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end", "def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end", "def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end", "def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end", "def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end", "def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end", "def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end", "def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end" ]
[ "0.7088127", "0.64820594", "0.6429773", "0.6227689", "0.61418885", "0.5809922", "0.57507086", "0.5743216", "0.5736045", "0.5708027", "0.57014966", "0.56777334", "0.5601988", "0.55947953", "0.55464065", "0.55371004", "0.55344343", "0.5528221", "0.5434983", "0.54312384", "0.5418137", "0.5379602", "0.53794384", "0.53794384", "0.53653747", "0.53513694", "0.53364015", "0.5330548", "0.5324624", "0.53222466", "0.5307476", "0.53004855", "0.52841866", "0.52784383", "0.52683413", "0.5265264", "0.525289", "0.52094126", "0.5189669", "0.5185224", "0.51700306", "0.5146029", "0.51444733", "0.51369494", "0.5134045", "0.5133414", "0.5130944", "0.51203525", "0.5117331", "0.5108703", "0.5108653", "0.5106191", "0.50937504", "0.50937504", "0.50840217", "0.5082524", "0.5074987", "0.50655115", "0.5064211", "0.505987", "0.50555235", "0.50513357", "0.5044483", "0.5041556", "0.5036054", "0.5031193", "0.5023556", "0.5019361", "0.49934402", "0.4989093", "0.49836317", "0.49754748", "0.49738207", "0.49702868", "0.49647367", "0.49602023", "0.4959052", "0.49577102", "0.49549797", "0.49535498", "0.49489576", "0.49489233", "0.4943718", "0.494183", "0.494042", "0.4935984", "0.49353147", "0.4934332", "0.49269903", "0.49202663", "0.49195725", "0.49171844", "0.49135497", "0.49132174", "0.4910008", "0.49098906", "0.49096495", "0.49090025", "0.49080157", "0.49024847", "0.49014568" ]
0.0
-1
Custom attribute writer method checking allowed values (enum).
def compatibility_mode=(compatibility_mode) validator = EnumAttributeValidator.new('String', ["notApplicable", "physicalMode", "virtualMode"]) unless validator.valid?(compatibility_mode) fail ArgumentError, "invalid value for \"compatibility_mode\", must be one of #{validator.allowable_values}." end @compatibility_mode = compatibility_mode end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end", "def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end", "def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end", "def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end", "def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end", "def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end", "def valid?\n ENUM.include? @type.downcase.to_sym\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end", "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end", "def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end", "def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end", "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end", "def validate_exclusion_of(attr); end", "def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend", "def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end", "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end", "def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end", "def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end", "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "def status_enum=(status)\n write_attribute(:status, status)\n end", "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end", "def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end", "def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end", "def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end", "def enum?(field)\n !!self.enums[field.to_sym]\n end", "def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end", "def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end", "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end", "def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end", "def enum?\n true\n end", "def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end", "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end", "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end", "def enum?\n false\n end", "def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end", "def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end", "def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end", "def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end", "def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end", "def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end", "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end", "def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end", "def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end", "def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end", "def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end", "def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end", "def has_enums?\n !!eh_params[:has_enums]\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end", "def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end", "def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end", "def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end", "def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end", "def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end", "def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end", "def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end", "def allow_value_matcher; end", "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end", "def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end", "def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end", "def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end", "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end", "def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end", "def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end", "def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end", "def attr_bool_writer *symbols\n attr_writer *symbols\n end", "def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end", "def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end", "def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end", "def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end", "def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end", "def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end", "def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end", "def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end" ]
[ "0.7088127", "0.64820594", "0.6429773", "0.6227689", "0.61418885", "0.5809922", "0.57507086", "0.5743216", "0.5736045", "0.5708027", "0.57014966", "0.56777334", "0.5601988", "0.55947953", "0.55464065", "0.55371004", "0.55344343", "0.5528221", "0.5434983", "0.54312384", "0.5418137", "0.5379602", "0.53794384", "0.53794384", "0.53653747", "0.53513694", "0.53364015", "0.5330548", "0.5324624", "0.53222466", "0.5307476", "0.53004855", "0.52841866", "0.52784383", "0.52683413", "0.5265264", "0.525289", "0.52094126", "0.5189669", "0.5185224", "0.51700306", "0.5146029", "0.51444733", "0.51369494", "0.5134045", "0.5133414", "0.5130944", "0.51203525", "0.5117331", "0.5108703", "0.5108653", "0.5106191", "0.50937504", "0.50937504", "0.50840217", "0.5082524", "0.5074987", "0.50655115", "0.5064211", "0.505987", "0.50555235", "0.50513357", "0.5044483", "0.5041556", "0.5036054", "0.5031193", "0.5023556", "0.5019361", "0.49934402", "0.4989093", "0.49836317", "0.49754748", "0.49738207", "0.49702868", "0.49647367", "0.49602023", "0.4959052", "0.49577102", "0.49549797", "0.49535498", "0.49489576", "0.49489233", "0.4943718", "0.494183", "0.494042", "0.4935984", "0.49353147", "0.4934332", "0.49269903", "0.49202663", "0.49195725", "0.49171844", "0.49135497", "0.49132174", "0.4910008", "0.49098906", "0.49096495", "0.49090025", "0.49080157", "0.49024847", "0.49014568" ]
0.0
-1
Custom attribute writer method checking allowed values (enum).
def disk_mode=(disk_mode) validator = EnumAttributeValidator.new('String', ["persistent", "independent_persistent", "independent_nonpersistent", "nonpersistent", "undoable", "append"]) unless validator.valid?(disk_mode) fail ArgumentError, "invalid value for \"disk_mode\", must be one of #{validator.allowable_values}." end @disk_mode = disk_mode end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end", "def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end", "def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end", "def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end", "def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end", "def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end", "def valid?\n ENUM.include? @type.downcase.to_sym\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end", "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end", "def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end", "def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end", "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end", "def validate_exclusion_of(attr); end", "def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend", "def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end", "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end", "def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end", "def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end", "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "def status_enum=(status)\n write_attribute(:status, status)\n end", "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end", "def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end", "def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end", "def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end", "def enum?(field)\n !!self.enums[field.to_sym]\n end", "def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end", "def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end", "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end", "def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end", "def enum?\n true\n end", "def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end", "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end", "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end", "def enum?\n false\n end", "def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end", "def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end", "def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end", "def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end", "def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end", "def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end", "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end", "def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end", "def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end", "def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end", "def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end", "def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end", "def has_enums?\n !!eh_params[:has_enums]\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end", "def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end", "def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end", "def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end", "def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end", "def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end", "def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end", "def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end", "def allow_value_matcher; end", "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end", "def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end", "def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end", "def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end", "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end", "def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end", "def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end", "def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end", "def attr_bool_writer *symbols\n attr_writer *symbols\n end", "def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end", "def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end", "def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end", "def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end", "def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end", "def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end", "def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end", "def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end" ]
[ "0.7088127", "0.64820594", "0.6429773", "0.6227689", "0.61418885", "0.5809922", "0.57507086", "0.5743216", "0.5736045", "0.5708027", "0.57014966", "0.56777334", "0.5601988", "0.55947953", "0.55464065", "0.55371004", "0.55344343", "0.5528221", "0.5434983", "0.54312384", "0.5418137", "0.5379602", "0.53794384", "0.53794384", "0.53653747", "0.53513694", "0.53364015", "0.5330548", "0.5324624", "0.53222466", "0.5307476", "0.53004855", "0.52841866", "0.52784383", "0.52683413", "0.5265264", "0.525289", "0.52094126", "0.5189669", "0.5185224", "0.51700306", "0.5146029", "0.51444733", "0.51369494", "0.5134045", "0.5133414", "0.5130944", "0.51203525", "0.5117331", "0.5108703", "0.5108653", "0.5106191", "0.50937504", "0.50937504", "0.50840217", "0.5082524", "0.5074987", "0.50655115", "0.5064211", "0.505987", "0.50555235", "0.50513357", "0.5044483", "0.5041556", "0.5036054", "0.5031193", "0.5023556", "0.5019361", "0.49934402", "0.4989093", "0.49836317", "0.49754748", "0.49738207", "0.49702868", "0.49647367", "0.49602023", "0.4959052", "0.49577102", "0.49549797", "0.49535498", "0.49489576", "0.49489233", "0.4943718", "0.494183", "0.494042", "0.4935984", "0.49353147", "0.4934332", "0.49269903", "0.49202663", "0.49195725", "0.49171844", "0.49135497", "0.49132174", "0.4910008", "0.49098906", "0.49096495", "0.49090025", "0.49080157", "0.49024847", "0.49014568" ]
0.0
-1
Custom attribute writer method checking allowed values (enum).
def disk_type=(disk_type) validator = EnumAttributeValidator.new('String', ["flatDisk", "rdmDisk"]) unless validator.valid?(disk_type) fail ArgumentError, "invalid value for \"disk_type\", must be one of #{validator.allowable_values}." end @disk_type = disk_type end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end", "def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end", "def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end", "def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end", "def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end", "def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end", "def valid?\n ENUM.include? @type.downcase.to_sym\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end", "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end", "def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end", "def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end", "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end", "def validate_exclusion_of(attr); end", "def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend", "def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end", "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end", "def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end", "def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end", "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "def status_enum=(status)\n write_attribute(:status, status)\n end", "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end", "def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end", "def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end", "def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end", "def enum?(field)\n !!self.enums[field.to_sym]\n end", "def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end", "def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end", "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end", "def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end", "def enum?\n true\n end", "def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end", "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end", "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end", "def enum?\n false\n end", "def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end", "def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end", "def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end", "def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end", "def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end", "def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end", "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end", "def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end", "def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end", "def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end", "def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end", "def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end", "def has_enums?\n !!eh_params[:has_enums]\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end", "def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end", "def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end", "def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end", "def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end", "def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end", "def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end", "def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end", "def allow_value_matcher; end", "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end", "def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end", "def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end", "def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end", "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end", "def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end", "def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end", "def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end", "def attr_bool_writer *symbols\n attr_writer *symbols\n end", "def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end", "def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end", "def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end", "def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end", "def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end", "def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end", "def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end", "def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end" ]
[ "0.7088127", "0.64820594", "0.6429773", "0.6227689", "0.61418885", "0.5809922", "0.57507086", "0.5743216", "0.5736045", "0.5708027", "0.57014966", "0.56777334", "0.5601988", "0.55947953", "0.55464065", "0.55371004", "0.55344343", "0.5528221", "0.5434983", "0.54312384", "0.5418137", "0.5379602", "0.53794384", "0.53794384", "0.53653747", "0.53513694", "0.53364015", "0.5330548", "0.5324624", "0.53222466", "0.5307476", "0.53004855", "0.52841866", "0.52784383", "0.52683413", "0.5265264", "0.525289", "0.52094126", "0.5189669", "0.5185224", "0.51700306", "0.5146029", "0.51444733", "0.51369494", "0.5134045", "0.5133414", "0.5130944", "0.51203525", "0.5117331", "0.5108703", "0.5108653", "0.5106191", "0.50937504", "0.50937504", "0.50840217", "0.5082524", "0.5074987", "0.50655115", "0.5064211", "0.505987", "0.50555235", "0.50513357", "0.5044483", "0.5041556", "0.5036054", "0.5031193", "0.5023556", "0.5019361", "0.49934402", "0.4989093", "0.49836317", "0.49754748", "0.49738207", "0.49702868", "0.49647367", "0.49602023", "0.4959052", "0.49577102", "0.49549797", "0.49535498", "0.49489576", "0.49489233", "0.4943718", "0.494183", "0.494042", "0.4935984", "0.49353147", "0.4934332", "0.49269903", "0.49202663", "0.49195725", "0.49171844", "0.49135497", "0.49132174", "0.4910008", "0.49098906", "0.49096495", "0.49090025", "0.49080157", "0.49024847", "0.49014568" ]
0.0
-1
Custom attribute writer method checking allowed values (enum).
def sharing=(sharing) validator = EnumAttributeValidator.new('String', ["sharingNone", "sharingMultiWriter"]) unless validator.valid?(sharing) fail ArgumentError, "invalid value for \"sharing\", must be one of #{validator.allowable_values}." end @sharing = sharing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end", "def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end", "def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end", "def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end", "def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end", "def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end", "def valid?\n ENUM.include? @type.downcase.to_sym\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end", "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end", "def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end", "def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end", "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end", "def validate_exclusion_of(attr); end", "def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend", "def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end", "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end", "def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end", "def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end", "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "def status_enum=(status)\n write_attribute(:status, status)\n end", "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end", "def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end", "def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end", "def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end", "def enum?(field)\n !!self.enums[field.to_sym]\n end", "def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end", "def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end", "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end", "def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end", "def enum?\n true\n end", "def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end", "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end", "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end", "def enum?\n false\n end", "def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end", "def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end", "def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end", "def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end", "def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end", "def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end", "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end", "def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end", "def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end", "def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end", "def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end", "def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end", "def has_enums?\n !!eh_params[:has_enums]\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end", "def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end", "def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end", "def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end", "def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end", "def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end", "def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end", "def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end", "def allow_value_matcher; end", "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end", "def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end", "def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end", "def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end", "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end", "def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end", "def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end", "def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end", "def attr_bool_writer *symbols\n attr_writer *symbols\n end", "def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end", "def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end", "def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end", "def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end", "def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end", "def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end", "def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end", "def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end" ]
[ "0.7088127", "0.64820594", "0.6429773", "0.6227689", "0.61418885", "0.5809922", "0.57507086", "0.5743216", "0.5736045", "0.5708027", "0.57014966", "0.56777334", "0.5601988", "0.55947953", "0.55464065", "0.55371004", "0.55344343", "0.5528221", "0.5434983", "0.54312384", "0.5418137", "0.5379602", "0.53794384", "0.53794384", "0.53653747", "0.53513694", "0.53364015", "0.5330548", "0.5324624", "0.53222466", "0.5307476", "0.53004855", "0.52841866", "0.52784383", "0.52683413", "0.5265264", "0.525289", "0.52094126", "0.5189669", "0.5185224", "0.51700306", "0.5146029", "0.51444733", "0.51369494", "0.5134045", "0.5133414", "0.5130944", "0.51203525", "0.5117331", "0.5108703", "0.5108653", "0.5106191", "0.50937504", "0.50937504", "0.50840217", "0.5082524", "0.5074987", "0.50655115", "0.5064211", "0.505987", "0.50555235", "0.50513357", "0.5044483", "0.5041556", "0.5036054", "0.5031193", "0.5023556", "0.5019361", "0.49934402", "0.4989093", "0.49836317", "0.49754748", "0.49738207", "0.49702868", "0.49647367", "0.49602023", "0.4959052", "0.49577102", "0.49549797", "0.49535498", "0.49489576", "0.49489233", "0.4943718", "0.494183", "0.494042", "0.4935984", "0.49353147", "0.4934332", "0.49269903", "0.49202663", "0.49195725", "0.49171844", "0.49135497", "0.49132174", "0.4910008", "0.49098906", "0.49096495", "0.49090025", "0.49080157", "0.49024847", "0.49014568" ]
0.0
-1
Custom attribute writer method checking allowed values (enum).
def storage_allocation_type=(storage_allocation_type) validator = EnumAttributeValidator.new('String', ["notApplicable", "thin", "lazyZeroedThick", "eagerZeroedThick"]) unless validator.valid?(storage_allocation_type) fail ArgumentError, "invalid value for \"storage_allocation_type\", must be one of #{validator.allowable_values}." end @storage_allocation_type = storage_allocation_type end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end", "def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end", "def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end", "def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end", "def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end", "def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end", "def valid?\n ENUM.include? @type.downcase.to_sym\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end", "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end", "def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end", "def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end", "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end", "def validate_exclusion_of(attr); end", "def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend", "def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end", "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end", "def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end", "def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end", "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "def status_enum=(status)\n write_attribute(:status, status)\n end", "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end", "def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end", "def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end", "def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end", "def enum?(field)\n !!self.enums[field.to_sym]\n end", "def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end", "def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end", "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end", "def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end", "def enum?\n true\n end", "def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end", "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end", "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end", "def enum?\n false\n end", "def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end", "def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end", "def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end", "def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end", "def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end", "def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end", "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end", "def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end", "def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end", "def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end", "def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end", "def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end", "def has_enums?\n !!eh_params[:has_enums]\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end", "def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end", "def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end", "def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end", "def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end", "def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end", "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end", "def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end", "def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end", "def allow_value_matcher; end", "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end", "def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end", "def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end", "def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end", "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end", "def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end", "def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end", "def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end", "def attr_bool_writer *symbols\n attr_writer *symbols\n end", "def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end", "def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end", "def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end", "def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end", "def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end", "def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end", "def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end", "def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end" ]
[ "0.7088127", "0.64820594", "0.6429773", "0.6227689", "0.61418885", "0.5809922", "0.57507086", "0.5743216", "0.5736045", "0.5708027", "0.57014966", "0.56777334", "0.5601988", "0.55947953", "0.55464065", "0.55371004", "0.55344343", "0.5528221", "0.5434983", "0.54312384", "0.5418137", "0.5379602", "0.53794384", "0.53794384", "0.53653747", "0.53513694", "0.53364015", "0.5330548", "0.5324624", "0.53222466", "0.5307476", "0.53004855", "0.52841866", "0.52784383", "0.52683413", "0.5265264", "0.525289", "0.52094126", "0.5189669", "0.5185224", "0.51700306", "0.5146029", "0.51444733", "0.51369494", "0.5134045", "0.5133414", "0.5130944", "0.51203525", "0.5117331", "0.5108703", "0.5108653", "0.5106191", "0.50937504", "0.50937504", "0.50840217", "0.5082524", "0.5074987", "0.50655115", "0.5064211", "0.505987", "0.50555235", "0.50513357", "0.5044483", "0.5041556", "0.5036054", "0.5031193", "0.5023556", "0.5019361", "0.49934402", "0.4989093", "0.49836317", "0.49754748", "0.49738207", "0.49702868", "0.49647367", "0.49602023", "0.4959052", "0.49577102", "0.49549797", "0.49535498", "0.49489576", "0.49489233", "0.4943718", "0.494183", "0.494042", "0.4935984", "0.49353147", "0.4934332", "0.49269903", "0.49202663", "0.49195725", "0.49171844", "0.49135497", "0.49132174", "0.4910008", "0.49098906", "0.49096495", "0.49090025", "0.49080157", "0.49024847", "0.49014568" ]
0.0
-1
Custom attribute writer method with validation
def uuid=(uuid) pattern = Regexp.new(/^$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) if !uuid.nil? && uuid !~ pattern fail ArgumentError, "invalid value for \"uuid\", must conform to the pattern #{pattern}." end @uuid = uuid end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{attr_name}', new_value);end\", \"#{attr_name}=\"\n end", "def attr_writer(*vars)\n # avoid tracking attributes that are added by the class_attribute\n # as these are class attributes and not instance attributes.\n tracked_vars = vars.reject {|var| respond_to? var }\n add_tracked_attrs(false, true, *tracked_vars)\n vars.extract_options!\n super\n end", "def attr_writer(sym, *more) end", "def is_attribute?; end", "def validate_exclusion_of(attr); end", "def register_attributes\n raise \"Not implemented in #{self.class}\"\n end", "def method_missing(method_name, *args)\n return super unless permitted_attributes.include?(method_name)\n begin\n object.send(:\"#{method_name}=\", args.first)\n rescue => e\n if params.has_key?(method_name)\n message = \"Unable to process value for :#{method_name}, no attribute writer. Be sure to override the automatic setters for all params that do not map straight to a model attribute.\"\n Rails.logger.warn({message: message,\n missing_writer: method_name,\n value: args.first,\n error: e})\n self.errors << {status: 422, message: message}\n else\n raise e\n end\n end\n end", "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "def create_setter_for(attribute, options)\n setter_method = \"#{attribute}=\"\n\n define_method setter_method do |value|\n if options[:allow_blank] || value != \"\"\n write_attribute(attribute, value)\n end\n end\n end", "def attr_internal_writer(*attrs)\n attrs.each {|attr_name| attr_internal_define(attr_name, :writer)}\n end", "def escape_attr input\n escape input, attr_regexp, attr_mapping\n end", "def make_writer( attrtype )\n\t\tself.log.debug \"Generating an attribute writer for %p\" % [ attrtype ]\n\t\tattrname = attrtype.name\n\t\tif attrtype.single?\n\t\t\tself.log.debug \" attribute is SINGLE, so generating a scalar writer...\"\n\t\t\treturn lambda {|newvalue| self[attrname] = newvalue }\n\t\telse\n\t\t\tself.log.debug \" attribute isn't SINGLE, so generating an array writer...\"\n\t\t\treturn lambda {|*newvalues| self[attrname] = newvalues.flatten }\n\t\tend\n\tend", "def write_attribute(name, value)\n # Simply check if the accessor is allowed to write the field\n # (if so, go to superclass and do it)\n @bypass_auth ||= false\n if allowed_to_write(name) || @bypass_auth\n super(name, value)\n end\n end", "def mattr_writer(*syms, &proc)\n receiver = self\n options = syms.extract_options!\n syms.each do |sym|\n raise NameError.new('invalid attribute name') unless sym =~ /^[_A-Za-z]\\w*$/\n class_exec do\n define_singleton_method \"#{sym}=\" do |obj|\n class_variable_set(\"@@#{sym}\", obj)\n end\n end\n\n unless options[:instance_writer] == false || options[:instance_accessor] == false\n class_exec do\n define_method \"#{sym}=\" do |obj|\n receiver.class_variable_set(\"@@#{sym}\", obj)\n end\n end\n end\n send(\"#{sym}=\", proc.call) if proc\n end\n end", "def write_attribute(attribute, value)\n false\n end", "def add_attribute attribute\n return attribute unless @document_self\n\n # mainly to check for redefinition of an attribute as a method\n # TODO find a policy for 'attr_reader :foo' + 'def foo=()'\n register = false\n\n key = nil\n\n if attribute.rw.index 'R' then\n key = attribute.pretty_name\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name + '='] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if attribute.rw.index 'W' then\n key = attribute.pretty_name + '='\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if register then\n attribute.visibility = @visibility\n add_to @attributes, attribute\n resolve_aliases attribute\n end\n\n attribute\n end", "def define_writer_method(mod)\n writer_method_name = \"#{name}=\"\n attribute = self\n\n mod.send(:define_method, writer_method_name) { |value| attribute.set(self, value) }\n mod.send(writer_visibility, writer_method_name)\n\n self\n end", "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "def assert_attr_writer(obj, method)\n assert_respond_to obj, \"#{method}=\"\nend", "def add_attribute(name, &block); end", "def authenticates_writes_to(attr, options={})\n authenticates_access\n @write_validation_map ||= {}\n @write_validation_map[attr.to_s] ||= AuthMethodList.new\n @write_validation_map[attr.to_s].add_method(options)\n end", "def write_attribute_3(param1, param2)\n\twrite_attribute(param1, param2)\n end", "def write_attribute(attr_name, value) #:doc:\n @attributes[attr_name] = empty_string_for_number_column?(attr_name, value) ? nil : value\n end", "def add_writer_tags(klass, new_method, member)\n member_tag = member_tag_for_member(klass, member, :write)\n return_type = return_type_from_tag(member_tag)\n setter_doc_text = member_tag ? member_tag.text : \"Sets the attribute #{member}\"\n new_method.docstring.replace(setter_doc_text)\n new_method.add_tag YARD::Tags::Tag.new(:param, \"the value to set the attribute #{member} to.\", return_type, \"value\")\n new_method.add_tag YARD::Tags::Tag.new(:return, \"the newly set value\", return_type)\n end", "def print_attribute(*) end", "def attribute(name); end", "def add_checked_attribute(clazz, attribute)\r\n eval <<END\r\n class #{clazz}\r\n\r\n def #{attribute}=(value)\r\n raise 'Invalid attribute' unless value\r\n @#{attribute}=value\r\n end\r\n\r\n def #{attribute}\r\n #{attribute}\r\n end\r\n end\r\nEND\r\nend", "def attr(name); end", "def is_attribute?(line)\n (line =~ /(\\s+)attr_(writer|reader|accessor)\\s+:[a-zA-Z_0-9]+/) == 0\n end", "def attribute(name, value)\n\t if !@inStartTag\n\t\traise WriterError.new('attribute outside of tag start')\n\t end\n\t @io << \" #{name}=\\\"#{NQXML.encode(value.to_s)}\\\"\"\n\tend", "def set_attribute(name, value); end", "def dataset_writer(*attributes)\n attributes.flatten.each do |attr_name|\n next if method_defined?(\"#{attr_name}=\")\n\n class_eval <<-RUBY, __FILE__, __LINE__ + 1\n def #{attr_name}=(value)\n dataset_set(:#{attr_name}, value)\n end\n RUBY\n end\n end", "def validated_attribute_names(params); end", "def require_format_of(attribute)\r\n RequireFormatOf.new(attribute)\r\n end", "def attr_writer(*fields)\n check_fields(fields)\n added_fields = jiak.data.writable(*fields)\n added_fields.each do |field|\n class_eval <<-EOM\n def #{field}=(val)\n @jiak.object.data.#{field} = val\n self.class.do_auto_update(self)\n end\n EOM\n end\n nil\n end", "def html_attr(*attrs)\n options = attrs.extract_options!.reverse_merge({\n :level => :super_relaxed\n })\n attrs.each do |att|\n class_eval \"def #{att}=(val); self[:#{att}] = sanitize(val, :#{options[:level]}); end\"\n end\n end", "def validate_attributes=(new_attribute)\n @validate_attributes = new_attribute\n end", "def html_attributes(attr); end", "def instance_write(attr, value)\n setter = :\"#{@name_string}_#{attr}=\"\n instance.send(setter, value) if instance.respond_to?(setter)\n end", "def valid_xml_attribute(name, options={:level => :warning})\n\t\t\t\tvalidate(\"Invalid XML attribute '#{name}'\", options) { name.to_s.match(/^([^[:punct:]0-9<>]|_)[^<>\"']*/) }\n\t\t\tend", "def attr_writer(*args)\n sym_args=args_to_sym(args)\n sym_args.each do |value|\n self.instance_eval(\"def #{value}=(arg); @#{value}=arg;end;\")\n end\n \n end", "def define_writer_method(attribute, method_name, visibility)\n define_method(method_name) { |value| attribute.set(self, value) }\n send(visibility, method_name)\n self\n end", "def write_attribute(name, val)\n if @embedded_models.include? name\n @embedded_models[name].model = val\n elsif @attribute_objects.include? name\n @attribute_objects[name].value = val\n else\n return false\n end\n\n run_callbacks :attribute_change\n end", "def valid_attributes\n { \"name\" => \"MyString\" }\n end", "def valid_attributes\n { \"name\" => \"MyString\" }\n end", "def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end", "def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end", "def attr; end", "def attribute(*args)\n define_expressions(Attribute, args)\n end", "def write_attribute(name, value)\n name = name.to_s\n\n # The attribute already has an unsaved change.\n if attribute_changed?(name)\n old = changed_attributes[name]\n changed_attributes.delete(name) unless field_changed?(name, old, value)\n else\n attribute_will_change(name) if field_changed?(name, old, value)\n end\n\n # Carry on.\n super(name, value)\n end", "def define_magic_attr(name)\n define_method name do |*attrs|\n raise ArgumentError.new(\"wrong number of arguments\") if attrs.size > 1\n send(\"#{name}=\", attrs.first) if attrs.size == 1\n instance_variable_get(\"@#{name}\")\n end\n\n attr_writer name\n end", "def configurable_writer(attribute, code=nil, &block)\n if block_given? and not code\n Halcyon.class.send(:define_method, :\"#{attribute}=\", block)\n elsif code and not block_given?\n Halcyon.class.send(:eval, <<-\"end;\")\n def #{attribute.to_s}=(value)\n #{code % [attribute.to_sym.inspect]}\n end\n end;\n else\n raise ArgumentError.new(\"Either a block or a code string should be supplied.\")\n end\n end", "def method_missing(name, *args, &block)\n if /\\Ahas_validated_(?<type>\\w*)_attribute\\Z/ =~ name\n has_validated_attribute(type, *args, &block)\n else\n super\n end\n end", "def add_checked_attribute(klass, attribute)\n klass.class_eval do\n define_method attribute do\n instance_variable_get(\"@#{attribute}\")\n end\n\n define_method \"#{attribute}=\" do |value|\n raise 'Invalid attribute' unless value\n \n instance_variable_set(\"@#{attribute}\", value)\n end\n end\nend", "def method_missing(meth, *args, &blk)\n match = meth.to_s.match(/^([a-zA-Z\\_]+)(=|$)$/)\n if match\n attribute, setter = match[1], !match[2].blank?\n if setter\n write_attribute(attribute, args.first)\n else\n read_attribute(attribute)\n end\n else\n super(meth, *args, &blk)\n end\n end", "def valid_attributes\n { name: 'do this' }\n end", "def make_attributes_definitions_or_croak(attrArgs, &attrBlok)\n eye = :'m_attrs_defs'\n\n # Work with attribute as strings\n \n $DEBUG && logger_me(eye, logger_fmt_kls(:attrArgs => attrArgs, :attrBlok => attrBlok))\n\n mustbe_attributes_specification_or_croak(attrArgs, eye, \"attrArgs not attributes_specification\")\n \n #STOPATTRARGSINSUPER\n \n #attrAll = mustbe_not_empty_or_croak(mustbe_array_key_or_nil_or_croak(attrArgs, :all, eye, \"all attributes not array\"), eye, \"all attributes is empty\").map(&:to_s)\n attrAll = mustbe_not_empty_or_croak(mustbe_attributes_specification_all_key_or_croak(attrArgs, :all, eye), eye, \"all attributes is empty\").map(&:to_s)\n \n\n #puts(\"\\n\\n\\nATTR ALL >#{attrAll}<\")\n\n #STOPMAKEATTRSPECSENTRY\n\n attrInc = mustbe_attributes_specification_include_key_or_nil_or_croak(attrArgs, :include, eye) # mustbe all strings\n #puts(\"ATTR INC >#{attrInc.class}< >#{attrInc}< >#{is_value_not_empty?(attrInc)}<\")\n attrInc && mustbe_not_empty_or_croak(attrInc, eye, \"include attributes is empty\")\n\n attrExc = mustbe_attributes_specification_exclude_key_or_nil_or_croak(attrArgs, :exclude, eye) || []\n \n attrMapNom = mustbe_attributes_definitions_key_or_nil_or_croak(attrArgs, :definitions, eye) || {}\n attrMap = attrMapNom && potrubi_util_map_hash_kv(attrMapNom) {|k,v| [k.to_s, v]} # keys all strings\n\n # Ensure all consistent\n \n attrInc && mustbe_subset_or_croak(attrInc, attrAll, eye, \"include attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrExc, attrAll, eye, \"exclude attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrMap.keys, attrAll, eye, \"attribute map contains unknown attributes\")\n \n attrUse = ((attrInc || attrAll) - attrExc).uniq # list of unique attributes to report on\n\n # consolidate \"faked up\" attr specs with ones provided to get the composite attrSpecs\n \n attrDefsNom = potrubi_util_array_to_hash(attrUse).merge(attrMap.select {|k,v| attrUse.include?(k)}) # consolidated \"faked up\" attr specs with ones provided\n\n attrDefs = potrubi_util_map_hash_v(attrDefsNom) do | attrName, attrSpecNom|\n\n attrSpec =\n case attrSpecNom\n when NilClass then {}\n when Hash then\n attrSpecNom.each_with_object({}) do | (verbName, verbSpec), h1 |\n case verbName\n when :pass_thru then h1[:pass_thru] = verbSpec # dont touch; just pass through\n when :event_defaults then # add these to pass_thru\n h1[:pass_thru] = (h1[:pass_thru] || {}).merge(verbName => verbSpec)\n when :map, :select, :metric then\n h1[verbName] = {\n :method_name => \"#{verbName}_#{attrName}_#{rand(1000000)}\", # make a unqiue name\n :method_spec => verbSpec # spec must be valid to dynamic_define_methods\n }\n else\n logic_exception(verbName, eye, \"attrName >#{attrName}< verbName >#{verbName}< value should be impossible\")\n end\n end\n \n else\n logic_exception(attrrSpecNom, eye, \"attrSpecNom value should be impossible\")\n end\n\n attrSpec\n \n end\n \n $DEBUG && logger_mx(eye, logger_fmt_kls(:attrDefs => attrDefs))\n\n mustbe_attributes_definitions_or_croak(attrDefs, eye, \"attrDefs failed contract\")\n\n #STOPMAKEATTRSPECS\n \n end", "def create_writer(klass, member)\n # We want to convert these members into attributes just like\n # as if they were declared using attr_accessor.\n new_meth = register MethodObject.new(klass, \"#{member}=\", :instance) do |o|\n o.parameters = [['value', nil]]\n o.signature ||= \"def #{member}=(value)\"\n o.source ||= \"#{o.signature}\\n @#{member} = value\\nend\"\n end\n add_writer_tags(klass, new_meth, member)\n klass.attributes[:instance][member][:write] = new_meth\n end", "def create_setter!\n @target.class_eval <<-EOS\n #{writer_visibility.to_s}\n def #{name}=(value)\n attribute_set(#{name.inspect}, value)\n end\n EOS\n rescue SyntaxError\n raise SyntaxError.new(column)\n end", "def attribute name, type, conditions= DEFAULT_ATTRIBUTE_CONDITIONS\n RMOF.complete_conditions conditions, DEFAULT_ATTRIBUTE_CONDITIONS\n @attributes= {} unless instance_variable_defined? :@attributes\n @attributes[name]= [name, type, conditions]\n unless method_defined? :__attributes then \n define_method( :__attributes) do \n @attributes\n end \n end\n at= \"@#{name}\".to_sym\n getter= \"#{name}\".to_sym\n setter= \"#{name}=\".to_sym\n completion= \"__complete_#{name}\".to_sym\n define_method( getter) do\n if instance_variable_defined? at then instance_variable_get at\n else conditions[:default]\n end\n end\n define_method( setter) do |val|\n instance_variable_set at, val\n end\n define_method( completion) do\n RMOF.validate( self.send(getter), name, type, conditions)\n end\n end", "def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end", "def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end", "def create_setter(name, meth)\n define_method(\"#{meth}=\") do |value|\n write_attribute(name, value)\n end\n end", "def sanitized_allowed_attributes=(attributes); end", "def sanitized_allowed_attributes=(attributes); end", "def oattr(name, type)\n case type\n when :custom\n # Do nothing, just register attr below.\n when :writer\n attr_writer name\n else\n raise ArgumentError, \"Unknown type: #{type.inspect}\"\n end\n\n # Register and return.\n name.tap { oattrs << name}\n end", "def valid_attributes\n { name: \"Expert\" }\n end", "def attributes(*method_names, **options)\n add_attributes(method_names, **options, strategy: :write_value_using_method_strategy)\n end", "def []=(attr_name, value)\n writer_method = \"#{attr_name}=\"\n send(writer_method, value) if respond_to?(writer_method)\n end", "def write_extended_attributes(attrs)\n attrs.each do |k, val|\n self.send((k.to_s + \"=\").to_sym, val) if is_flex_attribute?(k)\n end\n self\n end", "def valid_attributes\n { \"username\" => \"MyString\" }\n end", "def cattr_writer(*fields)\n metaclass.send :attr_writer, *fields\n end", "def write_attribute(attr, value)\n if attribute_encrypted?(attr)\n conductor_for(attr).encrypt(value)\n else\n super(attr, value)\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "def define_attribute_method(attr_name, _owner: generated_attribute_methods)\n CodeGenerator.batch(_owner, __FILE__, __LINE__) do |owner|\n attribute_method_matchers.each do |matcher|\n method_name = matcher.method_name(attr_name)\n\n unless instance_method_already_implemented?(method_name)\n generate_method = \"define_method_#{matcher.target}\"\n\n if respond_to?(generate_method, true)\n send(generate_method, attr_name.to_s, owner: owner)\n else\n define_proxy_call true, owner, method_name, matcher.target, attr_name.to_s\n end\n end\n end\n attribute_method_matchers_cache.clear\n end\n end", "def has_attributes?; end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isExpirationRequired\", @is_expiration_required)\n writer.write_duration_value(\"maximumDuration\", @maximum_duration)\n end", "def add_attributes(item)\n [:class, :instance].each do |attr_loc|\n # Grab attributes for the current location (class or instance)\n attrs = item.attributes[attr_loc]\n attrs.each do |name, attribute|\n reader = attribute[:read]\n writer = attribute[:write]\n\n unless reader || writer\n Logging.warn(\"attribute is not readable or writable somehow, skipping\", attribute)\n next\n end\n\n # Get all given types\n yard_types = []\n if reader\n next if @hide_private && reader.visibility == :private\n yard_types += reader.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n reader.tags('param').flat_map(&:types)\n end\n if writer\n next if @hide_private && writer.visibility == :private\n yard_types += writer.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n writer.tags('param').flat_map(&:types)\n end\n\n # Use untyped if not types specified anywhere, otherwise try to\n # compute Parlour type given all these types\n if yard_types.empty?\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", reader || writer)\n parlour_type = Parlour::Types::Untyped.new\n elsif yard_types.all? { |x| x == 'nil' }\n # Nil attributes are extremely unusual, so just use untyped\n parlour_type = Parlour::Types::Untyped.new\n else\n parlour_type = TypeConverter.yard_to_parlour(\n yard_types, reader || writer, @type_converter_config)\n end\n\n # Generate attribute\n if reader && writer\n kind = :accessor\n elsif reader\n kind = :reader\n elsif writer\n kind = :writer\n end\n\n if @exclude_untyped && parlour_type.is_a?(Parlour::Types::Untyped)\n Logging.omit(\"excluding untyped attribute\", reader || writer, immediate: true)\n next\n end\n\n case @mode\n when :rbi\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n class_attribute: (attr_loc == :class)\n ) do |m|\n add_comments(reader || writer, m)\n end\n when :rbs\n if attr_loc == :class\n # RBS doesn't support class attr_accessors so create individual methods\n\n if reader\n @current_object.create_method(\n name.to_s,\n [Parlour::RbsGenerator::MethodSignature.new([], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(reader, m)\n end\n end\n\n if writer\n @current_object.create_method(\n \"#{name}=\",\n [Parlour::RbsGenerator::MethodSignature.new([Parlour::RbsGenerator::Parameter.new(\n \"value\",\n type: parlour_type,\n required: true\n )], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(writer, m)\n end\n end\n else\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n ) do |m|\n add_comments(reader || writer, m)\n end\n end\n end\n end\n end\n end", "def []=(attr_name, value)\r\n if attr_name.is_a?(String) and attr_name != attr_name.split(ID_SEP).first\r\n attr_name = attr_name.split(ID_SEP)\r\n end\r\n\r\n if attr_name.is_a? Array\r\n value = value.split(ID_SEP) if value.is_a? String\r\n unless value.length == attr_name.length\r\n raise \"Number of attr_names and values do not match\"\r\n end\r\n #breakpoint\r\n [attr_name, value].transpose.map {|name,val| write_attribute(name.to_s, val)}\r\n else\r\n write_attribute(attr_name, value)\r\n end\r\n end", "def attr(symbol, writable=false) end", "def define_writer!(k, definition)\n define_method(\"#{k}=\") do |value|\n # Recursively convert hash and array of hash to schematized objects\n value = ensure_schema value, definition[:schema]\n\n # Initial value\n instance_variable_set \"@#{k}\", value\n\n # Dirty tracking\n self.changed_attributes ||= Set.new\n self.changed_attributes << k\n end\n end", "def validate\n validate_string_attributes\n end", "def write_attribute_with_dynamo(field_name, value)\n if is_dynamo_field?(field_name)\n # Store these guys for now. We don't actually save the field value until the model is saved ( i.e my_supplier.save ).\n # If we were to save the field_value now we wouldn't be able to know the id of the model to link this value to it.\n # @see delay_save\n @all_fields_and_values ||= []\n @all_fields_and_values << {:dynamo_field=>cached_dynamo_field_by_name(field_name), :value=>value}\n end\n # If its a 'normal' attribute let rails write it in the usual way.\n write_attribute_without_dynamo(field_name, value)\n end", "def define_attr_accessor(attr)\n attr_accessor(attr)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_collection_of_object_values(\"attributeMappings\", @attribute_mappings)\n writer.write_boolean_value(\"enabled\", @enabled)\n writer.write_enum_value(\"flowTypes\", @flow_types)\n writer.write_collection_of_object_values(\"metadata\", @metadata)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_object_value(\"scope\", @scope)\n writer.write_string_value(\"sourceObjectName\", @source_object_name)\n writer.write_string_value(\"targetObjectName\", @target_object_name)\n writer.write_additional_data(@additional_data)\n end", "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def valid_attributes\n { }\n end", "def validatable_attributes(atts, opts)\n am, an, ab, m = opts.values_at(:allow_missing, :allow_nil, :allow_blank, :message)\n Array(atts).each do |a|\n next if am && !values.has_key?(a)\n v = send(a)\n next if an && v.nil?\n next if ab && v.respond_to?(:blank?) && v.blank?\n if message = yield(a, v, m)\n errors.add(a, message)\n end\n end\n end", "def valid_attributes\n { }\n end", "def valid_attributes\n { }\n end", "def attribute_name=(_arg0); end", "def attribute_name=(_arg0); end", "def attribute_name=(_arg0); end", "def require_attr(name)\n send(name).tap do |_|\n raise \"Attribute must be set: #{name}\" if _.nil?\n end\n end", "def write_attributes(attributes)\n _attributes = attributes.select do |name, value|\n if self.is_dynamic_field?(name)\n self.dynamic_setter(name, value)\n false\n else\n true\n end\n end\n\n super(_attributes)\n end", "def attribute; end", "def attribute; end" ]
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.58328366", "0.5823013", "0.5822229", "0.57850474", "0.5701491", "0.5696689", "0.5682951", "0.5678094", "0.566814", "0.5657499", "0.56555206", "0.5642589", "0.56219065", "0.5615893", "0.56105876", "0.559851", "0.5598089", "0.55940455", "0.5585137", "0.55848545", "0.55796933", "0.5571477", "0.5567006", "0.55667996", "0.55652434", "0.5562926", "0.55600035", "0.55590326", "0.55590326", "0.5554599", "0.5554599", "0.55407417", "0.5534935", "0.5527733", "0.55271375", "0.55238813", "0.5501504", "0.5497003", "0.5496233", "0.54927665", "0.5464706", "0.54617554", "0.5461167", "0.5451583", "0.54498726", "0.54498726", "0.54359984", "0.5430996", "0.5430996", "0.5426488", "0.5418467", "0.54153895", "0.54107565", "0.5407886", "0.5401234", "0.54008496", "0.5400268", "0.53910094", "0.53827274", "0.5377731", "0.5375473", "0.5374833", "0.53720397", "0.5370215", "0.5363264", "0.5361161", "0.5360557", "0.5351706", "0.53514725", "0.53492516", "0.53459316", "0.5341237", "0.5328037", "0.5328037", "0.53230566", "0.53230566", "0.53230566", "0.5319575", "0.531832", "0.5315559", "0.5315559" ]
0.0
-1
Custom attribute writer method with validation
def vdisk_id=(vdisk_id) pattern = Regexp.new(/^$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) if !vdisk_id.nil? && vdisk_id !~ pattern fail ArgumentError, "invalid value for \"vdisk_id\", must conform to the pattern #{pattern}." end @vdisk_id = vdisk_id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_writer_tag(text); end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{attr_name}', new_value);end\", \"#{attr_name}=\"\n end", "def attr_writer(*vars)\n # avoid tracking attributes that are added by the class_attribute\n # as these are class attributes and not instance attributes.\n tracked_vars = vars.reject {|var| respond_to? var }\n add_tracked_attrs(false, true, *tracked_vars)\n vars.extract_options!\n super\n end", "def attr_writer(sym, *more) end", "def is_attribute?; end", "def validate_exclusion_of(attr); end", "def register_attributes\n raise \"Not implemented in #{self.class}\"\n end", "def method_missing(method_name, *args)\n return super unless permitted_attributes.include?(method_name)\n begin\n object.send(:\"#{method_name}=\", args.first)\n rescue => e\n if params.has_key?(method_name)\n message = \"Unable to process value for :#{method_name}, no attribute writer. Be sure to override the automatic setters for all params that do not map straight to a model attribute.\"\n Rails.logger.warn({message: message,\n missing_writer: method_name,\n value: args.first,\n error: e})\n self.errors << {status: 422, message: message}\n else\n raise e\n end\n end\n end", "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "def create_setter_for(attribute, options)\n setter_method = \"#{attribute}=\"\n\n define_method setter_method do |value|\n if options[:allow_blank] || value != \"\"\n write_attribute(attribute, value)\n end\n end\n end", "def attr_internal_writer(*attrs)\n attrs.each {|attr_name| attr_internal_define(attr_name, :writer)}\n end", "def escape_attr input\n escape input, attr_regexp, attr_mapping\n end", "def make_writer( attrtype )\n\t\tself.log.debug \"Generating an attribute writer for %p\" % [ attrtype ]\n\t\tattrname = attrtype.name\n\t\tif attrtype.single?\n\t\t\tself.log.debug \" attribute is SINGLE, so generating a scalar writer...\"\n\t\t\treturn lambda {|newvalue| self[attrname] = newvalue }\n\t\telse\n\t\t\tself.log.debug \" attribute isn't SINGLE, so generating an array writer...\"\n\t\t\treturn lambda {|*newvalues| self[attrname] = newvalues.flatten }\n\t\tend\n\tend", "def write_attribute(name, value)\n # Simply check if the accessor is allowed to write the field\n # (if so, go to superclass and do it)\n @bypass_auth ||= false\n if allowed_to_write(name) || @bypass_auth\n super(name, value)\n end\n end", "def mattr_writer(*syms, &proc)\n receiver = self\n options = syms.extract_options!\n syms.each do |sym|\n raise NameError.new('invalid attribute name') unless sym =~ /^[_A-Za-z]\\w*$/\n class_exec do\n define_singleton_method \"#{sym}=\" do |obj|\n class_variable_set(\"@@#{sym}\", obj)\n end\n end\n\n unless options[:instance_writer] == false || options[:instance_accessor] == false\n class_exec do\n define_method \"#{sym}=\" do |obj|\n receiver.class_variable_set(\"@@#{sym}\", obj)\n end\n end\n end\n send(\"#{sym}=\", proc.call) if proc\n end\n end", "def write_attribute(attribute, value)\n false\n end", "def add_attribute attribute\n return attribute unless @document_self\n\n # mainly to check for redefinition of an attribute as a method\n # TODO find a policy for 'attr_reader :foo' + 'def foo=()'\n register = false\n\n key = nil\n\n if attribute.rw.index 'R' then\n key = attribute.pretty_name\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name + '='] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if attribute.rw.index 'W' then\n key = attribute.pretty_name + '='\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if register then\n attribute.visibility = @visibility\n add_to @attributes, attribute\n resolve_aliases attribute\n end\n\n attribute\n end", "def define_writer_method(mod)\n writer_method_name = \"#{name}=\"\n attribute = self\n\n mod.send(:define_method, writer_method_name) { |value| attribute.set(self, value) }\n mod.send(writer_visibility, writer_method_name)\n\n self\n end", "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "def assert_attr_writer(obj, method)\n assert_respond_to obj, \"#{method}=\"\nend", "def add_attribute(name, &block); end", "def authenticates_writes_to(attr, options={})\n authenticates_access\n @write_validation_map ||= {}\n @write_validation_map[attr.to_s] ||= AuthMethodList.new\n @write_validation_map[attr.to_s].add_method(options)\n end", "def write_attribute_3(param1, param2)\n\twrite_attribute(param1, param2)\n end", "def write_attribute(attr_name, value) #:doc:\n @attributes[attr_name] = empty_string_for_number_column?(attr_name, value) ? nil : value\n end", "def add_writer_tags(klass, new_method, member)\n member_tag = member_tag_for_member(klass, member, :write)\n return_type = return_type_from_tag(member_tag)\n setter_doc_text = member_tag ? member_tag.text : \"Sets the attribute #{member}\"\n new_method.docstring.replace(setter_doc_text)\n new_method.add_tag YARD::Tags::Tag.new(:param, \"the value to set the attribute #{member} to.\", return_type, \"value\")\n new_method.add_tag YARD::Tags::Tag.new(:return, \"the newly set value\", return_type)\n end", "def print_attribute(*) end", "def attribute(name); end", "def add_checked_attribute(clazz, attribute)\r\n eval <<END\r\n class #{clazz}\r\n\r\n def #{attribute}=(value)\r\n raise 'Invalid attribute' unless value\r\n @#{attribute}=value\r\n end\r\n\r\n def #{attribute}\r\n #{attribute}\r\n end\r\n end\r\nEND\r\nend", "def attr(name); end", "def is_attribute?(line)\n (line =~ /(\\s+)attr_(writer|reader|accessor)\\s+:[a-zA-Z_0-9]+/) == 0\n end", "def attribute(name, value)\n\t if !@inStartTag\n\t\traise WriterError.new('attribute outside of tag start')\n\t end\n\t @io << \" #{name}=\\\"#{NQXML.encode(value.to_s)}\\\"\"\n\tend", "def set_attribute(name, value); end", "def dataset_writer(*attributes)\n attributes.flatten.each do |attr_name|\n next if method_defined?(\"#{attr_name}=\")\n\n class_eval <<-RUBY, __FILE__, __LINE__ + 1\n def #{attr_name}=(value)\n dataset_set(:#{attr_name}, value)\n end\n RUBY\n end\n end", "def validated_attribute_names(params); end", "def require_format_of(attribute)\r\n RequireFormatOf.new(attribute)\r\n end", "def attr_writer(*fields)\n check_fields(fields)\n added_fields = jiak.data.writable(*fields)\n added_fields.each do |field|\n class_eval <<-EOM\n def #{field}=(val)\n @jiak.object.data.#{field} = val\n self.class.do_auto_update(self)\n end\n EOM\n end\n nil\n end", "def html_attr(*attrs)\n options = attrs.extract_options!.reverse_merge({\n :level => :super_relaxed\n })\n attrs.each do |att|\n class_eval \"def #{att}=(val); self[:#{att}] = sanitize(val, :#{options[:level]}); end\"\n end\n end", "def validate_attributes=(new_attribute)\n @validate_attributes = new_attribute\n end", "def html_attributes(attr); end", "def instance_write(attr, value)\n setter = :\"#{@name_string}_#{attr}=\"\n instance.send(setter, value) if instance.respond_to?(setter)\n end", "def valid_xml_attribute(name, options={:level => :warning})\n\t\t\t\tvalidate(\"Invalid XML attribute '#{name}'\", options) { name.to_s.match(/^([^[:punct:]0-9<>]|_)[^<>\"']*/) }\n\t\t\tend", "def attr_writer(*args)\n sym_args=args_to_sym(args)\n sym_args.each do |value|\n self.instance_eval(\"def #{value}=(arg); @#{value}=arg;end;\")\n end\n \n end", "def define_writer_method(attribute, method_name, visibility)\n define_method(method_name) { |value| attribute.set(self, value) }\n send(visibility, method_name)\n self\n end", "def write_attribute(name, val)\n if @embedded_models.include? name\n @embedded_models[name].model = val\n elsif @attribute_objects.include? name\n @attribute_objects[name].value = val\n else\n return false\n end\n\n run_callbacks :attribute_change\n end", "def valid_attributes\n { \"name\" => \"MyString\" }\n end", "def valid_attributes\n { \"name\" => \"MyString\" }\n end", "def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end", "def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end", "def attr; end", "def attribute(*args)\n define_expressions(Attribute, args)\n end", "def write_attribute(name, value)\n name = name.to_s\n\n # The attribute already has an unsaved change.\n if attribute_changed?(name)\n old = changed_attributes[name]\n changed_attributes.delete(name) unless field_changed?(name, old, value)\n else\n attribute_will_change(name) if field_changed?(name, old, value)\n end\n\n # Carry on.\n super(name, value)\n end", "def define_magic_attr(name)\n define_method name do |*attrs|\n raise ArgumentError.new(\"wrong number of arguments\") if attrs.size > 1\n send(\"#{name}=\", attrs.first) if attrs.size == 1\n instance_variable_get(\"@#{name}\")\n end\n\n attr_writer name\n end", "def configurable_writer(attribute, code=nil, &block)\n if block_given? and not code\n Halcyon.class.send(:define_method, :\"#{attribute}=\", block)\n elsif code and not block_given?\n Halcyon.class.send(:eval, <<-\"end;\")\n def #{attribute.to_s}=(value)\n #{code % [attribute.to_sym.inspect]}\n end\n end;\n else\n raise ArgumentError.new(\"Either a block or a code string should be supplied.\")\n end\n end", "def method_missing(name, *args, &block)\n if /\\Ahas_validated_(?<type>\\w*)_attribute\\Z/ =~ name\n has_validated_attribute(type, *args, &block)\n else\n super\n end\n end", "def add_checked_attribute(klass, attribute)\n klass.class_eval do\n define_method attribute do\n instance_variable_get(\"@#{attribute}\")\n end\n\n define_method \"#{attribute}=\" do |value|\n raise 'Invalid attribute' unless value\n \n instance_variable_set(\"@#{attribute}\", value)\n end\n end\nend", "def method_missing(meth, *args, &blk)\n match = meth.to_s.match(/^([a-zA-Z\\_]+)(=|$)$/)\n if match\n attribute, setter = match[1], !match[2].blank?\n if setter\n write_attribute(attribute, args.first)\n else\n read_attribute(attribute)\n end\n else\n super(meth, *args, &blk)\n end\n end", "def valid_attributes\n { name: 'do this' }\n end", "def make_attributes_definitions_or_croak(attrArgs, &attrBlok)\n eye = :'m_attrs_defs'\n\n # Work with attribute as strings\n \n $DEBUG && logger_me(eye, logger_fmt_kls(:attrArgs => attrArgs, :attrBlok => attrBlok))\n\n mustbe_attributes_specification_or_croak(attrArgs, eye, \"attrArgs not attributes_specification\")\n \n #STOPATTRARGSINSUPER\n \n #attrAll = mustbe_not_empty_or_croak(mustbe_array_key_or_nil_or_croak(attrArgs, :all, eye, \"all attributes not array\"), eye, \"all attributes is empty\").map(&:to_s)\n attrAll = mustbe_not_empty_or_croak(mustbe_attributes_specification_all_key_or_croak(attrArgs, :all, eye), eye, \"all attributes is empty\").map(&:to_s)\n \n\n #puts(\"\\n\\n\\nATTR ALL >#{attrAll}<\")\n\n #STOPMAKEATTRSPECSENTRY\n\n attrInc = mustbe_attributes_specification_include_key_or_nil_or_croak(attrArgs, :include, eye) # mustbe all strings\n #puts(\"ATTR INC >#{attrInc.class}< >#{attrInc}< >#{is_value_not_empty?(attrInc)}<\")\n attrInc && mustbe_not_empty_or_croak(attrInc, eye, \"include attributes is empty\")\n\n attrExc = mustbe_attributes_specification_exclude_key_or_nil_or_croak(attrArgs, :exclude, eye) || []\n \n attrMapNom = mustbe_attributes_definitions_key_or_nil_or_croak(attrArgs, :definitions, eye) || {}\n attrMap = attrMapNom && potrubi_util_map_hash_kv(attrMapNom) {|k,v| [k.to_s, v]} # keys all strings\n\n # Ensure all consistent\n \n attrInc && mustbe_subset_or_croak(attrInc, attrAll, eye, \"include attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrExc, attrAll, eye, \"exclude attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrMap.keys, attrAll, eye, \"attribute map contains unknown attributes\")\n \n attrUse = ((attrInc || attrAll) - attrExc).uniq # list of unique attributes to report on\n\n # consolidate \"faked up\" attr specs with ones provided to get the composite attrSpecs\n \n attrDefsNom = potrubi_util_array_to_hash(attrUse).merge(attrMap.select {|k,v| attrUse.include?(k)}) # consolidated \"faked up\" attr specs with ones provided\n\n attrDefs = potrubi_util_map_hash_v(attrDefsNom) do | attrName, attrSpecNom|\n\n attrSpec =\n case attrSpecNom\n when NilClass then {}\n when Hash then\n attrSpecNom.each_with_object({}) do | (verbName, verbSpec), h1 |\n case verbName\n when :pass_thru then h1[:pass_thru] = verbSpec # dont touch; just pass through\n when :event_defaults then # add these to pass_thru\n h1[:pass_thru] = (h1[:pass_thru] || {}).merge(verbName => verbSpec)\n when :map, :select, :metric then\n h1[verbName] = {\n :method_name => \"#{verbName}_#{attrName}_#{rand(1000000)}\", # make a unqiue name\n :method_spec => verbSpec # spec must be valid to dynamic_define_methods\n }\n else\n logic_exception(verbName, eye, \"attrName >#{attrName}< verbName >#{verbName}< value should be impossible\")\n end\n end\n \n else\n logic_exception(attrrSpecNom, eye, \"attrSpecNom value should be impossible\")\n end\n\n attrSpec\n \n end\n \n $DEBUG && logger_mx(eye, logger_fmt_kls(:attrDefs => attrDefs))\n\n mustbe_attributes_definitions_or_croak(attrDefs, eye, \"attrDefs failed contract\")\n\n #STOPMAKEATTRSPECS\n \n end", "def create_writer(klass, member)\n # We want to convert these members into attributes just like\n # as if they were declared using attr_accessor.\n new_meth = register MethodObject.new(klass, \"#{member}=\", :instance) do |o|\n o.parameters = [['value', nil]]\n o.signature ||= \"def #{member}=(value)\"\n o.source ||= \"#{o.signature}\\n @#{member} = value\\nend\"\n end\n add_writer_tags(klass, new_meth, member)\n klass.attributes[:instance][member][:write] = new_meth\n end", "def create_setter!\n @target.class_eval <<-EOS\n #{writer_visibility.to_s}\n def #{name}=(value)\n attribute_set(#{name.inspect}, value)\n end\n EOS\n rescue SyntaxError\n raise SyntaxError.new(column)\n end", "def attribute name, type, conditions= DEFAULT_ATTRIBUTE_CONDITIONS\n RMOF.complete_conditions conditions, DEFAULT_ATTRIBUTE_CONDITIONS\n @attributes= {} unless instance_variable_defined? :@attributes\n @attributes[name]= [name, type, conditions]\n unless method_defined? :__attributes then \n define_method( :__attributes) do \n @attributes\n end \n end\n at= \"@#{name}\".to_sym\n getter= \"#{name}\".to_sym\n setter= \"#{name}=\".to_sym\n completion= \"__complete_#{name}\".to_sym\n define_method( getter) do\n if instance_variable_defined? at then instance_variable_get at\n else conditions[:default]\n end\n end\n define_method( setter) do |val|\n instance_variable_set at, val\n end\n define_method( completion) do\n RMOF.validate( self.send(getter), name, type, conditions)\n end\n end", "def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end", "def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end", "def create_setter(name, meth)\n define_method(\"#{meth}=\") do |value|\n write_attribute(name, value)\n end\n end", "def sanitized_allowed_attributes=(attributes); end", "def sanitized_allowed_attributes=(attributes); end", "def oattr(name, type)\n case type\n when :custom\n # Do nothing, just register attr below.\n when :writer\n attr_writer name\n else\n raise ArgumentError, \"Unknown type: #{type.inspect}\"\n end\n\n # Register and return.\n name.tap { oattrs << name}\n end", "def valid_attributes\n { name: \"Expert\" }\n end", "def attributes(*method_names, **options)\n add_attributes(method_names, **options, strategy: :write_value_using_method_strategy)\n end", "def []=(attr_name, value)\n writer_method = \"#{attr_name}=\"\n send(writer_method, value) if respond_to?(writer_method)\n end", "def write_extended_attributes(attrs)\n attrs.each do |k, val|\n self.send((k.to_s + \"=\").to_sym, val) if is_flex_attribute?(k)\n end\n self\n end", "def valid_attributes\n { \"username\" => \"MyString\" }\n end", "def cattr_writer(*fields)\n metaclass.send :attr_writer, *fields\n end", "def write_attribute(attr, value)\n if attribute_encrypted?(attr)\n conductor_for(attr).encrypt(value)\n else\n super(attr, value)\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "def define_attribute_method(attr_name, _owner: generated_attribute_methods)\n CodeGenerator.batch(_owner, __FILE__, __LINE__) do |owner|\n attribute_method_matchers.each do |matcher|\n method_name = matcher.method_name(attr_name)\n\n unless instance_method_already_implemented?(method_name)\n generate_method = \"define_method_#{matcher.target}\"\n\n if respond_to?(generate_method, true)\n send(generate_method, attr_name.to_s, owner: owner)\n else\n define_proxy_call true, owner, method_name, matcher.target, attr_name.to_s\n end\n end\n end\n attribute_method_matchers_cache.clear\n end\n end", "def has_attributes?; end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isExpirationRequired\", @is_expiration_required)\n writer.write_duration_value(\"maximumDuration\", @maximum_duration)\n end", "def add_attributes(item)\n [:class, :instance].each do |attr_loc|\n # Grab attributes for the current location (class or instance)\n attrs = item.attributes[attr_loc]\n attrs.each do |name, attribute|\n reader = attribute[:read]\n writer = attribute[:write]\n\n unless reader || writer\n Logging.warn(\"attribute is not readable or writable somehow, skipping\", attribute)\n next\n end\n\n # Get all given types\n yard_types = []\n if reader\n next if @hide_private && reader.visibility == :private\n yard_types += reader.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n reader.tags('param').flat_map(&:types)\n end\n if writer\n next if @hide_private && writer.visibility == :private\n yard_types += writer.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n writer.tags('param').flat_map(&:types)\n end\n\n # Use untyped if not types specified anywhere, otherwise try to\n # compute Parlour type given all these types\n if yard_types.empty?\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", reader || writer)\n parlour_type = Parlour::Types::Untyped.new\n elsif yard_types.all? { |x| x == 'nil' }\n # Nil attributes are extremely unusual, so just use untyped\n parlour_type = Parlour::Types::Untyped.new\n else\n parlour_type = TypeConverter.yard_to_parlour(\n yard_types, reader || writer, @type_converter_config)\n end\n\n # Generate attribute\n if reader && writer\n kind = :accessor\n elsif reader\n kind = :reader\n elsif writer\n kind = :writer\n end\n\n if @exclude_untyped && parlour_type.is_a?(Parlour::Types::Untyped)\n Logging.omit(\"excluding untyped attribute\", reader || writer, immediate: true)\n next\n end\n\n case @mode\n when :rbi\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n class_attribute: (attr_loc == :class)\n ) do |m|\n add_comments(reader || writer, m)\n end\n when :rbs\n if attr_loc == :class\n # RBS doesn't support class attr_accessors so create individual methods\n\n if reader\n @current_object.create_method(\n name.to_s,\n [Parlour::RbsGenerator::MethodSignature.new([], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(reader, m)\n end\n end\n\n if writer\n @current_object.create_method(\n \"#{name}=\",\n [Parlour::RbsGenerator::MethodSignature.new([Parlour::RbsGenerator::Parameter.new(\n \"value\",\n type: parlour_type,\n required: true\n )], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(writer, m)\n end\n end\n else\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n ) do |m|\n add_comments(reader || writer, m)\n end\n end\n end\n end\n end\n end", "def []=(attr_name, value)\r\n if attr_name.is_a?(String) and attr_name != attr_name.split(ID_SEP).first\r\n attr_name = attr_name.split(ID_SEP)\r\n end\r\n\r\n if attr_name.is_a? Array\r\n value = value.split(ID_SEP) if value.is_a? String\r\n unless value.length == attr_name.length\r\n raise \"Number of attr_names and values do not match\"\r\n end\r\n #breakpoint\r\n [attr_name, value].transpose.map {|name,val| write_attribute(name.to_s, val)}\r\n else\r\n write_attribute(attr_name, value)\r\n end\r\n end", "def attr(symbol, writable=false) end", "def define_writer!(k, definition)\n define_method(\"#{k}=\") do |value|\n # Recursively convert hash and array of hash to schematized objects\n value = ensure_schema value, definition[:schema]\n\n # Initial value\n instance_variable_set \"@#{k}\", value\n\n # Dirty tracking\n self.changed_attributes ||= Set.new\n self.changed_attributes << k\n end\n end", "def validate\n validate_string_attributes\n end", "def write_attribute_with_dynamo(field_name, value)\n if is_dynamo_field?(field_name)\n # Store these guys for now. We don't actually save the field value until the model is saved ( i.e my_supplier.save ).\n # If we were to save the field_value now we wouldn't be able to know the id of the model to link this value to it.\n # @see delay_save\n @all_fields_and_values ||= []\n @all_fields_and_values << {:dynamo_field=>cached_dynamo_field_by_name(field_name), :value=>value}\n end\n # If its a 'normal' attribute let rails write it in the usual way.\n write_attribute_without_dynamo(field_name, value)\n end", "def define_attr_accessor(attr)\n attr_accessor(attr)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_collection_of_object_values(\"attributeMappings\", @attribute_mappings)\n writer.write_boolean_value(\"enabled\", @enabled)\n writer.write_enum_value(\"flowTypes\", @flow_types)\n writer.write_collection_of_object_values(\"metadata\", @metadata)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_object_value(\"scope\", @scope)\n writer.write_string_value(\"sourceObjectName\", @source_object_name)\n writer.write_string_value(\"targetObjectName\", @target_object_name)\n writer.write_additional_data(@additional_data)\n end", "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def valid_attributes\n { }\n end", "def validatable_attributes(atts, opts)\n am, an, ab, m = opts.values_at(:allow_missing, :allow_nil, :allow_blank, :message)\n Array(atts).each do |a|\n next if am && !values.has_key?(a)\n v = send(a)\n next if an && v.nil?\n next if ab && v.respond_to?(:blank?) && v.blank?\n if message = yield(a, v, m)\n errors.add(a, message)\n end\n end\n end", "def valid_attributes\n { }\n end", "def valid_attributes\n { }\n end", "def attribute_name=(_arg0); end", "def attribute_name=(_arg0); end", "def attribute_name=(_arg0); end", "def require_attr(name)\n send(name).tap do |_|\n raise \"Attribute must be set: #{name}\" if _.nil?\n end\n end", "def write_attributes(attributes)\n _attributes = attributes.select do |name, value|\n if self.is_dynamic_field?(name)\n self.dynamic_setter(name, value)\n false\n else\n true\n end\n end\n\n super(_attributes)\n end", "def attribute; end", "def attribute; end" ]
[ "0.6472992", "0.6315012", "0.6315012", "0.62821025", "0.6279224", "0.6211609", "0.61891466", "0.6182247", "0.60683644", "0.6032628", "0.5995443", "0.5988785", "0.5959885", "0.5938289", "0.5931089", "0.58951056", "0.5859927", "0.5851703", "0.58493423", "0.58465594", "0.58328366", "0.5823013", "0.5822229", "0.57850474", "0.5701491", "0.5696689", "0.5682951", "0.5678094", "0.566814", "0.5657499", "0.56555206", "0.5642589", "0.56219065", "0.5615893", "0.56105876", "0.559851", "0.5598089", "0.55940455", "0.5585137", "0.55848545", "0.55796933", "0.5571477", "0.5567006", "0.55667996", "0.55652434", "0.5562926", "0.55600035", "0.55590326", "0.55590326", "0.5554599", "0.5554599", "0.55407417", "0.5534935", "0.5527733", "0.55271375", "0.55238813", "0.5501504", "0.5497003", "0.5496233", "0.54927665", "0.5464706", "0.54617554", "0.5461167", "0.5451583", "0.54498726", "0.54498726", "0.54359984", "0.5430996", "0.5430996", "0.5426488", "0.5418467", "0.54153895", "0.54107565", "0.5407886", "0.5401234", "0.54008496", "0.5400268", "0.53910094", "0.53827274", "0.5377731", "0.5375473", "0.5374833", "0.53720397", "0.5370215", "0.5363264", "0.5361161", "0.5360557", "0.5351706", "0.53514725", "0.53492516", "0.53459316", "0.5341237", "0.5328037", "0.5328037", "0.53230566", "0.53230566", "0.53230566", "0.5319575", "0.531832", "0.5315559", "0.5315559" ]
0.0
-1
Checks equality by comparing each attribute.
def ==(o) return true if self.equal?(o) self.class == o.class && class_id == o.class_id && object_type == o.object_type && compatibility_mode == o.compatibility_mode && controller_key == o.controller_key && device_name == o.device_name && disk_mode == o.disk_mode && disk_type == o.disk_type && key == o.key && limit == o.limit && lun_uuid == o.lun_uuid && serial == o.serial && shares == o.shares && sharing == o.sharing && storage_allocation_type == o.storage_allocation_type && unit_number == o.unit_number && uuid == o.uuid && vdisk_id == o.vdisk_id && vendor == o.vendor && virtual_disk_path == o.virtual_disk_path && vm_identity == o.vm_identity && datastore == o.datastore && virtual_machine == o.virtual_machine && super(o) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ==(other)\n attributes == other.attributes\n end", "def ==(other) # :nodoc:\n @attrs == other.attrs\n end", "def eql?(other)\n return true if self == other\n @@ATTRIBUTES.each do |att|\n return false unless self.send(att).eql?(other.send(att))\n end\n true\n end", "def assert_equal_attributes(object, expected_attributes)\n expected_attributes.each do |index, value|\n assert_equal value, object[index], \"#{index}\"\n end\n end", "def attr_equal?(o)\n self == o and\n self.instance_variables_compare(o).empty? and\n self.attributes == o.attributes\n end", "def same_attributes?(spec)\n @@attributes.all? {|name, default| self.send(name) == spec.send(name) }\n end", "def ==(other)\n self.class.valid_attrs.each do |attr|\n return false if read(attr) != other.read(attr)\n end\n true\n end", "def ==(other)\n self.attributes == (other.respond(:attributes) || {} )\n end", "def ==(other)\n other.present? && self.attributes == other.attributes\n end", "def ==(other)\n return false if other.nil? || !other.respond_to?(:attributes)\n attributes == other.attributes\n end", "def match?(attributes)\n attributes.each do |attr, val|\n return false if send(attr).to_s != val.to_s\n end\n true\n end", "def ==(other)\n self.class == other.class &&\n self.attributes == other.attributes\n end", "def ==(other)\n self.class == other.class &&\n attributes == other.attributes\n end", "def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.send(name) }\n end", "def changed?(comparison)\n attributes.any? do |attribute, value|\n next unless comparison.key?(attribute)\n comparison[attribute] != value\n end\n end", "def ==(other)\n return false unless self.class == other.class\n self.attributes == other.attributes\n end", "def ==(other)\n if other.kind_of? Details::Attribute\n self.name == other.name && self.value == other.value\n else\n self.value == other\n end\n end", "def ==(other)\n return false unless other.instance_of? self.class\n attributes == other.attributes\n end", "def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.attributes[name] }\n end", "def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.attributes[name] }\n end", "def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.attributes[name] }\n end", "def ==(other)\n Attribute === other && \n !(Expression === other) &&\n relation == other.relation && \n name == other.name && \n self.alias == other.alias && \n original_relation == other.original_relation\n end", "def ==(obj)\n if obj.instance_of?(self.class)\n compare_attributes = [\"category_id\", \"combo_item_id\", \"quantity\", \"sequence\"]\n compare_attributes.each do |field|\n if self.send(field) != obj.send(field)\n return false\n end\n end\n return true\n end\n return false\n end", "def ==(other)\n return false if other.class != self.class\n attr_hash == other.attr_hash\n end", "def ==(other)\n case other\n when Chair::Row\n @attributes == other.instance_variable_get('@attributes')\n when Array\n @attributes.values == other\n else false\n end\n end", "def == other\n return false unless other.kind_of? self.class\n attribute_of.all? do |key, val|\n val.get == other.__send__(key)\n end\n end", "def correct_combination?(attr1, attr2, attr3)\n result = false\n if attr1 == attr2 && attr2 == attr3\n result = true\n elsif attr1 != attr2 && attr2 != attr3 && attr1 != attr3\n result = true\n end\n return result\n end", "def ==(other)\n return false if self.class != other.class\n return super if @_lazer_model.required_properties.empty?\n @_lazer_model.required_properties.each do |key_name|\n return false if read_attribute(key_name) != other.read_attribute(key_name)\n end\n true\n end", "def eql?(other)\n other.is_a?(self.class) && !self.class.comparison_attrs.find{|a| send(a) != other.send(a)}\n end", "def verify_attributes(hash, expected)\n return [] unless expected.attributes\n expected.attributes.map{ |a| verify_attribute_value(hash[a.name.to_s], a) }\n end", "def assert_attributes obj, attr_hash\n default_attr_hash = {}\n if obj.respond_to? :default_attr_hash\n default_attr_hash = obj.default_attr_hash\n end\n default_attr_hash.merge(attr_hash).each_pair do |key, value|\n assert_equal value, obj.__send__(key), \"Attribute #{key} of #{obj}\"\n end\n end", "def match_attributes(attrs)\n attrs = Saxxy::Helpers.stringify_keys(attrs)\n attributes.reduce(true) do |b, (k, v)|\n value = attrs[k]\n b && ((!value.nil? && match(v, value)) || (v.nil? && value.nil?))\n end\n end", "def equal_set(expected)\n message = \"#{Helpers.inspect_records(@object)} has the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id).sort\n right = expected.map(&:id).sort\n \n test_case.assert(left != right, message)\n end", "def ===(other)\n required = self.class.required_attributes\n\n other.respond_to?(:keys) && (common = other.keys & required) &&\n common.size == other.keys.size && common.size == required.size\n end", "def bt_same_value?(other)\n bt_value_attributes == other.bt_value_attributes\n end", "def ==(x)\n return true if object_id == x.object_id\n return false unless x.kind_of?(AttrArray)\n each_with_index do |a, n|\n return false unless a == x[n]\n end\n true\n end", "def equal_set(expected)\n message = \"#{Helpers.inspect_records(@object)} does not have the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id).sort\n right = expected.map(&:id).sort\n \n test_case.assert(left == right, message)\n end", "def compare_attributes(data_criteria, criteria)\n return false unless data_criteria['dataElementAttributes']&.any?\n\n data_criteria['dataElementAttributes'].map { |dc| dc.except('_id') }.include? criteria['dataElementAttributes'][attribute_index].except('_id')\n end", "def ==(other)\n @klass == other.class && @attributes == strip_active_record(other)\n end", "def ==(other)\n other.is_a?(self.class) &&\n other.attribute == attribute &&\n other.validation == validation &&\n other.expected == expected &&\n other.actual == actual\n end", "def == other\n return false unless self.class == other.class\n [:unit, :frequency, :anchor, :weeks, :monthdays, :weekdays, :times].all? do |attribute|\n self.send(attribute) == other.send(attribute)\n end\n end", "def compare_equal?(item, line_item)\n ![\n :ax_account_number,\n :ax_account_id,\n :ax_order_number,\n :ax_order_id,\n :email_address,\n :first_name,\n :last_name,\n :serial_number,\n :purch_order_form_num\n ].detect { |attr| item.send(attr) != line_item.send(attr) }\n end", "def ==(b) # :nodoc:\n ( b.respond_to?(:result_attributes) &&\n result_attributes == b.result_attributes && \n @result_attributes.all?{ |k| send(k) == b.send(k) } )\n end", "def validates_different(*attr_names)\n validates_with ValidatesAll::DifferenceValidator, _merge_attributes(attr_names)\n end", "def identical?\n #Song.first.attributes.each { |v,k| Song.find(:all, :conditions => [\" #{v} like ?\", \"%blah%\"])}\n Song.find(:all, :conditions => [\"name = ? or length = ?\", \"#{self.name}\", self.length]) do |x| \n x.hash == self.hash\n end\n end", "def diff?(model = self.class.find(id))\n self.class.diffable_attributes.each do |attribute|\n return true if send(attribute) != model.send(attribute)\n end\n return false\n end", "def filter_attributes_match?(hash_one, hash_two)\n hash_one.all? do |key, value_one|\n value_two = hash_two[key]\n case\n when value_one == value_two\n true\n when value_one.is_a?(Hash) && value_two.is_a?(Hash)\n filter_attributes_match?(value_one, value_two)\n when hash_one[key].to_s == hash_two[key].to_s\n true\n when value_one.is_a?(String) && value_one.start_with?(\"eval:\")\n eval_attribute_value(value_one, value_two)\n else\n false\n end\n end\n end", "def comparable_attributes\n#\t\tHashWithIndifferentAccess[attributes.select {|k,v| \n#\t\t\t!Abstract.incomparable_attribute_names.include?(k)}]\n\t\tHashWithIndifferentAccess[attributes.select {|k,v| db_fields.include?(k)}]\n\tend", "def all_equal?\n a = self.first\n all? { |b| a == b }\n end", "def check_attrs(attr_list)\r\n attrs = []\r\n attr_list.each do |attr_sym|\r\n attr = assigns(attr_sym.to_sym)\r\n assert_not_nil attr, \"Attribute @#{attr_sym} should not be nil\"\r\n assert !attr.new_record?, \"Should have saved the @#{attr_sym} obj\" if attr.class == ActiveRecord\r\n attrs << attr\r\n end\r\n attrs.length > 1 ? attrs : attrs[0]\r\n end", "def check_attrs(attr_list)\r\n attrs = []\r\n attr_list.each do |attr_sym|\r\n attr = assigns(attr_sym.to_sym)\r\n assert_not_nil attr, \"Attribute @#{attr_sym} should not be nil\"\r\n assert !attr.new_record?, \"Should have saved the @#{attr_sym} obj\" if attr.class == ActiveRecord\r\n attrs << attr\r\n end\r\n attrs.length > 1 ? attrs : attrs[0]\r\n end", "def attr_set?(cards, attr)\n array = []\n cards.each do |card|\n # evalutes the string 'attr' and returns the value\n array << card.send(attr)\n end\n\n # only return true if it's all the same or totally different\n return true if array.uniq.count == 1\n return true if array.uniq.count == 3\n return false\n end", "def attribute_changed?(attribute_name)\n (self.diff['attributes']['new']||{})[attribute] != (self.diff['attributes']['old']||{})[attribute]\n end", "def eql?(other)\n return false if (other.nil? or self.class != other.class)\n return false unless super(other)\n return false unless self.attributes == other.attributes\n return false unless self.nodes == other.nodes\n true\n end", "def eql?(other)\n return false unless self.class == other.class\n self.key_attributes == other.key_attributes\n end", "def uniquify_attributes(attributes)\n attributes.each do |ka|\n oldval = send(ka)\n next unless String === oldval\n newval = UniquifierCache.instance.get(self, oldval)\n set_property_value(ka, newval)\n logger.debug { \"Reset #{qp} #{ka} from #{oldval} to unique value #{newval}.\" }\n end\n end", "def eql?(object)\n self.class.equal?(object.class) && attributes == object.attributes\n end", "def multi_element_attr_check( elements )\n wanted = Array.new\n found = Array.new\n elements.each do |element|\n print \".\"\n e = $driver.find_element(element[0].to_sym, element[1])\n wanted << [ element[1], element[2], element[3] ]\n found << [ element[1], element[2], e.attribute(element[2]) ]\n end\n\n found.should == wanted\n end", "def equals(rule)\n element == rule.element && attributes == rule.attributes\n end", "def attr_reader(*args)\n super\n comparison_attrs.concat(args)\n end", "def xml_nodes_match_attrs(xml_nodes, attrs, mismatches = [])\n attrs.each_with_index.each { |attr_set, idx|\n xn = xml_nodes[idx]\n attr_set.each { |(attr_key, attr_val)|\n # Either call method, or hash key, or recurse on children\n # p.name vs. p[:name]\n if :children == attr_key\n # recurse over children\n xml_nodes_match_attrs(xn.children, attr_val, mismatches)\n else\n # compare attrs\n xn_val = xn.methods.include?(attr_key) ? xn.send(attr_key) : xn[attr_key]\n if xn_val != attr_val\n mismatches << { node: xn.name_and_class_path, attr: \"#{ attr_key }: expected #{ attr_val.inspect }, got #{ xn_val.inspect }\" }\n end\n end\n }\n }\n mismatches\n end", "def matches_state_attrs?\n @expected_attrs == state_attrs\n end", "def equal_list(expected)\n message = \"#{Helpers.inspect_records(@object)} has the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id)\n right = expected.map(&:id)\n \n test_case.assert(left != right, message)\n end", "def eql?(other)\n return false unless super(other)\n return false unless attributes == other.attributes\n return false unless content == other.content\n\n true\n end", "def ==(other)\n return true if other.equal?(self)\n return false unless other.instance_of?(self.class)\n\n self.class.attributes.inject(true) do |memo, attribute|\n attribute_name = attribute.first\n attribute_type = attribute.last[:type]\n\n # Skip associations\n if attribute_type.include?(LazyResource::Resource) || (attribute_type.is_a?(::Array) && attribute_type.first.include?(LazyResource::Resource))\n memo\n else\n memo && self.send(:\"#{attribute_name}\") == other.send(:\"#{attribute_name}\")\n end\n end\n end", "def matches? item, attributes\n\n attributes.map { |attribute, value|\n\n item.send(attribute) == value\n\n }.flatten == [true]\n\n end", "def ==( other ) \n\t\t\tcomparison_attributes = lambda{ |area| [ area.area_desc, area.altitude, area.ceiling, area.circles, area.geocodes, area.polygons ]}\n\t\t\tcomparison_attributes.call( self ) == comparison_attributes.call( other )\n\t\tend", "def all_obs_same_attr?(observations, attr)\n exemplar = observations.first.send(attr)\n observations.all? { |o| o.send(attr) == exemplar }\n end", "def eql?(*) end", "def eql?(other)\n return true if equal?(other)\n return false unless self == other\n [:id, :fide_id, :rating, :fide_rating, :title, :gender].each do |m|\n return false if self.send(m) && other.send(m) && self.send(m) != other.send(m)\n end\n true\n end", "def match\n @matches = attributes_enumerator.map do |(type, value), index|\n attribute_name = self.class.names[index]\n attributes.store(\n attribute_name, type.match(value, context: @context.dup)\n )\n end\n return if (failures = @matches.select(&:invalid?)).empty?\n failures.unshift(failure).reduce(:merge!)\n end", "def ==(val)\n if val.is_a?(Model)\n # Use normal comparison for a model\n super\n else\n # Compare to attributes otherwise\n attributes == val\n end\n end", "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n attribute == o.attribute &&\n statistics == o.statistics &&\n other == o.other &&\n total == o.total &&\n missing == o.missing &&\n term_count == o.term_count &&\n term_type == o.term_type &&\n terms == o.terms\n end", "def ==(*several_variants)\n #This is a stub, used for indexing\n end", "def is_equal?(a)\n @amount == a.amount && @code == a.code\n end", "def equal_list(expected)\n message = \"#{Helpers.inspect_records(@object)} does not have the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id)\n right = expected.map(&:id)\n \n test_case.assert(left == right, message)\n end", "def comparison_attributes\n except_list = ['id', 'updated_at', 'created_at', 'verified_at']\n except_list << 'alternative_phone' unless Spree::Config[:alternative_shipping_phone]\n except_list << 'company' unless Spree::Config[:company]\n\n a = attributes.except(*except_list)\n a.each{|k, v|\n if v.is_a?(String)\n v = v.downcase.strip.gsub(/\\s+/, ' ')\n a[k] = v.present? ? v : nil\n end\n }\n a['state_name'] = nil if a['state_name'].blank?\n a\n end", "def multi_element_attr_match( elements )\n elements.each do |element|\n print \".\"\n wait_for_element(element[0].to_sym, element[1])\n check_attribute_match(element[0].to_sym, element[1], element[2], element[3])\n end\n end", "def xml_should_eql(actual, expected)\n same = xml_cmp(actual, expected)\n actual.should.== expected unless same \nend", "def test_equality_simple\n value1_ = ::Versionomy.create(:major => 2, :minor => 0, :release_type => :alpha, :alpha_version => 5)\n value2_ = ::Versionomy.create(:major => 2, :release_type => :alpha, :alpha_version => 5)\n assert_equal(value2_, value1_)\n assert_equal(value2_.hash, value1_.hash)\n end", "def ==(other)\n other.is_a?(self.class) &&\n name == other.name &&\n attributes == other.attributes\n end", "def changes(attrs1, attrs2)\n old_attrs = attrs1.slice(*GENERATED_ATTRS)\n new_attrs = attrs2.slice(*GENERATED_ATTRS)\n\n return if old_attrs == new_attrs\n old_attrs.each do |k, v|\n next if new_attrs[k] == v\n @changes << Change.new(nil, k, v, new_attrs[k]) \n end\n end", "def tdiff_equal(node)\n if (self.class == node.class)\n case node\n when Nokogiri::XML::Attr\n (self.name == node.name && self.value == node.value)\n when Nokogiri::XML::Element, Nokogiri::XML::DTD\n self.name == node.name\n when Nokogiri::XML::Text, Nokogiri::XML::Comment\n self.text == node.text\n when Nokogiri::XML::ProcessingInstruction\n (self.name == node.name && self.content = self.content)\n else\n false\n end\n else\n false\n end\n end", "def ==(other)\n name == other.name &&\n color == other.color &&\n age == other.age\n end", "def more_desirable?(attribute_id1, attribute_id2)\n attribute_id1 < attribute_id2\n end", "def isSame(tab)\n for x in 0..3\n for y in 0..3\n return(false) if (self.val(x,y) != tab.val(x,y)) ;\n end\n end\n return true ;\n end", "def ==(other)\n # If the classes don't match, they cannot possibly be equal.\n if self.class != other.class\n return false\n end\n\n # If the persisted state doesn't match, they also can never be equal.\n if persisted? != other.persisted?\n return false\n end\n\n # When persisted, check the other's id to see if it's the same,\n # cannot possible be equals if they have different ids.\n if persisted? && id != other.id\n return false\n end\n\n # Finally, compare the attributes hash. If all key/values match,\n # they are considered equal.\n attributes == other.attributes\n end", "def ==(other)\n self.class == other.class &&\n attributes[\"_id\"] == other.attributes[\"_id\"]\n end", "def assert_same_values(expected, actual)\n actual.each_pair do |k,v|\n next unless expected[k]\n assert_equal expected[k], v, \"Values for #{k} are not matching\"\n end\n end", "def assert_equivalent_xml(expected, actual)\n expected_xml = Nokogiri::XML(\"<test-xml>\\n#{expected}\\n</test-xml>\")\n actual_xml = Nokogiri::XML(\"<test-xml>\\n#{actual}\\n</test-xml>\")\n ignored_attributes = %w(style data-disable-with)\n\n equivalent = EquivalentXml.equivalent?(expected_xml, actual_xml, {\n ignore_attr_values: ignored_attributes\n }) do |a, b, result|\n if result === false && b.is_a?(Nokogiri::XML::Element)\n if b.attr('name') == 'utf8'\n # Handle wrapped utf8 hidden field for Rails 4.2+\n result = EquivalentXml.equivalent?(a.child, b)\n end\n if b.delete('data-disable-with')\n # Remove data-disable-with for Rails 5+\n # Workaround because ignoring in EquivalentXml doesn't work\n result = EquivalentXml.equivalent?(a, b)\n end\n if a.attr('type') == 'datetime' && b.attr('type') == 'datetime-local'\n a.delete('type')\n b.delete('type')\n # Handle new datetime type for Rails 5+\n result = EquivalentXml.equivalent?(a, b)\n end\n end\n result\n end\n\n assert equivalent, lambda {\n # using a lambda because diffing is expensive\n Diffy::Diff.new(\n sort_attributes(expected_xml.root),\n sort_attributes(actual_xml.root)\n ).to_s(:color)\n }\n end", "def sync_duplicate_obj_attributes(obj1, obj2)\n duplicate_keys.each do |key|\n unless obj1[key].blank? && obj2[key].blank?\n if obj1[key].blank?\n obj1.send(\"#{key}=\", obj2[key])\n elsif obj2[key].blank?\n obj2.send(\"#{key}=\", obj1[key])\n else # Each obj has a value\n if obj1[key] != obj2[key]\n raise ArgumentError, \"#{key} attribute values on the two objects don't match: #{obj1[key]} vs #{obj2[key]}\"\n end\n end\n end\n end\n end", "def eql?(other)\n return true if equal?(other)\n\n # two instances for different models cannot be equivalent\n return false unless other.kind_of?(model)\n\n # two instances with different keys cannot be equivalent\n return false if key != other.key\n\n # neither object has changed since loaded, so they are equivalent\n return true if repository == other.repository && !dirty? && !other.dirty?\n\n # get all the loaded and non-loaded properties that are not keys,\n # since the key comparison was performed earlier\n loaded, not_loaded = properties.select { |p| !p.key? }.partition do |property|\n attribute_loaded?(property.name) && other.attribute_loaded?(property.name)\n end\n\n # check all loaded properties, and then all unloaded properties\n (loaded + not_loaded).all? { |p| p.get(self) == p.get(other) }\n end", "def assert_event_are_light_equal e1, e2\n return false if e1.class != e2.class\n\n [:subject, :event, :moodid,\n :mood, :music, :location, :taglist, :pickeyword,\n :preformatted, :backdated, :comments, :security, :allowmask,\n :screening,].each do |attr|\n return false if e1.send(attr) != e2.send(attr)\n end\n\n e1.compare_time(e2)\n end", "def eql(expected)\n set_relativity(:eql, expected)\n end", "def modified?( original )\n DATA_ATTRIBUTES.any? { |e| send( e ) != original.send( e )}\n end", "def ==(other)\n @name == other.name && @amount == other.amount\n end", "def ==(other)\n other.kind_of?(self.class) &&\n @name == other.name && @columns == other.columns && @unique == other.unique?\n end", "def match_same_name_attributes(*options)\n\n options = options.extract_options!\n same_name_attributes = @from_table.columns.map(&:name) & @to_table.columns.map(&:name)\n\n if same_name_attributes\n same_name_attributes = columns_from_options(same_name_attributes, options)\n same_name_attributes.each do |same_name_attribute|\n from same_name_attribute, :to => same_name_attribute\n end\n end\n end", "def equal_pair(key, request)\n if @event[\"required\"][key] == request[\"object_attributes\"][key] || event[\"required\"][key] == \"\"\n true\n else\n false\n end\n end", "def assert_equal(att, value, error = [att, :not_equal])\n assert value === send(att), error\n end", "def validate\n matched = {}\n duplicated_attributes = []\n attributes.each do |attribute|\n if matched.has_key?(attribute.name) && matched[attribute.name] == attribute.name_format\n duplicated_attributes << attribute.name unless duplicated_attributes.include?(attribute.name)\n else\n matched[attribute.name] = attribute.name_format\n end\n end\n if !duplicated_attributes.empty?\n raise ValidationError, \"An attribute with the same name and name format may only be specified once. The following attributes were specified multiple times: #{duplicated_attributes.join(',')}\"\n end\n end" ]
[ "0.7291717", "0.7188103", "0.70395297", "0.7007927", "0.68874705", "0.6861532", "0.6707156", "0.6660597", "0.66147524", "0.658478", "0.6584619", "0.6580019", "0.65543133", "0.6543933", "0.65068495", "0.6479513", "0.6456241", "0.6415999", "0.6412208", "0.6412208", "0.6412208", "0.6411266", "0.6380575", "0.63775986", "0.6260147", "0.6246534", "0.6240681", "0.62150854", "0.62014365", "0.6186426", "0.61837834", "0.6164858", "0.61304426", "0.61149454", "0.6097789", "0.6083095", "0.6078927", "0.6067201", "0.60053444", "0.59974694", "0.5994989", "0.5991373", "0.59856457", "0.5985243", "0.5977118", "0.59521115", "0.59428704", "0.59311265", "0.59247756", "0.5921222", "0.5921222", "0.59095234", "0.58795947", "0.58789194", "0.5870439", "0.58598673", "0.58571184", "0.5856412", "0.5855177", "0.58480394", "0.5847516", "0.58370507", "0.5799985", "0.5795313", "0.57880926", "0.57823527", "0.57788265", "0.5776185", "0.57670164", "0.5759791", "0.5758563", "0.5753949", "0.57518554", "0.5750137", "0.57385117", "0.57309806", "0.5729126", "0.572618", "0.57250285", "0.57210624", "0.5712646", "0.5710082", "0.57059866", "0.57036847", "0.5702592", "0.5690256", "0.5674193", "0.56433815", "0.5641553", "0.56216776", "0.56148046", "0.5591313", "0.5587681", "0.55836356", "0.5569298", "0.5550885", "0.5546161", "0.5545665", "0.55422115", "0.5539372", "0.5529004" ]
0.0
-1
Calculates hash code according to all attributes.
def hash [class_id, object_type, compatibility_mode, controller_key, device_name, disk_mode, disk_type, key, limit, lun_uuid, serial, shares, sharing, storage_allocation_type, unit_number, uuid, vdisk_id, vendor, virtual_disk_path, vm_identity, datastore, virtual_machine].hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\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 code = 17\n code = 37*code + @x.hash\n code = 37*code + @y.hash\n # Add lines like this for each significant instance variable\n code # Return the resulting code\n end", "def hash(*) end", "def hash\n code = 17\n code = 37 * code\n self.instance_variables.each do |v|\n code += self.instance_variable_get(v).hash\n end\n code\n end", "def hash_code; 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 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 prime = 31\n result = 1\n result = result * prime + (@decision_target == nil ? 0 : @decision_target.hash)\n result = prime * result + (@string_id == nil ? 0 : @string_id.hash)\n result\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; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; 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 raw = [name, type, values.join('/')].join(' ')\n Digest::MD5.hexdigest(raw)\n end", "def hash\n size.hash ^ rank.hash\n end", "def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end", "def hash\n @hash || calculate_hash!\n end", "def hash\n return name.hash ^ direction.hash ^ lhs.hash ^ rhs.hash\n end", "def hash\n value = 0\n my_rows = @rows\n r_size = my_rows.size\n for i in 0..r_size-1 do\n a_row = my_rows[i]\n a_size = a_row.size\n for j in 0..a_size-1 do\n value ^= a_row[j].hash\n end\n end\n return value\n end", "def hash\n id.hash + 32 * bs_request.hash\n end", "def do_hash(input)\n a = OpenSSL::Digest.hexdigest(\"SHA224\", input).to_i % 19\n b = OpenSSL::Digest.hexdigest(\"SHA512\", input).to_i % 19\n [a, b]\n end", "def hash\n type.hash ^ (id.hash >> 1)\n end", "def hash\n [self.class, self.val, self.attribute].hash\n end", "def hash\n 0\n end", "def hash # :nodoc:\n identifier.hash ^ requirement.hash\n end", "def hash\n self.class.hash ^ key_attributes.hash\n 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 hash\n h = @e.nil? ? 0 : @e\n h = (h << 1) ^ @r.hash\n h = (h << 1) ^ @v.hash\n end", "def hash() source.hash ^ (target.hash+1); end", "def hash() source.hash ^ (target.hash+1); end", "def hash\n\t\t\"#{@x}#{@y}\".hash\n\tend", "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_code\n prime = 31\n result = 1\n result = prime * result + x\n result = prime * result + y\n return result;\n end", "def hash\n self.class.hash ^ operand.hash\n end", "def hash!\n\t\t@@email.downcase!\n\t\thash = Digest::MD5.hexdigest(@@email)\n\t\treturn hash\n\tend", "def hash\n [anchor, cv, nullifier, proof, rk, spend_auth_sig].hash\n end", "def hash\n ([self.class] + self.class.comparison_attrs.map{|x| send(x)}).hash\n end", "def hash\n @symbols.hash + 37*positive?.hash\n end", "def calculate_unique_hash\n unique = ''\n unique += self.content if self.content.present?\n unique += self.summary if self.summary.present?\n unique += self.title if self.title.present?\n self.unique_hash = Digest::MD5.hexdigest unique\n end", "def hash()\n #This is a stub, used for indexing\n end", "def hash\n # Memoizing such a simple hash value seems silly, however the\n # profiler showed the Card#hash method as having 22% of the runtime. My\n # memoizing the hash value that was reduced to 12%.\n return @hash unless @hash.nil?\n @hash = @value.hash ^ @suit.hash\n end", "def hash=(_arg0); 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 hash\n num = 0\n self.each do |k,v|\n if k.is_a?(Integer) && v.is_a?(Integer)\n num += k * 26 + v\n elsif k.is_a?(Integer) && !v.is_a?(Integer)\n num += k * 26 + ALPHA_NUMBERS[v.to_s.downcase]\n elsif v.is_a?(Integer) && !k.is_a?(Integer)\n num += v * 26 + ALPHA_NUMBERS[k.to_s.downcase]\n elsif !k.nil? && !v.nil?\n num += ALPHA_NUMBERS[k.to_s.downcase] * ALPHA_NUMBERS[v.to_s.downcase]\n end\n end\n num\n end", "def hash\r\n\t\treturn @name.hash() + @type.hash()\r\n\tend", "def hash\n return @hash_code if defined? @hash_code\n @hash_code = usual_equal_object.hash\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; end", "def hash; end", "def hash; end", "def hash\n [oct, pc].hash\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 hash\n code.hash\n end", "def hash # :nodoc:\n name.hash ^ type.hash ^ requirement.hash\n end", "def hash\n @vbits.hash\n end", "def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end", "def hash\n if @sha512hash != nil\n return @sha512hash.to_i(16)\n else\n super\n end\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 [lac, cid, radio, mcc, mnc, signal, psc, asu, ta].hash\n end", "def calculate_checksum\n last_checksum = previous_event&.checksum\n attrs = attributes.except(\"checksum\", \"id\", \"updated_at\").merge(last_checksum: last_checksum)\n cs = Digest::SHA256.hexdigest(attrs.to_s)\n puts \"#{id} calculate_checksum: #{cs} <- #{attrs} \" if Rails.env.development?\n Rails.logger.info(\"#{id} calculate_checksum: #{cs} <- #{attrs} \")\n return cs\n end", "def hash\n code.hash\n end", "def hash\n\t\t[@a, @b, self.class::D].hash\n\tend", "def consistent_hash\n Zlib.crc32(self.to_yaml, 0)\n end", "def hash\n @hash[:perm_type].hash ^\n @hash[:perms].hash ^\n @hash[:inheritance].hash ^\n @hash[:target].hash\n end", "def hash( *strs )\n return Digest::MD5.hexdigest( strs.join )\n end", "def hash\n @rank.hash ^ @suit.hash\n end", "def hash\n return Digest::MD5.hexdigest(self.describe(' '))\n end", "def hash\n @real.hash ^ @image.hash\n end", "def to_hash() end", "def hash_length\n super\n end", "def hash_hash(h)\n require 'digest/md5'\n Digest::MD5.hexdigest(Marshal::dump(h.sort))\n end", "def hash() source.hash ^ target.hash; end", "def hash\n [first_name, last_name, address_one, address_two, city, state, zip, phone, email, country_code].hash\n end", "def calculate_hash(input, prep_hashes)\n result = 0\n input.unpack('U*').each do |x|\n result += prep_hashes.hash(x)\n end\n (result % MOD_VALUE).to_s(HEX)\nend", "def c_hash\n sha256 = Digest::SHA256.new\n token = @code.token.token\n hashed_token = sha256.digest(token)\n first_half = hashed_token[0...hashed_token.length / 2]\n Base64.urlsafe_encode64(first_half).tr('=', '')\n end", "def hash(block)\n Digest::SHA256.hexdigest(block.to_s.encode)\n end", "def calculate_hash\n\t\toptions = {:firstname => firstname, :email => email, :phone => phone, :txnid => txnid, :surl => surl, :furl => furl, :productinfo => productinfo, :amount => amount}\n\t\tservice = PayuIndia::Helper.new(payment_gateway_key, payment_gateway_salt, options)\n\t\tself.hast = service.generate_checksum\n\tend", "def hash\n [rank, suit].hash\n end", "def hash\n self.class.hash ^ left.hash ^ right.hash\n end", "def generate_hash(*args)\n Digest::SHA3.hexdigest(args.join(''))\n end", "def hash_code\n hash_code = {}\n self.seq.each do |letter|\n hash_code.keys.include?(letter) ? hash_code[letter] += 1 : hash_code[letter] = 1\n end\n hash_code\n end", "def hashify_attributes(attrs)\n Hash.new.tap{ |h| attrs.each{|a| h[a] = self.send(a)} }\n end", "def hash\n\n self.h.fei.hash\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 attributes.hash\n end", "def hash\n attributes.hash\n end" ]
[ "0.7118691", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.70400536", "0.68960655", "0.67847186", "0.6707762", "0.670052", "0.6688737", "0.66705376", "0.6489735", "0.6462376", "0.6462376", "0.64444333", "0.6413127", "0.6395483", "0.63898623", "0.6372129", "0.635671", "0.63370055", "0.62682766", "0.62533766", "0.6246914", "0.6230963", "0.62173444", "0.6214272", "0.6214131", "0.61962456", "0.619165", "0.61866295", "0.6185355", "0.6185355", "0.6153702", "0.6145376", "0.6144877", "0.6139152", "0.6128312", "0.61224943", "0.61217207", "0.61205214", "0.61041045", "0.61000645", "0.60937095", "0.60931146", "0.60818595", "0.60811466", "0.60500103", "0.60322344", "0.6022704", "0.6020012", "0.6020012", "0.6020012", "0.6020012", "0.6020012", "0.6020012", "0.6020012", "0.6020012", "0.6020012", "0.6020012", "0.60178953", "0.6014942", "0.5997442", "0.59880185", "0.598736", "0.59799886", "0.5972682", "0.5969595", "0.5969411", "0.59594935", "0.5957466", "0.59423596", "0.5942144", "0.59245354", "0.5924357", "0.5904946", "0.59025365", "0.58536685", "0.5847055", "0.58454466", "0.5845053", "0.58447546", "0.5844059", "0.5842638", "0.5840575", "0.58391696", "0.5825819", "0.5824118", "0.5823615", "0.58184344", "0.5815284", "0.58124787", "0.5810309", "0.5808056", "0.5808056", "0.5808056", "0.5806852", "0.5806852" ]
0.0
-1
Builds the object from hash
def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) super(attributes) VirtualizationVmwareVirtualDisk.openapi_types.each_pair do |key, type| if attributes[VirtualizationVmwareVirtualDisk.attribute_map[key]].nil? && VirtualizationVmwareVirtualDisk.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[VirtualizationVmwareVirtualDisk.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[VirtualizationVmwareVirtualDisk.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[VirtualizationVmwareVirtualDisk.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[VirtualizationVmwareVirtualDisk.attribute_map[key]])) end end self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(hash)\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v if variables[k]\n end\n return obj\n end", "def build_from_hash(attributes)\n\n end", "def build_from_hash(hash)\n instance = self.new\n\n # Add the instance attributes dynamically from the hash. If the attribute\n # does not already exist, then don't re-add the attribute class and\n # variable, just set it with the value from the hash\n hash.keys.each do |key|\n class_eval { attr_accessor key } unless instance.methods.include?(key.to_sym)\n instance.instance_variable_set \"@#{key}\", hash[key]\n end\n\n instance\n end", "def build(hash, track_changes = true)\n resource = fields.each_with_object(new) do |field, r|\n value = hash.fetch(field.to_s, hash[field.to_sym])\n r.send(\"#{field}=\", value)\n end\n resource.clear_changes! unless track_changes\n resource\n end", "def initialize hash\n @hash = hash\n end", "def build(params)\n return new(params) if params.is_a?(Hash)\n raise(\"unexpected parameter, expected Hash, received #{params.class}\")\n end", "def initialize( hash )\n\t\t\t@hash = hash.dup\n\t\t\t@dirty = false\n\t\tend", "def initialize(a_hash)\n from_h(a_hash)\n end", "def initialize\n\t\t\t@hash = {}\n\t\tend", "def initialize(hash)\n @hash = hash\n @converted = {}\n end", "def initialize(hash)\n @short_code = hash[\"short_code\"]\n @name = hash[\"name\"]\n @id = hash[\"id\"]\n end", "def initialize(hash)\n super(hash)\n end", "def initialize\n @h = new_hash\n end", "def new_from_hash(hash)\n if hash == nil\n self.class.new.assign(self)\n else\n hash_obj = hash\n if hash.instance_of?(Hash)\n hash_obj = self.class.new\n merge_hash_into_object(hash, hash_obj)\n end\n instance = self.class.new\n object_assign(instance, hash_obj)\n end\n end", "def initialize(hash={})\n @hash = hash\n end", "def initialize\n @hash = {}\n end", "def initialize\n @hash = {}\n end", "def initialize(hash)\r\n hash.each { |k, v|\r\n # Create getters and setters\r\n self.class.attr_accessor(k)\r\n # Set value for created variable\r\n self.send(\"#{k}=\", v)\r\n }\r\n self.class.all.push(self)\r\n end", "def build!(hash)\n hash.must(::Hash) { raise ArgumentError, \"#{self} expects Hash, but got #{hash.class}\" }\n\n if hash.size != variables.size\n keys1 = variables.keys\n keys2 = hash.keys.map(&:to_s)\n minus = (keys1 - keys2).map{|i| \"-#{i}\"}\n plus = (keys2 - keys1).map{|i| \"+#{i}\"}\n \n msg = \"#{self} expects #{variables.size}, but got #{hash.size} (%s)\" % (minus + plus).join(\",\")\n raise Typed::SizeMismatch, msg\n end\n\n # 'build' just ignore unknown fields, but 'build!' raise errors\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v\n end\n return obj\n end", "def initialize(hash)\n @cw_id = hash[\"cw_id\"]\n @cik = hash[\"cik\"]\n @name = hash[\"company_name\"]\n @irs_number = hash[\"irs_number\"]\n @sic_code = hash[\"sic_code\"]\n @industry = hash[\"industry_name\"]\n @sic_sector = hash[\"sic_sector\"]\n @sector_name = hash[\"sector_name\"]\n @source_type = hash[\"source_type\"]\n @address = hash[\"raw_address\"]\n @country = hash[\"country_code\"]\n @state = hash[\"subdiv_code\"]\n @top_parent_id = hash[\"top_parent_id\"]\n @num_parents = hash[\"num_parents\"]\n @num_children = hash[\"num_children\"]\n @max_year = hash[\"max_year\"]\n @min_year = hash[\"min_year\"]\n end", "def from_hash(hash)\n instance = allocate\n instance.instance_variable_set :@attributes, hash.freeze\n instance\n end", "def from_hash(hash)\n hash = DEFAULTS.merge(hash)\n hash['spdx_id'] = hash.delete('spdx-id')\n ordered_array = hash.values_at(*members.map(&:to_s))\n new(*ordered_array)\n end", "def initialize(hash=nil)\n @table = HashWithIndifferentAccess.new\n\n for k,v in hash\n @table[k] = v\n new_ostruct_member(k)\n end if hash\n end", "def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end", "def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end", "def initialize(hash)\n @hash = hash\n @data = resourcify_data\n end", "def from_hash hash\n @id= hash['id']\n\n @admin= hash['admin']\n @username= hash['username']\n @timezone= hash['timezone']\n @email_address= hash['email_address']\n\n @password = nil\n\n @created_at= DateTime.parse(hash['created_at'])\n @updated_at= DateTime.parse(hash['updated_at'])\n end", "def hash_to_obj hash\n OpenStruct.new(hash) rescue raise ConfigError, \"Can't convert setup to object\"\n end", "def initialize(hash)\n load_hash(hash)\n end", "def from_hash( h)\n\t\th.each { |name,attributes|\n\t\t\tklass = Klass.new\n\t\t\tklass.from_hash( { name => attributes } )\n\t\t\tself.add_class( klass)\n\t\t}\n\n\t\t# this is an experiment in handling \"through\" attributes\n\t\t# i.e. enriching the model with the join classes\n\tend", "def initialize(*args)\n super\n # hash = {}\n end", "def build_object(resp)\n return resp unless resp.respond_to?(:merge)\n @build_object ||= final_object_class.new(resp.merge(additional_hash_to_serialize_after_response))\n end", "def from_hash(hash)\n ordered_array = hash.values_at(*members.map(&:to_s))\n new(*ordered_array)\n end", "def __convert hash #:nodoc:\n instance = self.class.new\n hash.each do |k, v|\n k = k.to_s if !k.respond_to?(:to_sym) && k.respond_to?(:to_s)\n instance.new_ostruct_member k\n if v.is_a?(Hash)\n v = v[\"type\"] == \"hash\" ? v[\"contents\"] : __convert(v)\n elsif v.is_a?(Array)\n v = v.map{|e| e.instance_of?(Hash) ? __convert(e) : e}\n end\n instance.send \"#{k}=\".to_sym, v\n end\n instance\n end", "def initialize(hash)\n\t\t@id = hash['id']\n\t\t@first_name = hash['first_name']\n\t\t@last_name = hash['last_name']\n\t\t@mentor = hash['mentor']\n\tend", "def initialize(hash={})\n @name = validate_name(hash[:name])\n @description = hash[:description]\n @snmp_opts = hash[:snmp_opts]\n\n save # Save a copy of self to Redis on creation\n end", "def initialize\n @hash_dict = {}\n end", "def initialize(hash=nil)\n @attributes = hash\n @attributes ||= {}\n end", "def initialize(hash={})\n self.init_attrs_from_hash(hash)\n end", "def from_hash(hash)\n apply_nested_hash(hash)\n end", "def initialize(hash)\n # @id = hash[\"id\"]\n # @street_address = hash[\"street_address\"]\n # @city = hash[\"city\"]\n # @state = hash[\"state\"]\n # @zipcode = hash[\"zipcode\"]\n # @country = hash[\"country\"]\n\n #add in correct details\n end", "def from_hash(hash)\n @data_object.user_acc_name = hash['user_acc_name']\n @data_object.user_affiliate = hash['user_affiliate']\n @user_over_13 = hash['user_over_13']\n\n contact.from_hash(hash)\n end", "def initialize(hash)\n @name = hash[\"campaign\"] #decided to change it to \"name\" since this is the campaign class\n date_elements = hash[\"date\"].split(\"/\") #date is being passed in as a string, need this array to create the Date object in the next line\n @date = Date.new(date_elements[2].to_i + 2000, date_elements[0].to_i, date_elements[1].to_i) #added 2000 to year since the program was considering it as the year 15; this creates the date object\n @spend = hash[\"spend\"].to_f #use .to_f to make sure spend comes in as a float instead of a string\n @impressions = hash[\"impressions\"].to_i #need it as an integer for counting purposes later\n @actions = JSON.parse(hash[\"actions\"])#ensures that each action comes in as an array instead of a string\n @@all << self #shovels it into the all array\n end", "def initialize(hash)\n hash.each do |k, v|\n self.send(\"#{k}=\", v) if self.respond_to?(\"#{k}=\")\n end\n @id = hash[\"id\"]\n end", "def initialize (hash)\n hash.each {|key, value|\n self.class.attr_accessor(key)\n self.send((\"#{key}=\"), value)\n }\n @@all << self\n end", "def initialize(hash={})\n @data = Hash.new\n hash.each do |key, value|\n self[key] = value\n end\n end", "def create_from_hash(hash, opts={})\n create_opts = update_or_create_options(hash, opts)\n create { |instance| instance.set(create_opts) }\n end", "def initialize(hash={})\n # assign the attributes here (???)\n hash.each do |k, v| # name = id, name, etc.\n self.send(\"#{k}=\", v)\n # self.k = v # there's no '.k' method\n #binding.pry\n end\n end", "def initialize(hash) #.new\n @name = hash[:name][0]\n @region = hash[:region]\n @population = hash[:population]\n @capital = hash[:capital]\n @flag_link = hash[:flag_link]\n @@all << self\n #binding.pry\n end", "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @clientId = extract_value(hash, :clientId)\n @clientIdAlias = extract_value(hash, :clientIdAlias)\n @clientIdAliasUsed = extract_boolean_value(hash, :clientIdAliasUsed)\n @expiresAt = extract_integer_value(hash, :expiresAt)\n @subject = extract_value(hash, :subject)\n @scopes = extract_value(hash, :scopes)\n @existent = extract_boolean_value(hash, :existent)\n @usable = extract_boolean_value(hash, :usable)\n @sufficient = extract_boolean_value(hash, :sufficient)\n @refreshable = extract_boolean_value(hash, :refreshable)\n @responseContent = extract_value(hash, :responseContent)\n @properties = extract_array_value(hash, :scopes) do |element|\n Authlete::Model::Property.parse(element)\n end\n end", "def initialize( hash )\n\t\t@object_classes = self.parse_objectclasses( hash['objectClasses'] || [] )\n\t\t@attribute_types = self.parse_attribute_types( hash['attributeTypes'] || [] )\n\t\t@ldap_syntaxes = self.parse_ldap_syntaxes( hash['ldapSyntaxes'] || [] )\n\t\t@matching_rules = self.parse_matching_rules( hash['matchingRules'] || [] )\n\t\t@matching_rule_uses = self.parse_matching_rule_uses( hash['matchingRuleUse'] || [] )\n\tend", "def from_hash(hash)\n super(hash)\n verify\n end", "def objects_from_serialized_hash(hash) # :nodoc:\n klass, attributes = Helpers.to_class_and_attributes(hash)\n klass.from_seedable_attributes(attributes)\n end", "def initialize (hash)\n @name = hash [:name]\n @color = hash [:color]\n @robots = hash [:robots]\n @moon_count = hash [:moon_count]\n @cats = hash [:cats]\n #@solar_rotation = solar_rotation .....I dont really understand what a solar rotation is.... it's confusing.....\n @distance_from_the_sun = hash [:distance_from_the_sun]\n end", "def initialize(hash = nil)\n @arguments = 0\n return if hash.nil?\n @name = hash['name']\n @arguments = hash['arguments']\n end", "def _from_hash(hsh)\n hsh.each do |k, v|\n v = restore_hash(v)\n v = v.map { |iv| restore_hash(iv) } if v.is_a?(Array)\n send(:\"#{k}=\", v)\n end\n self\n end", "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end", "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end", "def initialize(hash={})\n self.attributes = hash\n end", "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end", "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end", "def build(base, object, type = nil, selected_fields = nil)\n return object unless object.is_a?(Hash)\n if _loading?\n Factory.from_db(klass, object, nil, selected_fields)\n else\n Factory.build(klass, object)\n end\n end", "def initialize(hash)\n super(hash)\n @size = hash[\"size\"]\n end", "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @cost, @salt, @digest = split_hash(self.to_s)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end", "def instantiate hash, extra_attributes={}\n return hash unless hash.kind_of? Hash\n# init = hash.values_at(*@singulars).compact.first\n init = hash[@singular]\n inits = hash[@plural]\n if init\n new init.merge extra_attributes\n elsif inits\n inits.map {|each| new each.merge extra_attributes}\n else\n hash\n end\n end", "def from_hash(values)\n @data_object.team_challenge = values['team_challenge']\n @data_object.team_level = values['team_level']\n @data_object.team_name = values['team_name']\n\n# @mgr_email = values['mgr_email']\n\n names = values['tm_name']\n\n TeamMember::MEMBERS_PER_TEAM.times do |i|\n if names[i].empty?\n @members[i].clear\n else\n @members[i].tm_name = names[i]\n @members[i].tm_grade = values['tm_grade'][i].to_i\n @members[i].tm_dob_mon = values['tm_dob_mon'][i]\n @members[i].tm_dob_day = values['tm_dob_day'][i]\n @members[i].tm_dob_year = values['tm_dob_year'][i]\n @members[i].tm_sex = values['tm_sex'][i]\n end\n end\n end", "def hash\n { hash: @hash, hashType: @hash_type }\n end", "def initialize(raw_hash)\n raise Errors::InvalidHash, 'invalid hash' unless valid_hash?(raw_hash)\n\n replace(raw_hash)\n\n @cost, @salt, @digest = split_hash(to_s)\n end", "def initialize( confighash={} )\n\t\tihash = internify_keys( untaint_values(confighash) )\n\t\tmergedhash = DEFAULTS.merge( ihash, &HashMergeFunction )\n\n\t\t@struct = ConfigStruct.new( mergedhash )\n\t\t@create_time = Time.now\n\t\t@name = nil\n\t\t@loader = nil\n\n\t\tsuper()\n\tend", "def initialize(*args)\n @hash = HashWithIndifferentAccess.new(*args)\n end", "def create(hash={})\n model = self.new(hash)\n model.save\n model\n end", "def from_hash(hash:, klass:)\n validate_class_kit(klass)\n\n @hash_helper.indifferent!(hash)\n entity = klass.new\n attributes = @attribute_helper.get_attributes(klass)\n attributes.each do |attribute|\n key = attribute[:name]\n type = attribute[:type]\n\n #if the hash value is nil skip it\n next if hash[key].nil?\n\n value = if is_class_kit?(type)\n from_hash(hash: hash[key], klass: type)\n elsif type == Array\n hash[key].map do |array_element|\n if attribute[:collection_type].nil?\n array_element\n else\n if is_class_kit?(attribute[:collection_type])\n from_hash(hash: array_element, klass: attribute[:collection_type])\n else\n @value_helper.parse(type: attribute[:collection_type], value: array_element)\n end\n end\n end\n else\n hash[key]\n end\n\n entity.public_send(:\"#{key}=\", value)\n end\n\n entity\n end", "def from_h(hash, converter = nil)\n instance = new\n\n hash.each do |k, v|\n v = convert(v, k, converter) if converter\n instance.instance_variable_set(:\"@#{k}\", v)\n end\n\n instance\n end", "def initialize(hash_that_represents_json)\n\t\t@data = hash_that_represents_json\n\tend", "def hash_for_merging(hash)\n new_hash = { id: hash['message_id'].to_i,\n date: Time.at(hash['date'].to_i),\n from: User.new(hash['from'], @bot),\n chat: Chat.new(hash['chat'], @bot) }\n\n type = TYPES.find { |t| hash[t.to_s] }\n new_hash[type] = hash[type.to_s] # TODO: fail if type not found\n\n new_hash\n end", "def initialize(hash)\n @header = Msg::Header.new(hash)\n @body = Msg::Body.new(content_is_json?, hash)\n end", "def build_resource(hash = {})\n self.resource = resource_class.new(hash)\n end", "def initialize()\n @hash = {}\n @values = []\n end", "def build\n fail \"Please provide a value for key, currently: #{key}\" if key.nil?\n\n if in_key\n { in_key.to_sym => { key => data } }\n else\n process_data\n transform_to_hash\n end\n end", "def initialize(build)\n @build = build\n @hash = {}\n @already_run = []\n end", "def new_from_hash_marketplace(h)\n self.url = h\n h=h.split('/')\n h=h[h.size-2]\n self.original_id = h\n return self\n end", "def initialize(hash, type, dump)\n self.hash = hash\n self.type = type.to_sym\n self.dump = dump\n end", "def initialize(hash_data, opts: {})\n @hsh = hash_data\n @opts = opts\n\n @title = @hsh[:title]\n @body = @hsh[:body_hash]\n end", "def initialize(hash)\n @color = hash[:color]\n @scent = hash[:scent]\n end", "def initialize(hash = nil)\n hash.each { |key, value| self[key] = value } if !hash.nil? && hash.is_a?(Hash)\n end", "def create(hash)\n NotImplementedError\n end", "def from_h(hash, converter = nil)\n instance = new\n\n hash.each do |k, v|\n v = instance.convert(v, k, converter) if converter\n instance.send(:\"#{k}=\", v)\n end\n\n instance\n end", "def init_jaxb_json_hash(_o)\n super _o\n @id = String.from_json(_o['id']) unless _o['id'].nil?\n @version = String.from_json(_o['version']) unless _o['version'].nil?\n @description = String.from_json(_o['description']) unless _o['description'].nil?\n @url = String.from_json(_o['url']) unless _o['url'].nil?\n @name = String.from_json(_o['name']) unless _o['name'].nil?\n @organization = Org::Apache::Archiva::Metadata::Model::Organization.from_json(_o['organization']) unless _o['organization'].nil?\n @issueManagement = Org::Apache::Archiva::Metadata::Model::IssueManagement.from_json(_o['issueManagement']) unless _o['issueManagement'].nil?\n @scm = Org::Apache::Archiva::Metadata::Model::Scm.from_json(_o['scm']) unless _o['scm'].nil?\n @ciManagement = Org::Apache::Archiva::Metadata::Model::CiManagement.from_json(_o['ciManagement']) unless _o['ciManagement'].nil?\n if !_o['licenses'].nil?\n @licenses = Array.new\n _oa = _o['licenses']\n _oa.each { | _item | @licenses.push Org::Apache::Archiva::Metadata::Model::License.from_json(_item) }\n end\n if !_o['mailingLists'].nil?\n @mailingLists = Array.new\n _oa = _o['mailingLists']\n _oa.each { | _item | @mailingLists.push Org::Apache::Archiva::Metadata::Model::MailingList.from_json(_item) }\n end\n if !_o['dependencies'].nil?\n @dependencies = Array.new\n _oa = _o['dependencies']\n _oa.each { | _item | @dependencies.push Org::Apache::Archiva::Metadata::Model::Dependency.from_json(_item) }\n end\n @incomplete = Boolean.from_json(_o['incomplete']) unless _o['incomplete'].nil?\n end", "def create_version_hash\n new_version = {}\n new_version['created'] = ''\n new_version['message'] = ''\n new_version['user'] = {}\n # user is #name, # address.\n new_version['user']['name'] = ''\n new_version['user']['address'] = ''\n new_version['state'] = {}\n new_version\n end", "def create_from_hash hash\n values = values_from_hash hash\n unless obj = find(:first, :conditions => values)\n return nil if values[:id]\n obj = create!(values)\n raise ArgumentError, \"#{obj.errors.to_s}\" unless obj.errors.empty?\n end\n obj\n end", "def initialize result_hash={}\n @result_hash = result_hash\n end", "def create_hash(&block); end", "def create_hash(&block); end", "def initialize(attrs={})\n from_hash(attrs)\n end", "def build_request_data(hash)\n {\n :attributes! => {\n addressinfo: { \"xsi:type\" => \"ns2:Map\" },\n },\n username: @username,\n password: @password,\n addressinfo: {\n item: [\n { key: 'name', value: hash[:name] },\n { key: 'address1', value: hash[:address1] },\n { key: 'address2', value: hash[:address2] },\n { key: 'city', value: hash[:city] },\n { key: 'state', value: hash[:state] },\n { key: 'zip', value: hash[:zip] },\n { key: 'fflno', value: hash[:fflno] },\n { key: 'fflexp', value: hash[:fflexp] }\n ]\n },\n testing: @testing\n }\n end", "def init_jaxb_json_hash(_o)\n @groupId = String.from_json(_o['groupId']) unless _o['groupId'].nil?\n @artifactId = String.from_json(_o['artifactId']) unless _o['artifactId'].nil?\n @version = String.from_json(_o['version']) unless _o['version'].nil?\n @packaging = String.from_json(_o['packaging']) unless _o['packaging'].nil?\n @className = String.from_json(_o['className']) unless _o['className'].nil?\n if !_o['repositories'].nil?\n @repositories = Array.new\n _oa = _o['repositories']\n _oa.each { | _item | @repositories.push String.from_json(_item) }\n end\n @bundleVersion = String.from_json(_o['bundleVersion']) unless _o['bundleVersion'].nil?\n @bundleSymbolicName = String.from_json(_o['bundleSymbolicName']) unless _o['bundleSymbolicName'].nil?\n @bundleExportPackage = String.from_json(_o['bundleExportPackage']) unless _o['bundleExportPackage'].nil?\n @bundleExportService = String.from_json(_o['bundleExportService']) unless _o['bundleExportService'].nil?\n @classifier = String.from_json(_o['classifier']) unless _o['classifier'].nil?\n @includePomArtifacts = Boolean.from_json(_o['includePomArtifacts']) unless _o['includePomArtifacts'].nil?\n @queryTerms = String.from_json(_o['queryTerms']) unless _o['queryTerms'].nil?\n @bundleImportPackage = String.from_json(_o['bundleImportPackage']) unless _o['bundleImportPackage'].nil?\n @bundleRequireBundle = String.from_json(_o['bundleRequireBundle']) unless _o['bundleRequireBundle'].nil?\n @pageSize = Fixnum.from_json(_o['pageSize']) unless _o['pageSize'].nil?\n @selectedPage = Fixnum.from_json(_o['selectedPage']) unless _o['selectedPage'].nil?\n end", "def initialize(order_hash)\n @id = order_hash['id']\n @number = order_hash['number']\n @special_instructions = order_hash['special_instructions']\n @total = order_hash['total']\n @total_quantity = order_hash['total_quantity']\n @created_at = order_hash['created_at']\n @updated_at = order_hash['updated_at']\n end", "def from_db_hash *args\n from_hash *args\n end", "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end", "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end", "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end" ]
[ "0.8011074", "0.7470833", "0.7457607", "0.7256629", "0.72455454", "0.70060325", "0.6973257", "0.6955014", "0.69459796", "0.69398683", "0.69363195", "0.6917627", "0.6872358", "0.6796184", "0.6783521", "0.67575246", "0.67575246", "0.67560464", "0.67514306", "0.67136854", "0.66667664", "0.6623634", "0.661206", "0.66098964", "0.66098964", "0.6591922", "0.65713006", "0.6547411", "0.6524743", "0.6524143", "0.6513636", "0.650189", "0.6498057", "0.6485853", "0.6483371", "0.6475685", "0.6459916", "0.6454491", "0.6440182", "0.6434778", "0.6401363", "0.63977015", "0.6396885", "0.63910425", "0.63720834", "0.6363958", "0.63597506", "0.6313429", "0.6295958", "0.62923384", "0.62915224", "0.62704456", "0.62703115", "0.62622243", "0.62515473", "0.6249854", "0.6242987", "0.6242987", "0.62426233", "0.62408733", "0.62407595", "0.62321323", "0.62298346", "0.622897", "0.622756", "0.62245685", "0.62217826", "0.6218501", "0.6210329", "0.62091905", "0.620342", "0.6201614", "0.6178616", "0.6166234", "0.61611027", "0.6140086", "0.6126761", "0.61154264", "0.61059844", "0.60980254", "0.60971874", "0.6090533", "0.6064119", "0.6061236", "0.6060324", "0.60599816", "0.60420287", "0.6039776", "0.603712", "0.6033585", "0.6030829", "0.6023582", "0.6023582", "0.6016123", "0.60155296", "0.6014705", "0.6008574", "0.60031897", "0.60024095", "0.60024095", "0.60024095" ]
0.0
-1
Deserializes the data based on type
def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = IntersightClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Telstra_Messaging.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = FattureInCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = IFClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = WineShipping.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n DearInventoryRuby.const_get(type).build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Mooncard.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Aimastering.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Harbor1Client.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = WellsFargoAchClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ArtikCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Dkron.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n MailSlurpClient.const_get(type).build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n MailSlurpClient.const_get(type).build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Esi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Esi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Esi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n ::DateTime.parse(value)\n when :Date\n ::Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Models.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n ::DateTime.parse(value)\n when :Date\n ::Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Models.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Hubspot::Cms::Performance.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SmoochApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Tradenity.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Tradenity.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SamplifyAPIClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = OpsgenieClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = LemonWayClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BudgeaClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BudgeaClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n Nodeum.const_get(type).build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TextMagic.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TextMagic.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TextMagic.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n Date.parse value\n when :Date\n Date.parse value\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else\n # model\n temp_model = GroupDocsViewerCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n Date.parse value\n when :Date\n Date.parse value\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else\n # model\n temp_model = GroupDocsViewerCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n Date.parse value\n when :Date\n Date.parse value\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else\n # model\n temp_model = GroupDocsViewerCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NSXT.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NSXT.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NSXT.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SwiftApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SwiftApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TripletexApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = unwiredClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Quandoo.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end" ]
[ "0.7330926", "0.7274019", "0.72504056", "0.7245751", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.72291344", "0.7218884", "0.7213926", "0.71909", "0.7183136", "0.71796805", "0.71796805", "0.71796805", "0.71796805", "0.71796805", "0.71796805", "0.71796805", "0.71791923", "0.71791923", "0.71791923", "0.71791923", "0.71791923", "0.71791923", "0.71791923", "0.71791923", "0.71791923", "0.71791923", "0.71712995", "0.71712995", "0.71712995", "0.71712995", "0.71712995", "0.71632504", "0.71549904", "0.71473306", "0.71413666", "0.71413666", "0.7141116", "0.7141116", "0.7141116", "0.7133874", "0.7133874", "0.7133874", "0.7133874", "0.71333444", "0.71333444", "0.7127688", "0.7125744", "0.71210617", "0.71210617", "0.71190786", "0.71184087", "0.711393", "0.7113519", "0.7113519", "0.7113516", "0.71119875", "0.71119875", "0.71119875", "0.7105169", "0.7105169", "0.7105169", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7104928", "0.7102596", "0.7102596", "0.7102596", "0.7101596", "0.7101596", "0.7101596", "0.70996517", "0.70996517", "0.7097952", "0.7097185", "0.70965225" ]
0.0
-1
Returns the string representation of the object
def to_s to_hash.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n @object.to_s\n end", "def to_s\n object.to_s\n end", "def serialize(object)\n object.to_s\n end", "def to_s\n self.inspect\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end", "def to_s\n \"#<#{self.class.name}:#{object_id}> @names=#{names}>\"\n end", "def to_s\n self.inspect\n end", "def to_s\n toString()\n end", "def to_s\r\n dump\r\n end", "def to_s\n inspect\n end", "def to_s\n toString\n end", "def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end", "def to_s\n\t\t\t@string\n\t\tend", "def to_s\n stringify\n end", "def to_s\n to_h.to_s\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def inspect\n serialize.to_s\n end", "def inspect\n to_s\n end", "def to_s\n @string ||= Builder::ToString.new(self).string\n end", "def to_s\n self\n end", "def to_s()\n serialize.to_s()\n end", "def to_s()\n serialize.to_s()\n end", "def to_s\n string\n end", "def to_s\n inspect\n end", "def to_s\n inspect\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n self.to_s\n end", "def inspect\n self.to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def inspect\n to_s.inspect\n end", "def inspect()\n serialize.to_s()\n end", "def inspect()\n serialize.to_s()\n end", "def inspect\n return self.to_s\n end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end" ]
[ "0.901024", "0.89506465", "0.84703195", "0.83409667", "0.8337169", "0.8337169", "0.8332247", "0.82546586", "0.8145818", "0.8144667", "0.81357557", "0.812714", "0.8093436", "0.8086725", "0.8073356", "0.8039774", "0.80308646", "0.80064154", "0.80064154", "0.80064154", "0.80064154", "0.7962831", "0.7962831", "0.7962831", "0.7962831", "0.7954296", "0.79446983", "0.7919419", "0.7909274", "0.78848016", "0.78848016", "0.78841925", "0.788328", "0.788328", "0.78758216", "0.78758216", "0.78758216", "0.78758216", "0.78758216", "0.78758216", "0.78758216", "0.7866813", "0.7866813", "0.7865939", "0.7865939", "0.7850519", "0.7850519", "0.7850519", "0.7850519", "0.7808076", "0.7784745", "0.7784745", "0.7767656", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824", "0.77608824" ]
0.0
-1
to_body is an alias to to_hash (backward compatibility)
def to_body to_hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_body\r\n to_hash\r\n end", "def to_body\n to_hash\nend", "def to_body\n to_hash\nend" ]
[ "0.84283537", "0.8347048", "0.8347048" ]
0.0
-1