query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
093e72ed4f500b0d4bd02283d3531a46
|
DELETE /warranty_types/1 DELETE /warranty_types/1.json
|
[
{
"docid": "57e47f254266782946d7da2a84fb0a64",
"score": "0.73633677",
"text": "def destroy\n authorize! :destroy, @warranty_type\n @warranty_type.destroy\n respond_to do |format|\n format.html { redirect_to warranty_types_url, notice: 'Warranty type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "27862c2c7d101385db89cc16109a083c",
"score": "0.748826",
"text": "def destroy\n @warrantytype = Warrantytype.find(params[:id])\n @warrantytype.destroy\n\n respond_to do |format|\n format.html { redirect_to(warrantytypes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ac3ae35e218639efda45bc4550df8e20",
"score": "0.71745884",
"text": "def destroy\n @warranty = Warranty.find(params[:id])\n @warranty.destroy\n\n respond_to do |format|\n format.html { redirect_to warranties_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac3ae35e218639efda45bc4550df8e20",
"score": "0.7173426",
"text": "def destroy\n @warranty = Warranty.find(params[:id])\n @warranty.destroy\n\n respond_to do |format|\n format.html { redirect_to warranties_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac3ae35e218639efda45bc4550df8e20",
"score": "0.7173426",
"text": "def destroy\n @warranty = Warranty.find(params[:id])\n @warranty.destroy\n\n respond_to do |format|\n format.html { redirect_to warranties_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3edef33ed6a210b5529b8b2a1d179172",
"score": "0.70627505",
"text": "def destroy\n @warrant = Warrant.find(params[:id])\n @warrant.destroy\n\n respond_to do |format|\n format.html { redirect_to warrants_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "971b0df0e50baf486fb3bbd7fdea7e0c",
"score": "0.70507944",
"text": "def destroy\n @type_license.status = 0\n @type_license.save!\n respond_to do |format|\n format.html { redirect_to type_licenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4dcc592c008f6864b7e1ae80473633b5",
"score": "0.7017402",
"text": "def destroy\n @benefit_type = BenefitType.find(params[:id])\n @benefit_type.destroy\n\n respond_to do |format|\n format.html { redirect_to benefit_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f1d6435b5575c33b8d2b406b30553f5d",
"score": "0.69749284",
"text": "def destroy\n @expense_type = ExpenseType.find(params[:id])\n @expense_type.destroy\n\n respond_to do |format|\n format.html { redirect_to expense_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa9d6e1680732b59a5a30fb5597ec807",
"score": "0.6965544",
"text": "def destroy\n @expend_type.destroy\n respond_to do |format|\n format.html { redirect_to expend_types_url, notice: 'Expend type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0f1262f58d1b8efd84540a146c6c8d44",
"score": "0.69639224",
"text": "def destroy\n @budget_type = BudgetType.find(params[:id])\n @budget_type.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_types_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b0e0ee96d66c17fd1d405e30d31f2611",
"score": "0.69303936",
"text": "def destroy\n @purchase_type.destroy\n respond_to do |format|\n format.html { redirect_to purchase_types_url, notice: 'Purchase type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bbef9fd81863d34753548266a7a300f7",
"score": "0.6893613",
"text": "def destroy\n @amount_type.destroy\n respond_to do |format|\n format.html { redirect_to amount_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "441ce396b9538c43a9a8df51cb943952",
"score": "0.6857583",
"text": "def destroy\n @fee_type.destroy\n\n respond_to do |format|\n format.html { redirect_to fees_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9ae1e6bc0acacc7185412c18273cb580",
"score": "0.68543434",
"text": "def destroy\n @warrant_purchase = WarrantPurchase.find(params[:id])\n @warrant_purchase.destroy\n\n respond_to do |format|\n format.html { redirect_to warrant_purchases_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bb9e63cee0e7001c94529aefa8e89c1d",
"score": "0.6826219",
"text": "def delete\n @type = Type.find_by_id(params[:id])\n\n # Make sure the type exists\n if @type == nil\n render :nothing => true, :status => 404\n return\n end\n\n deleted_type = @type.delete\n render json: deleted_type, :status => :ok\n end",
"title": ""
},
{
"docid": "e8dfed4d19e7a35fce1f54a0c4fb0184",
"score": "0.68239135",
"text": "def destroy\n @warranty = Warranty.find(params[:id])\n @warranty.destroy\n\n respond_to do |format|\n format.html { redirect_to(warranties_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a4e711e11d0c8803140ab0274629476b",
"score": "0.6820653",
"text": "def destroy\n @budget_type.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_types_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.budget_type')) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "769328c90958b8a81e2b6a31b4108f20",
"score": "0.6811515",
"text": "def destroy\n @warrant.destroy\n respond_to do |format|\n format.html { redirect_to warrants_url, notice: 'Warrant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1c3dd02ee456fd2de4e98a0e582b2eea",
"score": "0.67686933",
"text": "def destroy\n @maintenance_type = MaintenanceType.find(params[:id])\n @maintenance_type.destroy\n\n respond_to do |format|\n format.html { redirect_to maintenance_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ca1aec5c02d2df2812be0a73fe269412",
"score": "0.6753546",
"text": "def destroy\n @bill_type = BillType.find(params[:id])\n @bill_type.destroy\n\n respond_to do |format|\n format.html { redirect_to bill_types_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fd7fd3810e98ef373cf5ce6da4b5db20",
"score": "0.6751175",
"text": "def destroy\n @reinforcement_type.destroy\n respond_to do |format|\n format.html { redirect_to reinforcement_types_url, notice: 'Reinforcement type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cbadce5fbe0159004789afe62a4db81c",
"score": "0.67419016",
"text": "def destroy\n @cost_type = CostType.find(params[:id])\n @cost_type.destroy\n\n respond_to do |format|\n format.html { redirect_to cost_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1c3ef22a5aa4ce5015d16dde63006034",
"score": "0.67290515",
"text": "def destroy\n @payment_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_payment_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dfacc0c0b5bee336632b2db7f0575d87",
"score": "0.6718017",
"text": "def destroy\n @adjustment_type = AdjustmentType.find(params[:id])\n @adjustment_type.destroy\n\n respond_to do |format|\n format.html { redirect_to adjustment_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d8b40cb8690c31ea462d9fd3f50c8c44",
"score": "0.6698944",
"text": "def destroy\n @expensetype = Expensetype.find(params[:id])\n @expensetype.destroy\n\n respond_to do |format|\n format.html { redirect_to expensetypes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "48e8afa935976ad88f09b12445c1af4d",
"score": "0.66971004",
"text": "def destroy\n @goods_additional_type = Goods::Additional::Type.find(params[:id])\n @goods_additional_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(goods_additional_types_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "06d455b74a01a0bc02e6b0999d2fb98e",
"score": "0.66853327",
"text": "def destroy\n @payment_type = @business.payment_types.find(params[:id])\n @payment_type.destroy\n\n respond_to do |format|\n format.html { redirect_to business_payment_types_url(@business) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "06d455b74a01a0bc02e6b0999d2fb98e",
"score": "0.66853327",
"text": "def destroy\n @payment_type = @business.payment_types.find(params[:id])\n @payment_type.destroy\n\n respond_to do |format|\n format.html { redirect_to business_payment_types_url(@business) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dbffefead4fd8bd0ae33924568998259",
"score": "0.6685268",
"text": "def destroy\n @consultation_type = ConsultationType.find(params[:id])\n @consultation_type.destroy\n\n respond_to do |format|\n format.html { redirect_to consultation_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "03e8be3b78f4eeef73c52d50397d01e9",
"score": "0.66852224",
"text": "def destroy\n @investigation_type.destroy\n respond_to do |format|\n format.html { redirect_to investigation_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e8d9036465580059a2384782b36f3430",
"score": "0.668253",
"text": "def destroy\n @financial_type.destroy\n respond_to do |format|\n format.html { redirect_to financial_types_url, notice: 'Financial type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "894aebebae458ad4fc6bb21a76980a9a",
"score": "0.66728455",
"text": "def destroy\n @exp_type = ExpType.find(params[:id])\n @exp_type.destroy\n\n respond_to do |format|\n format.html { redirect_to exp_types_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1d9a702ec120dc0664ad3b95c84c20d2",
"score": "0.6661909",
"text": "def destroy\n @refund_type.destroy\n respond_to do |format|\n format.html { redirect_to refund_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8192f2e718d56da6873bde83817e9f56",
"score": "0.66551954",
"text": "def destroy\n @paytype = Paytype.find(params[:id])\n @paytype.destroy\n\n respond_to do |format|\n format.html { redirect_to paytypes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "343953a399df71f9c58fc7673d57436d",
"score": "0.6653209",
"text": "def destroy\n @policy_type = PolicyType.find(params[:id])\n @policy_type.destroy\n\n respond_to do |format|\n format.html { redirect_to policy_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "83ffb67057cc8702b6f07e9baf31bc3c",
"score": "0.66472447",
"text": "def destroy\n @capital_type = CapitalType.find(params[:id])\n @capital_type.destroy\n\n respond_to do |format|\n format.html { redirect_to capital_types_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "70d42ef97a69b8e83b9032c55f9eb1f8",
"score": "0.6644213",
"text": "def destroy\n @crust_type.destroy\n respond_to do |format|\n format.html { redirect_to crust_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0d2ded696485254eeaba9a23af4d3be8",
"score": "0.6643412",
"text": "def destroy\n @insurance_type.destroy\n respond_to do |format|\n format.html { redirect_to insurance_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aa26667473b4df7272c76b91ad6d8d7b",
"score": "0.66299486",
"text": "def destroy\n @voucher_type.destroy\n\n respond_to do |format|\n format.html { redirect_to voucher_types_url, notice: \"Voucher type was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b3cb3e8344962ca9c7b83f5dbf785ee4",
"score": "0.662838",
"text": "def destroy\n @offense_type.destroy\n respond_to do |format|\n format.html { redirect_to offense_types_url, notice: 'Offense type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "00c3650f1413b501052bdffee3f780bb",
"score": "0.66238385",
"text": "def destroy\n @discount_type.destroy\n respond_to do |format|\n format.html { redirect_to discount_types_url, notice: 'Discount type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d47cf16fecbfa3d69d559c82052ecff5",
"score": "0.6623062",
"text": "def destroy\n @payout_type.destroy\n respond_to do |format|\n format.html { redirect_to payout_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0184f5ba5165e385e5b30b5a06a79c48",
"score": "0.6620489",
"text": "def destroy\n @api_v1_mentorship_type.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentorship_types_url, notice: 'Mentorship type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e30f523860c82b5526279e8bcadb3681",
"score": "0.66176295",
"text": "def destroy\n @cost_type.destroy\n respond_to do |format|\n format.html { redirect_to cost_types_url, notice: 'Cost type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "48815bf6f7523b691e9d38e67fb49a9e",
"score": "0.6615391",
"text": "def destroy\n @admin_banking_transaction_type = Admin::BankingTransactionType.find(params[:id])\n @admin_banking_transaction_type.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banking_transaction_types_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0d9fc55a8bac582194294583e687dd06",
"score": "0.66143477",
"text": "def destroy\n @ledger_type.destroy\n respond_to do |format|\n format.html { redirect_to ledger_types_url, notice: 'Ledger type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "525201fb3bdfda7e822ed519aa691013",
"score": "0.66120553",
"text": "def destroy\n @type_decision = TypeDecision.find(params[:id])\n @type_decision.destroy\n\n respond_to do |format|\n format.html { redirect_to(type_decisions_url) }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>[]}}\n end\n end",
"title": ""
},
{
"docid": "d50f657fcad62c7a13c719c0349df62c",
"score": "0.6609668",
"text": "def destroy\n @voucher_type.destroy\n respond_to do |format|\n format.html { redirect_to voucher_types_url, notice: 'Voucher type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aed1132c8f1cd67394ff8f7c01398e70",
"score": "0.660512",
"text": "def destroy\n @expense_tax_type = ExpenseTaxType.find(params[:id])\n @expense_tax_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(expense_tax_types_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b43a28c5daf8746fa7c61c39228d4965",
"score": "0.66049755",
"text": "def destroy\n @incident_type = IncidentType.find(params[:id])\n @incident_type.destroy\n\n respond_to do |format|\n format.html { redirect_to incident_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f5f6b9f82a6bf15b4ccd3fd8f2324ba3",
"score": "0.6602057",
"text": "def destroy\n @bill_type.destroy\n respond_to do |format|\n format.html { redirect_to bill_types_url, notice: 'Bill type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a64365f360efd881a673ae9ce3548c35",
"score": "0.6599527",
"text": "def delete_item(type, id_or_name)\n delete(\"/#{type}s/#{resolve(id_or_name)}\", :superuser)\n end",
"title": ""
},
{
"docid": "4a7b58a8e237ee7175ee653a847625a0",
"score": "0.659262",
"text": "def destroy\n @insurance_type = InsuranceType.find(params[:id])\n @insurance_type.destroy\n\n respond_to do |format|\n format.html { redirect_to insurance_types_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a06584fb0e97eab05785239cc4b2e950",
"score": "0.65884376",
"text": "def destroy\n @contractor_type.destroy\n respond_to do |format|\n format.html { redirect_to contractor_types_url, notice: \"Contractor type was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2a0b1c6033b38b65acc56e226a0934a",
"score": "0.65846044",
"text": "def destroy\n @insured_type = InsuredType.find(params[:id])\n @insured_type.destroy\n\n respond_to do |format|\n format.html { redirect_to insured_types_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "28cd1b1e1b7bc858fa773d024eafb34e",
"score": "0.65792584",
"text": "def destroy\n @payment_type.destroy\n respond_to do |format|\n format.html { redirect_to payment_types_url, notice: \"Payment type was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ead6f4a029d8db434f0f2e4fce3ccdee",
"score": "0.65763015",
"text": "def destroy\n @type = Type.find(params[:id])\n @type.destroy\n\n respond_to do |format|\n format.html { redirect_to types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e1cc5d8d63e7ab8c6b94ad94a36d7256",
"score": "0.65756565",
"text": "def destroy\n @accttype.destroy\n respond_to do |format|\n format.html { redirect_to accttypes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "66f469cea8aed9f48d2848567ec676b4",
"score": "0.65683967",
"text": "def destroy\n @bath_type.destroy\n respond_to do |format|\n format.html { redirect_to bath_types_url, notice: 'Bath type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a3702e55b2ab9d68d599cbb839b00e04",
"score": "0.65670145",
"text": "def destroy\n @reward_type = RewardType.find(params[:id])\n @reward_type.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_reward_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "46e59046fce32e0a53caebf8e3d8ca13",
"score": "0.65633273",
"text": "def destroy\n @coupon_type.destroy\n respond_to do |format|\n format.html { redirect_to coupon_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "87c86d445aa80377dfb28baf4f62c510",
"score": "0.65598357",
"text": "def destroy\n @admin_payment_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_payment_types_url, notice: \"Payment type was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "06a8de467fc725f4a576ff52d8bf758b",
"score": "0.6558772",
"text": "def destroy\n @investigation_type = InvestigationType.find(params[:id])\n @investigation_type.destroy\n\n respond_to do |format|\n format.html { redirect_to investigation_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "87bdbd1b5136e9c20ba7a0e1a9a7bbe5",
"score": "0.6557913",
"text": "def destroy\n @donor_type.destroy\n respond_to do |format|\n format.html { redirect_to donor_types_url, notice: t('messages.delete.donar_type') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "73030dae22d7b88bf91c6cd88fc84942",
"score": "0.6556401",
"text": "def destroy\n @responsibility_type.destroy\n respond_to do |format|\n format.html { redirect_to responsibility_types_url, notice: 'Responsibility type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bd8b7beb5fc19fe905da210054ec80f",
"score": "0.65563184",
"text": "def destroy\n @incidence_type.destroy\n respond_to do |format|\n format.html { redirect_to incidence_types_url, notice: 'Incidence type ha sido eliminado.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "80fae56949e382cef963b1c27150ec59",
"score": "0.65535647",
"text": "def destroy\r\n @blessuretype = Blessuretype.find(params[:id])\r\n @blessuretype.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to blessuretypes_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "cef5f7113a33d9e1228aa3ba2ae4c53a",
"score": "0.6546943",
"text": "def destroy\n @loan_type = LoanType.find(params[:id])\n @loan_type.destroy\n\n respond_to do |format|\n format.html { redirect_to loan_types_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4ec6145996f0cabca084b4b506d1e4b1",
"score": "0.65422267",
"text": "def destroy\n @resident_type.destroy\n respond_to do |format|\n format.html { redirect_to resident_types_url, notice: 'Resident type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6cb97a68f9b4f1037f3a700ad83d7b4d",
"score": "0.6540124",
"text": "def destroy\n @subsidy_type = SubsidyType.find(params[:id])\n @subsidy_type.destroy\n\n respond_to do |format|\n format.html { redirect_to subsidy_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6d8bdd1d780c604fd1d2cff902ac6528",
"score": "0.6538782",
"text": "def destroy\n @vacation_type.destroy\n respond_to do |format|\n format.html { redirect_to vacation_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac7cb2f1fe4a65f8ba778569e3fc9b52",
"score": "0.65382755",
"text": "def destroy\n @company_type = CompanyType.find(params[:id])\n @company_type.destroy\n\n respond_to do |format|\n format.html { redirect_to company_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0dc6eef03eddcbfad5da86327ed2e0c9",
"score": "0.6537168",
"text": "def destroy\n @receipt_item_type = current_account.receipt_item_types.find(params[:id])\n @receipt_item_type.destroy\n respond_with @receipt_item_type, location: receipt_item_types_url \n end",
"title": ""
},
{
"docid": "dd519fad14b9f7e5d272cf8007c273fb",
"score": "0.6535236",
"text": "def destroy\n @usage_type.destroy\n respond_to do |format|\n format.html { redirect_to usage_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dd519fad14b9f7e5d272cf8007c273fb",
"score": "0.6535236",
"text": "def destroy\n @usage_type.destroy\n respond_to do |format|\n format.html { redirect_to usage_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cb1ab8c95a78101779a9ad7ec238a3ed",
"score": "0.6535184",
"text": "def destroy\n @type_req_resp.destroy\n respond_to do |format|\n format.html { redirect_to '/maestricos/prueba?titulo=Tipo+de+Respuesta+de+Solicitud&tabla=TypeReqResps' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8a654bdcb2ae234db191254c70f1c593",
"score": "0.6530441",
"text": "def _delete(type, *args)\n type = type.to_s.camelize\n metadata = args.map { |full_name| {:full_name => full_name} }\n request :delete do |soap|\n soap.body = {\n :metadata => metadata\n }.merge(attributes!(type))\n end\n end",
"title": ""
},
{
"docid": "d61e1aaf8c9e082a43af5bb6e22af529",
"score": "0.6528156",
"text": "def destroy\n @promotion_type = PromotionType.find(params[:id])\n @promotion_type.destroy\n\n respond_to do |format|\n format.html { redirect_to promotion_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3d931c3908b2f660c296f42110030e1d",
"score": "0.6525237",
"text": "def destroy\n @approval_type.destroy\n respond_to do |format|\n format.html { redirect_to base_approval_types_url, notice: 'Approval type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "937154a9ef014d49f295fd9f4f767998",
"score": "0.65209526",
"text": "def destroy\n @expensetype.destroy\n respond_to do |format|\n format.html { redirect_to expensetypes_url, notice: 'Expensetype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9111a7a837af697cfcfe1180f5f67fac",
"score": "0.6519497",
"text": "def destroy\n @reagent_type = ReagentType.find(params[:id])\n @reagent_type.destroy\n\n respond_to do |format|\n format.html { redirect_to reagent_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ad9ca4d77a0647931d22887aa20dccb3",
"score": "0.65139955",
"text": "def destroy\n @pricing_type = PricingType.find(params[:id])\n @pricing_type.destroy\n\n respond_to do |format|\n format.html { redirect_to pricing_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a463c712dc68005d974e6260c40b2388",
"score": "0.6512413",
"text": "def destroy\n @type_contract.destroy\n respond_to do |format|\n format.html { redirect_to type_contracts_url, notice: 'Type contract was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9d096c79c999f8e81b29d6a400065723",
"score": "0.6512284",
"text": "def destroy\n @request_type = RequestType.find(params[:id])\n @request_type.destroy\n\n respond_to do |format|\n format.html { redirect_to request_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e6a79b485acffa06799e2200366b1f7d",
"score": "0.6509696",
"text": "def destroy\n @appeal_type.destroy\n respond_to do |format|\n format.html { redirect_to appeal_types_url, notice: 'Обращение было успешно удалено.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "22482e5491e9d45a7c01f459fba0437c",
"score": "0.6507635",
"text": "def destroy\n @clienttype = Clienttype.find(params[:id])\n @clienttype.destroy\n\n respond_to do |format|\n format.html { redirect_to clienttypes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9e05cdffdb5998ed5b286fd8169c5ed8",
"score": "0.65059125",
"text": "def destroy\n @type.destroy\n respond_to do |format|\n format.html { redirect_to types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa91651805d2d1185879c65092469496",
"score": "0.650102",
"text": "def destroy\n @paymenttype.destroy\n respond_to do |format|\n format.html { redirect_to paymenttypes_url, notice: 'Paymenttype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "110cda66cdc18ac681f84321e3fe7794",
"score": "0.65008855",
"text": "def destroy\n @bowtype.destroy\n respond_to do |format|\n format.html { redirect_to bowtypes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9bdb7aed8ea39b61180e82f4980d7c0b",
"score": "0.6499785",
"text": "def destroy\n @rent_type.destroy\n respond_to do |format|\n format.html { redirect_to rent_types_url, notice: 'Rent type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4f16ac17ba44fef44132b960e812ecf0",
"score": "0.64960784",
"text": "def destroy\n @price_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_price_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dae82ccd7181ced05b99db26370c4c27",
"score": "0.64956635",
"text": "def destroy\n authorize! :destroy, CompetenceType\n \n @competence_type.destroy!\n render json: {status: :ok}\n end",
"title": ""
},
{
"docid": "141a7c49d8c18d44e18c4ce8fb0006a5",
"score": "0.64939195",
"text": "def destroy\n @vaccination_type.destroy\n respond_to do |format|\n format.html { redirect_to vaccination_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38fae5b13ab0f0b4fb6e5f096ef07dca",
"score": "0.64872634",
"text": "def destroy\n @taxe_type = Taxe::Type.find(params[:id])\n @taxe_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(taxe_types_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "70b263acadf6962dbe03e5fc3f1509a2",
"score": "0.6485767",
"text": "def destroy\n @type_status_consignation = TypeStatusConsignation.find(params[:id])\n @type_status_consignation.destroy\n\n respond_to do |format|\n format.html { redirect_to(type_status_consignations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9f768debaf7ac5f5d21af96e996b6fb0",
"score": "0.64824694",
"text": "def destroy\n @applicant_disability_type.destroy\n respond_to do |format|\n format.html { redirect_to applicant_disability_types_url, notice: 'Applicant disability type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1337a609608cb61f80d448e968fb9b8e",
"score": "0.648026",
"text": "def destroy\n @payment_type = PaymentType.find(params[:id])\n @payment_type.destroy\n \n respond_to do |format|\n format.html { redirect_to admin_payment_types_url }\n format.xml { render :nothing => true }\n end\n end",
"title": ""
},
{
"docid": "864d615f5a982383a9c514776e41ccec",
"score": "0.6473715",
"text": "def destroy\n @inquiry_type.destroy\n respond_to do |format|\n format.html { redirect_to inquiry_types_url, notice: 'Inquiry type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a0b66a4e403c60dd1ce7eba91ade7578",
"score": "0.6470794",
"text": "def destroy\n @stakeholder_type.destroy\n respond_to do |format|\n format.html { redirect_to stakeholder_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "82b69225c97a9ee22972dce58b8b0f3a",
"score": "0.6470048",
"text": "def destroy\n @exp_type.destroy\n respond_to do |format|\n format.html { redirect_to exp_types_url, notice: 'Exp type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
9d18ae451493139e7f30bf1ce5d96352
|
Generate scope at top level e.g. User.on_replica
|
[
{
"docid": "4c355d9a9617d2de33ef912f483d0783",
"score": "0.0",
"text": "def on_replica\n # Why where(nil)?\n # http://stackoverflow.com/questions/18198963/with-rails-4-model-scoped-is-deprecated-but-model-all-cant-replace-it\n context = where(nil)\n context.knockoff_target = :replica\n context\n end",
"title": ""
}
] |
[
{
"docid": "a95ca71a73143bde330e84db80daf329",
"score": "0.70302594",
"text": "def scope_name; end",
"title": ""
},
{
"docid": "30e913f766c746c07a11a0e27284fd0c",
"score": "0.6825383",
"text": "def scope_level; end",
"title": ""
},
{
"docid": "f3c13a1a81915ee7e7acb15e84307ded",
"score": "0.68154",
"text": "def scopes; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.6781223",
"text": "def scope; end",
"title": ""
},
{
"docid": "da5eb2048cef56f6f8d9a4d429d9d707",
"score": "0.6734759",
"text": "def scope\n @scope ||= Array(@root_scope) + [Inflector.underscore(name)]\n end",
"title": ""
},
{
"docid": "18e5411c55442f2f636f9f652067a7c2",
"score": "0.6636595",
"text": "def scope\n @scope ||= \"study.#{app_name}\"\n end",
"title": ""
},
{
"docid": "ed84d06884df63265fa1af69ca7e8633",
"score": "0.6514995",
"text": "def scope_options; end",
"title": ""
},
{
"docid": "ed84d06884df63265fa1af69ca7e8633",
"score": "0.6514995",
"text": "def scope_options; end",
"title": ""
},
{
"docid": "cce3bbaaa3ee1ceb1e7a63e190c824c6",
"score": "0.6472106",
"text": "def scope\n @scope ||= {}\n end",
"title": ""
},
{
"docid": "cce3bbaaa3ee1ceb1e7a63e190c824c6",
"score": "0.6472106",
"text": "def scope\n @scope ||= {}\n end",
"title": ""
},
{
"docid": "b615008ee85af9df41a676d01ada2ae1",
"score": "0.6377778",
"text": "def scope *args\n [main_scope, args, graphite_identifier].flatten.compact.map(&:to_s).join('.')\n end",
"title": ""
},
{
"docid": "dbed5f052023bae11d0403d32dc9b11e",
"score": "0.6376098",
"text": "def policy_scopes; end",
"title": ""
},
{
"docid": "39d7f1ecd7d1afea685a657b8d0f4fcb",
"score": "0.6332442",
"text": "def scope\n parameter[:scope]\n end",
"title": ""
},
{
"docid": "25bb8afe65fb74015eaa0f138431bd8f",
"score": "0.62642866",
"text": "def scope\n @scope\n end",
"title": ""
},
{
"docid": "25bb8afe65fb74015eaa0f138431bd8f",
"score": "0.62642866",
"text": "def scope\n @scope\n end",
"title": ""
},
{
"docid": "2c925b04f83c498d780ecce61f0c3306",
"score": "0.62415105",
"text": "def scope\n read_attr :scope, :to_sym\n end",
"title": ""
},
{
"docid": "ede8516c91636f45c76174d0432c7319",
"score": "0.6226894",
"text": "def scope() binding end",
"title": ""
},
{
"docid": "04b84ee6df2d902160b735f3c87d8129",
"score": "0.61677676",
"text": "def scope\n finder_or_run(:scope)\n end",
"title": ""
},
{
"docid": "a5432aadd8cc5947db0ccf866c05e0a0",
"score": "0.61423486",
"text": "def scope=(_); end",
"title": ""
},
{
"docid": "b13dc2eea9e9984c73f6470575daae34",
"score": "0.6117775",
"text": "def scopeName _args\n \"scopeName _args;\" \n end",
"title": ""
},
{
"docid": "67e2857469a9829bffc8c9f0a44a6932",
"score": "0.61130357",
"text": "def create_with_scope(name); end",
"title": ""
},
{
"docid": "b9775dfc45ef992cacf57d0aa82f3a1f",
"score": "0.6107555",
"text": "def scope\n @scope ||= %i[evil client errors] << \\\n Tram::Policy::Inflector.underscore(model.to_s).to_sym\n end",
"title": ""
},
{
"docid": "7259dd410affd3468a46d3f51791be85",
"score": "0.60968786",
"text": "def scope(*args); end",
"title": ""
},
{
"docid": "7f0cd3a811cffed9a185223731af03e2",
"score": "0.60951656",
"text": "def prov_scope(opts)\n scope = []\n # Request date (created since X days ago)\n scope << [:created_recently, opts[:time_period].to_i] if opts[:time_period].present?\n # Select requester user across regions\n scope << [:with_requester, current_user.id] unless approver?\n scope << [:with_requester, opts[:user_choice]] if opts[:user_choice] && opts[:user_choice] != \"all\"\n\n scope << [:with_approval_state, opts[:applied_states]] if opts[:applied_states].present?\n scope << [:with_type, MiqRequest::MODEL_REQUEST_TYPES[model_request_type_from_layout].keys]\n scope << [:with_request_type, opts[:type_choice]] if opts[:type_choice] && opts[:type_choice] != \"all\"\n scope << [:with_reason_like, opts[:reason_text]] if opts[:reason_text].present?\n\n scope\n end",
"title": ""
},
{
"docid": "a02aa23473f371b609ab15b00c6e3954",
"score": "0.60613334",
"text": "def scope\n Pundit.policy_scope!(user, record.class)\n end",
"title": ""
},
{
"docid": "7468db54a226dbc07e108eaaf99db06a",
"score": "0.60605395",
"text": "def default_scope; end",
"title": ""
},
{
"docid": "fee6e5182985b2f3122e949998b084c1",
"score": "0.60103583",
"text": "def read_scope(user)\n self\n end",
"title": ""
},
{
"docid": "637bdf8600ed3646f55b5d5af6bbea84",
"score": "0.60032654",
"text": "def apply_scopes(*)\n relation = super\n relation = relation.accessible_by(current_ability) if scope_accessible?\n relation\n end",
"title": ""
},
{
"docid": "51bfbc7f76a314764eb2507779b57d5d",
"score": "0.5989664",
"text": "def build_collection_scope_base(some_instance)\n some_instance.send(@collection_name).scoped\n end",
"title": ""
},
{
"docid": "c22db392b7bcfd1c8b2d6658f6b51889",
"score": "0.5963043",
"text": "def build_scope_from_columns\n self.scope\n end",
"title": ""
},
{
"docid": "ddf83f1a9bdfd55bcd2e898b5595c466",
"score": "0.595732",
"text": "def namespace_scopes\n super\n end",
"title": ""
},
{
"docid": "885f77c51fae4471c36775ec3d64b91b",
"score": "0.59509474",
"text": "def scope\n @options[:scope]\n end",
"title": ""
},
{
"docid": "fcc4da2f0056974b6594d1bef42fff1b",
"score": "0.59455335",
"text": "def newscope(parent, options = {})\n raise _('having multiple named scopes is not supported when scripting')\n end",
"title": ""
},
{
"docid": "3bb135c9e4a3723af5f37daf89a4a37c",
"score": "0.59119475",
"text": "def scope\n @scope.dup\n end",
"title": ""
},
{
"docid": "bf075114e4dfa9dab5990521210ae60f",
"score": "0.5902975",
"text": "def scopes\n @scopes ||= {}\n end",
"title": ""
},
{
"docid": "1becb805e3945ab04c9010b1aacca600",
"score": "0.58770156",
"text": "def scope\n klass\n end",
"title": ""
},
{
"docid": "ef8ed1ff2177beac51f04dad045499ec",
"score": "0.5875178",
"text": "def scopes\n @@scopes ||= {}\n end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.5851364",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.5851364",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.5851364",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "93131439201dff9354379988affddb9a",
"score": "0.58464795",
"text": "def devise_scope(scope); end",
"title": ""
},
{
"docid": "39db944e0d06c14023e5b1904578f931",
"score": "0.5834967",
"text": "def base_scope\n ApplicationRecord.none\n end",
"title": ""
},
{
"docid": "62f23ff9cd9a3ef013b4fbf2b7b3a496",
"score": "0.58345616",
"text": "def create_scope\n sprintf \"%s/%s/signer\", @self_key, @client_id\n end",
"title": ""
},
{
"docid": "70987fabbf2238338ba5b7427da1289e",
"score": "0.5829536",
"text": "def dynamic_scopes\n self.scopes.select { |name, args| args.present? }\n end",
"title": ""
},
{
"docid": "fe10fdbdafd61d66904725b94eac8887",
"score": "0.582165",
"text": "def scope\n @attributes[:scope]\n end",
"title": ""
},
{
"docid": "00f60afa850061c957aa8bf482ca8201",
"score": "0.58201563",
"text": "def apply_standard_scope\n each_sort do |attribute, direction|\n @scope = resource.adapter.order(@scope, attribute, direction)\n end\n @scope\n end",
"title": ""
},
{
"docid": "5ca8ac53f0d0540823ff2227a89984b3",
"score": "0.58118653",
"text": "def scope_condition() \"1\" end",
"title": ""
},
{
"docid": "6dd6aac321c9dcdd9bc35e53e0b85e99",
"score": "0.5808047",
"text": "def apply_to_scope(scope)\n scope\n end",
"title": ""
},
{
"docid": "8f0e09aed85c8cee377bab47b8236bee",
"score": "0.5800492",
"text": "def current_user_scope\n current_user\n end",
"title": ""
},
{
"docid": "5bdcacf3126d63cc210c8d5668b724be",
"score": "0.57943344",
"text": "def collection_scope; end",
"title": ""
},
{
"docid": "2b7331694c41d423bf0fac01c1ebbdc2",
"score": "0.5788386",
"text": "def scope_test\n end",
"title": ""
},
{
"docid": "6b6c581e6976ae5924a296ade3227dfa",
"score": "0.57782483",
"text": "def protected_scope(*args)\n self.scope_without_resource_definition_addition(*args)\n end",
"title": ""
},
{
"docid": "b9693e0a323be4c923b3ee7b1114d808",
"score": "0.5777924",
"text": "def custom_scope_get scope_name\n\t\t\tThread.current[SESSION].custom_scope_get scope_name\n\t\tend",
"title": ""
},
{
"docid": "710936f7676b9eefd35a976dd1c64248",
"score": "0.5775992",
"text": "def policy_scope(target, options={})\n policy(target, options).scope\n end",
"title": ""
},
{
"docid": "f783150f460b8b471f6a8185974f06b1",
"score": "0.57498306",
"text": "def current_scope\n params[:scope].try(:to_sym) || railgun_resource.default_scope.try(:key)\n end",
"title": ""
},
{
"docid": "04e879fe6767b1004ecb150cdafb126b",
"score": "0.5748172",
"text": "def scopes\n read_inheritable_attribute(:scopes) || write_inheritable_attribute(:scopes, {})\n end",
"title": ""
},
{
"docid": "96b2bef7e97e812d5518a4afc6ca8862",
"score": "0.5739446",
"text": "def scope_to(*args, &block)\n config.scope_to(*args, &block)\n end",
"title": ""
},
{
"docid": "fb4e06dd520f2ab54ba955d3b1d449ff",
"score": "0.5732672",
"text": "def people_scope\n Person.all.order_by_full_name\n end",
"title": ""
},
{
"docid": "9159a5abca5b42af93216efbe6c839c4",
"score": "0.5720072",
"text": "def scope\n return @scope\n end",
"title": ""
},
{
"docid": "9159a5abca5b42af93216efbe6c839c4",
"score": "0.5720072",
"text": "def scope\n return @scope\n end",
"title": ""
},
{
"docid": "9159a5abca5b42af93216efbe6c839c4",
"score": "0.5720072",
"text": "def scope\n return @scope\n end",
"title": ""
},
{
"docid": "9159a5abca5b42af93216efbe6c839c4",
"score": "0.5720072",
"text": "def scope\n return @scope\n end",
"title": ""
},
{
"docid": "9159a5abca5b42af93216efbe6c839c4",
"score": "0.5720072",
"text": "def scope\n return @scope\n end",
"title": ""
},
{
"docid": "9159a5abca5b42af93216efbe6c839c4",
"score": "0.5720072",
"text": "def scope\n return @scope\n end",
"title": ""
},
{
"docid": "bb2276b2d3bcab4bf601295064d2f0c1",
"score": "0.5710331",
"text": "def skip_policy_scope; end",
"title": ""
},
{
"docid": "2ca0645212cf70f3e497c097dc7bda49",
"score": "0.5705695",
"text": "def scope=(value)\n @scope = value\n end",
"title": ""
},
{
"docid": "2ca0645212cf70f3e497c097dc7bda49",
"score": "0.5705695",
"text": "def scope=(value)\n @scope = value\n end",
"title": ""
},
{
"docid": "2ca0645212cf70f3e497c097dc7bda49",
"score": "0.5705695",
"text": "def scope=(value)\n @scope = value\n end",
"title": ""
},
{
"docid": "2ca0645212cf70f3e497c097dc7bda49",
"score": "0.5705695",
"text": "def scope=(value)\n @scope = value\n end",
"title": ""
},
{
"docid": "2ca0645212cf70f3e497c097dc7bda49",
"score": "0.5705695",
"text": "def scope=(value)\n @scope = value\n end",
"title": ""
},
{
"docid": "2ca0645212cf70f3e497c097dc7bda49",
"score": "0.5705695",
"text": "def scope=(value)\n @scope = value\n end",
"title": ""
},
{
"docid": "140368b8340d3dcc7fafcb70843ade01",
"score": "0.56958157",
"text": "def define_scopes(custom_plural = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "a4e53f11272938243ef4b8bf32ac4958",
"score": "0.568666",
"text": "def pundit_scope(*scope)\n @pundit_api_scope ||= scope\n end",
"title": ""
},
{
"docid": "8236841161475386f2a15731ca66b622",
"score": "0.5686362",
"text": "def scope(parameters)\n scope_proxy.ad_hoc(parameters)\n end",
"title": ""
},
{
"docid": "b0c2182da48e139c6d320339bffee9b7",
"score": "0.5682899",
"text": "def scopes\n self.class.scopes\n end",
"title": ""
},
{
"docid": "4818278c961b6439eef67257fa415d57",
"score": "0.567209",
"text": "def scopes\n @scopes ||= config[:scopes] || []\n end",
"title": ""
},
{
"docid": "6596362e38441df593a62f86c444d6ac",
"score": "0.56543887",
"text": "def scope_name scope\n\t\traise \"No data-source set\" unless data_source\n\t\tdata_source.scopes.get(scope).human_name\n\tend",
"title": ""
},
{
"docid": "9e45f8a879484a24201df1a909b858e2",
"score": "0.5648148",
"text": "def scope_stack\n Thread.current[:\"[mongoid]:scope-stack\"] ||= {}\n end",
"title": ""
},
{
"docid": "9e45f8a879484a24201df1a909b858e2",
"score": "0.5648148",
"text": "def scope_stack\n Thread.current[:\"[mongoid]:scope-stack\"] ||= {}\n end",
"title": ""
},
{
"docid": "9e45f8a879484a24201df1a909b858e2",
"score": "0.5648148",
"text": "def scope_stack\n Thread.current[:\"[mongoid]:scope-stack\"] ||= {}\n end",
"title": ""
},
{
"docid": "30d1b5df9e8750ab1d2e191ed8fd70a5",
"score": "0.56120086",
"text": "def available_scopes\n (default_scopes << Doorkeeper.config.optional_scopes.to_a).flatten.uniq\n end",
"title": ""
},
{
"docid": "c1d818d8f0866bce9ff3f05be11a69fc",
"score": "0.56113803",
"text": "def define_scope_method(name)\n singleton_class.class_eval do\n ruby2_keywords(\n define_method(name) do |*args|\n scoping = _declared_scopes[name]\n scope = instance_exec(*args, &scoping[:scope])\n extension = scoping[:extension]\n to_merge = scope || queryable\n criteria = to_merge.empty_and_chainable? ? to_merge : with_default_scope.merge(to_merge)\n criteria.extend(extension)\n criteria\n end\n )\n end\n end",
"title": ""
},
{
"docid": "e7798f9ea2f4fc5a3e0d0e867d604264",
"score": "0.5607016",
"text": "def scope\n if @scope.kind_of? String\n @scope = @scope.split \",\"\n else\n @scope || []\n end\n end",
"title": ""
},
{
"docid": "f63aa4c069c82dd8094f81cbdb28c219",
"score": "0.56040996",
"text": "def scope\n field[:scope]\n end",
"title": ""
},
{
"docid": "07626ab294a870263d75e49fe47e40f7",
"score": "0.55965143",
"text": "def scope\n @scope ||= Scope.new(parent)\n end",
"title": ""
},
{
"docid": "3e463304ef594c1ed0906d3424abd26d",
"score": "0.5595546",
"text": "def scope_condition() {} end",
"title": ""
},
{
"docid": "255c0768fc69d8ec6854d0e955aef11d",
"score": "0.5580397",
"text": "def current_scope\n @scope\n end",
"title": ""
},
{
"docid": "5c38bac33efefa966ecfa7cd18402d92",
"score": "0.5578871",
"text": "def scope!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 2)\n\n type = SCOPE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:9: 'scope'\n match(\"scope\")\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__, 2)\n\n end",
"title": ""
},
{
"docid": "bce15153ee1dbafa809e93f1def9562f",
"score": "0.5562117",
"text": "def extra_scopes()\n @scopes_added_by_common_scopes\n end",
"title": ""
},
{
"docid": "bb2e7b7a15d051098d2c13e3265b9edd",
"score": "0.5551701",
"text": "def accessible_scopes\n [uid, shared_space.try(:uid)].compact\n end",
"title": ""
},
{
"docid": "a4f606407550262a1c4f7b5453725273",
"score": "0.55362654",
"text": "def apply_authz_scopes(on:)\n ScopingManager.apply_scopes_for_user(on, authz_user)\n end",
"title": ""
},
{
"docid": "fd72f2ee706eef47961cb553cb519ac4",
"score": "0.5531262",
"text": "def quoted_scope(name = nil, type: nil)\n schema, name = extract_schema_qualified_name(name)\n type =\n case type # rubocop:disable Style/HashLikeCase\n when \"BASE TABLE\"\n \"'r','p'\"\n when \"VIEW\"\n \"'v','m'\"\n when \"FOREIGN TABLE\"\n \"'f'\"\n end\n scope = {}\n scope[:schema] = quote(schema || shard.name)\n scope[:name] = quote(name) if name\n scope[:type] = type if type\n scope\n end",
"title": ""
}
] |
d1f4b3501a99af352f47b71610724e9e
|
adapter_bucket Retrieve parallel adapter bucket instance.
|
[
{
"docid": "c3d82e65a407c3c78dd631fa3e8a6385",
"score": "0.7955855",
"text": "def adapter_bucket\n \n unless @adapter_bucket\n raise 'Persistence port must be enabled first.'\n end\n \n return @adapter_bucket\n \n end",
"title": ""
}
] |
[
{
"docid": "7e3495ea06e8367294227312cd7a9a27",
"score": "0.64103746",
"text": "def bucket\n @bucket ||= begin\n bucket = config[:bucket]\n connection.buckets.create(bucket) unless connection.buckets[bucket].exists?\n connection.buckets[bucket]\n end\n end",
"title": ""
},
{
"docid": "026869deedcaa750ff89c101ae41037c",
"score": "0.62737507",
"text": "def bucket\n @bucket ||= connection.directories.get(@bucket_name, :prefix => @prefix)\n end",
"title": ""
},
{
"docid": "94603b1f46a766951dd26e90fbe24922",
"score": "0.62718165",
"text": "def bucket!(bucket)\n request = Riakpb::RpbGetBucketReq.new(:bucket => bucket)\n response = rpc.request(\n Util::MessageCode::GET_BUCKET_REQUEST,\n request\n )\n @bucket_cache[bucket].load(response)\n end",
"title": ""
},
{
"docid": "f2169a071f1212c93a3ddfe1077137b5",
"score": "0.6122057",
"text": "def bucket\n @gapi[\"bucket\"]\n end",
"title": ""
},
{
"docid": "028aa4dec79a64403179c48ed9e5db83",
"score": "0.61207765",
"text": "def bucket\n @bucket or raise NoBucketSpecified\n end",
"title": ""
},
{
"docid": "1adede2bcc0ef8aff9941077e4ac6398",
"score": "0.60995233",
"text": "def bucket\n Replication::IbmProvider.new(\n region: Settings.zip_endpoints.ibm_us_south.region,\n access_key_id: Settings.zip_endpoints.ibm_us_south.access_key_id,\n secret_access_key: Settings.zip_endpoints.ibm_us_south.secret_access_key\n ).bucket\n end",
"title": ""
},
{
"docid": "2273d0728a1240972a7ee71803dd69ef",
"score": "0.60217917",
"text": "def bucket(bucket)\n return(@bucket_cache[bucket]) if @bucket_cache.has_key?(bucket)\n self.bucket!(bucket)\n end",
"title": ""
},
{
"docid": "5086ee267fa57c1eaddc5bf159485400",
"score": "0.5973648",
"text": "def get_bucket(name)\n Bucket.new({:name => name}, @protocol)\n end",
"title": ""
},
{
"docid": "6dd17b565cea4f64e6585446ae4e0d13",
"score": "0.5915655",
"text": "def bucket(bucket)\n @buckets[bucket] = RiakOdm::Bucket.new(self, bucket) unless @buckets.has_key? bucket\n @buckets[bucket]\n end",
"title": ""
},
{
"docid": "e85b58feec0f7295e7d01e003bcbde08",
"score": "0.58522207",
"text": "def bucket(bucket)\n @task.bucket = bucket\n end",
"title": ""
},
{
"docid": "9181f4b0ec6df519c965b61461be05fe",
"score": "0.57721835",
"text": "def bucket_field\n 'bucket'\n end",
"title": ""
},
{
"docid": "9ea2e69fd178d91d57cd8cc62537bc07",
"score": "0.5750514",
"text": "def bucket=(bucket)\n @bucket = bucket\n self\n end",
"title": ""
},
{
"docid": "6ceccb1f711e399f3619f752c330a4b3",
"score": "0.57169974",
"text": "def instance_persistence_bucket\n\n bucket_instance = nil\n \n encapsulation = ::CascadingConfiguration::Core::Encapsulation.encapsulation( :default )\n \n unless bucket_instance = encapsulation.get_configuration( self, :instance_persistence_bucket )\n self.instance_persistence_bucket = to_s\n bucket_instance = super\n end\n \n return bucket_instance\n \n end",
"title": ""
},
{
"docid": "08b0601298b999b3e59bd698aec6c4e3",
"score": "0.5673162",
"text": "def bucket; ::AWS::S3.new( { :secure => false } ).buckets[DC::SECRETS['bucket']]; end",
"title": ""
},
{
"docid": "db79c06f93e51bff4337bf93345a1b34",
"score": "0.56010056",
"text": "def bucket\n return Brevidy::Application::S3_BUCKET\n end",
"title": ""
},
{
"docid": "1aa78d1a905f8f06ccace19da4f54516",
"score": "0.55987686",
"text": "def find_bucket(name)\n buckets.find(\"#{name}\")\n end",
"title": ""
},
{
"docid": "6c09d42a5094a5c0e30c37676fc5f780",
"score": "0.5590927",
"text": "def s3_bucket(name)\n s3_client.buckets[name]\n end",
"title": ""
},
{
"docid": "c69b399c0637c7f2eee27c5c5db4c85b",
"score": "0.5577441",
"text": "def bucket_for(type)\n return BUCKETS[type.to_sym]\n end",
"title": ""
},
{
"docid": "c9d40a6bf87547ec8d29b08105a20c13",
"score": "0.5564602",
"text": "def bucket_function\n @bucket_function ||= _bucket_function\n end",
"title": ""
},
{
"docid": "55445549047d8f4c1361ae31f866da3a",
"score": "0.5556538",
"text": "def get_ab_adapter(adapter)\n # return @ab_adapters[adapter]\n return get_fasta(@ab_adapters,adapter,\"ab_adapter\")\n end",
"title": ""
},
{
"docid": "3c9f07c6bc37a9872ac11f2ec347a400",
"score": "0.5553992",
"text": "def bucket_name\n self.class.bucket.name\n end",
"title": ""
},
{
"docid": "b07a28671fa88ad424c7199e17780031",
"score": "0.55489564",
"text": "def bucket\n @bucket = AWS::S3.new(:access_key_id => ENV[\"S3_ACCESS_KEY_ID\"], :secret_access_key => ENV[\"S3_SECRET_ACCESS_KEY\"]).buckets[ENV[\"S3_BUCKET\"]] if @bucket.nil?\n @bucket\n end",
"title": ""
},
{
"docid": "9e1907a529c32a8598faaeb13f9d3dcf",
"score": "0.55435544",
"text": "def storage_adapter\n Valkyrie::StorageAdapter.find(:disk_via_copy)\n end",
"title": ""
},
{
"docid": "429711010a5767f9f57867672ce690ab",
"score": "0.55059874",
"text": "def find_bucket bucket_name\n resp = connection.get_bucket bucket_name\n if resp.success?\n Bucket.from_gapi resp.data, connection\n else\n return nil if resp.data[\"error\"][\"code\"] == 404\n fail ApiError.from_response(resp)\n end\n end",
"title": ""
},
{
"docid": "429711010a5767f9f57867672ce690ab",
"score": "0.55059874",
"text": "def find_bucket bucket_name\n resp = connection.get_bucket bucket_name\n if resp.success?\n Bucket.from_gapi resp.data, connection\n else\n return nil if resp.data[\"error\"][\"code\"] == 404\n fail ApiError.from_response(resp)\n end\n end",
"title": ""
},
{
"docid": "92e78ef8fc5986b486d4cecee2b005a6",
"score": "0.5478183",
"text": "def bucket(bucket_id)\n @server.bucket(bucket_id)\n end",
"title": ""
},
{
"docid": "adc754301ba2fed7960224e039ec77aa",
"score": "0.54548323",
"text": "def bucket; ::AWS::S3.new({ secure: true }).buckets[DC::SECRETS['bucket']]; end",
"title": ""
},
{
"docid": "13c33a0b710fdb971d9e80a4527d9a04",
"score": "0.5448322",
"text": "def s3_bucket\n return @s3_bucket if defined? @s3_bucket\n\n s3 = AWS::S3.new(@task.aws_config)\n @s3_bucket = s3.buckets[@task.bucket]\n end",
"title": ""
},
{
"docid": "31db69e32ff7fa6ed19eb526dc968caf",
"score": "0.54421145",
"text": "def set_bucket\n @bucket = Bucket.find(params[:id])\n end",
"title": ""
},
{
"docid": "31db69e32ff7fa6ed19eb526dc968caf",
"score": "0.54421145",
"text": "def set_bucket\n @bucket = Bucket.find(params[:id])\n end",
"title": ""
},
{
"docid": "31db69e32ff7fa6ed19eb526dc968caf",
"score": "0.54421145",
"text": "def set_bucket\n @bucket = Bucket.find(params[:id])\n end",
"title": ""
},
{
"docid": "0466f041347d91645de17ac5b1e676d0",
"score": "0.54305",
"text": "def get_workspace_bucket(workspace_bucket_id)\n self.storage.bucket workspace_bucket_id\n end",
"title": ""
},
{
"docid": "6bd6ecb23995372c4ed6abb08d6bdd4c",
"score": "0.5394991",
"text": "def get_storage_adapter\n @storage_adapter.new(storage_adapter_config)\n end",
"title": ""
},
{
"docid": "ff2bce60fff9545825b921926e592fce",
"score": "0.539255",
"text": "def get_bucket!(bucket_name, **opts)\n bucket = gcs_client.bucket(bucket_name, **opts)\n return bucket if bucket\n raise BucketNotFoundError.new(\"Bucket \\\"#{bucket_name}\\\" not found\")\n end",
"title": ""
},
{
"docid": "e57ea0dba0c429a169e20dcb2604bbd8",
"score": "0.5387311",
"text": "def newBucket\n innerNewBucket \n end",
"title": ""
},
{
"docid": "717912ffd68cef11948ffa1edd48e45c",
"score": "0.5362025",
"text": "def default_bucket\n request(method: :get, path: '/v1/buckets')\n end",
"title": ""
},
{
"docid": "8bae19fecca12f25fa4d0ebb5b67dd5b",
"score": "0.5321779",
"text": "def initialize\n @bucket = []\n @bucket\n end",
"title": ""
},
{
"docid": "4712555f50c724c89190519b210f487a",
"score": "0.5314152",
"text": "def bucket bucket_name\n resp = connection.get_bucket bucket_name\n if resp.success?\n Bucket.from_gapi resp.data, connection\n else\n return nil if resp.data[\"error\"][\"code\"] == 404\n fail ApiError.from_response(resp)\n end\n end",
"title": ""
},
{
"docid": "4b5ad008b9fd018e71c6373cf295873b",
"score": "0.53037816",
"text": "def bucket\n begin\n # Find existing bucket:\n bucket = service.buckets.find(s3_bucket)\n rescue ::S3::Error::NoSuchBucket => e\n # Apparently the bucket doesn't exist yet, so create a new one:\n bucket = service.buckets.build(s3_bucket)\n bucket.save\n end\n bucket.retrieve\n end",
"title": ""
},
{
"docid": "ee7e772c4657e264ce65e9b79a59e499",
"score": "0.52901924",
"text": "def aws_S3_bucket_get(opts)\n AWS::S3.new.buckets[opts[:name]]\n end",
"title": ""
},
{
"docid": "7d3c15306cf32efd63c8418a1b5c5d8f",
"score": "0.52849686",
"text": "def fill_bucket(bucket_state, index)\n bucket_state[index] = @instance.capacities[index]\n return bucket_state\n end",
"title": ""
},
{
"docid": "f75f04ba75c5cf8729d44aeb2250e09c",
"score": "0.52675766",
"text": "def get_bucket(bucket_id:)\n path = '/storage/buckets/{bucketId}'\n .gsub('{bucketId}', bucket_id)\n\n if bucket_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"bucketId\"')\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::Bucket\n )\n end",
"title": ""
},
{
"docid": "92628765744e5a93ccbbdce9a890843d",
"score": "0.52560335",
"text": "def get_buckets\n buckets = call(CMD_GET_BUCKETS)[:buckets]\n buckets.map {|bucket| Bucket.new(bucket) }\n end",
"title": ""
},
{
"docid": "2c81fe7fc8375d4c7a99e6eac24d5544",
"score": "0.5254052",
"text": "def [] bucket_name\n bucket_named(bucket_name)\n end",
"title": ""
},
{
"docid": "2cd006047221d81ff14610c6ac71d638",
"score": "0.5252749",
"text": "def bucket_id bucket_name:\n buckets = b2_list_buckets(bucketName: bucket_name, accountId: account_id).buckets\n found = buckets.find{|hw| hw.bucketName == bucket_name}\n found&.bucketId or raise NotFound, \"no bucket named #{bucket_name}\"\n end",
"title": ""
},
{
"docid": "c52623cc7b53b9d29164ab6c35f8f7fd",
"score": "0.523513",
"text": "def find_bucket(bucket)\n begin\n Bucket.find(bucket) \n rescue NoSuchBucket\n S3.create_bucket(bucket)\n find_bucket(bucket)\n end\n end",
"title": ""
},
{
"docid": "849cee868b6604bea50013833faeff79",
"score": "0.52341115",
"text": "def full_bucket(bucket_name)\n @monkey_patched ||= monkey_patch_bucket\n @full_buckets ||= Hash.new\n\n bucket = buckets[bucket_name]\n @full_buckets[bucket_name] ||= Aws::S3::Bucket.new(name: bucket_name, client: client(bucket.location))\n end",
"title": ""
},
{
"docid": "637f4e547b830fe0b0bdcdc9c43490c2",
"score": "0.52214795",
"text": "def s3_gen_bucket\n s3_gen.bucket(App.aws_bucket,true)\n end",
"title": ""
},
{
"docid": "caf353451a27e2b1ca1bdc45a19337a5",
"score": "0.5203932",
"text": "def bucket_with_name(bucket_name)\n @buckets[bucket_name.to_sym] if bucket_name\n end",
"title": ""
},
{
"docid": "1483785c955b928bcb9d8ee312acb77c",
"score": "0.51848614",
"text": "def s3_bucket(bucket, **opt)\n s3_resource(**opt).bucket(bucket)\n end",
"title": ""
},
{
"docid": "2cdfbe4c4cc30f830997a8731a7f10c7",
"score": "0.5184089",
"text": "def buckets\n @buckets ||= init_buckets\n end",
"title": ""
},
{
"docid": "bc7f9c7ee4df2900f034d78ae3d1cbb0",
"score": "0.51776075",
"text": "def get bucket=nil\n if bucket\n super [@resource , bucket].join('/') \n else \n super\n end\n end",
"title": ""
},
{
"docid": "2db53379e80c4457b82dc008a87ab7d7",
"score": "0.5175772",
"text": "def adapter_params\n params[:adapter]\n end",
"title": ""
},
{
"docid": "236411c8a6957fc8d93c2e9bcc141328",
"score": "0.51756847",
"text": "def get_adapter\n \n unless @remote_adapter\n @remote_adapter = adapter_class(adapter).new(account)\n end\n \n @remote_adapter\n \n end",
"title": ""
},
{
"docid": "e5baf81ccac7d1db5f0c1b4fdfcf3748",
"score": "0.5153814",
"text": "def buckets( opts = {} )\n jbuckets = @jservice.list_all_buckets\n jbuckets.map { |jb| S3Bucket.new( self, jb, opts ) }\n end",
"title": ""
},
{
"docid": "d916a59b5e1eb2c8fb8a7b77d23e9320",
"score": "0.5150622",
"text": "def primary_storage_adapter\n @storage_adapters.first\n end",
"title": ""
},
{
"docid": "b7dcfe5281dc82033e4e46bee36a5a45",
"score": "0.51327825",
"text": "def s3_bucket\n Lono::S3::Bucket.name\n end",
"title": ""
},
{
"docid": "95e2bce7e3082021d75d0e701c9f1e8b",
"score": "0.5128398",
"text": "def get_s3_bucket_object(bucket_name)\n resource.bucket(bucket_name)\n end",
"title": ""
},
{
"docid": "30e9b49e9ccacd15582a8a53c1012d9c",
"score": "0.51239145",
"text": "def s3_bucket\n photo.s3_bucket\n end",
"title": ""
},
{
"docid": "d8de9c07893c02e5dff76708888d9759",
"score": "0.5109008",
"text": "def adapter\n account.adapter\n end",
"title": ""
},
{
"docid": "5c35e9fd15b513721457a8439156624e",
"score": "0.51068836",
"text": "def map_bucket\n @buckets.map do |bucket_name, bucket|\n yield bucket_name, bucket\n end if block_given?\n end",
"title": ""
},
{
"docid": "3766f52fed016171e895c3fb3e330d06",
"score": "0.5106236",
"text": "def find_bucket(object)\n\n\t\tif object == \"song\"\n\t\t\t@bucket = BUCKET\n\t\telsif object == \"album\"\n\t\t\t@bucket = ALBUM_BUCKET\n\t\telsif object == \"image\"\n\t\t\t@bucket = IMAGE_BUCKET\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "874ac130838e4eba53c5b841d9a96737",
"score": "0.5089011",
"text": "def bucket_policy\n @bucket_policy ||= fetch_bucket_policy\n end",
"title": ""
},
{
"docid": "21ae5277136b0c42610cdefbe5eca6a6",
"score": "0.5077912",
"text": "def instance_persistence_bucket=( persistence_bucket_class_or_name )\n \n bucket = nil\n\n case persistence_bucket_class_or_name\n \n when nil\n\n bucket = super( nil )\n \n when ::String, ::Symbol\n \n if port = instance_persistence_port\n bucket = super( port.persistence_bucket( persistence_bucket_class_or_name.to_s ) )\n else\n bucket = super( ::Persistence.pending_bucket( self, persistence_bucket_class_or_name.to_s ) )\n end\n \n when ::Persistence::Bucket\n \n bucket = super( persistence_bucket_class_or_name )\n \n else\n\n if persistence_bucket_class_or_name.respond_to?( :persistence_bucket )\n bucket = super( persistence_bucket_class_or_name.persistence_bucket )\n end\n \n end\n\n return bucket\n \n end",
"title": ""
},
{
"docid": "c490c0baa90f272170f86dd2958c98f0",
"score": "0.5066519",
"text": "def init_buckets\n Hash[client.list_buckets.buckets.map { |bucket| [bucket.name, bucket] }]\n end",
"title": ""
},
{
"docid": "e9e514f8b12aae2d3a322fb6d7eb4282",
"score": "0.5054123",
"text": "def next\n return nil unless next?\n ensure_service!\n gapi = @service.list_buckets prefix: @prefix, token: @token,\n max: @max, user_project: @user_project\n Bucket::List.from_gapi gapi, @service, @prefix, @max,\n user_project: @user_project\n end",
"title": ""
},
{
"docid": "fceefcd0b8c6c777179b259b9c1f9bb5",
"score": "0.50503606",
"text": "def adapter\n @adapter\n end",
"title": ""
},
{
"docid": "0ab34bdfe726b59eb91a9a1b8c0fdf01",
"score": "0.5045135",
"text": "def []( bucket_name, opts = {} )\n jbucket = @jservice.get_bucket( bucket_name )\n S3Bucket.new( self, jbucket, opts )\n end",
"title": ""
},
{
"docid": "48ac82a102d0de2bfc56151c2d536b5c",
"score": "0.5035441",
"text": "def swf_bucket\n return Brevidy::Application::S3_BUCKET\n end",
"title": ""
},
{
"docid": "d6daf24b136a760b25ca07f27e24cb89",
"score": "0.5021797",
"text": "def bucket_from_uri(uri)\n uri.split('/')[2]\n end",
"title": ""
},
{
"docid": "84480417534a96b462682732f8fd6b6c",
"score": "0.5018815",
"text": "def remote_file_bucket\n find_or_create_bucket('filestore.platform.infochimps')\n end",
"title": ""
},
{
"docid": "7818d8bb177d81abcfa880d07a70bb50",
"score": "0.50114876",
"text": "def adapter\n cluster.job_allow? ? cluster.job_adapter : raise(AdapterNotAllowed, \"Session specifies '#{cluster_id}' cluster id that you do not have access to.\")\n end",
"title": ""
},
{
"docid": "8c6cda04772c061fc5563c796f5ab33d",
"score": "0.50105464",
"text": "def initialize(bucket, options = {})\n raise BlankBucketException.new unless bucket\n @options = options\n\n connect!(bucket)\n end",
"title": ""
},
{
"docid": "d5836b510c5159e3ec29d78d5adcc1a5",
"score": "0.5002303",
"text": "def process_bucket(&block)\n raise ArgumentError, \"process_bucket requires a block!\" unless block_given?\n raise ArgumentError, \"You must call register_worker before processing!\" unless @memcache_client\n\n begin\n nominate\n if leader?\n # Drb thread handles leader duties\n log.info { \"#{@uri} has been elected leader\" }\n relax until_next_iteration\n initialize_buckets \n else\n # Get a bucket from the leader and process it\n begin\n bucket_process(*leader.bucket_request, &block)\n rescue DRb::DRbError => dre\n log.error { \"Error talking to leader: #{dre.message}\" }\n relax until_next_iteration\n end\n end\n end while loop?\n end",
"title": ""
},
{
"docid": "2c7108b0f0a384f623dae9696aefff51",
"score": "0.49832413",
"text": "def create_bucket( bucket_name, opts = {} )\n jbucket = JS3Bucket.new( bucket_name )\n yield jbucket if block_given?\n jbucket = @jservice.create_bucket( jbucket )\n S3Bucket.new( self, jbucket, opts )\n end",
"title": ""
},
{
"docid": "ce69c083d5f671887c734d26db2e3e76",
"score": "0.49753058",
"text": "def adapter_class\n ADAPTERS[Utilities.adapter]\n end",
"title": ""
},
{
"docid": "6e83ba6a7123cdafadf8b35a7888010c",
"score": "0.49749526",
"text": "def adapter_class\n @@adapters[configuration[:adapter]]\n end",
"title": ""
},
{
"docid": "93b3f3e531168a7bbb27355cd74ad6a5",
"score": "0.4968944",
"text": "def bucket_descriptor\n labels = {}\n MU::MommaCat.listStandardTags.each_pair { |name, value|\n if !value.nil?\n labels[name.downcase] = value.downcase.gsub(/[^a-z0-9\\-\\_]/i, \"_\")\n end\n }\n labels[\"name\"] = @mu_name.downcase\n\n params = {\n :name => @mu_name.downcase,\n :labels => labels,\n :storage_class => @config['storage_class'],\n }\n\n if @config['web']\n params[:website] = MU::Cloud::Google.storage(:Bucket)::Website.new(\n main_page_suffix: @config['web_index_object'],\n not_found_page: @config['web_error_object']\n )\n end\n\n if @config['versioning']\n params[:versioning] = MU::Cloud::Google.storage(:Bucket)::Versioning.new(enabled: true)\n else\n params[:versioning] = MU::Cloud::Google.storage(:Bucket)::Versioning.new(enabled: false)\n end\n\n if @config['bucket_wide_acls']\n params[:iam_configuration] = MU::Cloud::Google.storage(:Bucket)::IamConfiguration.new(\n bucket_policy_only: MU::Cloud::Google.storage(:Bucket)::IamConfiguration::BucketPolicyOnly.new(\n enabled: @config['bucket_wide_acls']\n )\n )\n else\n params[:iam_configuration] = MU::Cloud::Google.storage(:Bucket)::IamConfiguration.new(\n bucket_policy_only: MU::Cloud::Google.storage(:Bucket)::IamConfiguration::BucketPolicyOnly.new(\n enabled: false\n )\n )\n end\n\n MU::Cloud::Google.storage(:Bucket).new(params)\n end",
"title": ""
},
{
"docid": "aa9ec33411977a30bf6a547bae95a04c",
"score": "0.49600932",
"text": "def adapter\n @adapter ||= load_adapter\n end",
"title": ""
},
{
"docid": "7a30348dbd8e78d21a748cdf3d06ca86",
"score": "0.49540508",
"text": "def get_bucket(bucket_name, options={})\n resp = get(bucket_name, '/', options)\n resp_obj = Crack::XML.parse(resp.body)\n if resp.code == \"200\"\n resp_obj[:success] = true\n resp_obj[:bucket_name] = bucket_name\n resp_obj[:message] = \"Bucket retrieved successfully\"\n contents = resp_obj[\"ListBucketResult\"][\"Contents\"] ? Array.new : nil\n resp_obj[\"ListBucketResult\"][\"Contents\"].is_a?(Array) ? \\\n (contents = resp_obj[\"ListBucketResult\"][\"Contents\"]) : \\\n (contents[0] = resp_obj[\"ListBucketResult\"][\"Contents\"]) unless contents.nil?\n resp_obj[:contents] = contents\n resp_obj[:raw] = Crack::XML.parse(resp.body)\n resp_obj.each_key {|key| resp_obj.delete(key) unless [:success, :bucket_name, :message, :contents, :raw].include?(key) }\n\n else\n resp_obj[:success] = false\n resp_obj[:bucket_name] = bucket_name\n resp_obj[:message] = resp_obj[\"Error\"][\"Message\"]\n resp_obj[:contents] = nil\n resp_obj[:code] = resp_obj[\"Error\"][\"Code\"]\n resp_obj[:raw] = Crack::XML.parse(resp.body)\n resp_obj.each_key {|key| resp_obj.delete(key) unless [:success, :bucket_name, :message, :contents, :code, :raw].include?(key) }\n\n end\n return resp_obj\n end",
"title": ""
},
{
"docid": "95c87b754692de903a778da7d849135a",
"score": "0.49515212",
"text": "def initialize_for_port( port )\n\n if port = ::Persistence.port_for_name_or_port( port ) and port.enabled?\n \n @parent_port = ::Persistence.port_for_name_or_port( port )\n \n if @parent_port.enabled?\n @adapter_bucket = @parent_port.adapter.persistence_bucket( @name )\n end\n\n @indexes.each do |this_index_name, this_index_instance|\n this_index_instance.initialize_for_bucket( self )\n end\n \n @pending_indexes.delete_if do |this_pending_index|\n this_pending_index.initialize_for_bucket( self )\n true\n end\n \n else\n \n disable\n \n end\n \n end",
"title": ""
},
{
"docid": "694e5339889ed584bee67082b264c1b1",
"score": "0.4948509",
"text": "def aws_bucket_url\n UploadHelper.aws_bucket_url\n end",
"title": ""
},
{
"docid": "972bb6351c07bd41a3e63c134f75e6d0",
"score": "0.4946112",
"text": "def adapter\n return @adapter if @adapter\n self.use self.default_adapter\n @adapter\n end",
"title": ""
},
{
"docid": "972bb6351c07bd41a3e63c134f75e6d0",
"score": "0.49454635",
"text": "def adapter\n return @adapter if @adapter\n self.use self.default_adapter\n @adapter\n end",
"title": ""
},
{
"docid": "fcea631f2048cc16f383773d7bbd7f4b",
"score": "0.49395287",
"text": "def driver\n storage_hash = get_api_node(['storage-pools', resource[:name]])\n driver = storage_hash['driver']\n return driver\n end",
"title": ""
},
{
"docid": "5be44624f64db8163bf02c90b9050496",
"score": "0.49344394",
"text": "def get_bucket_info\n bucket = \"#{ENV['S3_BUCKET_PREFIX']}#{ENV['S3_BUCKET_SEPARATOR']}#{ENV['SERVER_NAME']}\"\n output = (`#{ENV['S3CMD_PATH']} du s3://#{bucket}`).split(' ')\n return [output[0], output[1]]\nend",
"title": ""
},
{
"docid": "94e96edf7c36cb1a39c1474780450335",
"score": "0.4925186",
"text": "def bucket_id_by_name(name)\n self.buckets.each do |bucket|\n return bucket[\"key\"] if bucket[\"name\"] == name\n end\n end",
"title": ""
},
{
"docid": "44264d6904fa722af668b5ac9b1fa435",
"score": "0.4919695",
"text": "def s3_bucket(bucket_name)\n S3Bucket.new(bucket_name)\n end",
"title": ""
},
{
"docid": "e2b88f14fd629c3eb3d589720cc3aaa5",
"score": "0.49077132",
"text": "def ensure_bucket\n Rubber::Util.retry_on_failure(*RETRYABLE_EXCEPTIONS) do\n @directory = @storage_provider.directories.create(:key => @bucket) unless @directory\n end\n return self\n end",
"title": ""
},
{
"docid": "81fff37961438aa07b3afe87f2071dec",
"score": "0.4902808",
"text": "def buckets\n body = {\n accountId: Backblaze::B2.account_id\n }\n response = post('/b2_list_buckets', body: body.to_json)\n response['buckets'].map do |bucket|\n params = Hash[bucket.map { |k, v| [Backblaze::Utils.underscore(k).to_sym, v] }]\n new(params)\n end\n end",
"title": ""
},
{
"docid": "bda77cfbb11792f958811d523c7bfc4b",
"score": "0.48968554",
"text": "def public_bucket=(value)\n class_variable_set(\"@@public_bucket\",value)\n end",
"title": ""
},
{
"docid": "6140d6ca973369cd654f5e2d788c79e0",
"score": "0.48919514",
"text": "def adapter\n self.class.adapter\n end",
"title": ""
},
{
"docid": "c1005e5022f053bd0dd3eb9a4e104cf5",
"score": "0.48890635",
"text": "def buckets\n resp = connection.list_buckets\n if resp.success?\n resp.data[\"items\"].map do |gapi_object|\n Bucket.from_gapi gapi_object, connection\n end\n else\n fail ApiError.from_response(resp)\n end\n end",
"title": ""
},
{
"docid": "e25f65dab60c724ad4697622bca658d5",
"score": "0.48878545",
"text": "def aws_s3_bucket(uri)\n uri.path.split('/')[1]\n end",
"title": ""
},
{
"docid": "5dfcb7cef4c8ce2fa9612ac5f634213c",
"score": "0.48745513",
"text": "def adapter\n @adapter ||= adapter_class.new configuration\n end",
"title": ""
},
{
"docid": "638dc6b4762813f4016cb31848b9e4cc",
"score": "0.48527858",
"text": "def buckets\n return @buckets\n end",
"title": ""
},
{
"docid": "ae5d3069f96b9a01260b25300846330a",
"score": "0.48480317",
"text": "def add(adapter)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'adapter', adapter)\n\t\t\tclient.queue_service_action_call('cdnadapterprofile', 'add', 'KalturaCDNAdapterProfile', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"title": ""
},
{
"docid": "60e4241019c6b63624fd0a032445d2b4",
"score": "0.484286",
"text": "def each &block\n response = client.list_buckets\n response.buckets.each do |b|\n yield(bucket_named(b.name, response.owner))\n end\n nil\n end",
"title": ""
},
{
"docid": "953683afa968e1a216a312465f8b8f8d",
"score": "0.4838926",
"text": "def region(bucket)\n BUCKET_TO_REGION[bucket] ||\n raise(NotImplementedError, \"Unknown bucket #{bucket}\")\n end",
"title": ""
},
{
"docid": "bd9f3907b3398d2773c28da6e1028c0d",
"score": "0.48365366",
"text": "def set_bucket_bloc\n @bucket_bloc = BucketBloc.find(params[:id])\n end",
"title": ""
}
] |
89253aa65b847d6498a45e9c0cf0bbaa
|
Visit ActiveRecord::Base objects. These should be converted to their id before being used in a comparison.
|
[
{
"docid": "d90a3084aaba3e6eb12f0a88ae8efba5",
"score": "0.6657057",
"text": "def visit_ActiveRecord_Base(o, parent)\n o.id\n end",
"title": ""
}
] |
[
{
"docid": "1a2e948b7842e3d95cb24600aaa21953",
"score": "0.57277626",
"text": "def instances_relating_to(obj)\n @relationships.map do |relationship|\n relationship_model = relationship[:references][obj.class]\n\n if !relationship_model\n []\n else\n # This relationship links to records with the same type as 'obj'\n relationship_model.filter(\"#{obj.class.table_name}_id\".intern => obj.id).map {|r|\n # Yield the instance of self that relates to obj\n r.send(self.table_name)\n }\n end\n end.flatten\n end",
"title": ""
},
{
"docid": "cd647725fc1cff8b953d605e9efd2f74",
"score": "0.56963795",
"text": "def ==(o) return self.id == o.id end",
"title": ""
},
{
"docid": "67bff480274016cfb48d1c39225910eb",
"score": "0.5653132",
"text": "def ==(o)\n if o.is_a? StupidRecord\n @id == o.id\n else\n false\n end\n end",
"title": ""
},
{
"docid": "691949444da10673a467c58a294e77c3",
"score": "0.551576",
"text": "def id_before_type_cast; end",
"title": ""
},
{
"docid": "19fcf55fc642c8214b931190eb900259",
"score": "0.5469466",
"text": "def ==(comparison_object)\n super ||\n comparison_object.instance_of?(self.class) &&\n !id.nil? &&\n comparison_object.id == id\n end",
"title": ""
},
{
"docid": "8d0a2637dd05e0f9186722b89013af42",
"score": "0.54583687",
"text": "def ==(object)\n self._id == object._id rescue false\n end",
"title": ""
},
{
"docid": "fcdb25bcb3f4ef288734bb7f61b8e5fb",
"score": "0.54553014",
"text": "def awesome_active_record_instance(object); end",
"title": ""
},
{
"docid": "00d3d25bc1a2d8eee3bda7ca8a232d41",
"score": "0.5441099",
"text": "def ==(comparison_object)\n super ||\n comparison_object.instance_of?(self.class) &&\n id.present? &&\n comparison_object.id == id\n end",
"title": ""
},
{
"docid": "c1498ce3a8ca1aaf6e7cad95d0f79f90",
"score": "0.5422124",
"text": "def ==(obj)\n obj.object_id == self.object_id\n end",
"title": ""
},
{
"docid": "57d2d917ed7cc0547f6db85160e32e79",
"score": "0.5406216",
"text": "def ==(obj)\n obj.instance_of?(self.class) && id ==(obj.id)\n end",
"title": ""
},
{
"docid": "b5dc9145f7f482d48cea5b3103da92df",
"score": "0.53787816",
"text": "def test_every_object_has_different_id\n obj = Object.new\n another_obj = Object.new\n assert_equal true, obj.object_id != another_obj.object_id\n end",
"title": ""
},
{
"docid": "e54199f9fb6957b146bdcf4b91c88423",
"score": "0.53439564",
"text": "def ==(comparison_object)\n super ||\n comparison_object.instance_of?(self.class) &&\n !id.nil? &&\n comparison_object.id == id\n end",
"title": ""
},
{
"docid": "ae8375ddaf88503af52e9c66f0686c37",
"score": "0.5331488",
"text": "def ==(comparison_object)\n super ||\n comparison_object.instance_of?(self.class) &&\n !id.nil? &&\n comparison_object.id == id\n end",
"title": ""
},
{
"docid": "ae8375ddaf88503af52e9c66f0686c37",
"score": "0.5329613",
"text": "def ==(comparison_object)\n super ||\n comparison_object.instance_of?(self.class) &&\n !id.nil? &&\n comparison_object.id == id\n end",
"title": ""
},
{
"docid": "ae8375ddaf88503af52e9c66f0686c37",
"score": "0.5329613",
"text": "def ==(comparison_object)\n super ||\n comparison_object.instance_of?(self.class) &&\n !id.nil? &&\n comparison_object.id == id\n end",
"title": ""
},
{
"docid": "b5291501c4d11bb216f9864c844f5028",
"score": "0.5317862",
"text": "def ==(obj)\n super ||\n obj.is_a?(OccamsRecord::Results::Row) &&\n obj.class.table_name && obj.class.table_name == self.class.table_name &&\n (pkey1 = obj.class.primary_key) && (pkey2 = self.class.primary_key) &&\n obj.send(pkey1) == self.send(pkey2)\n end",
"title": ""
},
{
"docid": "d8a3566c01e957d7f059535629c84f6d",
"score": "0.53085977",
"text": "def id; raise \"Subobjects don't have ids\"; end",
"title": ""
},
{
"docid": "4d51a68e2341ab8f5da099239076c34b",
"score": "0.53037125",
"text": "def ==(comparison_object)\n super ||\n comparison_object.instance_of?(self.class) &&\n self.id.present? &&\n self.id == comparison_object.id\n end",
"title": ""
},
{
"docid": "e4b8fc2c2048587c054f76d6446e0c6a",
"score": "0.52971095",
"text": "def == record\n self.id == record.try(:id)\n end",
"title": ""
},
{
"docid": "57e20978580667f4de1d702736d83cbb",
"score": "0.52850163",
"text": "def ==(object)\n\t\t\tid == object.id\n\t\tend",
"title": ""
},
{
"docid": "68a3710775e25af002ae669f55b72d94",
"score": "0.5276002",
"text": "def to_param; raise \"Subobjects don't have ids\"; end",
"title": ""
},
{
"docid": "d6802f5493efaf99402cb6d0a4f3a9d4",
"score": "0.5275668",
"text": "def ==(comparison_object)\n super ||\n comparison_object.instance_of?(self.class) &&\n primary_key_values_present? &&\n comparison_object.id == id\n end",
"title": ""
},
{
"docid": "767a5cceaf867c5088f713f47edbeee1",
"score": "0.52694994",
"text": "def convert_db_ids_to_objects(model_name,database_ids)\n result=[] \n #Get the frbr objects for rendering purposes\n for id in database_ids\n #Yuk - good old generic Ruby coding time\n myObject=FrbrObject.new(model_name.tableize.singularize, model_name.constantize.find(id))\n result << myObject\n end\n result\n end",
"title": ""
},
{
"docid": "441b5615bc92d5a58a7a6b0b45c26c26",
"score": "0.52432036",
"text": "def ==(another_object)\n if another_object.class <= ParseResource::Base\n self.id == another_object.id\n else\n super\n end\n end",
"title": ""
},
{
"docid": "726cb536316e38df19bc720fbfb411ee",
"score": "0.52421355",
"text": "def ==(other)\n case other\n when Redpear::Model\n other.instance_of?(self.class) && other.id == id\n else\n super\n end\n end",
"title": ""
},
{
"docid": "af78c2fc0066b576f626c83384f17497",
"score": "0.52321017",
"text": "def with_object(object)\n self.where(:obj_id => object.id, :obj_type => object.class.to_s)\n end",
"title": ""
},
{
"docid": "57fe4c97f46625187c3c12a27c8b0c1e",
"score": "0.5231328",
"text": "def ==(object)\n if object.is_a?(Integer)\n object == self.id\n elsif object.is_a?(Symbol)\n object == self.symbol\n elsif object.is_a?(self.class)\n object.id == self.id\n end\n end",
"title": ""
},
{
"docid": "9d96f651a7a96e6e2c4f7d9fd03b57a5",
"score": "0.52260447",
"text": "def __evolve_object_id__\n convert_to_object_id\n end",
"title": ""
},
{
"docid": "e453b5da26caf88ad0c8d5d85823037a",
"score": "0.51927215",
"text": "def eql?(o)\r\n return false if not o.is_a? Static\r\n return @id == o.id\r\n end",
"title": ""
},
{
"docid": "8d089b72ae664a2f3c820436890539e7",
"score": "0.51913834",
"text": "def ==(other)\n self.id == other.id\nend",
"title": ""
},
{
"docid": "836c2bfc0f6ad067cddfdab885012081",
"score": "0.5166527",
"text": "def object_id\n super\n end",
"title": ""
},
{
"docid": "af867578cc0fbc71cb43bdd37eadc4ff",
"score": "0.5163048",
"text": "def eql?(o, *fields)\n super o, *(fields + [:identities, :features])\n end",
"title": ""
},
{
"docid": "c810fb91ec7ffaf0a8f42bb28540c54f",
"score": "0.5160727",
"text": "def object_ids\n ids\n end",
"title": ""
},
{
"docid": "ddd907ebf81097db5976bc41a2d59880",
"score": "0.51563287",
"text": "def all_my_visitors\n DinosaursVisitor.all\n SELECT DinosaursVisitor.dinosaur_id == self.id\n \n end",
"title": ""
},
{
"docid": "70f19c59eada608f49074ed931f52b21",
"score": "0.5154982",
"text": "def ==(comparison_object)\n comparison_object.instance_of?(self.class) &&\n id.present? &&\n comparison_object.id == id\n end",
"title": ""
},
{
"docid": "70f19c59eada608f49074ed931f52b21",
"score": "0.5154982",
"text": "def ==(comparison_object)\n comparison_object.instance_of?(self.class) &&\n id.present? &&\n comparison_object.id == id\n end",
"title": ""
},
{
"docid": "6ab9f46e2ac46433d40d73181fb613a1",
"score": "0.5153738",
"text": "def eql?(obj); self.eql_count += 1; super; end",
"title": ""
},
{
"docid": "e12fe8971a3ee252f0e5e6722f5a4e52",
"score": "0.51449513",
"text": "def identical?(obj)\n raise Taxonifi::ModelError, \"Objects are not comparible.\" if obj.class != self.class\n self.class::ATTRIBUTES.each do |a|\n next if a == :id # don't compare\n return false if obj.send(a) != self.send(a)\n end\n return true\n end",
"title": ""
},
{
"docid": "b2fe1a2fc8fb466b8ec2f0dd01bd452b",
"score": "0.51392853",
"text": "def ==(comparison_record)\n self.id == comparison_record.id\n end",
"title": ""
},
{
"docid": "79785274491a015ac82624fc76f6ad70",
"score": "0.5133014",
"text": "def == other\n return false unless other.is_a?(Base)\n if id.nil? && other.id.nil?\n # no ids? assume comparing nested and revert to hash comparison\n to_hash == other.to_hash\n else\n database == other.database && id == other.id\n end\n end",
"title": ""
},
{
"docid": "4fec3be199927c843edb4e08608e855f",
"score": "0.51326334",
"text": "def animals #instance method soo zoo1.animal will give you all the animals\n Animal.all.select{|animal| animal.zoo == self}\n \n end",
"title": ""
},
{
"docid": "24171232a16833267bc773274db56be3",
"score": "0.51305085",
"text": "def === obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "24171232a16833267bc773274db56be3",
"score": "0.51305085",
"text": "def === obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "1ea1cb87c9e2a3f7fd15bad58da5f5ab",
"score": "0.51265526",
"text": "def each_oid( &block )\n\t\treturn self.model.select_map( :id ).each( &block )\n\tend",
"title": ""
},
{
"docid": "dc9f337f453397da1de1daf390789159",
"score": "0.5113128",
"text": "def identify\n\t\t[self.class, self.id]\n\tend",
"title": ""
},
{
"docid": "09f9fd1b2dd78d1f58383419b26d63d9",
"score": "0.51010424",
"text": "def id=(val); raise \"Subobjects don't have ids\"; end",
"title": ""
},
{
"docid": "699b1202f0e6a74cf884a904fab7bdef",
"score": "0.50847334",
"text": "def index_objects_by_id\n @index_objects_by_id ||= index_object_ids.invert.stringify_keys!\n end",
"title": ""
},
{
"docid": "699b1202f0e6a74cf884a904fab7bdef",
"score": "0.50847334",
"text": "def index_objects_by_id\n @index_objects_by_id ||= index_object_ids.invert.stringify_keys!\n end",
"title": ""
},
{
"docid": "e9a434f774673409e7bcaf115019da0e",
"score": "0.5084302",
"text": "def ==(comparison_object)\n comparison_object.equal?(self) ||\n (comparison_object.instance_of?(self.class) &&\n comparison_object.id == id &&\n !comparison_object.new_record?)\n end",
"title": ""
},
{
"docid": "c6261b70ce43ca35e758d49cb739f00d",
"score": "0.5081377",
"text": "def childrem_of(id)\n @objs.select do |obj| \n eval(comparision_childrem_value(\"obj\")).to_i == id.to_i\n end\n end",
"title": ""
},
{
"docid": "a75f1e67c04c91334003b7c65a93afdb",
"score": "0.5080706",
"text": "def find_identical(obj)\n return nil if obj.nil?\n raise \"#{obj.class} is not a #{self}.\" unless obj.is_a?(self)\n\n attributes= obj.attributes.send(self.acts_as_unique_col_filter) {|k,v|\n self.acts_as_unique_cols.include? k.to_sym\n }\n secondary_cols= self.acts_as_unique_cols_secondary\n unless secondary_cols.empty?\n missing= secondary_cols - attributes.keys\n raise \"Invalid column(s): #{missing.inspect}\" unless missing.empty?\n attributes.delete_if {|k,v| secondary_cols.include? k}\n end\n conditions= {}\n attributes.each{|k,v| conditions[k]= v}\n\n matches= find :all, :conditions => conditions\n if !secondary_cols.empty? and matches.size > 1\n matches= matches.select{|m| compare(secondary_cols, obj, m) }\n end\n matches.first\n end",
"title": ""
},
{
"docid": "f90218cfe3ebb53b10bd0582afe34e7b",
"score": "0.5071905",
"text": "def self_and_descendants_from_active_record\n [self]\n end",
"title": ""
},
{
"docid": "e2eadfcd43614b9544636dd4be4a2792",
"score": "0.50634295",
"text": "def ==(other)\n other.is_a?(self.class) && _id == other._id\n end",
"title": ""
},
{
"docid": "e2eadfcd43614b9544636dd4be4a2792",
"score": "0.50634295",
"text": "def ==(other)\n other.is_a?(self.class) && _id == other._id\n end",
"title": ""
},
{
"docid": "e2eadfcd43614b9544636dd4be4a2792",
"score": "0.50634295",
"text": "def ==(other)\n other.is_a?(self.class) && _id == other._id\n end",
"title": ""
},
{
"docid": "8f5ea601b7dc54540f6b90e7008949b1",
"score": "0.5057119",
"text": "def ==(other)\n self.id == other.id\n end",
"title": ""
},
{
"docid": "8f5ea601b7dc54540f6b90e7008949b1",
"score": "0.5057119",
"text": "def ==(other)\n self.id == other.id\n end",
"title": ""
},
{
"docid": "8f5ea601b7dc54540f6b90e7008949b1",
"score": "0.5057119",
"text": "def ==(other)\n self.id == other.id\n end",
"title": ""
},
{
"docid": "8f5ea601b7dc54540f6b90e7008949b1",
"score": "0.5057119",
"text": "def ==(other)\n self.id == other.id\n end",
"title": ""
},
{
"docid": "8f5ea601b7dc54540f6b90e7008949b1",
"score": "0.5057119",
"text": "def ==(other)\n self.id == other.id\n end",
"title": ""
},
{
"docid": "8f5ea601b7dc54540f6b90e7008949b1",
"score": "0.5057119",
"text": "def ==(other)\n self.id == other.id\n end",
"title": ""
},
{
"docid": "8f5ea601b7dc54540f6b90e7008949b1",
"score": "0.5057119",
"text": "def ==(other)\n self.id == other.id\n end",
"title": ""
},
{
"docid": "8f5ea601b7dc54540f6b90e7008949b1",
"score": "0.5057119",
"text": "def ==(other)\n self.id == other.id\n end",
"title": ""
},
{
"docid": "626f3058cfb44266df4b0cd8ab4e483f",
"score": "0.50525135",
"text": "def transform_to_ref(x)\n\t\t\t\tref_table[x.object_id] = x\n\t\t\t\treturn RefObject.new(x.object_id)\n\t\t\tend",
"title": ""
},
{
"docid": "ed991c8e192c7870978471d7cfa1965c",
"score": "0.5047121",
"text": "def id\n object.id.to_s\n end",
"title": ""
},
{
"docid": "74d2ae23a3ea78325ae8411421e68eff",
"score": "0.50387776",
"text": "def == obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "74d2ae23a3ea78325ae8411421e68eff",
"score": "0.50387776",
"text": "def == obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "d0baba51b265d5de16258ee101af7d77",
"score": "0.50368136",
"text": "def ==(obj)\n obj.is_a?(self.class) && obj.doc[\"_id\"] == @doc[\"_id\"]\n end",
"title": ""
},
{
"docid": "d0baba51b265d5de16258ee101af7d77",
"score": "0.50368136",
"text": "def ==(obj)\n obj.is_a?(self.class) && obj.doc[\"_id\"] == @doc[\"_id\"]\n end",
"title": ""
},
{
"docid": "60c9c11f013714cee85288ff58ca5c19",
"score": "0.50304294",
"text": "def ==(compare_dogs)\n self.id == compare_dogs.id\n end",
"title": ""
},
{
"docid": "d220ad7e7e9313c5cb9a760fc1208c91",
"score": "0.5022427",
"text": "def ==(other)\n return false unless other.is_a?(Base)\n if id.nil? && other.id.nil?\n to_hash == other.to_hash\n else\n id == other.id && database.to_s == other.database.to_s\n end\n end",
"title": ""
},
{
"docid": "9b4133a58a8358a8da2bcf8447509f6b",
"score": "0.5013789",
"text": "def identity\n [ self.class, _id ]\n end",
"title": ""
},
{
"docid": "2cdaabb9dc9fa0af3796f90eeb773f80",
"score": "0.501162",
"text": "def ==( other )\n self.object_id == other.object_id\n end",
"title": ""
},
{
"docid": "b5a7c63e4105adc033f9c299a85ec785",
"score": "0.5001273",
"text": "def ==(obj)\n obj.is_a?(self.class) && obj.doc[\"_id\"] == @doc[\"_id\"]\n end",
"title": ""
},
{
"docid": "b5a7c63e4105adc033f9c299a85ec785",
"score": "0.5001273",
"text": "def ==(obj)\n obj.is_a?(self.class) && obj.doc[\"_id\"] == @doc[\"_id\"]\n end",
"title": ""
},
{
"docid": "0fdc20d2e7214b877051e9f82ea2d9ee",
"score": "0.49973813",
"text": "def mongoize(object)\n object.__mongoize_object_id__\n end",
"title": ""
},
{
"docid": "210e412f8a69ba1af729e5176006f929",
"score": "0.49874666",
"text": "def each_oid( &block )\n\t\treturn self.model.select_map( :oid ).each( &block )\n\tend",
"title": ""
},
{
"docid": "4484ca6398706ca71d42fec88cebe2ed",
"score": "0.49840304",
"text": "def instance_identities\n \n return ::IdentifiesAs.object_instance_identities( self ) \n \n end",
"title": ""
},
{
"docid": "9a5658bbb4edbfdc704840d3d6b215e8",
"score": "0.49813616",
"text": "def ==(other)\n if other.is_a? self.class\n collect(&:id).sort == other.collect(&:id).sort\n else\n false\n end\n end",
"title": ""
},
{
"docid": "589f48ff67a7352cd2af42f0f3474f43",
"score": "0.4974226",
"text": "def convertable(metadata, object)\n inverse = metadata.inverse_klass\n if inverse.using_object_ids? || object.is_a?(BSON::ObjectId)\n object\n else\n Mongoid::Criterion::Unconvertable.new(object)\n end\n end",
"title": ""
},
{
"docid": "684ed96ee1b1715400dbcceca6f65458",
"score": "0.4973862",
"text": "def id\n object.id\n end",
"title": ""
},
{
"docid": "0a60f003bb84499ea028e9bbc48c0f70",
"score": "0.49640137",
"text": "def ===(other)\n self.object_id === other.object_id # Makes the '===' continue working, despite above <=> code\n end",
"title": ""
},
{
"docid": "edefbd33dcbfafc7143dd121a101d1d1",
"score": "0.49583402",
"text": "def real_object_id\n object_id\n end",
"title": ""
},
{
"docid": "c07eae23960d638067a882fffcbdfc84",
"score": "0.495569",
"text": "def animals\n #binding.pry\n Animal.all.select do |animal|\n animal.origin == self\n #binding.pry \n end\n end",
"title": ""
},
{
"docid": "d214a754fbb3571a951065b07c33b3ad",
"score": "0.49528658",
"text": "def ==(other)\n self.class == other.class && id == other.id\n end",
"title": ""
},
{
"docid": "205a3d488bc4d8cfddbc7f0406479265",
"score": "0.49510238",
"text": "def ==(other)\n self.class == other.class && self.id == other.id\n end",
"title": ""
},
{
"docid": "20b5c22930bb8d5e0b5d1b88f2bbcfb8",
"score": "0.4949989",
"text": "def identity\n [ self.class, self._id ]\n end",
"title": ""
},
{
"docid": "9739326e9b55b1c0301baa02c7723021",
"score": "0.49456385",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n error_type == o.error_type &&\n source_data == o.source_data &&\n object_type == o.object_type &&\n invalid_value == o.invalid_value &&\n extra_context == o.extra_context &&\n object_type_id == o.object_type_id &&\n known_column_number == o.known_column_number &&\n created_at == o.created_at &&\n id == o.id\n end",
"title": ""
},
{
"docid": "0e25a4d82fe11a0e71ebb16e5b0a24a8",
"score": "0.49424395",
"text": "def == other\n self.object_id == other.object_id\n end",
"title": ""
},
{
"docid": "4051684a33893b1708056ac7d1e95c59",
"score": "0.4941471",
"text": "def ==(other)\n self.class == other.class &&\n id == other.id\n end",
"title": ""
},
{
"docid": "3c7151f3374b530a885e577f595c1412",
"score": "0.4940592",
"text": "def hash\n [self.class, self.id].hash\n end",
"title": ""
},
{
"docid": "a098f2e245bf98625694d5f3707807ab",
"score": "0.49231225",
"text": "def all_record_ids(model)\n ids = []\n model.camelize.constantize.all.each do |e|\n ids << e.id\n end\n ids\nend",
"title": ""
},
{
"docid": "8659bc56a468f82e222962239e6a5735",
"score": "0.49220318",
"text": "def ==(other)\n id == other.id\n end",
"title": ""
},
{
"docid": "fbda2366c54c81a74499831e6978c332",
"score": "0.49208537",
"text": "def visitables(*args)\n query_options = args.extract_options!\n query_options[:include] = [:visitable]\n query_options.reverse_merge!(:conditions => Support.polymorphic_conditions_for(self, :visitor))\n \n ::Visit.find(:all, query_options).collect! { |visit| visit.visitable }\n end",
"title": ""
},
{
"docid": "99937309fd6aef8611c936e57291b94b",
"score": "0.49196488",
"text": "def visit_Torque_PostgreSQL_Arel_Nodes_Cast(o, collector)\n visit(o.left, collector) << '::' << o.right\n end",
"title": ""
},
{
"docid": "055345ea3703f66598ea6df622a1b27c",
"score": "0.4917141",
"text": "def ids\n\t self.map(&:id)\n\tend",
"title": ""
},
{
"docid": "ba818caf224dbcb462f53bd94f0d0aa6",
"score": "0.49161035",
"text": "def model_new_objects(new_objs, mapping)\n if new_objs\n new_objs.rest.each do |new_obj|\n mapping[new_obj] = @graph_builder.next_key(:os)\n @local_table.abstract_objects << mapping[new_obj]\n @local_table.assure_existence(mapping[new_obj],\n ConnectionGraph::ObjectNode, :arg_escape)\n end\n end\n end",
"title": ""
},
{
"docid": "c7bd52f3fd29085725ec142245b586b9",
"score": "0.49136996",
"text": "def ==(other)\n other.class == self.class && other.id == self.id\n end",
"title": ""
},
{
"docid": "3ecaafc791f9fa29331c8c804c70ddc6",
"score": "0.49061272",
"text": "def ==(other)\n case other\n when Associations::CollectionProxy, AssociationRelation\n self == other.records\n when Relation\n other.to_sql == to_sql\n when Array\n records == other\n end\n end",
"title": ""
}
] |
566797a10b84e8047ff662d308f49ee5
|
DELETE /modelprices/1 DELETE /modelprices/1.json
|
[
{
"docid": "c6e681aaff283dfc89ce73a2da5dd1d3",
"score": "0.6840021",
"text": "def destroy\n f_respond_destroy(@modelprice.destroy, @modelprice.id.to_s, modelprices_url)\n\n\n# @modelprice.destroy\n# respond_to do |format|\n# format.html { redirect_to modelprices_url, notice: 'Modelprice was successfully destroyed.' }\n# format.json { head :no_content }\n# end\n end",
"title": ""
}
] |
[
{
"docid": "c12d1ae42d08d3f8e2470a99060cd84c",
"score": "0.73673266",
"text": "def destroy\n @rackprice = Rackprice.find(params[:id])\n @rackprice.destroy\n\n respond_to do |format|\n format.html { redirect_to rackprices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3448c89a532325ce318a0d2120c253bf",
"score": "0.72548646",
"text": "def destroy\n @price = Price.find(params[:id])\n @price.destroy\n\n respond_to do |format|\n format.html { redirect_to prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3448c89a532325ce318a0d2120c253bf",
"score": "0.72548646",
"text": "def destroy\n @price = Price.find(params[:id])\n @price.destroy\n\n respond_to do |format|\n format.html { redirect_to prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b88e228b571ecf1c09794ef0239c4db4",
"score": "0.72133625",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to sample_prices_path, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0517d1a3b881fd2fc4f846a952840bde",
"score": "0.7175703",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: '' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b69adf71366da7c14d50405126dd8ac3",
"score": "0.7120338",
"text": "def destroy\n @fuelprice = Fuelprice.find(params[:id])\n @fuelprice.destroy\n\n respond_to do |format|\n format.html { redirect_to fuelprices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2efe7772808f0e3991c6285a7a70189f",
"score": "0.70883125",
"text": "def destroy\n @item_price = ItemPrice.find(params[:id])\n @item_price.destroy\n\n respond_to do |format|\n format.html { redirect_to item_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f8e9e193f64353245cb519059152653",
"score": "0.7055836",
"text": "def destroy\n @gt_price.destroy\n respond_to do |format|\n format.html { redirect_to gt_prices_url, notice: 'Gt price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d0431dfb677ecb048b82756767e349b3",
"score": "0.7052911",
"text": "def destroy\n @set_price = SetPrice.find(params[:id])\n @set_price.destroy\n\n respond_to do |format|\n format.html { redirect_to set_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "41b6f7f33675617c0d2436b9c54f602f",
"score": "0.7046671",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cfe489922623493d11ae7e340fabc4a4",
"score": "0.7032792",
"text": "def destroy\n @realtime_price.destroy\n respond_to do |format|\n format.html { redirect_to realtime_prices_url, notice: 'Realtime price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "04ec6bff3b0e09f1a031da1cad2fac23",
"score": "0.7030752",
"text": "def destroy\n @device_model_price = DeviceModelPrice.find(params[:id])\n @device_model_price.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'index' }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bfbfd14157d07c1f5876025d06b1429e",
"score": "0.70296",
"text": "def destroy\n @item_line_price = ItemLinePrice.find(params[:id])\n @item_line_price.destroy\n\n respond_to do |format|\n format.html { redirect_to item_line_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "727a5cb4136323f0f42411ac893e08c8",
"score": "0.70071393",
"text": "def destroy\n @default_price = DefaultPrice.find(params[:id])\n @default_price.destroy\n\n respond_to do |format|\n format.html { redirect_to default_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "52374eeb4509dd0100c7e7f3082127fd",
"score": "0.7003714",
"text": "def destroy\n @price = Price.find(params[:id])\n @price.destroy\n\n respond_to do |format|\n format.html { redirect_to(prices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f08618d66e375091ef76cd20fee26b22",
"score": "0.6998834",
"text": "def destroy\n @price_curf.destroy\n respond_to do |format|\n format.html { redirect_to price_curves_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1d7e64f736e4cd598d766bc8e8e96df1",
"score": "0.69787616",
"text": "def destroy\n @prices = Prices.find(params[:id])\n @prices.destroy\n\n respond_to do |format|\n format.html { redirect_to(prices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "35b9860b7cb9b20ea8cf1ca2465439c2",
"score": "0.6978227",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "35b9860b7cb9b20ea8cf1ca2465439c2",
"score": "0.6978227",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "35b9860b7cb9b20ea8cf1ca2465439c2",
"score": "0.6978227",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "524c45bad04aad341af6108603ceac6e",
"score": "0.6954347",
"text": "def destroy\n @stock_price = StockPrice.find(params[:id])\n @stock_price.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "264796ff390060c5b3d77cee360adc62",
"score": "0.6950134",
"text": "def delete(path, model = 'raw')\n request(:delete, path, nil, model)\n end",
"title": ""
},
{
"docid": "0a5094a1f78f9d497788243d15268456",
"score": "0.69496316",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_area_prices_url, notice: 'Период успешно удален.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "499bdde9c1238004f9e8b24ebfa518cd",
"score": "0.69420576",
"text": "def destroy\n @price_curve_nymex.destroy\n respond_to do |format|\n format.html { redirect_to price_curve_nymexes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e23bfa63b2d7e1259e2a4ce613694d0",
"score": "0.69165635",
"text": "def destroy\n @product_price.destroy\n respond_to do |format|\n format.html { redirect_to product_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "849e82f65076fecb0d4e76176fc8aa24",
"score": "0.6915924",
"text": "def destroy\n @salon.prices.each do |price|\n price.destroy\n end\n @salon.destroy\n respond_to do |format|\n format.html { redirect_to salons_url, notice: 'Salon was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8804644d778ef9138b03908809f3262",
"score": "0.6913945",
"text": "def destroy\n @admin_price = Admin::Price.find(params[:id])\n @admin_price.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_prices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b25d23a916e0956bdc1db4d869634785",
"score": "0.69101226",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to @station, notice: t('price_successfully_destroyed') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3177f1b12b1ce60d34dda67358511ffd",
"score": "0.69032466",
"text": "def destroy\n @price_master.destroy\n respond_to do |format|\n format.html { redirect_to price_masters_url, notice: DELETE_NOTICE }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c7eb24278319bff80c0189612d04532f",
"score": "0.68943316",
"text": "def destroy\n @item_price.destroy\n respond_to do |format|\n format.html { redirect_to item_prices_url, notice: 'Item price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3f652004d76ef264f743948bb9658a3d",
"score": "0.68915",
"text": "def destroy\n @i_price.destroy\n respond_to do |format|\n format.html { redirect_to i_prices_url, notice: 'I price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "04c1e3440feef9cf6bf4fab64db1f1bb",
"score": "0.6886872",
"text": "def destroy\n @stockprice.destroy\n respond_to do |format|\n format.html { redirect_to stockprices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8e95da7378862cf93a1e6ce22630486",
"score": "0.68859434",
"text": "def destroy\n @cake_price.destroy\n respond_to do |format|\n format.html { redirect_to cake_prices_url, notice: 'Cake price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f7dd66b3da61f7305a4439421a3fd1d7",
"score": "0.68843025",
"text": "def destroy\n @ih_price.destroy\n respond_to do |format|\n format.html { redirect_to ih_prices_url, notice: 'Ih price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "199ac086a72cef3596499a124412fa25",
"score": "0.68823034",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eb55435b4c1659165de1a309290cfd48",
"score": "0.68795073",
"text": "def destroy\n @customer_price = CustomerPrice.find(params[:id])\n @customer_price.destroy\n\n respond_to do |format|\n format.html { redirect_to customer_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3a6193289ad905ac823f6fc18f3e83c6",
"score": "0.68777055",
"text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html {redirect_to prices_url, notice: 'Price was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"title": ""
},
{
"docid": "0d21af8b06d2ad3643f3a2d08d4a7e8f",
"score": "0.68775725",
"text": "def destroy\n @list_price.destroy\n respond_to do |format|\n format.html { redirect_to list_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b7306cb2d598377b88d9478e0b9d4b6",
"score": "0.68688416",
"text": "def destroy\n @permit_price.destroy\n respond_to do |format|\n format.html { redirect_to permit_prices_url, notice: 'Permit price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "962a705e81790b3d4f8ced03c6c7d496",
"score": "0.6865565",
"text": "def destroy\n @client_unit_price.destroy\n respond_to do |format|\n format.html { redirect_to client_unit_prices_url, notice: 'Client unit price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8851af6e4bfc62f103b75d6cb5d76265",
"score": "0.68593925",
"text": "def destroy\n @express_price.destroy\n respond_to do |format|\n format.html { redirect_to express_prices_url, notice: 'Express price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fbb2f55787fe7cbd1a1138e5a26a763d",
"score": "0.6859103",
"text": "def destroy\n @spare_price.destroy\n respond_to do |format|\n format.html { redirect_to spare_prices_url, notice: 'Spare price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d47eaef4c92ff915f726c71f76ae7ad4",
"score": "0.6839907",
"text": "def destroy\n @coh_price.destroy\n respond_to do |format|\n format.html { redirect_to coh_prices_url, notice: 'Coh price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5be3c64b601da2e74b6f8d8a03a99dcd",
"score": "0.6839784",
"text": "def destroy\n @calculate.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c6673162fec677eea8eced46612d9f06",
"score": "0.6814722",
"text": "def destroy\n @unitprice = Unitprice.find(params[:id])\n @unitprice.destroy\n\n respond_to do |format|\n format.html { redirect_to unitprices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "42031532e6d418a3bc97c140ba35c7c0",
"score": "0.6812336",
"text": "def destroy\n @price_snapshot = PriceSnapshot.find(params[:id])\n @price_snapshot.destroy\n\n respond_to do |format|\n format.html { redirect_to price_snapshots_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72eaeec7d3b68dd07e1924bbc6095e2f",
"score": "0.68063784",
"text": "def destroy\n @offer_schedule_flat_rate_price = OfferScheduleFlatRatePrice.find(params[:id])\n @offer_schedule_flat_rate_price.destroy\n\n respond_to do |format|\n format.html { redirect_to offer_schedule_flat_rate_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c0c60da57c6daa5fd1263320541f3eb7",
"score": "0.6805078",
"text": "def destroy\n @service_price.destroy\n respond_to do |format|\n format.html { redirect_to service_prices_url, notice: 'Service price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89a06d86ec98f7ae5ef8ee7b16dc0c1b",
"score": "0.6799118",
"text": "def destroy\n @price_update.destroy\n respond_to do |format|\n format.html { redirect_to price_updates_url, notice: 'Price update was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "349a51323e209e31dc10ca8aacc77c3e",
"score": "0.6797681",
"text": "def destroy\n @crypto_price.destroy\n respond_to do |format|\n format.html { redirect_to crypto_prices_url, notice: \"Crypto price was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0d2da3465551207cc96e933a5bd0ef4",
"score": "0.6794791",
"text": "def destroy\n @create_price.destroy\n respond_to do |format|\n format.html { redirect_to create_prices_url, notice: 'Create price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e374db3c5aa8f4b7dbbf7e2704806f43",
"score": "0.67921513",
"text": "def destroy\n @moto_price = MotoPrice.find(params[:id])\n @moto_price.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_prices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3fa818c92f4c568e1735bcceb5817535",
"score": "0.6790664",
"text": "def delete(id)\n @client.delete(\"/#{@model}/#{id}\")\n end",
"title": ""
},
{
"docid": "3fa818c92f4c568e1735bcceb5817535",
"score": "0.6790664",
"text": "def delete(id)\n @client.delete(\"/#{@model}/#{id}\")\n end",
"title": ""
},
{
"docid": "168577f94fce14b048e8ddcae2d78a8a",
"score": "0.67357546",
"text": "def destroy\n @advicepost_price = AdvicepostPrice.find(params[:id])\n @advicepost_price.destroy\n\n respond_to do |format|\n format.html { redirect_to advicepost_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e8d607be0745e9c4d442829bc9b19213",
"score": "0.6721318",
"text": "def destroy\n @price_of_component.destroy\n respond_to do |format|\n format.html { redirect_to price_of_components_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "880fdc76ab0b3f0d9b816b16a1267537",
"score": "0.6721114",
"text": "def destroy\n @date_and_price.destroy\n respond_to do |format|\n format.html { redirect_to date_and_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3c11894f819518a41c42c57b267b2060",
"score": "0.67200094",
"text": "def destroy\n @dstrbtr_whl_sl_price.destroy\n respond_to do |format|\n format.html { redirect_to dstrbtr_whl_sl_prices_url, notice: 'Dstrbtr whl sl price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e773078b8237c164c91687cfec12e604",
"score": "0.6701666",
"text": "def destroy\n @price_history = PriceHistory.find(params[:id])\n @price_history.destroy\n\n respond_to do |format|\n format.html { redirect_to price_histories_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.6700918",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "3182cac99b1d0df21834840c43f67706",
"score": "0.669194",
"text": "def destroy\n @common_price = CommonPrice.find(params[:id])\n @common_price.destroy\n\n respond_to do |format|\n format.html { redirect_to(common_prices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.6690794",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "b2683d94949cd26d5891fc6257adafc9",
"score": "0.66888297",
"text": "def destroy\n @special_price.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_special_prices_url, notice: 'Период успешно удален.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "553f0c28f88fbd02afe95da49255531c",
"score": "0.6667988",
"text": "def destroy\n @mathematical_model = MathematicalModel.find(params[:id])\n @mathematical_model.destroy\n\n respond_to do |format|\n format.html { redirect_to mathematical_models_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a340c99b1b24689abddcc4da216c95d2",
"score": "0.66611797",
"text": "def destroy\n @quoted_price = QuotedPrice.find(params[:id])\n @quoted_price.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_quoted_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "78de5b72f9f57a8431cd6129af00b68f",
"score": "0.66565305",
"text": "def destroy\n @car_price.destroy\n respond_to do |format|\n format.html { redirect_to car_prices_url, notice: 'Car price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "642bcbc304d4c08be3bb94802359ce7d",
"score": "0.6654461",
"text": "def destroy\n @competitor_price.destroy\n respond_to do |format|\n format.html { redirect_to competitor_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4a4d73ec781fadcebf7c39a9eab21b73",
"score": "0.66538566",
"text": "def destroy\n @settlement_price.destroy\n respond_to do |format|\n format.html { redirect_to settlement_prices_url, notice: 'Settlement price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.66515005",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "5b803f2f5b8bda548225ccb997c834c7",
"score": "0.6650187",
"text": "def destroy\n @gprice.destroy\n respond_to do |format|\n format.html { redirect_to gprices_url, notice: 'Gprice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "625f96140612172b45ee0581ef5f24c3",
"score": "0.6644139",
"text": "def destroy\n @custumer_price.destroy\n respond_to do |format|\n format.html { redirect_to custumer_prices_url, notice: 'Custumer price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bc79641ee5ee9b32e8d9401187068ae3",
"score": "0.6639351",
"text": "def destroy\n @eq = Eq.find(params[:id])\n @eq.destroy\n\n respond_to do |format|\n format.html { redirect_to eqs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "87e4e406246f632c3574ce9d653246a4",
"score": "0.663929",
"text": "def destroy\n @unit_price.destroy\n respond_to do |format|\n format.html { redirect_to unit_prices_url, notice: 'Unit price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c27380c6dd2161b19149bede56c88801",
"score": "0.66186666",
"text": "def destroy\n @price_item.destroy\n respond_to do |format|\n format.html { redirect_to price_items_url, notice: 'Price item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6c0739eaa0d454df9ad8e26d9f40f49c",
"score": "0.6614668",
"text": "def destroy\n @api_supermarket.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "027aae8a8c4f73908c01e583d64f649c",
"score": "0.66062486",
"text": "def destroy\n @rate.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "30968027e3a1130271007d8b5d6b6768",
"score": "0.6604321",
"text": "def destroy\n @paper_weight_price = PaperWeightPrice.find(params[:id])\n @paper_weight_price.destroy\n\n respond_to do |format|\n format.html { redirect_to(paper_weight_prices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "111592deba8fb9ee5170fa7b4f3c2c70",
"score": "0.66023856",
"text": "def destroy\n @prd_m_whl_sl_price.destroy\n respond_to do |format|\n format.html { redirect_to prd_m_whl_sl_prices_url, notice: 'Prd m whl sl price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "60c98b037f8221ef39b19f37458da2bb",
"score": "0.6601997",
"text": "def destroy\n @offer_price = OfferPrice.find(params[:id])\n @offer_price.destroy\n\n respond_to do |format|\n format.html { redirect_to(offer_prices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "00570bd3b5446da292c454bd32ff97c6",
"score": "0.6592662",
"text": "def destroy\n @area_base_price = AreaBasePrice.find(params[:id])\n @area_base_price.destroy\n\n respond_to do |format|\n format.html { redirect_to area_base_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f7b1d7c8fe83a18e81c44b67dbf01294",
"score": "0.65846866",
"text": "def destroy\n @price_formula.destroy\n respond_to do |format|\n format.html { redirect_to price_formulas_url, notice: \"Price formula was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "afc9a6fa65a8e43ec1ca744ac992f0c5",
"score": "0.6580793",
"text": "def destroy\n @room_price.destroy\n respond_to do |format|\n format.html { redirect_to room_prices_url, notice: 'Room price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2c5956b2f5c7000ac708704ada3ab869",
"score": "0.6572346",
"text": "def destroy\n @client_product.destroy\n respond_to do |format|\n format.html { redirect_to @client, notice: 'Custom price was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4f16ac17ba44fef44132b960e812ecf0",
"score": "0.65636986",
"text": "def destroy\n @price_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_price_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "61a78573147aaa0c9c37ccea0f2c63a7",
"score": "0.65612245",
"text": "def destroy\n @price_observation.destroy\n respond_to do |format|\n format.html { redirect_to price_observations_url, notice: 'Price observation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d07ecf2991bcff6425699376b4f33582",
"score": "0.65602493",
"text": "def destroy\n @price_entry.destroy\n respond_to do |format|\n format.html { redirect_to price_entries_url, notice: 'Price entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ffad5960921acbfb379a7b464d3c4fff",
"score": "0.65508974",
"text": "def destroy\n @price.destroy\n update_services(@price)\n respond_to do |format|\n format.html { redirect_to :back, notice: '<b>' + @price.service.name + '</b> was successfully destroyed.'}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "98618f8a3d72f3ffd394671a29a8e341",
"score": "0.6548494",
"text": "def destroy\n @recurrency = Recurrency.find(params[:id])\n @recurrency.destroy\n\n respond_to do |format|\n format.html { redirect_to recurrencies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a420cd559576a7d46fb7268946d0b719",
"score": "0.65463275",
"text": "def destroy\n @price_level = PriceLevel.find(params[:id])\n @price_level.destroy\n\n respond_to do |format|\n format.html { redirect_to(price_levels_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "57b799133d29316426c358002043baa2",
"score": "0.6545533",
"text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end",
"title": ""
},
{
"docid": "41c29be523c843a448249c5177bfaf42",
"score": "0.65401775",
"text": "def destroy\n @curve.destroy\n respond_to do |format|\n format.html { redirect_to curves_url, notice: 'Curve was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3196c5c1f716f7bf94c85d2d2ed560c2",
"score": "0.65393484",
"text": "def destroy\n @pricelist = Pricelist.find(params[:id])\n @pricelist.destroy\n\n respond_to do |format|\n format.html { redirect_to pricelists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1cde2518cb592b6add14fe05ae1b37d",
"score": "0.65360427",
"text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end",
"title": ""
},
{
"docid": "7a44f0cb92616d0c806242af3b0ebe7c",
"score": "0.6534755",
"text": "def destroy\n @parking_space_lot_price = ParkingSpaceLotPrice.find(params[:id])\n @parking_space_lot_price.destroy\n\n respond_to do |format|\n format.html { redirect_to parking_space_lot_prices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.6529245",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "91c55e1b75df6b4c3fe419dc0aa90a08",
"score": "0.6529086",
"text": "def destroy\n @price_earning.destroy\n respond_to do |format|\n format.html { redirect_to price_earnings_url, notice: 'Price earning was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f9c5a5fb2b2e38828d4e6add95534d8b",
"score": "0.6527122",
"text": "def destroy\n @special_price = SpecialPrice.find(params[:id])\n @special_price.destroy\n get_data\n end",
"title": ""
},
{
"docid": "70b6d12e2c556adf01684b6aa3b53041",
"score": "0.6522848",
"text": "def destroy\n @price_control_item.destroy\n respond_to do |format|\n format.html { redirect_to price_control_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e9b410ec751e9e1f8d2bd109d76c7bf5",
"score": "0.652112",
"text": "def destroy\n @price_creation.destroy\n respond_to do |format|\n format.html { redirect_to price_creations_url, notice: 'Price creation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8503df71128d71acbadf5e6974de6040",
"score": "0.6518533",
"text": "def destroy\n @model.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
48ae059946bcca544fe164d404b3fb47
|
Load the RMXP Data
|
[
{
"docid": "6888cb05d9e340437181ac8566164563",
"score": "0.5982098",
"text": "def data_load\r\n unless $data_actors\r\n $data_actors = _clean_name_utf8(load_data(\"Data/Actors.rxdata\"))\r\n $data_classes = _clean_name_utf8(load_data(\"Data/Classes.rxdata\"))\r\n $data_enemies = _clean_name_utf8(load_data(\"Data/Enemies.rxdata\"))\r\n $data_troops = _clean_name_utf8(load_data(\"Data/Troops.rxdata\"))\r\n $data_tilesets = _clean_name_utf8(load_data(\"Data/Tilesets.rxdata\"))\r\n $data_common_events = _clean_name_utf8(load_data(\"Data/CommonEvents.rxdata\"))\r\n $data_system = load_data_utf8(\"Data/System.rxdata\")\r\n end\r\n $game_system = Game_System.new\r\n $game_temp = Game_Temp.new\r\n end",
"title": ""
}
] |
[
{
"docid": "68e6f70b12d1362b02ce91abe146dd6a",
"score": "0.59605944",
"text": "def load_data\n\t\tload_using_arr(train_file,train_hash,0,1)\n\t\tload_using_arr(train_file,movie_hash,1,0)\n\tend",
"title": ""
},
{
"docid": "027c59e9d511366a239b04a4c227ce17",
"score": "0.5700076",
"text": "def load(data)\n end",
"title": ""
},
{
"docid": "f91d12d1c95b2edb226492aecfe93e71",
"score": "0.56729335",
"text": "def load\r\n \r\n end",
"title": ""
},
{
"docid": "c81c532d35ee17d8b9edc99b3857d69f",
"score": "0.5648654",
"text": "def load_data\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "4fffb9d0adf3719e7c61751ce1237e1d",
"score": "0.56278884",
"text": "def load cxr\n where(cxx: cxr, hub: nil).delete_all\n #cxr_origins = OagSchedule.hub(hub).where(dest_apt: hub).pluck(:origin_apt, :airline_code, :mkt_cxrs ).uniq\n #cxr_dests = OagSchedule.hub(hub).where(origin_apt: hub).pluck(:dest_apt,:airline_code).uniq\n\n #origins = OagSchedule.cxr(cxr).distinct()\n direct_flight_records = []\n\n #origins = OagSchedule.cxr(cxr).pluck(:origin_apt, :airline_code, :mkt_cxrs).uniq\n\n schedules = OagSchedule.cxr(cxr).select(:origin_apt, :dest_apt, :airline_code, :mkt_cxrs).distinct\n cxr_schedules = schedules.group_by{|flt| [flt.origin_apt, flt.dest_apt] }.map{ |apt_pair,sched_a|\n [apt_pair, (sched_a.map{|sched| sched.airline_code } +\n sched_a.map{|sched| sched.mkt_carriers}.flatten(1)).uniq]}\n cxr_schedules.sort!\n cxr_schedules.each do |combo|\n direct_flight_records << new(cxx: cxr, origin: combo[0][0], dest: combo[0][1], carriers: combo[1])\n end\n ##origins = OagSchedule.for_cxr(cxr).pluck(:origin_apt).uniq\n #origins.each do |o_apt|\n # dest_apts = OagSchedule.cxr(cxr).where(origin_apt: o_apt).pluck(:dest_apt, :airline_code).uniq\n # dest_apts.each do |dest_apt|\n # direct_flight_records << new(cxx: cxr, origin: o_apt, dest: dest_apt)\n # end\n #end\n DirectFlight.import direct_flight_records\n end",
"title": ""
},
{
"docid": "3360c5760d3647507f36a52454e27950",
"score": "0.56070054",
"text": "def test_parse\n result = Yadis.parseXRDS(read_data_file(XRD_FILE))\n assert_not_nil result\n end",
"title": ""
},
{
"docid": "024e7b95ece34f61c588b50f943de997",
"score": "0.5597929",
"text": "def initialize\n load_data\n end",
"title": ""
},
{
"docid": "4cc638a6f7a98da975ed2f30510a5c5b",
"score": "0.55586696",
"text": "def load_rssi_data(month)\n month_counts = {\n feb: 2_237_875,\n mar: 2_247_918,\n apr: 1_420_853,\n may: 1_426_225\n }\n\n rssi_records_to_fetch = month_counts[month]\n total_slices = rssi_records_to_fetch / BATCH_SIZE\n\n progressbar = ProgressBar.create(\n total: total_slices,\n format: '%t: |%B| %p%% | %a - %e'\n )\n\n # Put RSSI data in table\n File.open(\"../data/rssi_#{month}.csv\") do |file|\n headers = file.first\n\n file.lazy.each_slice(BATCH_SIZE) do |lines|\n csv_rows = CSV.parse(lines.join, headers: headers)\n csv_rows.delete('ID')\n csv_rows.delete('Track')\n\n RssiRecord.insert_all csv_rows.map(&:to_h).each { |h| h.transform_keys!(&:underscore) }\n\n progressbar.increment\n end\n end\nend",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5541213",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5541213",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5541213",
"text": "def load; end",
"title": ""
},
{
"docid": "c1fb49c5bdcbd078a3026ca251a850ee",
"score": "0.55274063",
"text": "def load\n records.load\n end",
"title": ""
},
{
"docid": "060bb74d0718ff5b1915ee0de3708995",
"score": "0.55049765",
"text": "def load_data (training_set, test_set = :NIL)\n base = training_set + \"/u.data\" if test_set == :NIL\n\t\tbase = training_set + \"/\" + test_set.to_s + \".base\" if test_set != :NIL\n\t\tfile = File.open (base)\n\n\t\ti=0\n\t\tfile.each_line do |line|\n\t\t\t@movieStore[i] = line.split(/\\s/)\n\t\t\ti += 1\n\t\tend\n\t\tif test_set != :NIL then\n\t\t\ttest_set = training_set + \"/\" + test_set.to_s + \".test\"\n\t\t\tfile2 = File.open(test_set)\n\t\t file2.each_line do |line|\n\t\t\t @test_set << line.split(/\\s/)\n\t\t end\n else\n @test_set = @movieStore\n end\n \n\t\tuser_movie_index()\n\tend",
"title": ""
},
{
"docid": "e059b78a3db39df3941faca39728e0ea",
"score": "0.5489957",
"text": "def load\n end",
"title": ""
},
{
"docid": "e059b78a3db39df3941faca39728e0ea",
"score": "0.5489957",
"text": "def load\n end",
"title": ""
},
{
"docid": "e059b78a3db39df3941faca39728e0ea",
"score": "0.5489957",
"text": "def load\n end",
"title": ""
},
{
"docid": "3799d0dda9ea51d9c1fed9d66728fdf7",
"score": "0.546491",
"text": "def load_data\r\n\t\t@data_array = IO.readlines(@path)\r\n\t\tratings_array=[]\r\n\t\t# ya this is gonna be an array of hashes\r\n\t\t# with array index as movie id and hash with kew of rank and value of count \r\n\t\tmovie_pop_array_hash=[]\r\n\t\tuser_ratings_arr = []\r\n\t\tdata_array.each do |line|\r\n\t\t\ttemp = line.split(\"\\t\")\r\n\t\t\ttemp.map! { |i| i.to_i }\r\n\t\t\t####### THIS CREATES MOVIE POPULARITY TABLES\r\n\t\t\tmovie_pop_store(movie_pop_array_hash, temp)\r\n\t\t\t####### THIS CREATES USER RATING TABLES\r\n\t\t\tuser_rate(user_ratings_arr, temp)\r\n\t\t\t@movie_viewers[temp[0]] << temp[1]\r\n\t\tend\r\n\t\t@mov_pop_ar_hs = movie_pop_array_hash\r\n\t\t@user_ratings = user_ratings_arr\t\r\n\tend",
"title": ""
},
{
"docid": "593479a919eb316c2a11dbf2b3b63fd1",
"score": "0.5464076",
"text": "def load\n records.__send__(:load)\n end",
"title": ""
},
{
"docid": "4b3b721a1cafa094e7cd6e3d94c80339",
"score": "0.54398024",
"text": "def set_up_local_data\n Player.deserialize_from_file('players.dat')\n Game.deserialize_from_file('games.dat')\n Performance.deserialize_from_file('performance.dat')\n end",
"title": ""
},
{
"docid": "81d0d83b747aa441279b09efcc2b8bcb",
"score": "0.54284763",
"text": "def load_data(data_set)\n\t\tif data_set != :u\n\t\t\tload_hashes(\"#{data_set}.base\") # training set\n\t\t\tload_test(\"#{data_set}.test\") # test set\n\t\telse\n\t\t\tload_hashes(\"#{data_set}.data\") # training set\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ca0a947fef1c8ecd9df8aa58c2cf7bd3",
"score": "0.541959",
"text": "def load(existing_map_data, size_x)\n @data = existing_map_data\n @size_x = size_x\n end",
"title": ""
},
{
"docid": "44102e2b64dc7eab32cfad2e975776ca",
"score": "0.5406681",
"text": "def load\n flush\n replay\n end",
"title": ""
},
{
"docid": "c8e94da7553416f643754237db467fbf",
"score": "0.54044116",
"text": "def load\n end",
"title": ""
},
{
"docid": "93499056b8b38d9b1d2d3752ce048fe8",
"score": "0.53945637",
"text": "def load_data(_records, _loader)\n raise \"Implement in child\"\n end",
"title": ""
},
{
"docid": "82a0eda3838a0806128e0a1fb5ed37fc",
"score": "0.53934485",
"text": "def load_movie_data\n\t\tfull_file_path = @data_file_path + '/' + MOVIE_DATA_FILE\n\t\tCSV.foreach(full_file_path, {col_sep: \"|\", encoding: 'windows-1251:utf-8'}) do |row|\n\t\t\tid, title, date, released, url, *genre_bools = row\t\n\t\t\thas_genres = GENRE_LIST.zip(genre_bools).select{ |genre, bool| bool == '1'}.map{ |genre, bool| genre}\n\t\t\tmovie = get_obj(Movie, @all_movies, id)\n\t\t\tmovie.genres.merge has_genres\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6996186841d80b33eb2af6b4dddaa0c4",
"score": "0.5375452",
"text": "def DataLoadFromFile(filename)\n file = File.new(filename)\n \n @xml_data = file\n self.ScrapAnalyse()\n end",
"title": ""
},
{
"docid": "2aac845611dfa65d667a546e425cd179",
"score": "0.532732",
"text": "def load_rmxp_scripts\n ban1 = 'config'\n ban2 = 'boot'\n ban3 = '_'\n load_data('Data/Scripts.rxdata').each do |script|\n # @type [String]\n name = script[1].force_encoding(Encoding::UTF_8)\n next if name.downcase.start_with?(ban1, ban2, ban3)\n eval(Zlib::Inflate.inflate(script[2]).force_encoding(Encoding::UTF_8), $global_binding, name)\n GC.start\n end\n end",
"title": ""
},
{
"docid": "935d8e1d8c0e59a13267c94e114e1449",
"score": "0.5325205",
"text": "def load record\n end",
"title": ""
},
{
"docid": "8c49a900e72df23aff491eb3631882c1",
"score": "0.53040814",
"text": "def load\n\t\t\t\t0\n\t\t\tend",
"title": ""
},
{
"docid": "8982067822481128cb6137d1a172aedd",
"score": "0.5289471",
"text": "def load_data(dir_path,file_name=nil)\n \tloca_path='/Users/jinfenglin/Dropbox/cosi105b_jinfenglin/movies-2/'\n\t\tif file_name\n base=loca_path+dir_path+'/'+file_name.to_s+'.base'\n test=loca_path+dir_path+'/'+file_name.to_s+'.test'\n base_file=open(base)\n test_file=open(test)\n build_database(base_file,@base_data_user_key,@base_data_movie_key)\n build_database(test_file,@test_data_user_key,@test_data_movie_key)\n else\n path=loca_path+dir_path+'/u.data'\n file=open(path)\n build_database(file,@base_data_user_key,@base_data_movie_key)\n end\n end",
"title": ""
},
{
"docid": "fb5591c2fbad3669415a2e0a24c719a3",
"score": "0.5275737",
"text": "def load_data\n raise \"Data is temporarily disabled\" unless EolConfig.data?\n EOL.log_call\n # Sad that we need to load all of this for the about and glossary tabs, but\n # TODO - we can cache this, later:\n @taxon_data = []\n @range_data = []\n @data_point_uris = []\n @categories = []\n @include_other_category = @data_point_uris &&\n @data_point_uris.detect { |d| d.predicate_known_uri.nil? ||\n d.predicate_known_uri.toc_items.blank? }\n @units_for_select = []\n end",
"title": ""
},
{
"docid": "74d7d6ea7352e3914e6d23478eadb9de",
"score": "0.5269681",
"text": "def load_fx_data(feed_uri)\n #Update the local file that datastore.datasource reads from e.g.'http://www.ecb.europa.eu/stats/eurofxref/fx_data.xml'\n fx_data = open(feed_uri) { |f| f.read }\n File.open(@datastore.fx_datasource::FX_DATA, 'w+') { |f| f.puts(fx_data) }\n @datastore.load_fx_rate\n end",
"title": ""
},
{
"docid": "ac259f0314112fb3c8238c51d4a6955d",
"score": "0.5253195",
"text": "def load_data\n\t\tFile.open(\"#{@path_to_training}\", \"r\").each_line do |line|\n\t\t\ta = line.split\n\t\t\tadd_movie(a[1].to_i, a[0].to_i, a[2].to_i)\n\t\t\tadd_user(a[0].to_i, a[1].to_i, a[2].to_i)\n\t\tend\n\t\tif File.file?(\"#{@path_to_test}\") then\n\t\t\tFile.open(\"#{@path_to_test}\", \"r\").each_line do |line|\n\t\t\t\ta = line.split\n\t\t\t\t@list_of_test_set << Rating.new(a[0].to_i, a[1].to_i, a[2].to_i)\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d0807e3323483166279996d425c5fdfc",
"score": "0.52489823",
"text": "def load\n end",
"title": ""
},
{
"docid": "d0807e3323483166279996d425c5fdfc",
"score": "0.52489823",
"text": "def load\n end",
"title": ""
},
{
"docid": "09021896bec502cc0b73ce7cc466790f",
"score": "0.52467",
"text": "def load\n super\n slice_records!\n\n self\n end",
"title": ""
},
{
"docid": "0e4666e4345846623d2d6f071064e042",
"score": "0.52317464",
"text": "def data\n @data ||= load_matrix\n end",
"title": ""
},
{
"docid": "0107eb35f88c7dab0a91fdf6862bc238",
"score": "0.52274746",
"text": "def load_file(path, name)\n data_file = PStore.new(path)\n data = nil\n data_file.transaction do\n data = data_file[name]\n end\n if data == nil\n data = Array.new\n end\n data\nend",
"title": ""
},
{
"docid": "67eb8ac976bcbc79e0df12657fffea5e",
"score": "0.5217396",
"text": "def data\n self.load if @data.nil?\n @data\n end",
"title": ""
},
{
"docid": "4f28d48fa827646eec0ec85c77129e37",
"score": "0.5210467",
"text": "def get_data\n data_array = File.open(RightScale::MetaDataFile)\n data_array.each do |d|\n key, data = d.split('=')\n key.strip!\n data.strip!\n rightscale_deprecated[key.sub(/RS_/,'')] = data unless add_server(key,data) \n end\nend",
"title": ""
},
{
"docid": "3d38a1391f6a3b42d71d22a349356a8e",
"score": "0.5206815",
"text": "def post_load(all_records)\n end",
"title": ""
},
{
"docid": "c10d7257b456e7da9691bd8802204f70",
"score": "0.5205477",
"text": "def load_data(data_file)\n puts \"FileGenTask: Loading data from YML file [ #{data_file} ]\" if @verbose\n df = DataFile.new\n @data = df.read( data_file )\n end",
"title": ""
},
{
"docid": "a34bb0630eefb2a0a256158a761197cb",
"score": "0.5205241",
"text": "def load_datapoints(data_points)\n @data_points = data_points\n end",
"title": ""
},
{
"docid": "f5fecd07b2e25ef24bfa4bdb924be5f0",
"score": "0.5204581",
"text": "def load\n #p 'loading ...'\n #p @name\n @rarray = Array.new\n begin\n dshash = YAML.load_file('db/'+@name+'.store') \n #p dshash\n #@rkeys = Array.new\n #p 'loading ...'\n dshash.each {|k,v| # converts strings into symbols\n cid = dshash[k][\"id\"]\n next if cid < 1 # do not transform if id < 1 \n #@rkeys << k\n rhash = Hash.new \n v.each {|k2,v2|\n #p k2\n #p v2\n rhash[k2.to_sym] = v2\n }\n @rarray << rhash\n }\n rescue\n p 'no file now' \n self.insert({:id=>0})\n end\n end",
"title": ""
},
{
"docid": "5b7f319ea389a71b36a0ccd2b9b75810",
"score": "0.52028155",
"text": "def load_data\n puts \"Loading data now...\".cyan\n self.data_loader = CovidTracking::DataLoader.new\n sleep(1.5)\n puts \"Data loaded. Making the summaries now...\".cyan\n sleep(1.5)\n self.data_loader.make_summaries\n program_run\n end",
"title": ""
},
{
"docid": "eac35284c97be7cd3d56113d533482f5",
"score": "0.5183164",
"text": "def load\n eval(@data, TOPLEVEL_BINDING, @filename)\n end",
"title": ""
},
{
"docid": "71a64f6985ee025bc710d689c8ae7e41",
"score": "0.51704556",
"text": "def load_data(filename='./ml-100k/u.data')\n datafile = open(filename)\n #three data structure to store the data\n @data=Array.new #array of arrays which stores each line of the the data\n @movies=Hash.new #map that for each unique movie id in the data file, stores its relevant records\n @users=Hash.new #map that for each unique user in the data file, stores its relevant records\n datafile.each_line do |line|\n linedata=line.split(\" \").map(&:to_i)\n @data.push(linedata)\n if !@users.has_key?(linedata[0])\n @users[linedata[0]]=[linedata]\n else\n @users[linedata[0]].push(linedata)\n end\n \n if !@movies.has_key?(linedata[1])\n @movies[linedata[1]]=[linedata]\n else\n @movies[linedata[1]].push(linedata)\n end\n end\n datafile.close\n end",
"title": ""
},
{
"docid": "9ed9d2a55c27df18756cae5c734c28a6",
"score": "0.5169561",
"text": "def load_data\n ## @calculators = GiftPackage.calculators.sort_by(&:name)\n end",
"title": ""
},
{
"docid": "a29299e8173afc0308a0a255125ed98f",
"score": "0.5168085",
"text": "def reload\n self.data = self.class.load_data\n self\n end",
"title": ""
},
{
"docid": "c770ef06579d8782a14044674646411c",
"score": "0.5167254",
"text": "def pbLoadMetadata\n $PokemonTemp = PokemonTemp.new if !$PokemonTemp\n if !$PokemonTemp.pokemonMetadata\n if !pbRgssExists?(\"Data/metadata.dat\")\n $PokemonTemp.pokemonMetadata = []\n else\n $PokemonTemp.pokemonMetadata = load_data(\"Data/metadata.dat\")\n end\n end\n return $PokemonTemp.pokemonMetadata\nend",
"title": ""
},
{
"docid": "917a11242db31de98ac25d69a728e05f",
"score": "0.51542306",
"text": "def load_data()\n @trainSet.each do |line|\n subline = line.split\n user_id = subline[0].to_i\n movie_id = subline[1].to_i\n rating = subline[2].to_i\n\n if !(@usermap.has_key?(user_id))\n @usermap[user_id] = Hash.new\n end\n #first we fill up usermap\n @usermap[user_id][movie_id] = rating\n\n if !(@moviemap.has_key?(movie_id))\n @moviemap[movie_id] = Hash.new\n end\n #then we fill up moviemap\n @moviemap[movie_id][user_id] = rating\n end\n end",
"title": ""
},
{
"docid": "9affe4274779698f58b89651b03d9b4d",
"score": "0.5150208",
"text": "def reload_data\n puts \"Refreshing data now...\".cyan\n sleep(2)\n CovidTracking::Summary.reset\n CovidTracking::CountrySummary.reset\n self.data_loader.reset\n program_run\n end",
"title": ""
},
{
"docid": "290c97d0e05b0ff01cdb5a600074cdab",
"score": "0.51360023",
"text": "def reload; @data = File.read @path end",
"title": ""
},
{
"docid": "0d52f50f19aac795f0ff81403086bfb5",
"score": "0.5133013",
"text": "def load_data\n @data ||= CSV.read(@file)\n end",
"title": ""
},
{
"docid": "b9e400c8be6ea9052f75dedcd4ac5d68",
"score": "0.51234466",
"text": "def load_data(folder,dataset=nil)\n train = dataset == nil ? \"#{folder}/u.data\" : \"#{folder}/#{dataset.to_s}.base\" \n test = dataset == nil ? \"\" : \"#{folder}/#{dataset.to_s}.test\"\n @trainset=read_file train\n @testset=read_file test\n #build user and movie index using hashes\n @user_index=@trainset.group_by { |item| item.u_id }\n @movie_index=@trainset.group_by { |item| item.m_id }\n @rating_index={}\n @trainset.each {|item| @rating_index[[item.u_id,item.m_id]]=item.rating }\n end",
"title": ""
},
{
"docid": "24559bc6713358216416ac96feed98f3",
"score": "0.5115761",
"text": "def load_data\n @roles = Role.find(:all, :order => \"name\")\n @users = User.find(:all, :order => \"login\")\n end",
"title": ""
},
{
"docid": "b24324f3ab00f85d61d95f1be7006080",
"score": "0.51079017",
"text": "def load_data\n @regions = Region.find(:all, :order => \"name\")\n end",
"title": ""
},
{
"docid": "91cf49c6837d02e0573eaf30b6bb00b7",
"score": "0.51010054",
"text": "def set_source_data_pfr\n @source_data_pfr = SourceDataPfr.find(params[:id])\n end",
"title": ""
},
{
"docid": "c2a8074b54a958e8738f949237024c0d",
"score": "0.50808406",
"text": "def test_parse_and_load_mdc_snp_data\n column_headings = []\n snp_data = []\n results = 0\n \n File.open(\"#{RAILS_ROOT}/test/mocks/#{@mdc_filename}\",\"r\") do |file|\n while (f = file.gets)\n\n next if f =~ /^#/ # ignore lines that start with a hash - comments\n f.strip! # remove any whitespace, linefeeds, etc.\n\n # if this line has the column headings, extract and do the next line\n if f =~ /^a1_External_ID/\n column_headings = f.split(/\\t/)\n next\n end\n\n # Split the mdc file based on tabs\n snp_data = f.split(/\\t/)\n\n results += @controller.load_mdc_snp_data(column_headings,snp_data)\n \n assert_equal column_headings.size, snp_data.size\n # break\n end # end of file_array.each loop\n \n # check the results returned match the expected number of snps loaded\n assert 9, results\n\n # check number of SNPs loaded into the database itself, should be 15\n assert 9, Snp.find(:all).size\n \n # Look for specific SNP\n snp = Snp.find_by_symbol('J500418')\n assert_not_nil snp\n \n strain2 = Strain.find_by_mdc_id('MDC-05-90')\n assert_not_nil strain2\n end\n end",
"title": ""
},
{
"docid": "c7f144806c1a120e2244f24ebb7f6ddb",
"score": "0.5072481",
"text": "def load\n with_unzipped_file do |uzf|\n square_side = Math.sqrt(uzf.length / 2).to_i\n\n fail WrongDimensionsError if square_side != SRTM1_SIDE && square_side != SRTM3_SIDE\n\n lon, lat = tile_to_lon_lat(filename)\n TileData.new(filename, lat, lon, square_side, read_data(uzf, square_side))\n end\n end",
"title": ""
},
{
"docid": "4c7a030c45ef5e7d09b1ce3010f2c88b",
"score": "0.50699276",
"text": "def load_all; end",
"title": ""
},
{
"docid": "4c7a030c45ef5e7d09b1ce3010f2c88b",
"score": "0.50699276",
"text": "def load_all; end",
"title": ""
},
{
"docid": "4c7a030c45ef5e7d09b1ce3010f2c88b",
"score": "0.50699276",
"text": "def load_all; end",
"title": ""
},
{
"docid": "0a7c139e7d91ce388078eb8abcd0037f",
"score": "0.50698406",
"text": "def get_data\n\t\tdata_hash = {path: @data_file_path, training: @training_file_name, testing: @testing_file_name}\n\t\tDataLoader.new(data_hash)\n\tend",
"title": ""
},
{
"docid": "3a53ba83ff892f8a5fda5d61dc23e8d5",
"score": "0.5060218",
"text": "def map_added_rpx_data( rpx_data )\n\n\t\t\tend",
"title": ""
},
{
"docid": "e72284c6c23c3844b3f53dcc4111a005",
"score": "0.5050967",
"text": "def load_data(file)\n\t\t@user_set = Hash.new\n\t\t@sim_set = Hash.new\n\t\t@movies = Array.new\n\t\tFile.open(file).each do |line|\n\t\t\tline = line.split(\" \")\n\t\t\tgenerate_movies(line[0]) unless file.include? \"test\"\n\t\t\tgenerate_user_pref(line[0], line[1], line[2])\n\t\tend\n\t\t# generate_predictions unless file.include? \"test\"\n\tend",
"title": ""
},
{
"docid": "5c740f4b58ad1be89ce67c57a1da8207",
"score": "0.5046791",
"text": "def load!; end",
"title": ""
},
{
"docid": "eb90a550148776e55bda9bc091bc2e0c",
"score": "0.5037222",
"text": "def load_data\n\t\tFile.open(\"u.data\", \"r\").each_line do |line|\n\t\t\ta = line.split\n\t\t\t@movies[a[1].to_i] = @movies[a[1].to_i] + a[2].to_i\n\n\t\t\t@users[a[0].to_i] = @users[a[0].to_i].push(a[1].to_i)\n\t\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2c98ca85e57655118de42eb7da7873ca",
"score": "0.50306547",
"text": "def residual_load\n render_serializer QueryCurveCSVSerializer.new(\n Etsource::Config.residual_load_csv,\n @scenario.gql,\n 'residual_load'\n )\n end",
"title": ""
},
{
"docid": "d95d01fef94d3baa9b1d56c5b5c1ac4c",
"score": "0.50233656",
"text": "def load_mdc_snp_data(column_head_array, snp_data)\n snps_loaded = 0\n snp = Snp.find_by_symbol(snp_data[0])\n if snp == nil\n snp = Snp.new(\n :symbol => snp_data[0],\n :sequence => snp_data[3],\n :bn_genotype => snp_data[4],\n :target_allele => snp_data[5]\n )\n\n # location = MapPosition.new(\n # :chromosome_label => snp_data[1],\n # :chromosome_number => CHR_NUMBERS[snp_data[1]],\n # :start => snp_data[2],\n # :end => snp_data[2]\n # )\n\n if snp.save\n the_map = Map.find(1)\n MapPosition.create(\n :mappable => snp,\n :map => the_map,\n :chromosome_number => CHR_NUMBERS[snp_data[1]],\n :chromosome_label => snp_data[1],\n :start => snp_data[2],\n :end => snp_data[2]\n )\n snps_loaded += 1\n end\n end\n\n # SNP should exist at this point, lets load the genotype data\n\n alleles = snp_data[7..500] # 500 is arbitrary large number, larger than number of columns\n strain_cache = [] # store the strain objects after we've first got them, save db access\n\n alleles.each_with_index do |allele, i|\n\n strain = strain_cache[i]\n if strain == nil\n # find the strain appropriate to this column\n strain = Strain.find_by_mdc_id(column_head_array[i+7])\n if strain == nil\n \n # $LOG.warn(\">>>>> >>>> New strain!!: #{column_head_array[i+7]}\")\n \n strain = Strain.create(\n :symbol => column_head_array[i+7],\n :mdc_id => column_head_array[i+7],\n :taxon_id => 10116\n )\n end\n strain_cache[i] = strain # save for subsequent markers\n end\n\n if strain != nil # was found in database or created new\n\n is_het = false\n genotype_allele = '' # default value\n\n # For Rat, Allele 1 == BN, Allele 2 == other?\n allele1,allele2 = snp.target_allele.split('/')\n if snp.bn_genotype != allele1\n # Need to swap things around\n tmp1 = allele1\n tmp2 = allele2\n allele1 = tmp2\n allele2 = tmp1\n end\n\n\n # Translate the MDC data notation into genotype notation that is compatible\n # with other tools such as haploview\n\n case allele\n when '0'\n is_het = false\n genotype_allele = \"#{allele1}#{allele1}\"\n genotype_code = 0\n when '1'\n is_het = true\n genotype_allele = \"#{allele1}#{allele2}\"\n genotype_code = 1\n when '2'\n is_het = false\n genotype_allele = \"#{allele2}#{allele2}\"\n genotype_code = 2\n when '5'\n is_het = false\n genotype_allele = \"#{allele2}#{allele2}\"\n genotype_code = 5\n else\n is_het = false\n genotype_allele = \"NN\"\n genotype_code = 6\n end\n\n geno = Genotype.create(\n :genotypable => snp,\n :strain => strain,\n :is_het => is_het,\n :genotype_code => genotype_code,\n :genotype_allele => genotype_allele\n )\n \n if genotype_allele != 'NN'\n new_strain_snp_count = strain.snp_count + 1\n Strain.update(strain.id, {:snp_count => new_strain_snp_count})\n end\n end\n\n end\n return snps_loaded\n end",
"title": ""
},
{
"docid": "6986616c6c182c4cb43a89dda8ddc43b",
"score": "0.50156385",
"text": "def load(filename)\n\t\tend",
"title": ""
},
{
"docid": "ab0e050df115149293476666a2c8dcbb",
"score": "0.5006621",
"text": "def load_test(data_set)\n\t\tFile.open(data_set, \"r\") do |f|\n\t\t\tf.each_line do |line|\n\t\t\t\t@@line_array = line.split(' ')\n\t\t\t\t@test_set.push([@@line_array[0].to_i, @@line_array[1].to_i, @@line_array[2].to_i])\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bb46e48a3e4ff659cc7fffeee4c2fd87",
"score": "0.50045073",
"text": "def test_data_load_and_reset\n @test = CinePassion.new\n assert_equal(@test.xml_data, \"\")\n \n @test.DataLoadFromFile(\"test/data/cinepassion-scraper-test-01-one-response.xml\")\n assert_not_equal(@test.xml_data, \"\")\n \n @test.DataReset()\n assert_equal(@test.xml_data, \"\")\n end",
"title": ""
},
{
"docid": "a461eade7370c13bfb71ad2797492482",
"score": "0.49937338",
"text": "def preload_data\n DataStore.instance.insert_data('users', 'data/users.json')\n DataStore.instance.insert_data('tickets', 'data/tickets.json')\n end",
"title": ""
},
{
"docid": "db54771a10845ae64791a37847889bfc",
"score": "0.4992841",
"text": "def load_data\n # @categories = Category.find(:all)\n # @infoitems = Expert.find(:all)\n end",
"title": ""
},
{
"docid": "ef9803394501351d95b8d0e11d1d9d72",
"score": "0.49866372",
"text": "def read_data_file(path); end",
"title": ""
},
{
"docid": "ddf385117604a7ffcf852c5bd5f51d8b",
"score": "0.49721327",
"text": "def load_data\n return if [:loading, :ready ].include? state\n self.state = :loading\n data_loader.async.load_data\n end",
"title": ""
},
{
"docid": "91b5218c5e016283f2b520ddd28095bc",
"score": "0.49714863",
"text": "def load_dataE(filename)\r\n Log.ger.debug('Read '+filename)\r\n File.open(filename, \"rb\") { |f|\r\n obj = Marshal.load(f)\r\n }\r\nend",
"title": ""
},
{
"docid": "c6654925ea459fb382056c05fa787c80",
"score": "0.4970466",
"text": "def load_hashes(data_set)\n\t\tFile.open(data_set, \"r\") do |f|\n\t\t\tf.each_line do |line|\n\t\t\t\t@@line_array = line.split(' ')\n\t\t\t\tload_user_info\n\t\t\t\tload_movie_viewers\n\t\t\t\tload_movie_ratings\t\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c82b304ad2338dafb6c17cde365ed415",
"score": "0.4966578",
"text": "def load_local\n download_local if not File.exist?(Metar::Station.local_nsd_path)\n @nsd_cccc = File.open(Metar::Station.local_nsd_path) do |fil|\n fil.read\n end\n end",
"title": ""
},
{
"docid": "81c72dc26aa07a72fc17becf53ce2045",
"score": "0.49545375",
"text": "def load_realtime_data\n proto = Net::HTTP.get(URI.parse(realtime_url))\n data = Transit_realtime::FeedMessage.decode(proto)\n\n schedule_data = []\n data.entity.each do |entity|\n if entity.field?(:trip_update)\n schedule_data << entity.trip_update.to_hash_value\n end\n end\n schedule_data\n end",
"title": ""
},
{
"docid": "f407f5fdb8a6233c31e2007537688924",
"score": "0.49508578",
"text": "def load (scriptPath)\n @examRip.instance_eval( File.read( scriptPath ) , scriptPath, 1)\n end",
"title": ""
},
{
"docid": "e5f79d0d8534430af7088449f6fd46e6",
"score": "0.49501514",
"text": "def loadData!\n v = validateWorkingDir!\n @plataforms = YAML::load_file(File.open(getWorkingDir+'/data.host', 'r'))\n if(@plataforms == false)\n @plataforms = Hash.new\n end\n return v\n end",
"title": ""
},
{
"docid": "9711d6fa3ed463e4ad1dc4ee42b81cdb",
"score": "0.49397567",
"text": "def load_data(file_name)\n\t\tindata = []\n\t\t#csv reader as shown in class; typecasted because I ran into some weird bugs\n\t\tCSV.foreach(\"#{file_name}\", col_sep: \"\\t\") do |row| \n\t\t\tindata.push({\"user_id\"=>row[0].to_i, \"movie_id\"=>row[1].to_i, \"rating\" => row[2].to_i, \"timestamp\" => row[3].to_i})\n\t\tend\n\t\treturn indata\n\tend",
"title": ""
},
{
"docid": "b08430ec910e3dbf8db8e18852c16e57",
"score": "0.4938701",
"text": "def generate_raw_data\n self.raw_data = Estimation::RawData.factory(cols: parameter_space.size, rows: project_setting.accuracy)\n end",
"title": ""
},
{
"docid": "ecbf3ac06bd81839c10d3a953e01c1d4",
"score": "0.4936474",
"text": "def load_attributes\n p \"load attributes\"\n self.load_general_attributes\n self.load_pv_attributes\n self.load_lv_attributes\n end",
"title": ""
},
{
"docid": "3c8f81572ab1575b714757ac5ff583e2",
"score": "0.49243867",
"text": "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end",
"title": ""
},
{
"docid": "9aba28ec611b6a184d0caf70a9e3bbf3",
"score": "0.49195284",
"text": "def load_data!(time_start=nil, time_end=nil, tags = {}, agg = \"sum\", downsample = nil)\n metric_data = metrics(time_start, time_end, tags, agg, downsample).first\n if metric_data then\n self.data = metric_data[:vals]\n self.metadata = metric_data[:tags]\n end\n self.query = { :start => time_start, :end => time_end, :tags => tags, :downsample => downsample }\n end",
"title": ""
},
{
"docid": "fa4c906d2b9f95dc4226631c574d291d",
"score": "0.49063247",
"text": "def refresh\n @data = read_data\n end",
"title": ""
},
{
"docid": "ec6551a6f491f9ee71b4eb2e24f25007",
"score": "0.49057642",
"text": "def read_data\n\t\t@testers_data = CSV.read(\"data/testers.csv\")\n\n\t\t@testers_device_data = CSV.read(\"data/tester_device.csv\")\n\n\t\t@devices_data = CSV.read(\"data/devices.csv\")\n\n\t\t@bugs_data = CSV.read(\"data/bugs.csv\")\n\tend",
"title": ""
},
{
"docid": "d744252c819d9189143dce879ebf4d51",
"score": "0.49029514",
"text": "def initialize(rdb_filename)\n File.open(rdb_filename, \"rb\") do |file|\n @header = read_header(file)\n @data = file\n read_data\n end\n end",
"title": ""
},
{
"docid": "a0ddc6314e1bcc908227c9aa6cb1d0fa",
"score": "0.48999712",
"text": "def load_data\n @promotions = Promotion.find(:all)\n @products = Product.find(:all, :conditions => ProductFilter.website_conditions(@website))\n end",
"title": ""
},
{
"docid": "31f230216e322cd90ab67cb6bc33e2f3",
"score": "0.48998377",
"text": "def set_vars(path, suffix)\r\n\t\t\t#binding.pry\r\n\t\t\tset = MovieDataSet.new(@path+suffix)\r\n\t\t\tset.load_data\r\n\t\t\treturn set\r\n\tend",
"title": ""
},
{
"docid": "253259155ecea36147ebc87353a90e36",
"score": "0.48974198",
"text": "def reload!\n fetch_data!\n end",
"title": ""
},
{
"docid": "731ccfddbac16756081a5a409f40cd29",
"score": "0.4889092",
"text": "def read_data\n @files.each do |file|\n @source.location = file[:location]\n instance_variable_set('@' + file[:var].to_s,\n @source.send(file[:method], file[:klass]))\n end\n end",
"title": ""
},
{
"docid": "8e114f932e0b385fa719ede65e0394a4",
"score": "0.48841017",
"text": "def load_member_data_from_yml\n\t\tyml_member = YAML.load_file 'library_member_data.yml'\n\t\tyml_member.each_key do |key| \n\t\t\t@members.push(Member.new(key.to_i,yml_member[key]['mem_name']))\n\t\tend\n\t\t#puts \"#{yml_member.length} Member(s) loaded successfully\"\n\tend",
"title": ""
},
{
"docid": "bbeb507b133efff9ee32e5526623a00a",
"score": "0.48840636",
"text": "def load objid\n DataObj.new @repo, self, objid\n end",
"title": ""
},
{
"docid": "defc0e08c386132e977d33ecc08033ef",
"score": "0.48714873",
"text": "def load_data(filename)\n File.open(filename, 'r').each_line do |line|\n line = line.split '\t'\n\n @moviedata[line[1].to_sym][0] += 1\n @moviedata[line[1].to_sym][1] += line[2].to_i\n\n @userdata[line[0].to_sym].push([line[1], line[2].to_i])\n \n end\n #puts numlines\n end",
"title": ""
},
{
"docid": "71c2cb8063150ab53a37ea53d5249793",
"score": "0.4868441",
"text": "def load_param_values_non_arduino\n\n p = get_param_by_name('MOVEMENT_STEPS_PER_UNIT_X')\n @axis_x_steps_per_unit = p['value_db']\n\n p = get_param_by_name('MOVEMENT_STEPS_PER_UNIT_Y')\n @axis_y_steps_per_unit = p['value_db']\n\n p = get_param_by_name('MOVEMENT_STEPS_PER_UNIT_Z')\n @axis_z_steps_per_unit = p['value_db']\n\n end",
"title": ""
},
{
"docid": "71c2cb8063150ab53a37ea53d5249793",
"score": "0.4868441",
"text": "def load_param_values_non_arduino\n\n p = get_param_by_name('MOVEMENT_STEPS_PER_UNIT_X')\n @axis_x_steps_per_unit = p['value_db']\n\n p = get_param_by_name('MOVEMENT_STEPS_PER_UNIT_Y')\n @axis_y_steps_per_unit = p['value_db']\n\n p = get_param_by_name('MOVEMENT_STEPS_PER_UNIT_Z')\n @axis_z_steps_per_unit = p['value_db']\n\n end",
"title": ""
}
] |
d0848cee9ea416dfbd5b07103b6fd1ec
|
get every test to pass before coding runner below
|
[
{
"docid": "b60562dedb8335886456a980c0b71fe1",
"score": "0.0",
"text": "def runner\nWelcome\ncard_total = initial_round\nwhile card_total < 21\ncard_total = hit?(card_total)\ncard_total = display_card_total(card_total)\nend\nend_game(card_total)\n\nend",
"title": ""
}
] |
[
{
"docid": "4214d9c38556c2b02453744c9abd3771",
"score": "0.7492311",
"text": "def pass(suite, test, test_runner); end",
"title": ""
},
{
"docid": "e820a876acc56d01d07c4fe31f07d454",
"score": "0.74173",
"text": "def run_tests\n count = 0\n puts \"Starting test run...\"\n self.methods.each {|test|\n next if test !~ /^test_/\n puts \"[*] Running '#{test}'...\" if @loglevel > 2\n count +=1 if self.method(test).call\n }\n \n if count > 0\n puts \"Found #{count} failure#{\"s\" if count > 1 || count == 0}.\"\n else\n puts \"Found no failures. Tokens seem sane.\"\n end\n end",
"title": ""
},
{
"docid": "b394b10cb0558234b3c6fc1c4a03c82b",
"score": "0.73274654",
"text": "def run_all_tests\n read_env\n reset_tests\n\n ret = true\n self.failed_tests = []\n self.test_classes.each do |klass|\n ret &= run_all_tests_in_class(klass)\n end\n ret\n end",
"title": ""
},
{
"docid": "5596a3d5e4be52035b4157f548b708ba",
"score": "0.7279609",
"text": "def passing; @test_passed end",
"title": ""
},
{
"docid": "fe33402844dc199a7d3a6f44f3f81b57",
"score": "0.7245295",
"text": "def test_espresso_all(test = nil)\n generator = Generator.new(\"a\",\"b\",\"c\",\"d\")\n generator.seed = @seed\n if test then\n test = test.to_i\n print \"Test #{test}: \"\n return test_espresso(generator.make_1cover(test))\n else\n generator.each_1cover.with_index do |cover,i|\n print \"Test #{i}: \"\n return false unless test_espresso(cover)\n end\n return true\n end\n end",
"title": ""
},
{
"docid": "f16058f4c2ff1a02951e298da43a1e6a",
"score": "0.7151632",
"text": "def setup_test_stage\n say \"Checking common problems \"\n failed = false\n all_test_methods.sort.each do |test|\n begin\n send(test)\n print_dot unless failed\n true\n rescue => e\n say \"\\n\" unless failed\n failed = true\n paragraph{ error e.message }\n false\n end\n end.tap do |pass|\n success(' done') if !failed\n end\n\n true\n end",
"title": ""
},
{
"docid": "d5a6392d95e8bc4ef73fb2e93190a7d4",
"score": "0.71329165",
"text": "def run_passes\n run_before FIRST_PASS\n run_after FIRST_PASS\n end",
"title": ""
},
{
"docid": "6ac0f028dc11e1a857038fd8e748bba1",
"score": "0.7073319",
"text": "def test\n raise 'Failing test' if Global.fail\n\n Global.nbr_runs += 1\n end",
"title": ""
},
{
"docid": "f78af19ce90b642e642ae4137d599981",
"score": "0.7037707",
"text": "def check_tests\n tests_to_run.clear\n @test_monitor.scan_new_or_changed_with_test do |file, test|\n tests_to_run << test\n end\n if tests_to_run.size > 0\n print \"\\nTesting files: #{tests_to_run.join(\" \")}\\n\"\n system 'ruby -e \"\" -rtest/unit %s' % tests_to_run.map{|test| '-r%s' % test}.join(\" \")\n end\n end",
"title": ""
},
{
"docid": "c1152b3afd6ca1fb58b5069d4fc08aad",
"score": "0.6982976",
"text": "def passed\n all_tests.select(&:passed?)\n end",
"title": ""
},
{
"docid": "ed40ce7199db82876b1bdf9fda3f1528",
"score": "0.69716024",
"text": "def run_all_tests\n\n # Array of test sections\n test_library = [\n request_uri_test_cases,\n review_test_cases,\n reviews_request_test_cases,\n api_test_cases,\n server_test_cases\n ]\n\n # Actually run tests and print out results\n section_iter = 0\n puts \"\\n\"\n test_library.each do |test_section|\n section_iter += 1\n run_tests(test_section, section_iter)\n puts \"\\n\\n\"\n end\n\nend",
"title": ""
},
{
"docid": "8be1bd462fbd36f34b1b2d86a24e2536",
"score": "0.69709903",
"text": "def all_tests_pass\n cucumber_guard = ::Guard.guards({ :name => 'extendedcucumber', :group => 'tests'}).first\n cucumber_passed = cucumber_guard.instance_variable_get(\"@failed_paths\").empty?\n rspec_guard = ::Guard.guards({ :name => 'rspec', :group => 'tests'}).first\n rspec_passed = rspec_guard.instance_variable_get(\"@failed_paths\").empty?\n return rspec_passed && cucumber_passed\nend",
"title": ""
},
{
"docid": "10a276bce57bdee48e7d5d2b4690e737",
"score": "0.69156593",
"text": "def find_started_passing_tests\n @logger.debug('Looking for new successes...')\n\n failed_value = Result::Fail.value\n previous_test_ids = @previous_run_result.test_results.where { result < failed_value }.map { |result| result.test_id }\n tests = @run_result.test_results.where { result < failed_value }\n\n passed_tests = tests.where { |q| q.test_id.not_in previous_test_ids }\n passed_tests.each do |test_result|\n @test_database.create_test_result_change(@run_result, test_result.test, Automation::Test::Change::TestStartedPassing)\n end\n end",
"title": ""
},
{
"docid": "f311f458488fe72a875a01fdb96476e7",
"score": "0.68891853",
"text": "def test\n install_gems\n run_before_scripts\n run_scripts\n\n fail 'Some tests failed!' unless @passed\n\n puts 'All tests passed!'\n end",
"title": ""
},
{
"docid": "3ba4d2408f07cfe02b8fe74b8148c1b6",
"score": "0.68871903",
"text": "def passes_a\n tests.select(&:passed?).map { |e| result_h(e, 'passed') }\n end",
"title": ""
},
{
"docid": "38ec862ec3a8882eec9d4691fbea0d5b",
"score": "0.6873695",
"text": "def run_all\n results = runner.test_all\n throw :task_has_failed if results.failed?\n end",
"title": ""
},
{
"docid": "47731c9227e172710624da0fd2bb93a6",
"score": "0.68730116",
"text": "def test_cases\n test_suites.map(&:test_cases).tap(&:flatten!).select { |test_case| valid_test_method(test_case) }\n end",
"title": ""
},
{
"docid": "b9a22797dc9b97ac0ac383472c447b8c",
"score": "0.6862768",
"text": "def any_test_failed?(test_results); end",
"title": ""
},
{
"docid": "b94a14795c34b9bb80ab315b1d16c02f",
"score": "0.6853204",
"text": "def ran\n all_tests.select(&:ran?)\n end",
"title": ""
},
{
"docid": "9a461eb10c752e638f8709e6336f37e1",
"score": "0.6843228",
"text": "def run_tests(flags='run_all')\n # TODO - shore this up someday\n # Right now just a way to run just the tests in the else block below\n # Should eventually be able to take a list of tests or 'all' or something like that\n run_only = false\n run_only = true if flags[0].include? 'run_only' or flags[0].include? 'run_selected'\n num_tests = 0\n if not run_only\n\n all_pass = true\n begin\n #\n test__comment ; num_tests += 1 \n test__stmt_note_with_name ; num_tests += 1 \n test__stmt_note_without_name ; num_tests += 1\n test__stmt_note_alt_syntax ; num_tests += 1\n test__phrase ; num_tests += 1\n test__phrase_alt_syntax ; num_tests += 1\n test__section ; num_tests += 1\n test__repeat_index ; num_tests += 1\n test__write_format_sections_phrases ; num_tests += 1\n test__render ; num_tests += 1\n test__phrase_lite_syntax ; num_tests += 1\n test__measure_lite_syntax ; num_tests += 1\n test__copy_measure_lite_syntax ; num_tests += 1\n test__section_lite_syntax ; num_tests += 1\n test__repeat_index_lite_syntax ; num_tests += 1\n test__sections_phrases_lite_syntax ; num_tests += 1\n test__assignment ; num_tests += 1\n test__assignment_comment ; num_tests += 1\n test__assignment_2 ; num_tests += 1\n test__repeat_until; num_tests += 1\n test__repeat_assignment ; num_tests += 1\n test__func ; num_tests += 1\n test__next ; num_tests += 1\n test__render_lite_syntax ; num_tests += 1\n test__meter_lite_syntax ; num_tests += 1\n test__tempo ; num_tests += 1\n test__tempo_default ; num_tests += 1\n test__ensemble ; num_tests += 1\n test__ensemble_phrase_play_players ; num_tests += 1\n test__ensemble_phrase_play_ensembles ; num_tests += 1\n test__instruction_players ; num_tests += 1\n test__instruction_players_ensembles ; num_tests += 1\n test__instruction_players_state ; num_tests += 1\n test__instruction_ensemble_state ; num_tests += 1\n test__improvise_player ; num_tests += 1\n test__improvise2_player ; num_tests += 1\n test__render_lite_syntax_default_write ; num_tests += 1\n test__phrase_midi_lite_syntax ; num_tests += 1\n test__phrase_midi_format_top ; num_tests += 1\n test__ensemble_instrument_channel_midi_render ; num_tests += 1\n test__phrase_midi_format_consts ; num_tests += 1\n test__phrase_csound_format_consts ; num_tests += 1\n test__player_instrument ; num_tests += 1\n test__no_start_auto_next ; num_tests += 1\n test__import_phrase ; num_tests += 1\n test__import_root_map_players; num_tests += 1\n \n rescue AleatoricTestException => e\n puts e.to_s\n all_pass = false\n end\n\n else # if run_only\n \n all_pass = true\n begin \n \n # *** run_only TESTS GO HERE ***\n\n # *** run_only TESTS GO HERE ***\n \n rescue AleatoricTestException => e \n puts e.to_s\n all_pass = false\n end \n \n end\n \n puts \"\\n\\n***** composer_test: #{num_tests} run *****\\n\\n\"\n if AleatoricTest.all_pass? and all_pass \n puts \"***** composer_test: ALL TESTS PASSED *****\\n\\n\"\n else\n puts \"***** composer_test: #{AleatoricTest.failed_tests.length} TESTS FAILED *****\\n\\n\"\n AleatoricTest.failed_tests.each {|t| puts t}\n puts \"\\n\"\n end\n puts \"***** composer_test: complete *****\\n\\n\"\nend",
"title": ""
},
{
"docid": "8ed4d9487da168e3023e8e171ccf922e",
"score": "0.68255424",
"text": "def run_tests\n _run_anything :test\n end",
"title": ""
},
{
"docid": "2d707d830d05da5ab957f333347b9215",
"score": "0.6808374",
"text": "def run_checks\n tests_passed = true\n if @test_type == 'blinkr'\n tests_passed &= execute_blinkr\n elsif @test_type == 'dcp'\n tests_passed &= execute_dcp_checks\n else\n fail(StandardError, \"#{@test_type} is not a recognised test type, please check and try again\")\n end\n tests_passed\n end",
"title": ""
},
{
"docid": "63d69ce87585207e3e97639f4b03e22e",
"score": "0.6791387",
"text": "def successful_tests\n count = 0\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n end\n end\n count\n end",
"title": ""
},
{
"docid": "63d69ce87585207e3e97639f4b03e22e",
"score": "0.6791387",
"text": "def successful_tests\n count = 0\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n end\n end\n count\n end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.6790065",
"text": "def tests; end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.6790065",
"text": "def tests; end",
"title": ""
},
{
"docid": "e7c560b4a3161a8573c7f9514df1aa72",
"score": "0.6768047",
"text": "def passed_checks\n all_checks_which_pass\n end",
"title": ""
},
{
"docid": "be1a3c96e3fcb8f2d7f4f46c9b9f80d8",
"score": "0.6768014",
"text": "def run\n puts (1..tests.length).to_s\n tests.each_with_index do |test, i|\n begin\n if test.is_ok?\n ok(test, i)\n else\n not_ok(test, i)\n end\n rescue Sequel::DatabaseError\n puts $!.sql\n raise $!\n end\n end\n end",
"title": ""
},
{
"docid": "bb0c9a1f3b857de26bdb0dc4b0cc85d7",
"score": "0.6758628",
"text": "def fetch_tests\n _requirement_hook do\n @test_collection.fetch_and_add_testcases do |num|\n yield num if block_given?\n end\n #System.clear_screen\n end\n return @test_collection.test_cases\n end",
"title": ""
},
{
"docid": "afb454d44f89fa5eb7177e10f7341a6f",
"score": "0.6747024",
"text": "def run_tests\n @@test_config.each do |test|\n url_test = generate_url_test(test)\n @errors_or_warnings_found |= url_test.run_tests\n @email_body += url_test.format_results\n end\n end",
"title": ""
},
{
"docid": "4401d167bb7307005b52901a61ada6be",
"score": "0.6739721",
"text": "def passed \n tests.select{|test| test.test_status == \"passed\"}\n end",
"title": ""
},
{
"docid": "0974c3ad7f9ef5084c3427ec94334c0d",
"score": "0.6739479",
"text": "def run_tests\n tests_passed = true\n if @test_type == 'e2e' || @test_type == 'kc_e2e'\n %w(desktop mobile).each do |profile|\n tests_passed &= execute_e2e(profile)\n end\n else\n tests_passed &= execute_blc\n end\n tests_passed\n end",
"title": ""
},
{
"docid": "0974c3ad7f9ef5084c3427ec94334c0d",
"score": "0.6739081",
"text": "def run_tests\n tests_passed = true\n if @test_type == 'e2e' || @test_type == 'kc_e2e'\n %w(desktop mobile).each do |profile|\n tests_passed &= execute_e2e(profile)\n end\n else\n tests_passed &= execute_blc\n end\n tests_passed\n end",
"title": ""
},
{
"docid": "6f6bfdb51c20748c461768ed5ee2d3a6",
"score": "0.67315686",
"text": "def run_all_after_pass(tests_passed)\n return unless @options[:all_after_pass]\n\n if tests_passed\n run_all if @previous_failed\n else\n @previous_failed = true\n end\n end",
"title": ""
},
{
"docid": "329fbe415d9cde1f188261f949358ffe",
"score": "0.6731082",
"text": "def main_test_harness\n test__dnd_backstabber_attack\n test__bag_of_lost_coins_leads_to_lottery_ticket\n test__dice_battle__naruto_vs_sasuke\n\n puts \"\\n----- Extra Testing -----\\n\\n\"\n test__bag_cloning\n test__rc_randomizers_cloning\n test__random_select_and_add_items_from_player1_to_player2\nend",
"title": ""
},
{
"docid": "e2a0cdf3edf7be390ab66c3d2f5294be",
"score": "0.6729383",
"text": "def passed\n self.tests.select {|test| test.test_status == \"passed\"}\n end",
"title": ""
},
{
"docid": "d8813f940d83ba20232476df7ab827f8",
"score": "0.6707909",
"text": "def suite_result\n case\n when failures > 0; :failure\n when errors > 0; :error\n when skips > 0; :skip\n else :pass\n end\n end",
"title": ""
},
{
"docid": "a48e9119ea17a6bda4dde7a5b585851c",
"score": "0.66855913",
"text": "def pass?\n prepare_tests\n @tests.all?{ |t| t.pass? }\n end",
"title": ""
},
{
"docid": "84148dec3c1205e779c7decaaa8f1d0a",
"score": "0.66795045",
"text": "def test_run_started; end",
"title": ""
},
{
"docid": "20f58f6748cff9ec9a43210eb85a7c40",
"score": "0.6673442",
"text": "def test\n SeveralChecks.runs << [@name, '', '', 'Global test']\n end",
"title": ""
},
{
"docid": "c0f1e2ce33b688df41b242fa63f8e5b4",
"score": "0.6665543",
"text": "def pre_output\n @did_tests_fail = tests_failed?\n end",
"title": ""
},
{
"docid": "5a602adc31fd12c9cb5724ec50ce3766",
"score": "0.66651165",
"text": "def run_all\n stud_results = run_test stud_cmd\n teach_results = run_test teach_cmd\n puts(\"Students one: #{stud_results}\")\n puts(\"Teachers one: #{teach_results}\")\n if stud_results[:result].eql?(teach_results[:result])\n puts('100% passed!')\n end\n return stud_results\n end",
"title": ""
},
{
"docid": "aaa55e83c39ab0ea104a265f7bbcc47a",
"score": "0.6656543",
"text": "def run_suite(more_tests_follow, &block)\n\tbegin\n\t yield\n\trescue Exception => ex\n\t print_exception(ex)\n\t return false\n\tensure\n\t @service.stop_everything unless more_tests_follow\n\tend\n\tif more_tests_follow\n\t return all_tests_passed?\n\telse\n\t return print_results\n\tend\n end",
"title": ""
},
{
"docid": "517483965e802f0ebd521e8f97b15243",
"score": "0.6625879",
"text": "def test_all_on(sub)\n\t\tputs \"subject: #{sub}\"\n\t\t$tests.each{|test|\n\t\t\tr = test_sub(test,sub)\n\t\t\tif r[:result] then\n\t\t\t\tputs \"\t-- #{test}\"\n\t\t\tend\n\t\t}\t\n\tend",
"title": ""
},
{
"docid": "23aedb1f4ff28280dbb6767747232632",
"score": "0.6621978",
"text": "def test_all\n\t\ttest_cmd_list\n\t\ttest_cmd_mkd\n\t\ttest_cmd_stor\n\tend",
"title": ""
},
{
"docid": "1fbe098b1fdd6d553fbdfefd3e166f43",
"score": "0.66195345",
"text": "def run_all\n success = runner.run(options[:tests_path], options.merge(\n :message => 'Running all tests'\n ))\n\n @previous_failed = !success\n throw :task_has_failed unless success\n end",
"title": ""
},
{
"docid": "50341323d5ef92b6ba68e9c20de39366",
"score": "0.6616818",
"text": "def failed_tests\n @failed_tests\n end",
"title": ""
},
{
"docid": "f0fbb19b868b7d40482caee9e270611b",
"score": "0.6613102",
"text": "def test_run_finished; end",
"title": ""
},
{
"docid": "182c09faffa39fdb6d2f423f02a84a58",
"score": "0.66122174",
"text": "def passing(selected_tests = select_tests)\n selected_tests.select(&:passing?)\n end",
"title": ""
},
{
"docid": "657ca09ded2c7918af57a835c38ccfdb",
"score": "0.66042453",
"text": "def test_ok; end",
"title": ""
},
{
"docid": "657ca09ded2c7918af57a835c38ccfdb",
"score": "0.66042453",
"text": "def test_ok; end",
"title": ""
},
{
"docid": "c376ea2fcc2aa10bcb1c23ea3b6d7336",
"score": "0.6588145",
"text": "def run_all\n run_tests_and_report\n end",
"title": ""
},
{
"docid": "ece330d5d2480f039726ba26c597c6cd",
"score": "0.6586047",
"text": "def run_all\n\t\t\tputs 'Run all Behat tests'\n\t\t\tputs `behat`\n\t\t\tsuccess = last_command_is_successful?\n\n\t\t\tnotify success\n\t\t\tthrow :task_has_failed unless success\n\t\tend",
"title": ""
},
{
"docid": "adbfdc9f43bde6e2d37ba07928b011d4",
"score": "0.657925",
"text": "def before_each_test\nend",
"title": ""
},
{
"docid": "a9e125636a247822ddc9b916c96465cb",
"score": "0.6567096",
"text": "def all_tests\n # Explicit convesion to Array since the inject call on an empty array will return nil\n tests + Array(contexts.map(&:all_tests).inject(:+))\n end",
"title": ""
},
{
"docid": "c95a91380d7e0faed4a15ad6c738607a",
"score": "0.6560877",
"text": "def test_for(example)\n @mistakes += 1 if is_mistake(example)\n @tests += 1\n end",
"title": ""
},
{
"docid": "84f435a661a000dde241904307098154",
"score": "0.654625",
"text": "def recheck\n depends :init, :compile\n\n if config_source['testrun'].nil?\n latest_record = TestRunRecord.latest_record(@build_results.build_dir, @module_set)\n descrip = \"The latest test run\"\n else\n latest_record = named_testrun_record(config_source['testrun'])\n descrip = \"The specified test run\"\n end\n\n failed_test_classnames = latest_record.failed_test_classnames\n\n puts \"\"\n if failed_test_classnames.empty?\n puts \"%s, in '%s', passed. There is nothing to recheck.\" % [ descrip, latest_record.directory_description ]\n else\n puts \"%s, in '%s', failed %d tests. Re-running the following tests:\" % [ descrip, latest_record.directory_description, failed_test_classnames.length ]\n\n patterns = [ ]\n failed_test_classnames.each do |classname|\n puts \" %s\" % classname\n components = classname.split(/\\./)\n patterns << FilePath.new(*components).to_s\n end\n\n puts \"\"\n\n run_tests(FixedPatternSetTestSet.new(config_source, @module_groups, patterns))\n end\n end",
"title": ""
},
{
"docid": "1aa60fe24ab081e7afdd41678c928228",
"score": "0.6532687",
"text": "def test_case_started; end",
"title": ""
},
{
"docid": "1a4d37edbb7a988f058ab29b7e9cee45",
"score": "0.6519833",
"text": "def validate_and_run(test_set)\n start_time = Time.now\n total_patterns = 0\n\n @module_set.each do |build_module|\n build_module.each do |subtree|\n total_patterns += test_set.validate(subtree, ant, @platform, @build_results, @script_results)\n end\n end\n\n end_time = Time.now\n puts \"\\nValidated all %d test(s) in %.2f seconds for %s.\" % [ total_patterns, end_time - start_time, test_set.to_s ]\n\n run_tests(test_set) unless @script_results.failed?\n end",
"title": ""
},
{
"docid": "48fd2da2926fa6432da0aa973551b69c",
"score": "0.6515412",
"text": "def test_all\n\t\ttest_simple_upload\n\t\ttest_config\n\t\ttest_recursive_copy\n\t\ttest_safe_copy_without_overwriting\n\t\ttest_safe_copy_with_overwriting\n\tend",
"title": ""
},
{
"docid": "1b9cd1fbdf90863b393152073ee2c0b1",
"score": "0.6515273",
"text": "def test_cases\n test_suites.map(&:test_cases).tap(&:flatten!)\n end",
"title": ""
},
{
"docid": "1b9cd1fbdf90863b393152073ee2c0b1",
"score": "0.6515273",
"text": "def test_cases\n test_suites.map(&:test_cases).tap(&:flatten!)\n end",
"title": ""
},
{
"docid": "9a2997653017c82413fad50cfaab7811",
"score": "0.6514316",
"text": "def run\n if beginTest\n puts 'Passed!'\n else\n puts 'Failed!'\n end\n end",
"title": ""
},
{
"docid": "fd3002bddc15309761c18ce8e2b2b153",
"score": "0.6513728",
"text": "def testcase_setup\n end",
"title": ""
},
{
"docid": "159e16ddaec4a67f02e775e4390e77e5",
"score": "0.65110666",
"text": "def tests\n if test?\n @@tests\n end\n end",
"title": ""
},
{
"docid": "32eb8732389f631650979b5ffdf8ca35",
"score": "0.6510641",
"text": "def run\n Overseer.current_test = self\n start_time = Time.now\n suite.before.call if suite.before\n begin\n @code.call\n rescue Exception => e\n errors << e\n ensure\n begin\n suite.after.call if suite.after\n rescue Exception => e\n errors << e if passed?\n end\n @time = Time.now - start_time\n end\n end",
"title": ""
},
{
"docid": "05aa73202af7aa1bf57dd9f656622425",
"score": "0.6507352",
"text": "def tests\n ensure_valid\n @tests.keys\n end",
"title": ""
},
{
"docid": "05aa73202af7aa1bf57dd9f656622425",
"score": "0.6507352",
"text": "def tests\n ensure_valid\n @tests.keys\n end",
"title": ""
},
{
"docid": "b782e2616029fe9a866263c4dc064d3c",
"score": "0.6503384",
"text": "def total_successful_tests\n count = 0\n self.learning_tests.each do |test|\n count = test.is_successful_test? ? count + 1 : 0\n end\n count\n end",
"title": ""
},
{
"docid": "b782e2616029fe9a866263c4dc064d3c",
"score": "0.6503384",
"text": "def total_successful_tests\n count = 0\n self.learning_tests.each do |test|\n count = test.is_successful_test? ? count + 1 : 0\n end\n count\n end",
"title": ""
},
{
"docid": "18211f5e524e69674531c26f5e2fbe90",
"score": "0.6497115",
"text": "def test_passed(array)\n last_item = array.length - 1\n test_name = array[last_item - 1]\n test_suite_verify(array[@class_name_idx])\n printf \"%-40s PASS\\n\", test_name\n\n return unless @xml_out\n\n push_xml_output_passed(test_name) if @xml_out\n end",
"title": ""
},
{
"docid": "f5ad8f519b328578d43b60f25c3b991b",
"score": "0.6479112",
"text": "def set_all_test_cases\n @all_test_cases ||= TestCase.modules.inject([]) do |res, mod|\n res + TestCase.where(module: mod).order(name: :asc)\n end\n end",
"title": ""
},
{
"docid": "1dfc857dbcbecd0b1aea1470e96fefc0",
"score": "0.64615506",
"text": "def tapout_test_pass(result) #suite, test, test_runner\n doc = {\n 'type' => 'test',\n 'subtype' => '',\n 'status' => 'pass',\n #'setup': foo instance\n 'label' => \"#{result.label}\",\n #'expected' => 2\n #'returned' => 2\n #'file' => 'test/test_foo.rb'\n #'line': 45\n #'source': ok 1, 2\n #'snippet':\n # - 44: ok 0,0\n # - 45: ok 1,2\n # - 46: ok 2,4\n #'coverage':\n # file: lib/foo.rb\n # line: 11..13\n # code: Foo#*\n 'time' => Time.now - self.suite_start_time\n }\n\n record_stdcom(doc)\n\n #stdout, stderr = @_stdout, @_stderr\n #doc['stdout'] = stdout unless stdout.empty?\n #doc['stderr'] = stderr unless stderr.empty?\n\n return doc\n end",
"title": ""
},
{
"docid": "45d246087c6f8d83ce5031edb2e4cab9",
"score": "0.6448415",
"text": "def process_suitable_tests\n @suitable_tests ||= compute_suitable_tests\n @suitable_tests.each { |data| yield(*data) }\n end",
"title": ""
},
{
"docid": "428b5d1eaf9535043f41374ccd294f0d",
"score": "0.6447049",
"text": "def test_steps; end",
"title": ""
},
{
"docid": "b06f39351ecdfd70f80b90283dd377a6",
"score": "0.6419136",
"text": "def run_all_unit_tests\n\tenv = @context.env_hash\n\tcmd = \"go test `go list ./... | grep -v integration`\"\n\tpid = Process.spawn(env, cmd, chdir: @context.exchange_root)\n\tProcess.wait pid\n\treturn $?.exitstatus == 0\n end",
"title": ""
},
{
"docid": "70020bef7ce1848053b424f9b315b8d4",
"score": "0.64142483",
"text": "def run_all\n %w[unit functional integration performance].each do |test|\n load_in_fork(\"test/#{test}/**/*_test.rb\")\n end\n end",
"title": ""
},
{
"docid": "1ddad8a3ac680425d17717e0c7e0a932",
"score": "0.6407751",
"text": "def test_suite\n test_output_1()\n # test_output_2()\n # test_output_3()\nend",
"title": ""
},
{
"docid": "313cc13906a0cd423ee7743105e05f0c",
"score": "0.64054966",
"text": "def select_tests\r\n\r\n tests = []\r\n\r\n # These tests run the compiled executable and test the expected output\r\n if @config[\"diff\"] && @config[\"exe\"]\r\n\r\n prompt( \"Run diff tests?\", true ) do\r\n diff_test = @config[\"diff\"]\r\n\r\n # Handle multiple tests\r\n if diff_test.kind_of?( Array )\r\n tests = tests + diff_test.map do |diff|\r\n DiffTest.new( @assignment, diff, @config[\"exe\"] )\r\n end\r\n\r\n # There's only one test included\r\n else \r\n tests << DiffTest.new( @assignment, diff_test, @config[\"exe\"] )\r\n end\r\n end\r\n end\r\n\r\n # These tests link a submitted source file against a unit test\r\n if @config[\"simplectest\"]\r\n prompt( \"Run C unit tests?\", true ) do\r\n tests = tests + @config[\"simplectest\"].map do |test|\r\n SimpleCTest.new( @assignment, test )\r\n end\r\n end\r\n end\r\n\r\n # These tests use Cucumber at a feature level\r\n if @config[\"cucumber\"]\r\n prompt( \"Run Cucumber feature tests?\", true ) do\r\n tests = tests + @config[\"cucumber\"].map do |test|\r\n CucumberTest.new( @assignment, test, @config[\"exe\"] )\r\n end\r\n end\r\n end\r\n\r\n # These tests use PyUnit at a feature level\r\n if @config[\"pyunit\"]\r\n prompt( \"Run PyUnit tests?\", true ) do\r\n tests = tests + @config[\"pyunit\"].map do |test|\r\n PyUnitTest.new( @assignment, test )\r\n end\r\n end\r\n end\r\n\r\n # These tests use PyUnit at a feature level\r\n if @config[\"rubytestunit\"]\r\n prompt( \"Run Ruby Test::Unit tests?\", true ) do\r\n tests = tests + @config[\"rubytestunit\"].map do |test|\r\n RubyUnitTest.new( @assignment, test )\r\n end\r\n end\r\n end\r\n\r\n # These tests use PyUnit at a feature level\r\n if @config[\"tree\"]\r\n prompt( \"View source tree?\", true ) do\r\n tests = tests + @config[\"tree\"].map do |test|\r\n TreeTest.new( @assignment, test )\r\n end\r\n end\r\n end\r\n\r\n tests\r\n end",
"title": ""
},
{
"docid": "c52e7f53426a5936d032711491945d4f",
"score": "0.6395303",
"text": "def run_test(tests, primes_to_test, composites_to_test, current_test_name)\n require \"./primality_tests/\" + current_test_name + \".rb\"\n tests[current_test_name.to_sym][:result] = []\n tests[current_test_name.to_sym][:prime_pass?] = true\n tests[current_test_name.to_sym][:composite_pass?] = true\n primes_to_test.each {|i|\n result = send(current_test_name, i)\n tests[current_test_name.to_sym][:result] << result\n tests[current_test_name.to_sym][:prime_pass?] = false unless result\n }\n composites_to_test.each {|i|\n result = send(current_test_name, i)\n tests[current_test_name.to_sym][:result] << result\n tests[current_test_name.to_sym][:composite_pass?] = false if result\n }\nend",
"title": ""
},
{
"docid": "31af79b9c5e648e754d8dc04417bd9a7",
"score": "0.6387327",
"text": "def before_suites\n @before_all.call unless @before_all.nil?\n end",
"title": ""
},
{
"docid": "c1d674d4ba72bf42464f7b43ab7a5ec7",
"score": "0.63831043",
"text": "def smoke_test ()\n smoke_test = [\n \"case_001\",\n \"case_002\"\n ]\n return smoke_test\n end",
"title": ""
},
{
"docid": "9d904792abfd800fd078b71f1e94435d",
"score": "0.6382048",
"text": "def with_test_scaffold\n print \"testing #{name} . . . \"\n\n @passed = yield\n @has_run = true\n\n if passed?\n print 'passed'\n else\n print 'failed'\n end\n puts\n end",
"title": ""
},
{
"docid": "743789d6c34ab5ebfff5da767a5c4e8d",
"score": "0.6379222",
"text": "def run_all\n receive_results do\n log \"Run all tests\"\n test_files = load_test_files([\"test\"])\n\n reset_db_connection_post_fork\n test_runner = ::Nestor::Mappers::Rails::Test::TestRunner.new(nil)\n result = ::Test::Unit::AutoRunner.run(false, nil, []) do |autorunner|\n autorunner.runner = lambda { test_runner }\n end\n\n # Returns a Hash which the parent process will retrieve\n report(test_runner, test_files)\n end\n end",
"title": ""
},
{
"docid": "70ff2da1f74d1f51d06a3f1890e7e7fe",
"score": "0.6372814",
"text": "def all(expected); end",
"title": ""
},
{
"docid": "dbff941c6aece17c5183865503df3e90",
"score": "0.6371379",
"text": "def run_tests_for_dir(path, subfolder_depth)\n Dir.foreach path do |filename|\n if filename.match(/.*\\.rb/)\n out = \"\"\n err = \"\"\n str = \" TEST: #{filename}\"\n subfolder_depth.times do ||\n str.insert 0, \" \"\n end\n puts str\n \n\n out = `ruby #{path}#{filename} 2>&1`\n \n\n # TODO: what we need to do here is look through \"out\" with a regular expression to find out\n # the results of the test.\n # below is how we do it when compiling Xcode projects\n \n out.match(/.*Number of failed assertions: (.*).*/)\n \n if $1 == \"0\" # This means there are zero failed assertions\n @cur_count+=1\n log_test_pass \"*****************************************\"\n log_test_pass \"#{filename}\"\n log_test_pass \"*****************************************\"\n log_test_pass(out)\n # puts \"#{filename}: TEST PASSED\"\n puts \" TEST PASSED\"\n# # log_test(out)\n# # return 1\n else\n log_test_fail \"*****************************************\"\n log_test_fail \"#{filename}\"\n log_test_fail \"*****************************************\"\n log_test_fail(out) \n @fail_array.push(\"#{path}/#{filename}\")\n #puts \"#{filename}: TEST FAILED **************************************\"\n puts \" TEST FAILED **************************************\"\n# # log_test(out)\n# # log_error(err)\n end\n\n puts\n\n\n # elsif Dir.exist?(\"#{path}#{filename}\") && filename.match(/\\..*/) == nil\n elsif File.exists?(\"#{path}#{filename}\") && File.directory?(\"#{path}#{filename}\") && filename.match(/\\..*/) == nil\n str = \" FOLDER: #{path}#{filename}\"\n subfolder_depth.times do ||\n str.insert 0, \" \"\n end\n #puts str\n \n run_tests_for_dir \"#{path}#{filename}/\", 1+subfolder_depth\n end\n end\n\n ex_total, ex_count = get_count\n\nend",
"title": ""
},
{
"docid": "356d0aacb156dcbeb05679dea6848176",
"score": "0.63555026",
"text": "def run!\n time = Time.now\n yield\n time = ((Time.now-time)*1000).round\n \n print \"\\n ---\\n\"\n \n if @@error_count == 0\n green \"All #{@@test_count} tests finished in #{time} ms with no errors\"\n else\n red \"All #{@@test_count} tests finished in #{time} ms with #{@@error_count} errors\"\n end\n end",
"title": ""
},
{
"docid": "a001890b467ceff52d08c8a30672ff0c",
"score": "0.6349899",
"text": "def test(context)\n\t\t\t\t\t#\tfind the first failing test closure\n\t\t\t\t\t#\t\tit'd be nil if they all pass\n\t\t\t\t\tfailed = self.class.conditional_tests.find do |block|\n\t\t\t\t\t\t#\tfirst failure stops us\n\t\t\t\t\t\t(! (block.arity == 1 ? block.call(self) : block.call(self, context)))\n\t\t\t\t\tend\n\n\t\t\t\t\tfailed.nil?\n\t\t\t\tend",
"title": ""
},
{
"docid": "a500b345000521051ba63cbb47ca0b91",
"score": "0.6346521",
"text": "def tests_failed?\n return nil\n end",
"title": ""
},
{
"docid": "e319cc704698b8a7c4b5bc4b75585046",
"score": "0.6343057",
"text": "def testing_begin(files)\n end",
"title": ""
},
{
"docid": "1a74dde888cf9ccfb8d0bdf834a7bff6",
"score": "0.6341505",
"text": "def run\n Hash[\n @tests.map do |test|\n [test, test.run]\n end\n ]\n end",
"title": ""
},
{
"docid": "f7c0632309584cbf42a30ac6ce085d3a",
"score": "0.6340441",
"text": "def collect_tests\n # get local tests and get run list of profiles\n (local_suite_files + resolve_config_inspec_tests).compact.uniq\n end",
"title": ""
},
{
"docid": "79350fbbb93ea63d0ead748494435087",
"score": "0.6339531",
"text": "def continuous_successful_tests(number)\n count = 0\n successful = false\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n if count >= number\n successful = true\n end\n else\n count = 0\n end\n end\n successful\n end",
"title": ""
},
{
"docid": "79350fbbb93ea63d0ead748494435087",
"score": "0.6339531",
"text": "def continuous_successful_tests(number)\n count = 0\n successful = false\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n if count >= number\n successful = true\n end\n else\n count = 0\n end\n end\n successful\n end",
"title": ""
},
{
"docid": "f2672d22e3ca3520332cfd6332d2ba30",
"score": "0.63387984",
"text": "def test_case_finished; end",
"title": ""
},
{
"docid": "e541fff3b2cc0b1ecdc1227fedcc5905",
"score": "0.6333254",
"text": "def testBakery ()\n\tis_passed = true\n\tpassed = 0\n\terror = 0\n\tTEST_DATA.each do |test|\n\n\t\tr= results(test[:total],test[:packs])\n\t\tis_passed = (r==test[:numpacks]) && is_passed\n\t\tif !is_passed\n\t\t\terror+=1\n\t\t\tputs\n\t\t\tputs \"--- Error on Loop Bakery ---\"\n\t\t\tprint \"Passed: #{is_passed} - Expected: #{test} - ErrorOutput: #{r}\"\n\t\t\tputs\n\t\telse\n\t\t\tpassed+=1\n\t\tend\n\tend\n\tt=TEST_DATA.count\n puts \"--- Test result for Loop Bakery ---\"\n\tputs \"Passed: #{passed}/#{t} Error: #{error}/#{t}\"\n\treturn is_passed\nend",
"title": ""
},
{
"docid": "e0d07478878e26400961f9dd6b581ea2",
"score": "0.632165",
"text": "def runAllTests\r\n\t\tif @successfulLogin\r\n\t\t\tbegin\r\n\t\t\t\tallClasses = query(\"SELECT Id FROM ApexClass\")\r\n\t\t\t\ttoQueue = Array.new\r\n\t\t\t\tallClasses.each {\r\n\t\t\t\t\t|aClass|\r\n\t\t\t\t\ttoQueue << aClass.Id\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn queueUnitTests(toQueue)\r\n\t\t\trescue Exception => exception\r\n\t\t\t\tlogException('runAllTests()', exception.message, exception.backtrace)\r\n\t\t\t\traise\t\r\n\t\t\tend\t\t\t\t\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "e522f01507e09d3b19400eed61200ee5",
"score": "0.63188905",
"text": "def buildTests() \n @runner.build()\n end",
"title": ""
},
{
"docid": "598348d41710d29e8ed16f377862364e",
"score": "0.63177216",
"text": "def test(severity, txt)\n @tests << {severity => txt}\n unless severity == :I or severity == :W\n @fails += 1\n if $FAIL_FAST\n puts txt\n caller.each {|c| puts c}\n exit!\n end\n end\nend",
"title": ""
},
{
"docid": "dc2a21bd081b4c0294c6297492f066cc",
"score": "0.63083965",
"text": "def test_cases\n {}\n end",
"title": ""
},
{
"docid": "884d62b9acdf5e926f22e171a056dbcf",
"score": "0.6305766",
"text": "def failures\n all_tests.select(&:failed?)\n end",
"title": ""
}
] |
68bc719305ce85782830373a7fdf872c
|
Returns the block argument given to the Contextcall for the given frame, or nil if no block was given.
|
[
{
"docid": "c528fb8e7696615fe606bd5208666953",
"score": "0.528387",
"text": "def block_for_frame(frame)\n @block_association_cache[frame]\n end",
"title": ""
}
] |
[
{
"docid": "c1c0fbfc6105aab2fdc9c38080631786",
"score": "0.69842935",
"text": "def extract_block_arg\n if args.last.is_a?(Sexp) and args.last.type == :block_pass\n block_arg = args.pop\n block_arg = block_arg[1][1].to_sym\n end\n end",
"title": ""
},
{
"docid": "c6b3c9b10bf16398c2ada3c1e60fb50e",
"score": "0.671461",
"text": "def get_frame(block_name, frame)\n if frame[:vlocks].has_key?(block_name)\n frame\n elsif frame[:parent_frame]\n get_frame(block_name, frame[:parent_frame])\n end\n end",
"title": ""
},
{
"docid": "0fdc03f352e11d02b77c71407cd484a4",
"score": "0.6194539",
"text": "def context_from_signature(*locator, &block)\n if block_given?\n block\n else\n context = locator.shift\n context.is_a?(Proc) && locator.empty? ? context : nil\n end\n end",
"title": ""
},
{
"docid": "cec9bb67e91a3fbf091fdb369e67c63b",
"score": "0.58382344",
"text": "def frame\n context.frame\n end",
"title": ""
},
{
"docid": "4eaf49a6175eb88147c7632eaff12af7",
"score": "0.57572716",
"text": "def passed_blockarg\n <<-CODE\n next_int;\n if((unsigned long int)_int == c->blockargs) {\n stack_push(Qtrue);\n } else {\n stack_push(Qfalse);\n }\n CODE\n end",
"title": ""
},
{
"docid": "42f9ad1690dcf2f533aa2834897dedcc",
"score": "0.5378279",
"text": "def block_caller\n if block_given?\n result_of_block = yield\n return result_of_block\n else\n return 'no block'\n end\nend",
"title": ""
},
{
"docid": "f1a17aeedd34a7fe1570424e74c28f64",
"score": "0.5316968",
"text": "def set_block_argument_names\n @block_argument_names = if has_block? && element[2].is_a?(Sexp) # HACK: for lambdas\n element[2].drop(1).map { |argument| argument }\n end || []\n end",
"title": ""
},
{
"docid": "7a0611277ac85c6cd668b04164891018",
"score": "0.5305929",
"text": "def current_frame\n @callstack.top\n end",
"title": ""
},
{
"docid": "a7c84dfdc3c13da777dc4cbdc32ed2ae",
"score": "0.52457577",
"text": "def get_block name\n name = name.to_sym\n block = @blocks.find {|b| b.name == name}\n raise \"No block found for #{name} (in #{blocks.collect{|b|b.name}.join(':')})\" unless block\n block\n end",
"title": ""
},
{
"docid": "573a685fd5a589e633b0d941b3f4c75c",
"score": "0.52312976",
"text": "def gen_get_block_ptr(recklass, info, blk, b, context)\r\n blab = (info[1].to_s + '+blk+' + blk[1].to_s).to_sym\r\n minfo = MethodDefinition::RubyMethod[blab][recklass]\r\n\r\n func2 = minfo[:func]\r\n if func2 == nil then\r\n argtype = minfo[:argtype].map {|ele|\r\n ele.type.llvm\r\n }\r\n rett = minfo[:rettype]\r\n rettllvm = rett.type\r\n if rettllvm == nil then\r\n rettllvm = VALUE\r\n else\r\n rettllvm = rettllvm.llvm\r\n end\r\n ftype = Type.function(rettllvm, argtype)\r\n func2 = context.builder.get_or_insert_function(recklass, blab.to_s, ftype)\r\n end\r\n context.rc = b.ptr_to_int(func2, MACHINE_WORD)\r\n context\r\n end",
"title": ""
},
{
"docid": "0c35ba28b77ce9767bcbf6c1976de644",
"score": "0.52244234",
"text": "def contacting_block(block)\n face = block.state.data.facing\n unless face\n warn \"block #{block}'s face is nil\"\n nil\n end\n block.location.clone.tap {|loc|\n loc.subtract(face.mod_x, face.mod_y, face.mod_z)\n }.block\n end",
"title": ""
},
{
"docid": "8314935bef45d686e90d5bd46a451c36",
"score": "0.51908547",
"text": "def block_caller\n result_of_block = yield 'passed from block_caller'\n return result_of_block\nend",
"title": ""
},
{
"docid": "5c3e6fe4020f0dc444baa59341f46ad1",
"score": "0.5188141",
"text": "def frame_args_info(frame_position=0)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "50702a98549ad4a87c40e49372df3a65",
"score": "0.5177703",
"text": "def frame\n world.nil? ? nil : world.frame\n end",
"title": ""
},
{
"docid": "ed853038cac2f11279ddd67068063f71",
"score": "0.5136987",
"text": "def parse_yield(context, single, tk, method)\n return if method.block_params\n\n get_tkread\n method.block_params = parse_method_or_yield_parameters\n end",
"title": ""
},
{
"docid": "5b728f603f491dc9cc621522c562450c",
"score": "0.51341516",
"text": "def in_frame(identifier, frame=nil, &block)\n frame = [] if frame.nil?\n frame << identifier\n block.call(frame)\n end",
"title": ""
},
{
"docid": "f288bf94252878ad76ccf74e22607934",
"score": "0.5129515",
"text": "def find_frame(selector, &block)\n using_wait_time(7) do\n frame = find(selector)\n within_frame(frame) do\n block.call\n end\n end\n end",
"title": ""
},
{
"docid": "82c2c52ee0341048b85434162bff4018",
"score": "0.512468",
"text": "def call_block(&block)\n block.call\nend",
"title": ""
},
{
"docid": "fe28fa49f2bd6935a4a852a7fc27bea2",
"score": "0.5117787",
"text": "def execute_block_argument(number, &block)\n # procs can be stored in variables\n block_store = block\n # uses the call method to run the proc\n block_store.call number\nend",
"title": ""
},
{
"docid": "69f257e75f13a59c00478d148dbf7fa0",
"score": "0.5115782",
"text": "def get_block id\n block = self.blocks_get_by_id id\n if block[\"success\"]\n return block[\"block\"]\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "d3560d9bc783014bfe03b51d3efa4e40",
"score": "0.51112056",
"text": "def get_block(*params); raise('Stub or mock required.') end",
"title": ""
},
{
"docid": "443494272c3793bee6fa7578c1c7425c",
"score": "0.5104332",
"text": "def block_to_loc(block)\n @block_to_loc[block]\n end",
"title": ""
},
{
"docid": "519fa6a1e228cd00a06c6b35cdc9de96",
"score": "0.5102558",
"text": "def get_block_value\r\n if block_given?\r\n value = yield\r\n pp \"The block returned #{value}\"\r\n end\r\nend",
"title": ""
},
{
"docid": "0a368781271ff8c9ab4bc24b1cc58cbc",
"score": "0.50746936",
"text": "def calling_method(call_stack = nil)\n depth = 2\n if call_stack.is_a?(Integer)\n depth = call_stack if call_stack > depth\n call_stack = nil\n end\n # noinspection RubyMismatchedArgumentType\n call_stack ||= caller(depth)\n call_stack&.find do |line|\n _file_line, name = line.to_s.split(/:in\\s+/)\n name = name.to_s.sub(/^[ `]*(.*?)[' ]*$/, '\\1')\n next if name.blank?\n next if %w[each map __output __output_impl].include?(name)\n return name.match(/^(block|rescue)\\s+in\\s+(.*)$/) ? $2 : name\n end\n end",
"title": ""
},
{
"docid": "038a11f672e1adf53dba7b9b7a98e92e",
"score": "0.50717294",
"text": "def blockFun2(arg1, &aBlock)\n if aBlock\n aBlock.call(arg1)\n \"HAVE BLOCK\"\n else\n \"NO BLOCK\"\n end\nend",
"title": ""
},
{
"docid": "724733e6784c0a3895e88d67235a06e3",
"score": "0.5066273",
"text": "def c_frame?; end",
"title": ""
},
{
"docid": "05c03f659e0e4233b34c7444c77c84e5",
"score": "0.5065556",
"text": "def parse_block(*_arg0); end",
"title": ""
},
{
"docid": "7048912589e207f36770a767d731b77a",
"score": "0.5037474",
"text": "def getblocknumber\n coind.getblocknumber\n end",
"title": ""
},
{
"docid": "7612a7e9409361fe8de2df5a02355d21",
"score": "0.5027364",
"text": "def frame_id(*args)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "cca3047ddc31a6aedca52e95369f40cd",
"score": "0.50256056",
"text": "def block_id &block\n block.inspect =~ /(\\w+\\.rb:\\d+)/\n $1\n end",
"title": ""
},
{
"docid": "7f7b2e6f29a8dc7f6c6431300ac111d7",
"score": "0.5024298",
"text": "def frame_args(frame_position=0)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "50e530d9745093378fa8ef80cf9724cd",
"score": "0.50047725",
"text": "def context(&block); end",
"title": ""
},
{
"docid": "50e530d9745093378fa8ef80cf9724cd",
"score": "0.50047725",
"text": "def context(&block); end",
"title": ""
},
{
"docid": "623a32f73087fffca11d33de44f27c2a",
"score": "0.49966103",
"text": "def execute(&nameofblock)\n nameofblock.call\nend",
"title": ""
},
{
"docid": "819094f88fdc1b097f57bc014b624d8a",
"score": "0.49930248",
"text": "def spot_call_for_args\n _nd_recv, _mid, nd_args = @node.children\n if nd_args && nd_args.first_lineno == nd_args.last_lineno\n fetch_line(nd_args.first_lineno)\n @beg_column = nd_args.first_column\n @end_column = nd_args.last_column\n end\n # TODO: support @arg\n end",
"title": ""
},
{
"docid": "9c11ab0718ce58d5a10db507a2c26d2f",
"score": "0.4978536",
"text": "def block(name, value = nil, &block)\n value = self._template.context.capture(&block) if value.nil? && block\n self._template.blocks[name] ||= value\n return self._template.blocks[name]\n end",
"title": ""
},
{
"docid": "f18b3ffe160542f382d8ea2b4d8d9def",
"score": "0.49710953",
"text": "def generate_block_context(context:, block_param_node:)\n binds = ArgumentsBinder.new(generator: generator).bind(types: method_types, arguments: block_param_node.parameter)\n\n Contexts::BlockContext.new(parent: context, registry: registry, receiver: context.receiver, binds: binds)\n end",
"title": ""
},
{
"docid": "d7f3402f1299476ee6eff94da7d4c283",
"score": "0.4962331",
"text": "def __bb_context; end",
"title": ""
},
{
"docid": "9d853312ba306d13e6af4add3020f33c",
"score": "0.49577674",
"text": "def context\n @context_stack.last\n end",
"title": ""
},
{
"docid": "f73c54e722eeffe963108fb688e5dd98",
"score": "0.49503395",
"text": "def block=(_arg0); end",
"title": ""
},
{
"docid": "f73c54e722eeffe963108fb688e5dd98",
"score": "0.49503395",
"text": "def block=(_arg0); end",
"title": ""
},
{
"docid": "a2eeae24ce835167010c0850226d75d1",
"score": "0.49465278",
"text": "def yield_arg_block(compiler)\n arg_index = compiler.get_method.arguments_type.get_length - 1\n setup = SlotMachine::MessageSetup.new( arg_index )\n slot_receive = @receiver.to_slotted(compiler)\n args = @arguments.collect { |arg| arg.to_slotted(compiler)}\n setup << SlotMachine::ArgumentTransfer.new( self , slot_receive , args )\n setup << SlotMachine::BlockYield.new( self , arg_index )\n end",
"title": ""
},
{
"docid": "f38185fe0d2bd1dd7a4680a4bf4cfe93",
"score": "0.49134555",
"text": "def temporary_frame(frame, &block)\n old = current_frame\n @current_frame = frame\n block.call\n @current_frame = old\n end",
"title": ""
},
{
"docid": "c2544682c5ea37e07b0df08761041e53",
"score": "0.4909172",
"text": "def callBlock\n yield ,\n end",
"title": ""
},
{
"docid": "61540ccb0aaa46998a8beb1c18e2f872",
"score": "0.4894804",
"text": "def frame_binding(frame_position=0)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "dd911b6775b285c57169a3d7f0b1cfa2",
"score": "0.4891759",
"text": "def get_block\n return nil unless @blk_id\n @block ||= @store.get_block_by_id(@blk_id)\n end",
"title": ""
},
{
"docid": "5304f6711e304fa0d8a6b50828c14a9a",
"score": "0.4888289",
"text": "def last_context=(_arg0); end",
"title": ""
},
{
"docid": "6c0988e45fd576518b8a7f6cc17aaad4",
"score": "0.48838028",
"text": "def frame_method(frame_position=0)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "bcd99bf50ba86b5590c916afd03b48d2",
"score": "0.48814476",
"text": "def __get_block_source_location(&block)\n return {} unless block_given?\n\n r, l = block.source_location\n { ref: r, line: l }\n rescue MethodSource::SourceNotFoundError\n {}\n end",
"title": ""
},
{
"docid": "14a62117cef451a0ddee2a71df68c2ba",
"score": "0.48779345",
"text": "def get_block(blk_hash)\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "3ba02be9e2c8505c4256afc919bc7e8e",
"score": "0.48744485",
"text": "def cbo2 (&inBlock)\n returnLambda = nil\n begin\n puts \"Received inBlock of class #{inBlock.class}\"\n puts \"Inspecting inBlock: #{inBlock.inspect}\"\n puts \"Converting inBlock to lambda\"\n returnLambda = lambda inBlock\n rescue Exception\n puts \"Got an Exception. Guess you can't do that. Returning nil.\"\n end\n returnLambda\nend",
"title": ""
},
{
"docid": "3fcaa9a27c2e8d24d8b8149da294a4ba",
"score": "0.48738796",
"text": "def create_block(arg_type , frame_type)\n @callable.create_block(arg_type ,frame_type)\n end",
"title": ""
},
{
"docid": "d53fab2ce9dd8df02260bb45941170f5",
"score": "0.48716235",
"text": "def frame_locals(frame)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3ab1777df2c9364f7cef63e46da4af4c",
"score": "0.48680538",
"text": "def id\n @block\n end",
"title": ""
},
{
"docid": "3ab1777df2c9364f7cef63e46da4af4c",
"score": "0.48680538",
"text": "def id\n @block\n end",
"title": ""
},
{
"docid": "b489bb117b80907f333505fef44855be",
"score": "0.4865135",
"text": "def callBlock\n yield\n yield\nend",
"title": ""
},
{
"docid": "84bfb427796ca2ee402be8f2f9a286f5",
"score": "0.48567542",
"text": "def command_binding\n if @command_binding != nil\n return @command_binding\n elsif block != nil\n return block.binding\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "2520c8cbd9b1d08aab11f207055e51f1",
"score": "0.48545635",
"text": "def get_frame_flag(frame, options, name)\n rval = frame.fetch(\"@#{name}\", [options[name]]).first\n rval = rval.values.first if value?(rval)\n if name == :embed\n rval = case rval\n when true then '@once'\n when false then '@never'\n when '@always', '@first', '@last', '@link', '@once', '@never' then rval\n else\n raise JsonLdError::InvalidEmbedValue,\n \"Invalid JSON-LD frame syntax; invalid value of @embed: #{rval}\"\n end\n end\n rval\n end",
"title": ""
},
{
"docid": "b32c7e4c3d8bd8de4591390393fc9e9b",
"score": "0.48543397",
"text": "def foo(&block)\n a = 2\n block.call(a)\nend",
"title": ""
},
{
"docid": "17bd5db584ca46c1788e72c11403022b",
"score": "0.48471704",
"text": "def block_checker(param) \n [ param , block_given? ]\nend",
"title": ""
},
{
"docid": "837d2192d95b87a2e3389c9c966ecbeb",
"score": "0.48369777",
"text": "def label\n Block.get_label(function.name, name)\n end",
"title": ""
},
{
"docid": "52ae67ed38588e8030503bb3d0c5570c",
"score": "0.4836923",
"text": "def func_block (arg1, arg2, block_args = {})\n p arg1.inspect\n p arg2.inspect\n p block_args.inspect\nend",
"title": ""
},
{
"docid": "98b5ca9158f72ea7831145d99598f404",
"score": "0.48215845",
"text": "def matcher_with_blockpass(param0 = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "51914aafef7e9da46a4330764e5ebb03",
"score": "0.48026365",
"text": "def block_method_name(node)\n case node.type\n when :block\n node.method_name\n when :block_pass\n node.parent.method_name\n end\n end",
"title": ""
},
{
"docid": "1cf15848f19abc27941ae483f135f213",
"score": "0.48023042",
"text": "def context(args)\n context = args.delete(:context)\n context || @my\n end",
"title": ""
},
{
"docid": "759831a7b2f9dafa93dfa35da16082f5",
"score": "0.4794903",
"text": "def cast_for_single_block_arg\n <<-CODE\n t1 = stack_pop();\n k = NUM_FIELDS(t1);\n if(k == 0) {\n stack_push(Qnil);\n } else if(k == 1) {\n stack_push(tuple_at(state, t1, 0));\n } else {\n stack_push(array_from_tuple(state, t1));\n }\n CODE\n end",
"title": ""
},
{
"docid": "b03a66a41af2133cdac70c2985964e99",
"score": "0.47898364",
"text": "def get_frame\n next_frame\n rescue StopIteration => e\n return nil\n end",
"title": ""
},
{
"docid": "11d5c100de469cb4033ac008a32efb65",
"score": "0.4785377",
"text": "def frame\n (@frame || 1).to_f\n end",
"title": ""
},
{
"docid": "849a3a4e5f17316ea046ab28fc0f66ff",
"score": "0.4776347",
"text": "def block_def_node\n if @ast == nil\n if block == nil\n return nil\n end\n\n # Get array of block parameter names\n block_params = block.parameters.map do |param|\n param[1]\n end\n\n parser_local_vars = command_binding.local_variables + block_params\n source = Parsing.parse_block(block, parser_local_vars)\n @ast = AST::BlockDefNode.new(\n parameters: block_params,\n ruby_block: block, # necessary to get binding\n body: AST::Builder.from_parser_ast(source))\n end\n\n # Ensure `return` is there\n @ast.accept(Translator::LastStatementReturnsVisitor.new)\n\n return @ast\n end",
"title": ""
},
{
"docid": "3dcd6710ed6798dfff4d6603a9fb1fbd",
"score": "0.47742176",
"text": "def block_number\n request('getblocknumber')\n end",
"title": ""
},
{
"docid": "2ff6b65e098af6e1760240812eb4a396",
"score": "0.47727033",
"text": "def candidate_block(block)\n return unless (my_index = block.parent.blocks.find_index block)\n\n next_block = block.parent.blocks[my_index + 1]\n return unless next_block && next_block.context == :pass\n\n next_block\n end",
"title": ""
},
{
"docid": "ad25aa78128d9d19a2ea9eacb9bf0b1e",
"score": "0.4772544",
"text": "def BlocksAndMethods(&argumento)\n\targumento.call\nend",
"title": ""
},
{
"docid": "a238fb36abc2d378bbe0811bc78cc3a1",
"score": "0.47694528",
"text": "def get_arg(a)\n a = a.to_sym\n return [:lvar, @locals[a] + (rest? ? 1 : 0) + @next.lvaroffset] if @locals.include?(a)\n return @next.get_arg(a) if @next\n return [:addr, a] # Shouldn't get here normally\n end",
"title": ""
},
{
"docid": "2d8364cd2593523bc8eceeb61ba55b1b",
"score": "0.47692773",
"text": "def get_raw_value_for_argument(arg=nil)\n if arg.class == Hash && !block_given?\n return @j_del.java_method(:getRawValueForArgument, [Java::IoVertxCoreCli::Argument.java_class]).call(Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(arg)))\n end\n raise ArgumentError, \"Invalid arguments when calling get_raw_value_for_argument(arg)\"\n end",
"title": ""
},
{
"docid": "409adbb78f09dc5be4d44679ca244598",
"score": "0.4765712",
"text": "def parfait_block(compiler)\n return @parfait_block if @parfait_block\n @parfait_block = compiler.create_block( make_arg_type , make_frame(compiler))\n end",
"title": ""
},
{
"docid": "86affbec41e5c0292a9b1c976f3fe317",
"score": "0.47638613",
"text": "def the_call_to_stubs_or_expects\n @call.find_call_in_receiver_chain(%i[stubs expects])\n end",
"title": ""
},
{
"docid": "28aeb1c2fbf2938cd0142f34bc3ea3b8",
"score": "0.47477677",
"text": "def arg_node\n case node.type\n when :command, :aref then node[2][1]\n when :method_add_arg then (node[2][1] ? node[2][1] : nil)\n when :method_add_block then node[1].method_call.arg_node\n when :call, :var_ref, :vcall, :command_call, :zsuper then nil\n when :command_call then node[4][1]\n when :super\n node[1].type == :arg_paren ? node[1][1] : node[1]\n end\n end",
"title": ""
},
{
"docid": "8123bbd055ce07e6225b186831ec198a",
"score": "0.474631",
"text": "def receive_bad_frame(frame, exception)\n nil\n end",
"title": ""
},
{
"docid": "da2dd075a5f7195b08e921cb3cd5dd49",
"score": "0.47458783",
"text": "def call_on_binding(binding_, *context)\n if binding_.local_variable_defined?(applicable)\n binding_.local_variable_get(applicable)\n else\n invoke_lambda(binding_.receiver.method(applicable), binding_, *context)\n end\n end",
"title": ""
},
{
"docid": "8c0d1cf9cd81105fa162933e3e43df57",
"score": "0.47446093",
"text": "def getblocknumber\n request :getblocknumber\n end",
"title": ""
},
{
"docid": "9ca36e96679ae0918be1c13bde1bc99f",
"score": "0.474146",
"text": "def method_with_block_parameter &provided_block_proc\n puts provided_block_proc.class\n provided_block_proc.call(\"called from method\")\n yield \"called from method with yield\"\nend",
"title": ""
},
{
"docid": "e904ec8083366402d61db75c3290ebc4",
"score": "0.4737664",
"text": "def call_block\n yield('hello', 99)\nend",
"title": ""
},
{
"docid": "e904ec8083366402d61db75c3290ebc4",
"score": "0.4737664",
"text": "def call_block\n yield('hello', 99)\nend",
"title": ""
},
{
"docid": "e904ec8083366402d61db75c3290ebc4",
"score": "0.4737664",
"text": "def call_block\n yield('hello', 99)\nend",
"title": ""
},
{
"docid": "960ccd9e4a3c8a729464545371c3b719",
"score": "0.47371563",
"text": "def current_frame\n @current_frame\n end",
"title": ""
},
{
"docid": "b7616a015bcefc6e0b8ba29dbd78e477",
"score": "0.47349182",
"text": "def spot_fcall_for_name\n mid, _nd_args = @node.children\n fetch_line(@node.first_lineno)\n if @snippet.match(/(#{ Regexp.quote(mid) })/, @node.first_column)\n @beg_column = $~.begin(1)\n @end_column = $~.end(1)\n end\n end",
"title": ""
},
{
"docid": "4d43af8e01795590e5af001db41244d2",
"score": "0.47322452",
"text": "def get_receiver_object\n c = root.context\n if c.is_a?(Proc)\n c.binding.receiver\n elsif c.is_a?(Method)\n c.receiver\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "6389d8fccce0a8f5e2261b38adec35dd",
"score": "0.47204593",
"text": "def slot_type_for(name)\n if index = @callable.arguments_type.variable_index(name)\n slot_def = [\"arg#{index}\".to_sym]\n elsif index = @callable.frame_type.variable_index(name)\n slot_def = [\"local#{index}\".to_sym]\n elsif index = @method.arguments_type.variable_index(name)\n slot_def = [:caller , :caller , \"arg#{index}\".to_sym]\n elsif index = @method.frame_type.variable_index(name)\n slot_def = [:caller ,:caller , \"local#{index}\".to_sym ]\n elsif\n raise \"no variable #{name} , need to resolve at runtime\"\n end\n return slot_def\n end",
"title": ""
},
{
"docid": "c7dc396e3483ae5fe5c2787d6ab321f3",
"score": "0.471657",
"text": "def get_current_block(x, y)\n case @block_type\n when :ordinary\n Block.new(adjust_block_coordinates(x,y).to_vec2d)\n when :sliding_horizontally\n SlidingBlock.new(adjust_block_coordinates(x, y).to_vec2d,\n :horizontal) \n when :sliding_vertically\n SlidingBlock.new(adjust_block_coordinates(x, y).to_vec2d,\n :vertical) \n when :moving_enemy\n MovingEnemy.new(adjust_block_coordinates(x, y).to_vec2d)\n when :prize\n PrizeBottom.new(adjust_block_coordinates(x,y).to_vec2d)\n end\n end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "2d9dae549fadf48aadb71d08b3677f6c",
"score": "0.47061744",
"text": "def context=(_arg0); end",
"title": ""
},
{
"docid": "8fcf47eb6ed44e45a92b1c8e64a36893",
"score": "0.46993095",
"text": "def foo(name, &block)\n @name = name\n block.call\nend",
"title": ""
}
] |
b8695cfbe7c8b92a51879d60d8e4b6af
|
Constructeur de la classe
|
[
{
"docid": "a48e5cbf908e69aa48d1753675589fc7",
"score": "0.0",
"text": "def initialize\r\n @health = 20\r\n end",
"title": ""
}
] |
[
{
"docid": "700c042555d8ebc7c4de252bf9ffc0af",
"score": "0.8770985",
"text": "def constructor; end",
"title": ""
},
{
"docid": "d88825898c6b9898e549cc4320aeaf0a",
"score": "0.84330124",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.8234277",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.8234277",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.8234277",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.8234277",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.8234277",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.8234277",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.8234277",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.8234277",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.8234277",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.8234186",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.8234186",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.8234186",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.8234186",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.8234186",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.8234186",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "4ba68bf13f8658add40720f5b37f7b0f",
"score": "0.82265794",
"text": "def initialize( * )\n super\n end",
"title": ""
},
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.8214162",
"text": "def initialize() end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.8209315",
"text": "def initialize; end",
"title": ""
},
{
"docid": "08df82619f902788224a91d85e1c2550",
"score": "0.8186055",
"text": "def initialize\r\n\r\n end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd665bf3b2",
"score": "0.81466055",
"text": "def initialize(*) end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd665bf3b2",
"score": "0.81466055",
"text": "def initialize(*) end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd665bf3b2",
"score": "0.81466055",
"text": "def initialize(*) end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd665bf3b2",
"score": "0.81466055",
"text": "def initialize(*) end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd665bf3b2",
"score": "0.81466055",
"text": "def initialize(*) end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.8142661",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.8142661",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.8142661",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.8142661",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.8142661",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.8142661",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.8142661",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "81db6a0228d4eb5d7c2669bfd4516b44",
"score": "0.81219554",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "55d539453c287fc90b8cf716625cac85",
"score": "0.81157845",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "18250542a2b1999be90588db1d071d92",
"score": "0.80972797",
"text": "def initialize\n\t\t\n\tend",
"title": ""
},
{
"docid": "9340b0874d627092ce82cffda8dda649",
"score": "0.8089485",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "f466bb6c7455ea8d2d5ecdd1b8896422",
"score": "0.80465007",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "f466bb6c7455ea8d2d5ecdd1b8896422",
"score": "0.80465007",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "f466bb6c7455ea8d2d5ecdd1b8896422",
"score": "0.80465007",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "7a5eade4fa268386033662e3824d1d7a",
"score": "0.80060226",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "7a5eade4fa268386033662e3824d1d7a",
"score": "0.80060226",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "7a5eade4fa268386033662e3824d1d7a",
"score": "0.80060226",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "7a5eade4fa268386033662e3824d1d7a",
"score": "0.80060226",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "7a5eade4fa268386033662e3824d1d7a",
"score": "0.80060226",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "7a5eade4fa268386033662e3824d1d7a",
"score": "0.80060226",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "7a5eade4fa268386033662e3824d1d7a",
"score": "0.80060226",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "7a5eade4fa268386033662e3824d1d7a",
"score": "0.80060226",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "8dfa30b1286b735358fadd0128be660d",
"score": "0.7987279",
"text": "def construct\n end",
"title": ""
},
{
"docid": "5089834c8fb49e78a140c77b7194d0c9",
"score": "0.79739803",
"text": "def initialize\n\n\tend",
"title": ""
},
{
"docid": "5089834c8fb49e78a140c77b7194d0c9",
"score": "0.79739803",
"text": "def initialize\n\n\tend",
"title": ""
},
{
"docid": "b400b560eb97c0db55cbdba5cd71fa1c",
"score": "0.7966805",
"text": "def initialize()\n\t\tend",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7949192",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "006ef28ab51a28a982112d3c90ebf5a5",
"score": "0.789821",
"text": "def initialize(*_)\n super\n end",
"title": ""
},
{
"docid": "bc1d2dff3253fceaa6ad08ac5a19d9c5",
"score": "0.7897855",
"text": "def initialize()\r\n\r\n end",
"title": ""
},
{
"docid": "3c29a06b1e194a29c05635d71f51c108",
"score": "0.78966933",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "3c29a06b1e194a29c05635d71f51c108",
"score": "0.78966933",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "4b47ff77d50fd89449b4aee569683d2b",
"score": "0.7829575",
"text": "def initialize()\n raise \"#{self.class.to_s} should not be instantiated directly.\"\n end",
"title": ""
},
{
"docid": "cdd58dace22c11a7043a695fbef6319a",
"score": "0.78219414",
"text": "def initialize\n\n end",
"title": ""
},
{
"docid": "cdd58dace22c11a7043a695fbef6319a",
"score": "0.78219414",
"text": "def initialize\n\n end",
"title": ""
},
{
"docid": "9a734a184e1646ac4c8ba556b4e3873b",
"score": "0.7789517",
"text": "def initialize(*args)\n super\n end",
"title": ""
},
{
"docid": "9a734a184e1646ac4c8ba556b4e3873b",
"score": "0.7789517",
"text": "def initialize(*args)\n super\n end",
"title": ""
},
{
"docid": "9a734a184e1646ac4c8ba556b4e3873b",
"score": "0.7789517",
"text": "def initialize(*args)\n super\n end",
"title": ""
},
{
"docid": "46d903faea9067fe66559ea03018d219",
"score": "0.7774122",
"text": "def initialize(*args)\n super\n end",
"title": ""
},
{
"docid": "adfd75599e9fe9addd5ecc48ad25ab2d",
"score": "0.7773914",
"text": "def initialize\n init\n end",
"title": ""
},
{
"docid": "16d75915b84d17186b08d9a06d76f700",
"score": "0.77525985",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "16d75915b84d17186b08d9a06d76f700",
"score": "0.77525985",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "9ebb90d88dd859732a968c062fcf5659",
"score": "0.7706689",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "9ebb90d88dd859732a968c062fcf5659",
"score": "0.7706689",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "7b2a9c01c879a0b2fdf74f0f38b03e4e",
"score": "0.77008635",
"text": "def initialize\n initialize!\n end",
"title": ""
},
{
"docid": "7b2a9c01c879a0b2fdf74f0f38b03e4e",
"score": "0.77008635",
"text": "def initialize\n initialize!\n end",
"title": ""
},
{
"docid": "fe00ae5aa7b0dac2d92df9cf574b96d4",
"score": "0.76937133",
"text": "def initialize(*args)\r\n super(*args)\r\n end",
"title": ""
},
{
"docid": "d08f0cfe2b2b8c3c738e72226f397b1f",
"score": "0.7691689",
"text": "def initialize\n\n\n\n end",
"title": ""
},
{
"docid": "6782bb0990709aac0814e6d60eae798f",
"score": "0.7668323",
"text": "def initialize *args\n super\n end",
"title": ""
},
{
"docid": "e59fba6f4eae911ebe83a86742f8cb9e",
"score": "0.7654083",
"text": "def initialize\n super(true)\n end",
"title": ""
},
{
"docid": "24b80514cb0bded2aead9ac077021142",
"score": "0.7651047",
"text": "def initialize()\n # override parent\n end",
"title": ""
},
{
"docid": "d5b2c651ef02f091c61a5639e05783d2",
"score": "0.76301736",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "7d2e344238e7987f7b5aa68318c9a331",
"score": "0.76258886",
"text": "def initialize\n\t\nend",
"title": ""
},
{
"docid": "769e6c5939d580f922ebe018ac257213",
"score": "0.7620758",
"text": "def initialize()\n\tend",
"title": ""
},
{
"docid": "769e6c5939d580f922ebe018ac257213",
"score": "0.7620758",
"text": "def initialize()\n\tend",
"title": ""
},
{
"docid": "1556c42eb28e75c9b56e717f1f4a0c77",
"score": "0.76185197",
"text": "def initialize\n # nothing here for now\n end",
"title": ""
},
{
"docid": "bba9fbc807f0a73e812ebf601045bf31",
"score": "0.76009685",
"text": "def initialize()\n\n end",
"title": ""
}
] |
b3d5d2a3b65229b1a38592126b4a23dd
|
List all shares for the given device id List all shares for the given device id
|
[
{
"docid": "00c3226d0174dc06df8e449a9d7546a9",
"score": "0.7364808",
"text": "def get_all_shares_for_device(device_id, opts = {})\n data, _status_code, _headers = get_all_shares_for_device_with_http_info(device_id, opts)\n return data\n end",
"title": ""
}
] |
[
{
"docid": "2167748b852b46b2936e60105cb7b5b5",
"score": "0.68649006",
"text": "def get_all_shares_for_device_with_http_info(device_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesSharesApi.get_all_shares_for_device ...\"\n end\n # verify the required parameter 'device_id' is set\n fail ArgumentError, \"Missing the required parameter 'device_id' when calling DevicesSharesApi.get_all_shares_for_device\" if device_id.nil?\n # resource path\n local_var_path = \"/devices/{deviceId}/shares\".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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 => 'DeviceSharingEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesSharesApi#get_all_shares_for_device\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "32f18f235d36c72a180e0163e28ed512",
"score": "0.66597456",
"text": "def shares(calendar_id)\n @shares[calendar_id] || []\n end",
"title": ""
},
{
"docid": "e6fa4939edce711b5757aebc98f4ce85",
"score": "0.65724736",
"text": "def shares id\n uri = \"#{BASE_URL}/gauges/#{id}/shares\"\n fetch uri\n end",
"title": ""
},
{
"docid": "1c9fe943f94525d78eeff87de5214b3e",
"score": "0.6477527",
"text": "def list_shares(options = {})\n query = {}\n if options\n StorageService.with_query query, \"prefix\", options[:prefix]\n StorageService.with_query query, \"marker\", options[:marker]\n StorageService.with_query query, \"maxresults\", options[:max_results].to_s if options[:max_results]\n StorageService.with_query query, \"include\", \"metadata\" if options[:metadata] == true\n StorageService.with_query query, \"timeout\", options[:timeout].to_s if options[:timeout]\n end\n\n options[:request_location_mode] = RequestLocationMode::PRIMARY_OR_SECONDARY\n uri = shares_uri(query, options)\n response = call(:get, uri, nil, {}, options)\n\n Serialization.share_enumeration_results_from_xml(response.body)\n end",
"title": ""
},
{
"docid": "d64176ff23f5122498645e64e812e0f0",
"score": "0.63684094",
"text": "def mailing_shares_overview(id)\n get(\"/response/#{id}/shares/overview\")\n end",
"title": ""
},
{
"docid": "bcf959aed77bf6d873748c1baa26c650",
"score": "0.63170487",
"text": "def list_shares(options = {})\n query = {}\n if options\n StorageService.with_query query, \"prefix\", options[:prefix]\n StorageService.with_query query, \"marker\", options[:marker]\n StorageService.with_query query, \"maxresults\", options[:max_results].to_s if options[:max_results]\n StorageService.with_query query, \"include\", \"metadata\" if options[:metadata] == true\n StorageService.with_query query, \"timeout\", options[:timeout].to_s if options[:timeout]\n end\n\n options[:request_location_mode] = Azure::Storage::Common::RequestLocationMode::PRIMARY_OR_SECONDARY\n uri = shares_uri(query, options)\n response = call(:get, uri, nil, {}, options)\n\n Serialization.share_enumeration_results_from_xml(response.body)\n end",
"title": ""
},
{
"docid": "4f99921f2bb110987aa7b3a3b3036154",
"score": "0.6117631",
"text": "def shares\n @caldav_backend.shares(@calendar_info['id'])\n end",
"title": ""
},
{
"docid": "d33708ddd85228da8695bf1511c438e9",
"score": "0.5806504",
"text": "def index\n @fileshares = Fileshare.all\n end",
"title": ""
},
{
"docid": "8ba04afccd2d5dbe5ad96e8f06fa099d",
"score": "0.5784968",
"text": "def index\n if current_user.try(:admin)\n @shared_with_me = Share.all\n else\n @shared_with_me = current_user.shares\n end\n @shared_by_me = Share.shared_by(current_user)\n end",
"title": ""
},
{
"docid": "09eb356f446cd97fb25e75f074e3a06e",
"score": "0.5753167",
"text": "def index\n @shares = Share.all\n end",
"title": ""
},
{
"docid": "09eb356f446cd97fb25e75f074e3a06e",
"score": "0.5753167",
"text": "def index\n @shares = Share.all\n end",
"title": ""
},
{
"docid": "ee89aa122fbce249850d14298d45b69d",
"score": "0.57033825",
"text": "def device_privates(id)\n get(\"/devices/#{id}/privates\")\n end",
"title": ""
},
{
"docid": "74efedf2c695fbb04b724ddbcc7b9448",
"score": "0.568794",
"text": "def get_sharing_for_device(device_id, share_id, opts = {})\n data, _status_code, _headers = get_sharing_for_device_with_http_info(device_id, share_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "6537d83e695d9c02b4e6cdd51ad14107",
"score": "0.5672748",
"text": "def get_share(options = {})\n id = options.delete(:id)\n path = \"/shares/#{id}\"\n get(path, options)\n end",
"title": ""
},
{
"docid": "30d8a58d81bd57b7266810e177176f3c",
"score": "0.5648535",
"text": "def shares()\n return MicrosoftGraph::Print::Shares::SharesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "337d4579c2d65e7a24719e222b22d45b",
"score": "0.56468856",
"text": "def shares(options={})\n path = \"#{person_path(options)}/network/updates\"\n simple_query(path, {:type => \"SHAR\", :scope => \"self\"}.merge(options))\n end",
"title": ""
},
{
"docid": "174ab6a69d1ed51fc70738f55c20fb77",
"score": "0.5645448",
"text": "def get_sharing_for_device_with_http_info(device_id, share_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesSharesApi.get_sharing_for_device ...\"\n end\n # verify the required parameter 'device_id' is set\n fail ArgumentError, \"Missing the required parameter 'device_id' when calling DevicesSharesApi.get_sharing_for_device\" if device_id.nil?\n # verify the required parameter 'share_id' is set\n fail ArgumentError, \"Missing the required parameter 'share_id' when calling DevicesSharesApi.get_sharing_for_device\" if share_id.nil?\n # resource path\n local_var_path = \"/devices/{deviceId}/shares/{shareId}\".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s).sub('{' + 'shareId' + '}', share_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['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 => 'DeviceSharing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesSharesApi#get_sharing_for_device\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c8ee478e0b40c0e4b5f2b89ad9353f64",
"score": "0.5631476",
"text": "def index\n #@shares = Share.all\n @stores = Store.find_my_stores(session[:user_id])\n @sharedStores = Store.find_my_share_stores(session[:user_id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shares }\n end\n end",
"title": ""
},
{
"docid": "16eebc449fd12ba8564b4d438901683f",
"score": "0.5597726",
"text": "def index\n @dhcp_server = DhcpServer.find_by_id(params[:dhcp_server_id])\n @shared_networks = @dhcp_server.shared_networks\n end",
"title": ""
},
{
"docid": "b22488da6ee0ecd37d4b3e067c695e68",
"score": "0.55831856",
"text": "def index\n @share_tasks = @list.share_tasks\n end",
"title": ""
},
{
"docid": "c796f524c49f28d48ad41c655b33caa6",
"score": "0.5569118",
"text": "def get_shared_files(user_id)\n shared_file_ids = $db.execute(\"SELECT file_id FROM file_share_table WHERE user_id = ?\", user_id)\n \n files = []\n shared_file_ids.each do |id|\n files << $db.execute(\"SELECT * FROM files WHERE id = ?\", id[\"file_id\"])[0]\n end\n return files\nend",
"title": ""
},
{
"docid": "277c887064412d824ae31b85c629376d",
"score": "0.5554374",
"text": "def shares\n @users.map { |u| u.share }.uniq\n end",
"title": ""
},
{
"docid": "9320a6d6a04f4505e88f9db520c12bb6",
"score": "0.5539059",
"text": "def all_shared_instances\n @share ||= current_user.shares.where(:album_id => params[:id])\n @share.each do |share|\n \tshare.destroy\n end\n end",
"title": ""
},
{
"docid": "d2ca37ee73eb9a5381f7f1eadc4a88e6",
"score": "0.5522078",
"text": "def list_shares_anonymous\n file = Tempfile.new('ruby_smbclient')\n success = system(\"#{@smbclient} -L #{@host} -p #{@port} -N > #{file.path} 2>&1\")\n if success\n res = File.open(file.path).readlines\n if res.join(\"\\n\") =~ /Domain=(.+)\\sOS/\n $domain=$1.sub(/^\\[/, '').sub(/\\]$/, '')\n end\n if res.join(\"\\n\") =~ /Server=(.+)\\s+/\n server=$1.sub(/^\\[/, '').sub(/\\]$/, '')\n end\n if res.join(\"\\n\") =~ /Domain=.+\\sOS=(.+)\\sServer=/\n $os=$1.sub(/^\\[/, '').sub(/\\]$/, '') + ' (' + server + ')'\n end\n if res.join(\"\\n\") =~ /Error returning browse list: (.+)/i\n file.unlink\n return false, \"Unable to enumerate shares anonymously: #{$1}\"\n else\n if res =~ /Domain=\\[.+\\]\\s+Sharename\\s+Type\\s+Comment\\s+[-]{1,}\\s+[-]{1,}\\s+[-]{1,}\\s+(.+)\\s+Domain/m and not rez =~ /Error returning browse list: .+/i\n results=$1\n shares = [[\"Sharename\", \"Type\", \"Comment\"]]\n results.split(\"\\n\").each do |share|\n row = share.strip.chomp.split(' ')\n shares << [ row[0], row[1], row[2..-1].join(' ') ]\n end\n file.unlink\n table = t.to_table(:first_row_is_head => true)\n return true, table.to_s\n else\n return false, \"Unable to enumerate shares anonymously!\"\n end\n end\n else\n return false, \"Unable to enumerate shares anonymously!\" \n end\n end",
"title": ""
},
{
"docid": "e6717ed13fabd4c996241c88c0a3de2d",
"score": "0.5513018",
"text": "def index\n @albums = Album.where(user_id: current_user.id)\n @shares = Share.where(user_id: current_user.id)\n @shares.each {\n |share| @albums += Album.where(id: share.album.id)\n }\n end",
"title": ""
},
{
"docid": "e699e13f937c80f9bf52c599ae209f2f",
"score": "0.5499189",
"text": "def index\n @share_users = ShareUser.all\n end",
"title": ""
},
{
"docid": "1dff1c6ca081ece67f38d77b1e9dbb5a",
"score": "0.5487102",
"text": "def shareAllRandomly (id)\nend",
"title": ""
},
{
"docid": "f99b68639adfafb60306a494db159e6e",
"score": "0.5485642",
"text": "def index\n \n @shareables = Shareable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shareables }\n end\n end",
"title": ""
},
{
"docid": "bc718e7f8192fe261ad3f60b5984a29a",
"score": "0.5447796",
"text": "def shares\n return @shares\n end",
"title": ""
},
{
"docid": "bc718e7f8192fe261ad3f60b5984a29a",
"score": "0.5447796",
"text": "def shares\n return @shares\n end",
"title": ""
},
{
"docid": "3e3643a047baf19353b0e37b7dbbbd66",
"score": "0.54428035",
"text": "def index\n @share_operations = ShareOperation.all\n end",
"title": ""
},
{
"docid": "9b85193a494b01a0bfff7df7f9db782d",
"score": "0.5418525",
"text": "def shares=(value)\n @shares = value\n end",
"title": ""
},
{
"docid": "9b85193a494b01a0bfff7df7f9db782d",
"score": "0.5418525",
"text": "def shares=(value)\n @shares = value\n end",
"title": ""
},
{
"docid": "35d180dc1a77e349968185816d88ad8a",
"score": "0.5404527",
"text": "def index \n @shares = Share.all if admin?\n end",
"title": ""
},
{
"docid": "b878e36ae1fce1723052552996917de5",
"score": "0.53998834",
"text": "def customer_share_information(share_id, params = {})\n get(\"/response/#{share_id}/customer_share\", params)\n end",
"title": ""
},
{
"docid": "2c6ab46bd10b9e3cb85ee19d1881d095",
"score": "0.5337",
"text": "def index\n @shareds = Shared.all\n end",
"title": ""
},
{
"docid": "efca6f14e81cac72fdbc594b23a085bc",
"score": "0.5318676",
"text": "def fetch_mounted_nfs_shares\n if resource[:nfs_hostname]\n # Get list of all mounted NFS datastores, and add it to mounted NFS shares\n Puppet.debug(\"Getting list of mounted NFS datastores...\")\n host.esxcli.storage.nfs.list.each do |nfs_store|\n if nfs_store[:Host] && nfs_store[:Share] && nfs_store[:Mounted]\n key = nfs_store[:Host] + \":\" + nfs_store[:Share]\n @mounted_nfs_shares[key] = { :volume_name => nfs_store[:VolumeName], :new_mount => false }\n Puppet.debug(\"Found existing NFS mount #{key} on the ESX host\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c1efdf2d1548b5e2f5cbb605883b3804",
"score": "0.53022856",
"text": "def index\n @accounting = Accounting.find(params[:accounting_id])\n @shares = @accounting.shares\n end",
"title": ""
},
{
"docid": "26bb93ddeeb2f6b3e1bce1b49f8d861d",
"score": "0.5274728",
"text": "def shares(key)\n key = key.to_sym\n\n (@shares ||= {})[key] ||=\n CSVDocument::OneDimensional.new(\n dataset_dir.join(\"shares/#{ key }.csv\"))\n end",
"title": ""
},
{
"docid": "3f68315931594a0bbc7123b731ab784e",
"score": "0.5271556",
"text": "def index\n @shares = Share.all\n @user= User.all\n \n end",
"title": ""
},
{
"docid": "03f8a5af2ab6a6ae4ea67b9017936544",
"score": "0.52711195",
"text": "def index\n @dogshares = Dogshare.all\n end",
"title": ""
},
{
"docid": "93548dfee08f512079f27196b6129d6a",
"score": "0.5269001",
"text": "def share_index\n @asset = Asset.find(params[:id])\n str = @asset.shared_with.to_s\n @shared_to = str.split(\",\")\n end",
"title": ""
},
{
"docid": "c929d2caa386a79ecdf00ac1437b4b98",
"score": "0.5257066",
"text": "def index\n authorization(\"admin\")\n @sharespaces = Sharespace.all\n end",
"title": ""
},
{
"docid": "fee0147bb3bd5ea5583e6834b8812905",
"score": "0.5233813",
"text": "def list(id)\n get(\"lists/#{id}\").list\n end",
"title": ""
},
{
"docid": "f0e089434c60a4cbb25dd77c26617b5e",
"score": "0.522467",
"text": "def set_share\n \n @accounting = Accounting.find(params[:accounting_id])\n @share = @accounting.shares.find(params[:id])\n @group = @accounting.group\n end",
"title": ""
},
{
"docid": "25cbb77be3967f1da828f18672e0d867",
"score": "0.52066404",
"text": "def get_shared_playlists_entries(share_token)\n url = 'plentries/shared'\n\n options = {body: {entries: [{\n shareToken: share_token\n }]\n }.to_json\n }\n\n make_post_request(url, options)\n end",
"title": ""
},
{
"docid": "78acb5cfa48fea0c1653f3b5e06156cf",
"score": "0.5190483",
"text": "def index\n if params[:post_id].present?\n @post_shareables = PostShareable.where(post: Post.find(params[:post_id])).all\n else\n @post_shareables = PostShareable.all\n end\n end",
"title": ""
},
{
"docid": "93a1b42fee2fab2f9ee54e4911a613ff",
"score": "0.51794374",
"text": "def index\n @sharedfolders = Sharedfolder.all\n end",
"title": ""
},
{
"docid": "444af67304fac3209d7fcfc0a35a79c6",
"score": "0.515273",
"text": "def index\n # binding.pry\n @shares = Share.all\n @q = Share.search(params[:q])\n @shares = @q.result(distinct: true)\n end",
"title": ""
},
{
"docid": "8021405508b7a60f8e2ea11ea766f552",
"score": "0.51497376",
"text": "def index\n @facebook_shares = FacebookShare.all\n end",
"title": ""
},
{
"docid": "541114777ef93cd7b16a2a21185063ce",
"score": "0.51459014",
"text": "def delete_sharing_for_device_with_http_info(device_id, share_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesSharesApi.delete_sharing_for_device ...\"\n end\n # verify the required parameter 'device_id' is set\n fail ArgumentError, \"Missing the required parameter 'device_id' when calling DevicesSharesApi.delete_sharing_for_device\" if device_id.nil?\n # verify the required parameter 'share_id' is set\n fail ArgumentError, \"Missing the required parameter 'share_id' when calling DevicesSharesApi.delete_sharing_for_device\" if share_id.nil?\n # resource path\n local_var_path = \"/devices/{deviceId}/shares/{shareId}\".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s).sub('{' + 'shareId' + '}', share_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['artikcloud_oauth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DeviceSharingId')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesSharesApi#delete_sharing_for_device\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "40b08affc9883d0258c24401fe41f2c1",
"score": "0.51348704",
"text": "def share(data = nil)\n id_required_and_not_deleted\n @resource.share(\n @json_dict[@id_property],\n data\n )\n end",
"title": ""
},
{
"docid": "230a4be46b711f9db64760a27f971432",
"score": "0.51243776",
"text": "def shares()\n return MicrosoftGraph::Shares::SharesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "6d9e667cf92398aaf32450e19083ba67",
"score": "0.5110037",
"text": "def share\n network = params[:network].to_sym\n return respond_not_found unless network.in?(Network.shareable)\n photo = params[:photo_id].present? ? ListingPhoto.find(params[:photo_id]) : @listing.photos.first\n target_url = ::Listings::IndirectShareContext.share_dialog_url(network, @listing, photo, view_context)\n @listing.incr_shares(current_user, network)\n track_usage(\"share_listing_#{network}\".to_sym)\n redirect_to(target_url)\n end",
"title": ""
},
{
"docid": "9a18976234b3b7240a0cbc178273215c",
"score": "0.509819",
"text": "def get_disks(token, disks_url)\n disk_ids = Array.new \n endpoint = disks_url.scan(/\\/organizations.*disks/)\n resp_hash = get_url(token, endpoint[0], {})\n resp_hash[:embedded][:disks].each do |disk|\n disk_ids.push extract_id(disk[:_links][:self][:href], 'disks')\n end\n return [disk_ids, resp_hash]\nend",
"title": ""
},
{
"docid": "b6326c9a190ead6a0e03fb97c4f10d63",
"score": "0.5094667",
"text": "def share\n @card = Card.find(params[:id])\n end",
"title": ""
},
{
"docid": "fc5f0ccbe96c21029826fe527715f82c",
"score": "0.50897664",
"text": "def set_share\n @share = Share.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "d3ee79f6e278d06f2cd4d8e803f70200",
"score": "0.5082253",
"text": "def list_shared_assets\n str = current_user.shared_files.to_s\n a = str.split(\",\")\n @assets = []\n \n 0.upto(a.length-1) do |x|\n aId = a[x].to_i\n @assets << Asset.find(aId)\n end\n \n @assets \n end",
"title": ""
},
{
"docid": "2a756f8a4db9df39a8c79d4d442dfad9",
"score": "0.5061027",
"text": "def show\n @media_share = MediaShare.find(params[:id])\n @dir = params[:dir]\n @files = @media_share.get_files(@dir)\n @directories = @media_share.get_directories(@dir)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @media_share }\n end\n end",
"title": ""
},
{
"docid": "6ed94ce0be3eef641c7594386dce6d18",
"score": "0.5051569",
"text": "def show\n @accounting = Accounting.find(params[:accounting_id])\n @shares = @accounting.shares.find(params[:id])\n end",
"title": ""
},
{
"docid": "cba4ca8b56936f1e21da3b9630315d3d",
"score": "0.50138104",
"text": "def list\n all.each { |device| puts(device.pretty_name) }\n end",
"title": ""
},
{
"docid": "ab363485d8369e9d5fe0abffe3491603",
"score": "0.50012296",
"text": "def smb_srvsvc_netsharegetinfo(share)\n shares = []\n simple.connect(\"\\\\\\\\#{rhost}\\\\IPC$\")\n handle = dcerpc_handle('4b324fc8-1670-01d3-1278-5a47bf6ee188', '3.0', 'ncacn_np', [\"\\\\srvsvc\"])\n begin\n dcerpc_bind(handle)\n rescue Rex::Proto::SMB::Exceptions::ErrorCode, RubySMB::Error::RubySMBError => e\n vprint_error(e.message)\n return []\n end\n\n stubdata =\n NDR.uwstring(\"\\\\\\\\#{rhost}\") +\n NDR.wstring(share) +\n NDR.long(2)\n\n response = dcerpc.call(0x10, stubdata)\n\n if ! response\n raise RuntimeError, \"Invalid DCERPC response: <empty>\"\n end\n\n head = response.slice!(0, 40)\n if head.length != 40\n raise RuntimeError, \"Invalid DCERPC response: not enough data\"\n end\n\n share_info = {\n share_type: head[12, 4].unpack('V').first,\n permissions: head[20, 4].unpack('V').first,\n max_users: head[24, 4].unpack('V').first,\n }\n\n idx = 0\n\n [:share, :comment, :path, :password].each do |field|\n field_info = response[idx, 12].unpack(\"V*\")\n break if field_info.length == 0\n idx += 12\n\n field_text = response[idx, field_info.first * 2]\n share_info[ field ] = field_text.gsub(\"\\x00\", '')\n idx += (field_info.first * 2)\n idx += (idx % 4)\n end\n\n share_info\n end",
"title": ""
},
{
"docid": "c0d458f7fe7ccdb35aaa39c7286982b2",
"score": "0.49946725",
"text": "def volumes_for_account(accountid)\n api_call = {\n :method => \"ListVolumesForAccount\",\n :params => {\n :accountID => accountid\n }\n }\n answer = query_sf(api_call)\n return answer\n end",
"title": ""
},
{
"docid": "0c9ba09f93ec0313d839e4c38d3e4f1d",
"score": "0.4989864",
"text": "def share_id=(value)\n @share_id = value\n end",
"title": ""
},
{
"docid": "7548fed724c1d6dbf640eeaba5685def",
"score": "0.4975236",
"text": "def index\n @user_shares = UserShare.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_shares }\n end\n end",
"title": ""
},
{
"docid": "928c368028ebe4c05686f292dd6f365e",
"score": "0.49733046",
"text": "def clients\n clis = []\n url = prefix + \"listc\"\n users = response(url)\n if users.class == Array #success\n users.each do |u|\n clis << ShareUser.new(u[\"id\"], @authid, @subdomain, u)\n end\n return clis\n else #failed\n return users\n end\n end",
"title": ""
},
{
"docid": "a355f81b4e19300768d2f3b730221122",
"score": "0.49676725",
"text": "def smb_lanman_netshareenumall\n shares = []\n begin\n # XXX: #trans is not supported by RubySMB\n res = self.simple.client.trans(\n \"\\\\PIPE\\\\LANMAN\",\n (\n [0x00].pack('v') +\n \"WrLeh\\x00\" +\n \"B13BWz\\x00\" +\n [0x01, 65406].pack(\"vv\")\n ))\n rescue ::Rex::Proto::SMB::Exceptions::ErrorCode => e\n vprint_error(\"Could not enumerate shares via LANMAN\")\n return []\n end\n if res.nil?\n vprint_error(\"Could not enumerate shares via LANMAN\")\n return []\n end\n\n lerror, lconv, lentries, lcount = res['Payload'].to_s[\n res['Payload'].v['ParamOffset'],\n res['Payload'].v['ParamCount']\n ].unpack(\"v4\")\n\n data = res['Payload'].to_s[\n res['Payload'].v['DataOffset'],\n res['Payload'].v['DataCount']\n ]\n\n 0.upto(lentries - 1) do |i|\n sname,tmp = data[(i * 20) + 0, 14].split(\"\\x00\")\n stype = data[(i * 20) + 14, 2].unpack('v')[0]\n scoff = data[(i * 20) + 16, 2].unpack('v')[0]\n scoff -= lconv if lconv != 0\n scomm,tmp = data[scoff, data.length - scoff].split(\"\\x00\")\n shares << [ sname, smb_lookup_share_type(stype), scomm]\n end\n\n shares\n end",
"title": ""
},
{
"docid": "0797bb7962609cadd9a918f6371de1d4",
"score": "0.49640986",
"text": "def get_all_shared_files_for_user(user_id)\n return $db.execute(\"SELECT * \n FROM files \n INNER JOIN shared_files ON files.file_id = shared_files.file_id\n INNER JOIN users ON files.owner_id = users.user_id\n WHERE shared_files.user_id = ?\", user_id)\nend",
"title": ""
},
{
"docid": "67807f6ea3f58fa085c204572f469860",
"score": "0.49589163",
"text": "def share\n calculate_share if static_shares?\n end",
"title": ""
},
{
"docid": "f50b52b41d4e5f8f67ef0c5c3d7eed19",
"score": "0.495588",
"text": "def get_disks(vm_id)\n with_thread_name(\"get_disks(#{vm_id})\") do\n begin\n @logger.debug(\"Requesting disks attached to VM #{vm_id}...\")\n vm = @vm_manager.get_virtual_machine(vm_id, true)\n disks = []\n vm['vm_disk_info'].each do |disk|\n unless disk['disk_address']['volume_group_uuid'].nil?\n disks << disk['disk_address']['volume_group_uuid']\n end\n end\n @logger.debug(\"VM Disks: #{disks}\")\n disks\n rescue => e\n @logger.error(e)\n cloud_error(e.message)\n end\n end\n end",
"title": ""
},
{
"docid": "71943d4448ffeb032cf54496b72697aa",
"score": "0.49558067",
"text": "def index\n @artwork_shares = ArtworkShare.all\n end",
"title": ""
},
{
"docid": "0bdb5a0b93163e42b9871d86be6af8ea",
"score": "0.49535146",
"text": "def smb_netshareenumall\n begin\n return smb_srvsvc_netshareenumall\n rescue Rex::Proto::SMB::Exceptions::ErrorCode, RubySMB::Error::RubySMBError => e\n vprint_error(\"Warning: NetShareEnumAll failed via Server Service: #{e}\")\n return [] if self.simple.client.is_a?(RubySMB::Client)\n vprint_error(\"Falling back to LANMAN\")\n return smb_lanman_netshareenumall\n end\n end",
"title": ""
},
{
"docid": "de947488249807203ca6101b855e4cf2",
"score": "0.4942815",
"text": "def volumes_for_account(accountid)\n api_call = {\n :method => \"ListVolumesForAccount\",\n :params => {\n :volumeID => accountid\n }\n }\n answer = query_sf(api_call)\n return answer\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.49361977",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.49361977",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.49361977",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.49361977",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.49361977",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.49361977",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "fdb287fcd300c4a02c0b8ea9d3f0222a",
"score": "0.49346808",
"text": "def update_shares(calendar_id, add, remove)\n @shares[calendar_id] ||= []\n\n add.each do |val|\n val['status'] = SharingPlugin::STATUS_NORESPONSE\n @shares[calendar_id] << val\n end\n\n @shares[calendar_id].delete_if do |share|\n remove.include?(share['href'])\n end\n end",
"title": ""
},
{
"docid": "65e8540a33a4f99ae5897f7d15fb51ea",
"score": "0.49335206",
"text": "def set_share\n @share = user_shares.find_by(params.permit(:id))\n authorize @share\n end",
"title": ""
},
{
"docid": "22f447892c1629905a5b240795952376",
"score": "0.49164146",
"text": "def show\n @shareable = Shareable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shareable }\n end\n end",
"title": ""
},
{
"docid": "69000589d56fdd62f727373e16cbcec2",
"score": "0.48975143",
"text": "def list\n items = storage.items\n if items.empty?\n puts 'No items in the list.'\n return\n end\n\n storage.items.each do |(id, data)|\n puts \"#{id} #{data[:stamp]} #{data[:source].ljust(48)}\"\n end\n end",
"title": ""
},
{
"docid": "6dad64994b85c54d8bde3884c9e91dd9",
"score": "0.48891425",
"text": "def services(device_id=nil, shared=false)\n params = { shared: shared }\n params[:deviceid] = device_id unless device_id.nil?\n\n response = get('/listServices', params)\n services = []\n response.body['services'].each do |s|\n services << Service.from_json(s, @token, @logger)\n end\n services\n end",
"title": ""
},
{
"docid": "a43a6f71d583c07cc7376c51e463960b",
"score": "0.4888435",
"text": "def index\n @post_shares = PostShare.all\n end",
"title": ""
},
{
"docid": "2db012ac9268b3c7266ff73eff274199",
"score": "0.48784226",
"text": "def fetch_children\n @children = []\n for item in self.listex\n if item[\"type\"] == \"folder\" and item[\"id\"]!=@id #sharefile API includes self in list\n @children << ShareFolder.new(item[\"id\"], @authid, false, item)\n elsif item[\"type\"] == \"file\"\n @children << ShareFile.new(item[\"id\"], @authid, item)\n end\n end\n end",
"title": ""
},
{
"docid": "fa0541452af25de634bf26fea660339f",
"score": "0.48761225",
"text": "def share_folders(folders)\n end",
"title": ""
},
{
"docid": "2a771d8f6ee82981ba29e0b3b8783198",
"score": "0.4873652",
"text": "def getPrivate_objectAll( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"get\",\"/private_object/all\",params)\n end",
"title": ""
},
{
"docid": "3e7691c28d830b247cf89ab59ec6be12",
"score": "0.48591977",
"text": "def set_share\n @share = Share.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "54a726a94ecb577633c2293000d75910",
"score": "0.48578286",
"text": "def get_data_feeds(merchant_id)\n uri = build_uri_for(@provider, {id: merchant_id})\n http = initialize_http(uri)\n\n request = Net::HTTP::Get.new(uri.request_uri)\n JSON( http.request(request).body )['Items'] \n end",
"title": ""
},
{
"docid": "8e406bce108d77ab23477eba1222bc87",
"score": "0.48546526",
"text": "def index\n @media_shares = MediaShare.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @media_shares }\n end\n end",
"title": ""
},
{
"docid": "456eaf3ced45512dfe1455dbf3ee6402",
"score": "0.48504153",
"text": "def set_share\n # @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "05a657ea360cddcbce566f081459d897",
"score": "0.48396862",
"text": "def smb_srvsvc_netshareenumall\n shares = []\n simple.connect(\"\\\\\\\\#{rhost}\\\\IPC$\")\n handle = dcerpc_handle('4b324fc8-1670-01d3-1278-5a47bf6ee188', '3.0', 'ncacn_np', [\"\\\\srvsvc\"])\n begin\n dcerpc_bind(handle)\n rescue Rex::Proto::SMB::Exceptions::ErrorCode, RubySMB::Error::RubySMBError => e\n vprint_error(e.message)\n return []\n end\n\n stubdata =\n NDR.uwstring(\"\\\\\\\\#{rhost}\") +\n NDR.long(1) #level\n\n ref_id = stubdata[0,4].unpack(\"V\")[0]\n ctr = [1, ref_id + 4 , 0, 0].pack(\"VVVV\")\n\n stubdata << ctr\n stubdata << NDR.align(ctr)\n stubdata << [\"FFFFFFFF\"].pack(\"H*\")\n stubdata << [ref_id + 8, 0].pack(\"VV\")\n response = dcerpc.call(0x0f, stubdata)\n res = response.dup\n win_error = res.slice!(-4, 4).unpack(\"V\")[0]\n\n if win_error != 0\n raise RuntimeError, \"Invalid DCERPC response: win_error = #{win_error}\"\n end\n\n # Remove unused data\n res.slice!(0,12) # level, CTR header, Reference ID of CTR\n share_count = res.slice!(0, 4).unpack(\"V\")[0]\n res.slice!(0,4) # Reference ID of CTR1\n share_max_count = res.slice!(0, 4).unpack(\"V\")[0]\n\n if share_max_count != share_count\n raise RuntimeError, \"Invalid DCERPC response: count != count max (#{share_count}/#{share_max_count})\"\n end\n\n # ReferenceID / Type / ReferenceID of Comment\n types = res.slice!(0, share_count * 12).scan(/.{12}/n).map{|a| a[4,2].unpack(\"v\")[0]}\n\n share_count.times do |t|\n length, offset, max_length = res.slice!(0, 12).unpack(\"VVV\")\n if offset != 0\n raise RuntimeError, \"Invalid DCERPC response: offset != 0 (#{offset})\"\n end\n\n if length != max_length\n raise RuntimeError, \"Invalid DCERPC response: length !=max_length (#{length}/#{max_length})\"\n end\n name = res.slice!(0, 2 * length).gsub('\\x00','')\n res.slice!(0,2) if length % 2 == 1 # pad\n\n comment_length, comment_offset, comment_max_length = res.slice!(0, 12).unpack(\"VVV\")\n\n if comment_offset != 0\n raise RuntimeError, \"Invalid DCERPC response: comment_offset != 0 (#{comment_offset})\"\n end\n\n if comment_length != comment_max_length\n raise RuntimeError, \"Invalid DCERPC response: comment_length != comment_max_length (#{comment_length}/#{comment_max_length})\"\n end\n\n comment = res.slice!(0, 2 * comment_length)\n\n res.slice!(0,2) if comment_length % 2 == 1 # pad\n\n name = Rex::Text.to_ascii(name).gsub(\"\\x00\", \"\")\n s_type = smb_lookup_share_type(types[t])\n comment = Rex::Text.to_ascii(comment).gsub(\"\\x00\", \"\")\n\n shares << [ name, s_type, comment ]\n end\n\n shares\n end",
"title": ""
},
{
"docid": "d162d71d7e91461f5e302e7aa6d86bf2",
"score": "0.48383301",
"text": "def create_share_for_device_with_http_info(device_id, device_share_info, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesSharesApi.create_share_for_device ...\"\n end\n # verify the required parameter 'device_id' is set\n fail ArgumentError, \"Missing the required parameter 'device_id' when calling DevicesSharesApi.create_share_for_device\" if device_id.nil?\n # verify the required parameter 'device_share_info' is set\n fail ArgumentError, \"Missing the required parameter 'device_share_info' when calling DevicesSharesApi.create_share_for_device\" if device_share_info.nil?\n # resource path\n local_var_path = \"/devices/{deviceId}/shares\".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(device_share_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 => 'DeviceSharingId')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesSharesApi#create_share_for_device\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "21fa54e62aed18aa98cac4f3361141b1",
"score": "0.48144332",
"text": "def show\n @share = Share.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @share }\n end\n end",
"title": ""
},
{
"docid": "1c1d74e260f090e7ba00a175680c88e1",
"score": "0.48117033",
"text": "def share(resource_id, data = nil)\n _one_item_action('post',\n resource_id,\n 'share',\n data)\n end",
"title": ""
},
{
"docid": "1585d354c59584571c740ee401528735",
"score": "0.4804232",
"text": "def keys\n ::M2X::Client::Key.list(@client, params.merge(device: self[\"id\"]))\n end",
"title": ""
},
{
"docid": "50ab079ad5307e65b02078cf751a5197",
"score": "0.47820222",
"text": "def card_list(card_id, options = {})\n card_resource(card_id, \"list\", options)\n end",
"title": ""
},
{
"docid": "51874432481b7bb2aa68eb1464be1b96",
"score": "0.47676986",
"text": "def sharedCards\n \tcus_shared_with_user = cards_users.where(user_id: self.id, is_shared: true)\n\n \t# Have a list of CardsUsers, but want a list of Shared Cards\n \tshared_cards = []\n \tcus_shared_with_user.each do | cu |\n \t\tcard = Card.find(cu.card_id)\n \t\tshared_cards.push(card)\n \tend\n \tshared_cards\n end",
"title": ""
},
{
"docid": "60f1ddccad715f832985c315f4158016",
"score": "0.47633025",
"text": "def perform(share_id)\n\t\t#Retrieve the IDs for each whitelist api connection\n\t\twac_ids = WhitelistApiConnection.where(\"share_id = ?\", share_id).pluck(\"id\")\n\t\t#Retrieve all of the APIs with active pulls on this share from the database.\n\t\tapis = Api.joins(:whitelist_api_connections).where(\"share_id = ?\", share_id).uniq\n\t\t#puts \"API count: \" + apis.count.to_s\n\t\t#Iterate through each API\n\t\tapis.each do |ananke_api|\n\t\t\t#puts \"API Id: \" + ananke_api.id.to_s\n\t\t\traise ArgumentError, \"Api must be a corporation API.\" if ananke_api.ananke_type != 1\n\t\t\traise ArgumentError, \"Api must be active.\" if ananke_api.active != true\n\n\t\t\t#Construct an eve api with the eve gem\n\t\t\teve_api = Eve::API.new(:key_id => ananke_api.key_id, :v_code => ananke_api.v_code)\n\n\t\t\t#Query the API\n\t\t\tresult = eve_api.corporation.contact_list\n\n\t\t\t#Iterate through each contact\n\t\t\tresult.corporateContactList.each do |contact|\n\t\t\t\tcontact_type = 0\n\t\t\t\t#Process the contact's contactTypeID\n\t\t\t\tif contact.contactTypeID == 2\n\t\t\t\t\tcontact_type = 2\n\t\t\t\telsif contact.contactTypeID == 16159\n\t\t\t\t\tcontact_type = 1\n\t\t\t\telsif contact.contactTypeID >= 1370 && contact.contactTypeID <= 1390\n\t\t\t\t\tcontact_type = 4\n\t\t\t\telse\n\t\t\t\t\tcontact_type = 3\n\t\t\t\tend\n\n\t\t\t\tif contact.standing >= ananke_api.whitelist_standings\n\t\t\t\t\twhitelist_entity = Whitelist.where(\"name = ? AND share_id = ?\", contact.contactName, share_id)[0]\n\t\t\t\t\t#If this contact does not exist on the whitelist. \n\t\t\t\t\tif whitelist_entity.nil? == true\n\t\t\t\t\t\t#Create a whitelist entity from it\n\t\t\t\t\t\tnew_entity = Whitelist.create(name: contact.contactName, entity_type: contact_type, source_type: 1, source_share_user: ananke_api.share_user.id, standing: contact.standing, share_id: share_id)\n\n\t\t\t\t\t\t#and create a connection between that entity and the source API\n\t\t\t\t\t\tananke_api.whitelist_api_connections.create(whitelist_id: new_entity.id, share_id: share_id)\n\t\t\t\t\t\t#No need to remove the new wac's id from the wac_ids array because it was never there.\n\t\t\t\t\telse\n\t\t\t\t\t\t#Check the entity's standings and see if they've changed.\n\t\t\t\t\t\tif contact.standing != whitelist_entity.standing\n\t\t\t\t\t\t\t#If they've changed, update them with the new data from the API\n\t\t\t\t\t\t\twhitelist_entity.standing = contact.standing\n\t\t\t\t\t\tend\n\t\t\t\t\t\t#Remove the wac's id from the wac_ids array.\n\t\t\t\t\t\twac = whitelist_entity.whitelist_api_connections.where(\"api_id = ?\", ananke_api.id)[0]\n\t\t\t\t\t\twac_ids.delete_if{|list_id| \n\t\t\t\t\t\t\tlist_id == wac.id\n\t\t\t\t\t\t}\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tif contact.standing < ananke_api.whitelist_standings\n\t\t\t\t\twhitelist_entity = Whitelist.where(\"name = ? AND share_id = ?\", contact.contactName, share_id)[0]\n\t\t\t\t\t#If this contact is already on the whitelist\n\t\t\t\t\tif whitelist_entity.nil? == false\n\t\t\t\t\t\tconnection_api_ids = whitelist_entity.apis.pluck(\"api_id\")\n\n\t\t\t\t\t\t#If this contact does not have a connection with this api\n\t\t\t\t\t\tif connection_api_ids.include?(ananke_api.id) == true\n\t\t\t\t\t\t\t#Destroy the connection between this API and the whitelist entity\n\t\t\t\t\t\t\twac = whitelist_entity.whitelist_api_connections.where(\"api_id = ?\", ananke_api.id)[0]\n\t\t\t\t\t\t\twac.destroy!\n\t\t\t\t\t\t\t#Remove the wac's id from the wac_ids array.\n\t\t\t\t\t\t\twac_ids.delete_if{|id| id == wac.id}\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tWhitelistLog.create(entity_name: ananke_api.main_entity_name, source_share_user: ananke_api.share_user.id, source_type: 2, addition: true, entity_type: 5, date: Date.today, time: Time.now, share_id: share_id)\n\t\t\t#Generate a whitelist_log entry for this pull\n\t\tend\n\t\t#Delete any whitelist api connections (wacs) that remain.\n\t\t#This should result in the removal of api sourced whitelist entities that are no longer supported by any APIs.\n\t\tif wac_ids.empty? == false\n\t\t\twac_ids.each do |wac|\n\t\t\t\tWhitelistApiConnection.where(\"id = ?\", wac)[0].destroy\n\t\t\tend\n\t\tend\n\tend",
"title": ""
}
] |
001138653f4d2b622f229c36d1066b6a
|
Language of the source code associated with the object. Defaults to +:ruby+.
|
[
{
"docid": "f33e8f368f6e998bbf3494661077743f",
"score": "0.0",
"text": "def source_type; end",
"title": ""
}
] |
[
{
"docid": "7c12b45453d47339d8396b79bada2f71",
"score": "0.7372397",
"text": "def rb_language=(_arg0); end",
"title": ""
},
{
"docid": "43a323387e4bc857c56080cdf939a603",
"score": "0.7216183",
"text": "def language\n Language.lang_for(dictionaries, :source_language)\n end",
"title": ""
},
{
"docid": "db579f8b80ab820fddf0ec53e3f47453",
"score": "0.71675587",
"text": "def language(); end",
"title": ""
},
{
"docid": "1133cde23560e96b61734448aaa14f2a",
"score": "0.7066734",
"text": "def language\n if !block_given?\n return @j_del.java_method(:language, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling language()\"\n end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.7017759",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.7017759",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.7017759",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.7017759",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.7017759",
"text": "def language; end",
"title": ""
},
{
"docid": "94c2ea725c0b288cf57a163ca6baf730",
"score": "0.69965166",
"text": "def source_language\n lang self.source\n end",
"title": ""
},
{
"docid": "96858f278e7f335c2de797949151eb5e",
"score": "0.69112813",
"text": "def lang()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "96858f278e7f335c2de797949151eb5e",
"score": "0.69112813",
"text": "def lang()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "af3095f1ea2a07f80d5c33ebdaee388c",
"score": "0.6860644",
"text": "def display_language\n return 'Swift' if swift?\n\n Config.instance.hide_objc? ? 'Swift' : 'Objective-C'\n end",
"title": ""
},
{
"docid": "242109d7536a36fd459b0e0e644e8621",
"score": "0.68518794",
"text": "def source_code_class\n if document.attr? 'source-highlighter', 'highlightjs'\n \"language-#{source_lang || 'none'} hljs\"\n elsif source_lang\n \"language-#{source_lang}\"\n end\n end",
"title": ""
},
{
"docid": "278e0eeaa8494aac9014fac6b4ede695",
"score": "0.68508065",
"text": "def language\n wl = WhatLanguage.new(:all)\n wl.language(@content)\n end",
"title": ""
},
{
"docid": "50388f45f5b2b64b5b3e3e1b68585ba7",
"score": "0.6831146",
"text": "def language\n @language ||= Linguist.detect(self)\n end",
"title": ""
},
{
"docid": "7991d726480c642033cf741bd6fd4a19",
"score": "0.68036216",
"text": "def language\n @@language || \"en\"\n end",
"title": ""
},
{
"docid": "d9651d5dd0be7e3e2d78629be5f4e0fe",
"score": "0.67940694",
"text": "def detect_language\n @_language ||=\n if pygmentize?\n %x[pygmentize -N #{@file}].strip.split('+').first\n else\n @file.split('.').last\n end\n end",
"title": ""
},
{
"docid": "2e078fd6a8e663b95efbb6dca66f53a1",
"score": "0.67830056",
"text": "def parse_lang_for_codeblock(source); end",
"title": ""
},
{
"docid": "22179d3bca7aa718e144eaf56e5c60aa",
"score": "0.6765472",
"text": "def content_language; end",
"title": ""
},
{
"docid": "3c8c80861e05777ce3eaef5533d10ce9",
"score": "0.6746368",
"text": "def guess_h_language\n if lines.grep(/^@(interface|property|private|public|end)/).any?\n Language['Objective-C']\n elsif lines.grep(/^class |^\\s+(public|protected|private):/).any?\n Language['C++']\n else\n Language['C']\n end\n end",
"title": ""
},
{
"docid": "3c8c80861e05777ce3eaef5533d10ce9",
"score": "0.6746368",
"text": "def guess_h_language\n if lines.grep(/^@(interface|property|private|public|end)/).any?\n Language['Objective-C']\n elsif lines.grep(/^class |^\\s+(public|protected|private):/).any?\n Language['C++']\n else\n Language['C']\n end\n end",
"title": ""
},
{
"docid": "f36020a1d2c4e36c23f4beaf153af5c2",
"score": "0.6715677",
"text": "def language\n # Instanzvariablen beginnen immer mit @ und sind überall in der Klasse\n # verfügbar.\n \n @language\n end",
"title": ""
},
{
"docid": "818e3854bbee325cf0c79471de8889ce",
"score": "0.6665074",
"text": "def language\n self[:language].to_s.downcase if self[:language]\n end",
"title": ""
},
{
"docid": "9db59ac3188f12074bbab739c785b241",
"score": "0.66475224",
"text": "def language\n if defined? @language\n @language\n else\n @language = guess_language\n end\n end",
"title": ""
},
{
"docid": "9db59ac3188f12074bbab739c785b241",
"score": "0.66475224",
"text": "def language\n if defined? @language\n @language\n else\n @language = guess_language\n end\n end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.66239786",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.66239786",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.66239786",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.66239786",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.66239786",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.66239786",
"text": "def lang; end",
"title": ""
},
{
"docid": "6b72374d13585dc41c38605c40d03aeb",
"score": "0.6619632",
"text": "def ruby\n \"ruby\"\n end",
"title": ""
},
{
"docid": "6faa87b380b64cf486fc534857b8caad",
"score": "0.66052234",
"text": "def language\n @language ||= get_language\n end",
"title": ""
},
{
"docid": "803e29bf5ff1ad8b9f901878bca033e0",
"score": "0.66028166",
"text": "def detect_code_language!(el)\n code = el.value.split(\"\\n\")\n first_line = code.shift\n if first_line =~ /^:([^:]+):$/\n el.value = code.join(\"\\n\")\n $1\n end\n end",
"title": ""
},
{
"docid": "5fe800138e05b46e1e9832e93a244906",
"score": "0.6602779",
"text": "def language\n if LANGUAGES.keys.include? @language\n return @language\n else\n return 'text.plain'\n end\n end",
"title": ""
},
{
"docid": "ddb01ad9e97ea0560cd94d01df1e0cba",
"score": "0.6595895",
"text": "def language\n super\n end",
"title": ""
},
{
"docid": "c83974dc2818bf7ba8a6fd1c53a5b52c",
"score": "0.6586218",
"text": "def language\n @language || meta[:language]\n end",
"title": ""
},
{
"docid": "275054136d6b141fa38b208ea9b127d3",
"score": "0.6573587",
"text": "def language\n @language\n end",
"title": ""
},
{
"docid": "2ab7485790e8f02cdc61a86be24e4435",
"score": "0.6564295",
"text": "def language(*arg)\n self.descMetadata.get_language\n end",
"title": ""
},
{
"docid": "789d208321fe61ad40d06c21abc8844c",
"score": "0.6543049",
"text": "def language\n language = 'Unknown'\n unless blob.nil?\n detected_language = LanguageSniffer.detect(filename, content: blob.content).language\n language = detected_language.name unless detected_language.nil?\n end\n language\n end",
"title": ""
},
{
"docid": "0f6b0c9f24eb2fbec36ef4d8cebafdfd",
"score": "0.65173614",
"text": "def language\n self\n end",
"title": ""
},
{
"docid": "d346621a154537a84ec3b98178872861",
"score": "0.65170777",
"text": "def content_language\n data[:content_language]\n end",
"title": ""
},
{
"docid": "11b8d58f4234752f410cd15cec9063ef",
"score": "0.6469715",
"text": "def guess_m_language\n # Objective-C keywords\n if lines.grep(/^#import|@(interface|implementation|property|synthesize|end)/).any?\n Language['Objective-C']\n\n # File function\n elsif lines.first.to_s =~ /^function /\n Language['Matlab']\n\n # Matlab comment\n elsif lines.grep(/^%/).any?\n Language['Matlab']\n\n # Fallback to Objective-C, don't want any Matlab false positives\n else\n Language['Objective-C']\n end\n end",
"title": ""
},
{
"docid": "11b8d58f4234752f410cd15cec9063ef",
"score": "0.6469573",
"text": "def guess_m_language\n # Objective-C keywords\n if lines.grep(/^#import|@(interface|implementation|property|synthesize|end)/).any?\n Language['Objective-C']\n\n # File function\n elsif lines.first.to_s =~ /^function /\n Language['Matlab']\n\n # Matlab comment\n elsif lines.grep(/^%/).any?\n Language['Matlab']\n\n # Fallback to Objective-C, don't want any Matlab false positives\n else\n Language['Objective-C']\n end\n end",
"title": ""
},
{
"docid": "7014867aed791e91717a8558f4b5e779",
"score": "0.64599574",
"text": "def language\n @language ||= Language.find_by_filename(@path)\n end",
"title": ""
},
{
"docid": "4bd59e56ad8db5d2a633daab190f47ce",
"score": "0.6444065",
"text": "def language_code_of_text\n if self.language_of_text\n self.language_of_text.code\n end\n end",
"title": ""
},
{
"docid": "9923d1ae7b15738d504aa616f5b9722b",
"score": "0.6421187",
"text": "def parse_lang_for_codeblock(source)\n type = nil\n if source =~ /\\A(?:[ \\t]*\\r?\\n)?[ \\t]*!!!([\\w.+-]+)[ \\t]*\\r?\\n/\n type = $1\n source = $'\n end\n\n [type, source]\n end",
"title": ""
},
{
"docid": "badd567a788bbef88f1ecfa23b91f9ed",
"score": "0.641459",
"text": "def language\n return @language\n end",
"title": ""
},
{
"docid": "badd567a788bbef88f1ecfa23b91f9ed",
"score": "0.641459",
"text": "def language\n return @language\n end",
"title": ""
},
{
"docid": "badd567a788bbef88f1ecfa23b91f9ed",
"score": "0.641459",
"text": "def language\n return @language\n end",
"title": ""
},
{
"docid": "9fee2429714c887fb3d0ae45858c1d79",
"score": "0.6414185",
"text": "def template_language; end",
"title": ""
},
{
"docid": "42fe40f278ec3e76e2bb150e533704f4",
"score": "0.6374124",
"text": "def language\n @language ||= Language.new(env['HTTP_ACCEPT_LANGUAGE'])\n end",
"title": ""
},
{
"docid": "3f38607efa961abd15ca446a80a8b369",
"score": "0.6369639",
"text": "def lang\n self.class.lang\n end",
"title": ""
},
{
"docid": "192cde9ccac3cbaaa42885c9da086c80",
"score": "0.6365076",
"text": "def guess_language\n return if binary_mime_type?\n\n # Disambiguate between multiple language extensions\n disambiguate_extension_language ||\n\n # See if there is a Language for the extension\n pathname.language ||\n\n # Look for idioms in first line\n first_line_language ||\n\n # Try to detect Language from shebang line\n shebang_language\n end",
"title": ""
},
{
"docid": "ec3b7a22fa30c5f6e68c89ffcd44c909",
"score": "0.63590676",
"text": "def language\n 'en-us'\n end",
"title": ""
},
{
"docid": "2c05dfe0d8417577fa42943a1bb28099",
"score": "0.63466156",
"text": "def getSourceLang\r\n\t\t\"#{@sourceLang}\"\r\n\tend",
"title": ""
},
{
"docid": "394c3454738dd8e9e3c4a68fa297b0f1",
"score": "0.6346494",
"text": "def language_s\n if self.language.nil?\n return 'RAW'\n else\n Tool.languages(self.language)\n end\n end",
"title": ""
},
{
"docid": "44e9eae283884073529674e45012043e",
"score": "0.6342255",
"text": "def language\n Raise \"Method language must be overridden\"\n end",
"title": ""
},
{
"docid": "60891aa209c197bcbb98894be9279e2d",
"score": "0.63263667",
"text": "def target_language\n lang self.target\n end",
"title": ""
},
{
"docid": "ab5017d209d1d21d13ec07ed132e8d01",
"score": "0.6315827",
"text": "def language( unused=nil )\n\t\t\"English\"\n\tend",
"title": ""
},
{
"docid": "d14e8455d3d5d37c5ae2fec327e87a62",
"score": "0.6285709",
"text": "def getLang()\n return @language\n end",
"title": ""
},
{
"docid": "d14e8455d3d5d37c5ae2fec327e87a62",
"score": "0.6285709",
"text": "def getLang()\n return @language\n end",
"title": ""
},
{
"docid": "5b864d78b63c41992a0ded0e9b4487a4",
"score": "0.6277812",
"text": "def language_of_text\n @descriptive_detail.language_of_text || @default_language_of_text\n end",
"title": ""
},
{
"docid": "5a36562e743417c193f9c7cfe1b16e9d",
"score": "0.6273355",
"text": "def language\n @lang_object ||= @lang.is_a?(Language) ? @lang : Language.find_by_iso_639_1(@lang)\n end",
"title": ""
},
{
"docid": "eef22fcb0f383f60061adfd57cef9fc0",
"score": "0.6265993",
"text": "def language_code\n return self[:language_code].downcase if self[:language_code]\n end",
"title": ""
},
{
"docid": "2d34c04fcc597c3049d213f7d8c139e1",
"score": "0.62640417",
"text": "def name\n 'ruby'\n end",
"title": ""
},
{
"docid": "538e185b0418feadc1f142540aaa2d2a",
"score": "0.6258071",
"text": "def language\n descMetadata.language_code.zip(descMetadata.language_text).map{|a|{code: a[0],text: a[1]}}\n end",
"title": ""
},
{
"docid": "ba90aea0f02009b0d44afbd89362de9e",
"score": "0.6222938",
"text": "def language\n return model.language\n end",
"title": ""
},
{
"docid": "ffd46e3198f174ee4e6a773bd8d0f5e3",
"score": "0.62134653",
"text": "def guess_cls_language\n if lines.grep(/^(%|\\\\)/).any?\n Language['TeX']\n elsif lines.grep(/^\\s*(CLASS|METHOD|INTERFACE).*:\\s*/i).any? || lines.grep(/^\\s*(USING|DEFINE)/i).any?\n Language['OpenEdge ABL']\n elsif lines.grep(/\\{$/).any? || lines.grep(/\\}$/).any?\n Language['Apex']\n elsif lines.grep(/^(\\'\\*|Attribute|Option|Sub|Private|Protected|Public|Friend)/i).any?\n Language['Visual Basic']\n else\n # The most common language should be the fallback\n Language['TeX']\n end\n end",
"title": ""
},
{
"docid": "1aedfbcd74d4646d5003ba5f042dfb8e",
"score": "0.6211891",
"text": "def language\n rspec_language\n end",
"title": ""
},
{
"docid": "377ee8d7a248be513db688a801927883",
"score": "0.62051046",
"text": "def language(value)\n command[:language] = value\n self\n end",
"title": ""
},
{
"docid": "07d17bf4fab65bb097f899cbf6afa7f4",
"score": "0.6197596",
"text": "def guess_language\n # Disambiguate between multiple language extensions\n disambiguate_extension_language ||\n\n # See if there is a Language for the extension\n pathname.language ||\n\n # Look for idioms in first line\n first_line_language ||\n\n # Try to detect Language from shebang line\n shebang_language\n end",
"title": ""
},
{
"docid": "885a2c9fc4d2d3c04139b88c7e8d3ee7",
"score": "0.619633",
"text": "def language\n @language ||= (directive[:name] || @language_default).then do |handle|\n @aliases[handle.downcase] || handle\n end\n end",
"title": ""
},
{
"docid": "1967ce4891cc940b0f6684c574cf088e",
"score": "0.6195546",
"text": "def source_lang\n @doc.xpath(\"/#{@namespace_xliff}xliff/#{@namespace_xliff}file\").first['source-language']\n end",
"title": ""
},
{
"docid": "47fc4002cd2152bd0b043f70cf3a8174",
"score": "0.6195266",
"text": "def content_language\n @gapi.content_language\n end",
"title": ""
},
{
"docid": "36c34cd486b5e040a3a0315f71724354",
"score": "0.6182055",
"text": "def language(*l,&b)\n return @language if (l[0].nil? and not @language.nil?)\n @language = l[0]\n instance_eval(&b)\n end",
"title": ""
},
{
"docid": "b8103d170dcf64d9a669892b5da50fad",
"score": "0.61326814",
"text": "def language\n\t\t::Linguistics::ISO639::LANGUAGE_CODES[ self.language_code.to_sym ][:eng_name]\n\tend",
"title": ""
},
{
"docid": "b8103d170dcf64d9a669892b5da50fad",
"score": "0.61326814",
"text": "def language\n\t\t::Linguistics::ISO639::LANGUAGE_CODES[ self.language_code.to_sym ][:eng_name]\n\tend",
"title": ""
},
{
"docid": "80fd8607258eb9e5dea2d90458ea6b6e",
"score": "0.61236817",
"text": "def lang=(_arg0); end",
"title": ""
},
{
"docid": "80fd8607258eb9e5dea2d90458ea6b6e",
"score": "0.61236817",
"text": "def lang=(_arg0); end",
"title": ""
},
{
"docid": "0ae7d90b3097e8e5f786d3512c4e823f",
"score": "0.6121132",
"text": "def target_ruby; end",
"title": ""
},
{
"docid": "96446f597327b1d4067582282815d679",
"score": "0.61184573",
"text": "def get_code_language(node)\n split_lanugage_fence_info(node)&.first || \"unknown\"\n end",
"title": ""
},
{
"docid": "5f9c19c31500b85df112fbe3fb608057",
"score": "0.6116004",
"text": "def language\n I18n.locale\n end",
"title": ""
},
{
"docid": "6c14740a30d6c74ec49c363c7377b7d8",
"score": "0.61145675",
"text": "def language=(name)\n @language = name\n end",
"title": ""
},
{
"docid": "ad731a05f77a8cd85f5bf214b39698b5",
"score": "0.6090605",
"text": "def language\n return nil unless (extended_language = read_attribute(:language))\n encrypt_remove_pre_and_postfix(extended_language, 'language', 4)\n end",
"title": ""
},
{
"docid": "f30752b7c12acff33195e659703f975a",
"score": "0.60802037",
"text": "def language=(value)\n @language = value\n end",
"title": ""
},
{
"docid": "f30752b7c12acff33195e659703f975a",
"score": "0.60802037",
"text": "def language=(value)\n @language = value\n end",
"title": ""
},
{
"docid": "f30752b7c12acff33195e659703f975a",
"score": "0.60802037",
"text": "def language=(value)\n @language = value\n end",
"title": ""
},
{
"docid": "3612650e1f8eb5b991a25a23ff95e8bc",
"score": "0.60602206",
"text": "def lang; token_data[:language]; end",
"title": ""
},
{
"docid": "8a98cb143fb10b89b6c3ccadc419a995",
"score": "0.60542434",
"text": "def language(value)\n merge(language: value.to_s)\n end",
"title": ""
},
{
"docid": "8a98cb143fb10b89b6c3ccadc419a995",
"score": "0.60542434",
"text": "def language(value)\n merge(language: value.to_s)\n end",
"title": ""
},
{
"docid": "a956bedd5e780b6e7ddb2bf87660c739",
"score": "0.6049223",
"text": "def detect_language\n @filepath =~ /.*\\.(..)\\.cql$/i\n language_code = $1\n @language = LANGUAGES[language_code] || 'English'\n end",
"title": ""
},
{
"docid": "228392933f978c69885eeb80b1d95966",
"score": "0.6047463",
"text": "def detect_language(d)\n case\n when File.exists?(File.join(d, 'src', 'main.rs')) then :rust\n when File.exists?(File.join(d, 'Package.swift')) then :swift\n when File.exists?(File.join(d, 'main.py')) then :python\n when File.exists?(File.join(d, 'main.js')) then :javascript\n when File.exists?(File.join(d, 'main.ts')) then :typescript\n else nil\n end\n end",
"title": ""
},
{
"docid": "c28e6ad3fbae509e6e552a0b871a00e3",
"score": "0.6044554",
"text": "def lang\n\t\t\t@language_tag = nil unless defined?( @language_tag )\n\t\t\treturn @language_tag.language\n\t\tend",
"title": ""
},
{
"docid": "ac67d2775aab3a0cbf71874020473ed6",
"score": "0.60438454",
"text": "def language_of_text\n lang = nil\n l = @languages.select { |l| l.role.human == \"LanguageOfText\" }.first\n if l\n lang = l.code\n end\n lang || @default_language_of_text\n end",
"title": ""
},
{
"docid": "74015d0f2f3113a47cc107a626c6a94b",
"score": "0.6042725",
"text": "def guess_r_language\n if lines.grep(/(rebol|(:\\s+func|make\\s+object!|^\\s*context)\\s*\\[)/i).any?\n Language['Rebol']\n else\n Language['R']\n end\n end",
"title": ""
},
{
"docid": "74015d0f2f3113a47cc107a626c6a94b",
"score": "0.6042725",
"text": "def guess_r_language\n if lines.grep(/(rebol|(:\\s+func|make\\s+object!|^\\s*context)\\s*\\[)/i).any?\n Language['Rebol']\n else\n Language['R']\n end\n end",
"title": ""
},
{
"docid": "13d64a188bf1351125d364326af9f0e2",
"score": "0.60381675",
"text": "def ui_language\n @ui_language\n end",
"title": ""
},
{
"docid": "91b780df17dbdfaeb953b297a8a53871",
"score": "0.6024698",
"text": "def favorite_language_is_ruby?\n favorite_language == 'ruby'\n end",
"title": ""
},
{
"docid": "e5a99857c4d2cef7870be8ced4b16037",
"score": "0.60203284",
"text": "def language\n return @language unless @language.nil?\n lang = search_config[:language]\n return nil if lang.nil?\n lang = [lang] if lang.is_a? String\n @language = lang.collect(&:to_sym)\n end",
"title": ""
}
] |
52bdac7725b0e0c9a048e28ece463496
|
Sets a cryptographic hasher that will be used to sign outgoing commands. Once a hasher is set, all outgoing frames will be signed.
|
[
{
"docid": "b57ed6f9c49b794f7ac3b027320d7abb",
"score": "0.7394652",
"text": "def outgoing_command_hasher=(hasher)\n @out_command_hasher = hasher\n end",
"title": ""
}
] |
[
{
"docid": "32257fd852d1564a11f3335f7ac62f3a",
"score": "0.68958986",
"text": "def incoming_command_hasher=(hasher)\n @in_command_hasher = hasher\n end",
"title": ""
},
{
"docid": "d372ed8c307b1c26278f783e06084143",
"score": "0.58614194",
"text": "def set_outgoing_hash\n \n \t\tdata = \tself.class.get_payumoney_key + \"|\" + self.id.to_s + \"|\" + self.amount.to_s + \"|\" + get_product_info + \"|\" + get_first_name + \"|\" + get_email + \"|||||\" + get_udf5 + \"||||||\" + self.class.get_payumoney_salt\n\n \t\tself.outgoing_hash = Digest::SHA512.hexdigest(data)\n \tend",
"title": ""
},
{
"docid": "ac91a62484d2ad5119d1a0a26b2a628c",
"score": "0.50608474",
"text": "def send_command(command) \n command_str = command.to_encoded_str\n if @out_command_hasher\n send_frame command_str + @out_command_hasher.hash(command_str)\n else\n send_frame command_str\n end\n end",
"title": ""
},
{
"docid": "e59b6be74a584f64bcb7b117abee6d85",
"score": "0.49790546",
"text": "def hasher\n Hashids.new(@hash_id_state[:salt], @hash_id_state[:length])\n end",
"title": ""
},
{
"docid": "664ccfdbe158ca7ab8ecce0058480df0",
"score": "0.4871595",
"text": "def set_algorithms( cipher, hmac, compressor )\n super( cipher, hmac )\n @compressor = compressor\n end",
"title": ""
},
{
"docid": "368649aa07d2fa0225e79d8936e5fa3d",
"score": "0.48569545",
"text": "def dispatch_hashset!\n Thread::new do\n begin\n self.logger.debug { \"Starting hashing dispatcher.\" } \n loop do\n hash = @hash_queue.pop\n self.protocol.push_hash(hash)\n end\n \n rescue Exception => e\n self.logger.fatal { \"#{e.class.name}: #{e.message}\\n #{e.backtrace.join(\"\\n\")}\" }\n end\n end\n end",
"title": ""
},
{
"docid": "01436d9c83625db490ac144ca37e8dc9",
"score": "0.47943407",
"text": "def set_hash(hash, hash_type = 'SHA256')\n @hash = hash\n @hash_type = hash_type\n end",
"title": ""
},
{
"docid": "c17a3ecc79326bf67a8eee61217e6630",
"score": "0.4792751",
"text": "def set_crypto_hooks\n\n Binding.setopt_crypto_hooks(\n self,\n method(:aes_encrypt),\n method(:aes_decrypt),\n method(:random),\n method(:hmac_sha_512),\n method(:hmac_sha_256),\n method(:hmac_hash),\n )\n end",
"title": ""
},
{
"docid": "cb9686c30945f0f3a09503919a355b07",
"score": "0.47050935",
"text": "def set_hmac\n @hmac = Hmac.find(params[:id])\n end",
"title": ""
},
{
"docid": "1a410173b8296e47f3076eabba7fb1e7",
"score": "0.46540603",
"text": "def identity_publisher_hash=(value)\n @identity_publisher_hash = value\n end",
"title": ""
},
{
"docid": "a8bff0a48fa49ac341f1d8b3cdd7af6c",
"score": "0.46066016",
"text": "def set_secret_hash(opts = {})\n unless ['md5', 'sha512', nil].include?(opts[:value])\n raise ArgumentError, 'secret hash must be md5 or sha512'\n end\n cmd = command_builder(\"secret hash #{opts[:value]}\")\n cmds = ['management defaults', cmd]\n configure(cmds)\n end",
"title": ""
},
{
"docid": "bb6f0ee9120433d7324c861aa0be24dd",
"score": "0.455953",
"text": "def dispatch_hashing!\n Thread::new do\n begin\n self.logger.debug { \"Starting hashset dispatcher.\" }\n \n data = true\n position = @options.offset * @options.blocksize\n \n if @options.blockcount\n target = position + @options.blockcount * @options.blocksize\n else\n target = nil\n end\n \n self.logger.info { \"Starting indexing for transfer.\" }\n \n while data and (target.nil? or position < target)\n self.file.acquire do |file|\n self.logger.debug { \"Reading block from position #{position}.\" }\n file.seek(position)\n data = file.read(@options.blocksize)\n end\n \n position += @options.blocksize\n @hash_queue << Digest::SHA1.hexdigest(data) if data\n end\n \n # indicates finish\n @hash_queue << :end\n \n self.logger.info { \"Indexing for transfer finished.\" }\n \n rescue Exception => e\n self.logger.fatal { \"#{e.class.name}: #{e.message}\\n #{e.backtrace.join(\"\\n\")}\" }\n end\n end\n end",
"title": ""
},
{
"docid": "79e005ddc34b62e4c41ec02d5dd1c415",
"score": "0.44921046",
"text": "def set_hash_and_json\n @hash = {header: @header, payload: @payload, signature: encode(@signature)}\n @json = \"#{@header.to_json}.#{@payload.to_json}.#{encode(@signature)}\"\n end",
"title": ""
},
{
"docid": "dfc3fc52f68b14857c1bba6c033346a2",
"score": "0.4457707",
"text": "def encoderequest(sender, target, msg, requestid, filter={}, target_agent=nil, target_collective=nil)\n serialized = Marshal.dump(msg)\n digest = makehash(serialized)\n\n req = create_request(requestid, target, filter, serialized, @initiated_by, target_agent, target_collective)\n req[:hash] = digest\n\n Marshal.dump(req)\n end",
"title": ""
},
{
"docid": "ac7c84ddb1d00b51147db608475a18e6",
"score": "0.44165227",
"text": "def hash\n if @sha512hash != nil\n return @sha512hash.to_i(16)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "4c1b5b758dc69942b72d93c69f1c37cd",
"score": "0.43726268",
"text": "def collection_hsh\n collections_hasherizer(source_collections)\n end",
"title": ""
},
{
"docid": "175189782d077dd14f3e268cfee0cfc5",
"score": "0.43320394",
"text": "def set_header_obfuscator(header_obfuscator)\n raise ArgumentError, 'header_obfuscator is required' unless header_obfuscator\n\n @header_obfuscator = header_obfuscator\n end",
"title": ""
},
{
"docid": "d25a4edc74d6236241f24280f1143542",
"score": "0.43307436",
"text": "def set_algorithms( cipher, mac )\n @cipher, @hmac = cipher, mac\n end",
"title": ""
},
{
"docid": "8bf2acb0120eec86fbf3dcfab5efd7bb",
"score": "0.43054855",
"text": "def set hash\n hash.each_pair do |k,v|\n self.send(:\"#{k}=\", v)\n end\n \n self\n end",
"title": ""
},
{
"docid": "be30683b6276c0b6dff245e672c1e276",
"score": "0.42837572",
"text": "def hash(*tokens)\n result = tokens.flatten.join(joiner)\n cost.times { result = Digest::SHA512.hexdigest(result) }\n result\n end",
"title": ""
},
{
"docid": "1f68dda0e3020ef9f9608c32684497bc",
"score": "0.42771244",
"text": "def set(hash, &block)\n @compiler.set(hash, &block)\n end",
"title": ""
},
{
"docid": "514db179f21e502159f31589060edbd5",
"score": "0.42697445",
"text": "def store_encryption_key_sha\n self.encryption_key_sha = ENCRYPTION_KEY_SHA\n end",
"title": ""
},
{
"docid": "cc6b18c1dd98a68811b970a04a797ff8",
"score": "0.42312345",
"text": "def store(sender)\n raise ShadowHashError.new(ShadowHashError::UNSUPPORTED_OBJECT_ERR) unless sender.is_a? MacAdmin::User\n @data = @hash.to_s\n end",
"title": ""
},
{
"docid": "32fd301e8faca9eb7c925cbb8110eba9",
"score": "0.42281035",
"text": "def do_hmac_sha(digest_name, key_binary_p, input_binary_p,\n output_binary_p, status_p)\n key = Binary.from_pointer(key_binary_p).to_s\n input = Binary.from_pointer(input_binary_p).to_s\n\n write_binary_string_and_set_status(output_binary_p, status_p) do\n Hooks.hmac_sha(digest_name, key, input)\n end\n end",
"title": ""
},
{
"docid": "fe53b32915795f7ceb6b009e73a3e159",
"score": "0.41989285",
"text": "def hash_signature_by_method(values)\n case @method\n when :md5 then Digest::MD5.hexdigest(values)\n else Digest::SHA256.hexdigest(values)\n end\n end",
"title": ""
},
{
"docid": "6f413bc0f8d52ca6af09d85eeceed2bd",
"score": "0.41977295",
"text": "def set_algorithms( cipher, mac, decompressor )\n super( cipher, mac )\n @decompressor = decompressor\n end",
"title": ""
},
{
"docid": "5bb0798868589d4efe464386d0d7725e",
"score": "0.41813022",
"text": "def setup_hash(options)\n raise unless options[:transaction_key]\n raise unless options[:order_timestamp]\n amount = @fields['x_amount']\n data = \"#{@fields['x_login']}^#{@fields['x_fp_sequence']}^#{options[:order_timestamp].to_i}^#{amount}^#{@fields['x_currency_code']}\"\n hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('md5'), options[:transaction_key], data)\n add_field 'x_fp_hash', hmac\n add_field 'x_fp_timestamp', options[:order_timestamp].to_i\n end",
"title": ""
},
{
"docid": "e1d2e0343ae06d5fdf7dfe4885531e78",
"score": "0.41810867",
"text": "def set_signing_information(opts)\n opts = check_params(opts,[:signers])\n super(opts)\n end",
"title": ""
},
{
"docid": "fc1622cd73730efcf8274d7caa59829e",
"score": "0.41780445",
"text": "def enable_ssl_hash_verify\n # Not supported unless we have a socket with SSL enabled\n return nil unless self.client.sock.type? == 'tcp-ssl'\n\n request = Packet.create_request(COMMAND_ID_CORE_TRANSPORT_SETCERTHASH)\n\n hash = Rex::Text.sha1_raw(self.client.sock.sslctx.cert.to_der)\n request.add_tlv(TLV_TYPE_TRANS_CERT_HASH, hash)\n\n client.send_request(request)\n\n return hash\n end",
"title": ""
},
{
"docid": "4f802ab44bbe07dfe7a3e970c8c64160",
"score": "0.4173221",
"text": "def sender=( val )\n header[:sender] = val\n end",
"title": ""
},
{
"docid": "b74f5f73ca5094bc33842a0c56d36f4e",
"score": "0.41682887",
"text": "def hash_encode(i)\n @hasher.encode i\n end",
"title": ""
},
{
"docid": "524f923e209ed69ed951a6aaaa02fb51",
"score": "0.4167626",
"text": "def make_auth_hash\n self.auth_hash = Digest::SHA1.hexdigest(self.object_id.to_s + Time.now.to_i.to_s + self.name.to_s)\n end",
"title": ""
},
{
"docid": "5e8c9afc981cf6a6d2949bf35e8acc0c",
"score": "0.4164686",
"text": "def initialize\n super('Digest')\n @auth = {}\n @nonce_count = 0\n end",
"title": ""
},
{
"docid": "d65857e616ea0f63b34a8b7f414f5f10",
"score": "0.41585836",
"text": "def write_to_shadowhash_file(sender)\n raise ShadowHashError.new(ShadowHashError::UNSUPPORTED_OBJECT_ERR) unless sender.is_a? MacAdmin::User\n path = \"#{SHADOWHASH_STORE}/#{sender[:generateduid].first}\"\n file = File.open(path, mode='w+')\n content = file.read\n content = \"0\" * 1240 if content.length < 1240\n file.rewind\n content[168...(168 + 48)] = @hash.to_s\n file.write content\n file.close\n File.size(path) == 1240\n end",
"title": ""
},
{
"docid": "2fc0692228d7c2a5923b0780fd423f44",
"score": "0.4155229",
"text": "def set_password_lion(hash)\n salted_hash_hex = hash\n string = convert_hex_to_ascii(salted_hash_hex)\n data = NSData.alloc.initWithBytes_length_(string, string.length)\n @user['ShadowHashData'] = NSMutableArray.new\n @user['ShadowHashData'][0] = create_shadowhashdata('SALTED-SHA512', data)\n end",
"title": ""
},
{
"docid": "ea754e4f52cf666718cfb346a3f89df9",
"score": "0.4143021",
"text": "def hashes=(value)\n @hashes = value\n end",
"title": ""
},
{
"docid": "8590c391a6878fb183c003ac97ea0ec0",
"score": "0.413068",
"text": "def signer=(signer)\n if !signer.nil? && signer.to_s.length < 0\n fail ArgumentError, 'invalid value for \"signer\", the character length must be great than or equal to 0.'\n end\n\n @signer = signer\n end",
"title": ""
},
{
"docid": "a676183e6307dacd785d659080f48f60",
"score": "0.41287038",
"text": "def create_activation_digest\n self.activation_token = Band.new_token\n self.activation_digest = Band.digest(activation_token)\n end",
"title": ""
},
{
"docid": "45c2e4110b43e65d3dbd4a4385fb6b33",
"score": "0.4126244",
"text": "def set_header_obfuscator(header_obfuscator)\n connection = @session.connection\n connection.set_header_obfuscator(header_obfuscator) if connection.is_a? Logging::Obfuscation::ObfuscationCapable\n end",
"title": ""
},
{
"docid": "b0abefdd51bb605dd215a879e9a171a8",
"score": "0.41255915",
"text": "def hset( hex )\n @hexes[ [ hex.q, hex.r ] ] = hex\n end",
"title": ""
},
{
"docid": "b74a1ae5796ad589cd5b9c84fbb6476e",
"score": "0.4124374",
"text": "def set_slimmer_headers(hash)\n raise InvalidHeader if (hash.keys - SLIMMER_HEADER_MAPPING.keys).any?\n\n SLIMMER_HEADER_MAPPING.each do |hash_key, header_suffix|\n value = hash[hash_key]\n headers[\"#{HEADER_PREFIX}-#{header_suffix}\"] = value.to_s if value\n end\n end",
"title": ""
},
{
"docid": "a84aa7102e7abb8d71238eff56070620",
"score": "0.41226003",
"text": "def send_hash(cmd_hash)\n json = JSON.generate(cmd_hash)\n send_json() \n end",
"title": ""
},
{
"docid": "816ed646937b29bd4e13b1145cb67935",
"score": "0.41222668",
"text": "def authentication_hash=(_arg0); end",
"title": ""
},
{
"docid": "3a3b1354df3599992d1674147ca6334f",
"score": "0.4119373",
"text": "def hash_key=(value)\n send(\"#{self.class.hash_key}=\", value)\n end",
"title": ""
},
{
"docid": "3a3b1354df3599992d1674147ca6334f",
"score": "0.4119373",
"text": "def hash_key=(value)\n send(\"#{self.class.hash_key}=\", value)\n end",
"title": ""
},
{
"docid": "cec5c986e60ed5c8ef40210baaf7fecd",
"score": "0.4107075",
"text": "def headers=(hash); end",
"title": ""
},
{
"docid": "cec5c986e60ed5c8ef40210baaf7fecd",
"score": "0.4107075",
"text": "def headers=(hash); end",
"title": ""
},
{
"docid": "07d7f40742c486a3de7d7e60e8119ac5",
"score": "0.40956545",
"text": "def hasher(cancellation)\n lambda do |(tick, chunk)|\n next puts('hasher interrupted') if cancellation.cancelled?\n\n digest = Digest::SHA256.hexdigest(chunk).tap { sleep 0.1 }\n [tick, digest]\n end\nend",
"title": ""
},
{
"docid": "5c9e9b581cc159520ffdc10a5c29d8e7",
"score": "0.40819007",
"text": "def sha=(sha)\n @sha = sha ? string(sha) : nil\n end",
"title": ""
},
{
"docid": "4186eeac82d7b425e8cb6592b0024c87",
"score": "0.4080125",
"text": "def set_default_signature_method!\n # self.signature_digest_algorithm = :sha1\n # self.signature_algorithm_id = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'\n self.signature_digest_algorithm = :sha256\n self.signature_algorithm_id = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'\n end",
"title": ""
},
{
"docid": "272faed734eb29ee74752e1fe312f0e2",
"score": "0.40775284",
"text": "def set_hash_id_instance(salt)\n @hid = Hashids.new(salt, 12)\n end",
"title": ""
},
{
"docid": "0ddea25757b3169ab237678786754a1a",
"score": "0.40708855",
"text": "def message_digest_key_set(keyid, algtype, enctype, enc)\n current_keyid = message_digest_key_id\n if keyid == default_message_digest_key_id && current_keyid != keyid\n config_set('interface_ospf', 'message_digest_key_set',\n @interface.name, 'no', current_keyid,\n '', '', '')\n elsif keyid != default_message_digest_key_id\n fail TypeError unless enc.is_a?(String)\n fail ArgumentError unless enc.length > 0\n enctype = Encryption.symbol_to_cli(enctype)\n config_set('interface_ospf', 'message_digest_key_set',\n @interface.name, '', keyid, algtype, enctype, enc)\n end\n end",
"title": ""
},
{
"docid": "7675af6cf003a5d8451e3142cbf96eee",
"score": "0.40690604",
"text": "def hash *args, &block\n command \"hash\", args.join(\"/\"), &block\n end",
"title": ""
},
{
"docid": "153fb06ca1db5c74a1eebf508775238d",
"score": "0.40614244",
"text": "def set_root_hash(root_hash)\n command = [[5].pack('C'), root_hash].join\n @connector.send command\n end",
"title": ""
},
{
"docid": "43f8d0f2e2fa4c4bd1c2a552da0d5d09",
"score": "0.4054364",
"text": "def sign!(ha)\n ha[:sig] = compute_checksum(ha)\n end",
"title": ""
},
{
"docid": "8e760d62cf2f15b9e788a2f93ced37e3",
"score": "0.40412536",
"text": "def outgoing=(pipe)\n\t\t\t@outgoing = MsgpackIoWriter.new(pipe)\n\t\tend",
"title": ""
},
{
"docid": "1fc831afc7097e997a6779b3490c8bbb",
"score": "0.40380654",
"text": "def crypto_hash(name, digest_class)\n digest_length = digest_class.digest('').length\n\n defines = Proc.new do \n define_method :\"#{name}\" do |data|\n data = data.pack 'C*' unless data.kind_of? String\n digest_class.digest(data).unpack 'C*'\n end\n define_method(:\"#{name}_digest_class\") { digest_class }\n define_method(:\"#{name}_length\") { digest_length }\n end\n \n @target.class_eval(&defines)\n (class << @target; self; end).module_eval(&defines) \n end",
"title": ""
},
{
"docid": "71b0f20a8c162d468758e9ae95f0707a",
"score": "0.40374658",
"text": "def h(*args)\n\n Digest::MD5.hexdigest(args.join(\":\"))\n end",
"title": ""
},
{
"docid": "965e40c0783113024134f9b8b6607e81",
"score": "0.40369183",
"text": "def hmac_server; end",
"title": ""
},
{
"docid": "7978c6030c3a8ecbd50452f7cf3d9bbb",
"score": "0.4033352",
"text": "def set_hunger_for(hunger_level)\n hunger_hash.merge!(hunger_level)\n end",
"title": ""
},
{
"docid": "eb700fad7b0f2e1f98f1563dee0b0b2d",
"score": "0.40330553",
"text": "def signing_key= new_key\n @signing_key = new_key\n end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.40242416",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "d1dcc0ced2e5fe51edf7211d15359268",
"score": "0.40195066",
"text": "def create_signature_hashes\n if !self.manager_sign_username.blank?\n manager = User.find_by_username_and_store_id(self.manager_sign_username, Thread.current['user'].store_id)\n self.manager_signer = manager\n self.manager_signature_hash = Digest::SHA1.hexdigest(\"--#{manager.social_security_number}--#{self.instance.created_at}--\")\n self.manager_signature_date = Time.now\n self.save_status = self.save_status.to_s + \" Store Manager signature accepted. Reload this page to see the digital fingerprint.\"\n end\n\n if !self.regional_sign_username.blank?\n regional = Admin.find_by_username(self.regional_sign_username)\n self.regional_signer = regional\n self.regional_signature_hash = Digest::SHA1.hexdigest(\"--#{regional.social_security_number}--#{self.instance.created_at}--\")\n self.regional_signature_date = Time.now\n self.save_status = self.save_status.to_s + \" Regional Manager signature accepted. Reload this page to see the digital fingerprint.\"\n end\n end",
"title": ""
},
{
"docid": "98e24d9926243a74ae4c4e44ce7199a8",
"score": "0.40162566",
"text": "def on_after_create_http_request(http_request)\n if self.class.cached_digest_header\n http_request.set_header('authorization', digest_auth_header_from_response)\n end\n end",
"title": ""
},
{
"docid": "cb7c8d285c4ad777cfa5f35feaedd115",
"score": "0.40062606",
"text": "def set(iHashFunction)\n @Function = iHashFunction\n convertDataTypes\n optimize\n end",
"title": ""
},
{
"docid": "932a983a8a81880f9c36e398eb58a6c8",
"score": "0.39979053",
"text": "def check_hash=(flag)\r\n @conf[:use_md5_digest] = flag\r\n end",
"title": ""
},
{
"docid": "43d61c900e428121ceb13492b17d2f81",
"score": "0.39955363",
"text": "def initialize(hsh)\n @hash = hsh\n if merchant_info_set.is_a? Hash\n @merchants = [MerchantInfoResult.new(merchant_info_set)]\n else\n @merchants = merchant_info_set.map { |m| MerchantInfoResult.new(m) }\n end\n end",
"title": ""
},
{
"docid": "b0aef2ef99cc835e9e61ae292888d0b0",
"score": "0.3990289",
"text": "def create\n @hmac = Hmac.new(hmac_params)\n @hmac.digest = OpenSSL::Digest.new(@hmac.hashalgorithme)\n @hmac.hmac = OpenSSL::HMAC.new(@hmac.key, OpenSSL::Digest.new(@hmac.hashalgorithme))\n #@hmac.digest = OpenSSL::Digest.new(@hmac.hashalgorithme)\n #@hmac.hmac = OpenSSL::HMAC.digest(@hmac.digest, @hmac.key, @hmac.secret)\n\n respond_to do |format|\n if @hmac.save\n format.html { redirect_to @hmac, notice: 'Hmac was successfully created.' }\n format.json { render :show, status: :created, location: @hmac }\n else\n format.html { render :new }\n format.json { render json: @hmac.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40cdd60c5638fa00017e6e186701abfc",
"score": "0.39874914",
"text": "def set(hash)\n set_restricted(hash, nil, nil)\n end",
"title": ""
},
{
"docid": "1dacf9711310e12774cd94e4f8a4eedb",
"score": "0.39865065",
"text": "def with_sender(sender)\n @http_sender = sender\n self\n end",
"title": ""
},
{
"docid": "fbac7796e25837e4c3eab7627cee7905",
"score": "0.39786556",
"text": "def hash_generator(pass)\n require 'openssl'\n\n # Get hash parameters\n params = hash_decoder\n\n algo = params['algo']\n salt = params['salt']\n\n iter = if params['iter']\n params['iter'].to_i\n else\n 1\n end\n\n new_hash = (salt + pass).each_byte.to_a\n digest = OpenSSL::Digest.new(algo.delete('-'))\n\n 1.upto(iter) do\n digest.reset\n digest << new_hash.pack('c*')\n new_hash = digest.to_s.scan(/../).map(&:hex)\n end\n\n digest.to_s\n end",
"title": ""
},
{
"docid": "f901b3ae43c904385dfb5873707b00e2",
"score": "0.39757362",
"text": "def encoderequest(sender, target, msg, requestid, filter={})\n serialized = Marshal.dump(msg)\n digest = makehash(serialized)\n \n @log.debug(\"Encoding a request for '#{target}' with request id #{requestid}\")\n request = {:body => serialized,\n :hash => digest,\n :senderid => @config.identity,\n :requestid => requestid,\n :msgtarget => target,\n :filter => filter,\n :msgtime => Time.now.to_i}\n\n # if we're in use by a client add the callerid to the main client hashes\n request[:callerid] = callerid if @initiated_by == :client\n\n Marshal.dump(request)\n end",
"title": ""
},
{
"docid": "4669ff8087c48517c864b5afad095697",
"score": "0.3974795",
"text": "def register_mixin_hash(target_class, field, mod, options)\n mixin_registry[target_class][field.to_s] = [:hash, mod, options]\n end",
"title": ""
},
{
"docid": "8c423c8eeabc08cbc1ee0a3550ef4ed0",
"score": "0.3966236",
"text": "def create_invite_hash!\n self.invite_hash = Digest::SHA2.new(256).update(\"#{self.serializable_hash}+#{Time.now}+jibffffrrrji!@#sh\").to_s[2..12]\n end",
"title": ""
},
{
"docid": "2aab924bd68cc9a06e6d2e15297503f3",
"score": "0.39650354",
"text": "def set_hash_method(opts)\n opts = check_params(opts,[:methods])\n super(opts)\n end",
"title": ""
},
{
"docid": "93a348b4f8d6f0d4b721307f59fc6de5",
"score": "0.39645785",
"text": "def sign_up_fisherman(command_attributes)\n registrar_link = @current_resource.body.links[:self].href\n response = api_post(\n registrar_link,\n command_attributes.to_json,\n 'Content-Type' => 'application/json'\n )\n\n # In here to satisfy Cucumber scenarios, don't know what to do about reloading yet\n reload\n\n @uuid = UUIDTools::UUID.parse(response.body[\"uuid\"])\n end",
"title": ""
},
{
"docid": "5c9d3f6dbcb8501d793be7ba66261d9e",
"score": "0.39626703",
"text": "def perform\n add_request_if_new do |request|\n request.header_set(*arguments)\n end\n end",
"title": ""
},
{
"docid": "85c823788aeba198bfb32b0f3aa47a7b",
"score": "0.39590657",
"text": "def create_activation_digest\n self.activation_token = Golfer.new_token\n self.activation_digest = Golfer.digest(activation_token)\n end",
"title": ""
},
{
"docid": "96e91fcd50d740a2841a991b857ebce9",
"score": "0.39557552",
"text": "def store(sender)\n raise ShadowHashError.new(ShadowHashError::UNSUPPORTED_OBJECT_ERR) unless sender.is_a? MacAdmin::User\n @data = { @label => format(@hash) }.to_plist\n sender['ShadowHashData'] = [@data]\n end",
"title": ""
},
{
"docid": "0cce065bfde158cce0c2f59e1f55676c",
"score": "0.3950131",
"text": "def signing_input=(_); end",
"title": ""
},
{
"docid": "0cce065bfde158cce0c2f59e1f55676c",
"score": "0.3950131",
"text": "def signing_input=(_); end",
"title": ""
},
{
"docid": "5d1d1c4147dbe00caaf213cf660468e9",
"score": "0.39497742",
"text": "def initialize( ciphers, hmacs, decompressors )\n super( ciphers, hmacs )\n @decompressor = decompressors.fetch( \"none\" )\n @mutex = Mutex.new\n end",
"title": ""
},
{
"docid": "6398f1ba18f794431f2793b562d6cd49",
"score": "0.3948139",
"text": "def signature_digest_algorithm=(algorithm)\n @sign_digester = Kiji::Digester.new(algorithm)\n end",
"title": ""
},
{
"docid": "3e73afb145e5c8d4eb67dcadf131e402",
"score": "0.39479953",
"text": "def send\n Chain.send_transaction(hex)\n end",
"title": ""
},
{
"docid": "3ea6149b9ef2b8e8c76d4af860d9f1ce",
"score": "0.39465144",
"text": "def digest_method=(value)\n @children['digestMethod'][:value] = value\n end",
"title": ""
},
{
"docid": "3ea6149b9ef2b8e8c76d4af860d9f1ce",
"score": "0.39465144",
"text": "def digest_method=(value)\n @children['digestMethod'][:value] = value\n end",
"title": ""
},
{
"docid": "c045d1129c18974f40df121a8b07ee80",
"score": "0.39451477",
"text": "def serializable_hash(options = nil)\n h = super options.merge(except: 'token_digest')\n h.merge! 'token' => token if token.present?\n h\n end",
"title": ""
},
{
"docid": "f6a45cfa8d56a5c672cb865e8d8cab44",
"score": "0.39431804",
"text": "def register_renderer(renderer_hash)\n registered_renderers.merge!(renderer_hash)\n end",
"title": ""
},
{
"docid": "35f2513dc871cb1af058812a190928c1",
"score": "0.3941213",
"text": "def headers=(hash)\n if headers\n headers.replace hash\n else\n super\n end\n end",
"title": ""
},
{
"docid": "5692f91abcffbfa817887eb201f0b0c1",
"score": "0.39403102",
"text": "def _hash=(_hash)\n if !_hash.nil? && _hash.to_s.length > 40\n fail ArgumentError, 'invalid value for \"_hash\", the character length must be smaller than or equal to 40.'\n end\n if !_hash.nil? && _hash.to_s.length < 40\n fail ArgumentError, 'invalid value for \"_hash\", the character length must be great than or equal to 40.'\n end\n @_hash = _hash\n end",
"title": ""
},
{
"docid": "e0b1086da2e7c30725ab972cb42fcdbb",
"score": "0.3938199",
"text": "def configure_secrets_hashing\n if perform_secret_hashing? && bcrypt_present?\n use_bcrypt_for_hashing\n else\n self.secret_comparer = nil\n self.secret_hash_function = nil\n end\n end",
"title": ""
},
{
"docid": "13727d994a4fba282829b1e87aa95c15",
"score": "0.3934071",
"text": "def after_create\n super\n update(hash: md5_digest)\n end",
"title": ""
},
{
"docid": "1301a48c8dd0e8a94588c14edcc85564",
"score": "0.39320028",
"text": "def configure\n yield self\n @id_salt = DEFAULT_SALT if @id_salt.nil?\n set_hash_id_instance(@id_salt)\n end",
"title": ""
},
{
"docid": "e0b0d230e193b07e4de5c3d5e22292e3",
"score": "0.39284492",
"text": "def merchanthash\n if version.to_i == 1 \n return HashGenerator::generate(merchant_hash_key, merchant_id, order_id);\n else\n return Digest::SHA512.hexdigest(\"#{merchant_hash_key},#{merchant_id},01,#{order_id},#{gross_amount}\")\n end\n end",
"title": ""
},
{
"docid": "1e47fc57c3741366d9322d285fe5e399",
"score": "0.39273283",
"text": "def set_keys\n self.auth = gen_key('auth') if auth.blank?\n self.mkey = gen_key('mkey') if mkey.blank?\n end",
"title": ""
},
{
"docid": "91359d313ea1582fe1a11966c7237aba",
"score": "0.39264095",
"text": "def create_activation_digest\n self.activation_token = Gamer.new_token\n self.activation_digest = Gamer.digest(activation_token)\n end",
"title": ""
},
{
"docid": "ced83aa688c9c2338fc97bbc2ae0d9b6",
"score": "0.39246994",
"text": "def initialize( ciphers, hmacs )\n @sequence_number = 0\n\n @cipher = ciphers.get( \"none\" )\n @hmac = hmacs.get( \"none\" )\n end",
"title": ""
},
{
"docid": "f5caf32a0a0ee9159bb608307a49365c",
"score": "0.3911824",
"text": "def password_delivery\n @password_delivery ||= delivery_method_from_header\n end",
"title": ""
},
{
"docid": "1229c65facd311bfb76415132ecf0328",
"score": "0.39096227",
"text": "def makehash(body)\n Log.debug(\"Creating message hash using #{private_key_file}\")\n\n sign(private_key_file, body.to_s)\n end",
"title": ""
},
{
"docid": "89e7fd5960348636fae677b019042ba1",
"score": "0.39077523",
"text": "def compute_checksum(h)\n begin\n signed_h = h.dup.with_indifferent_access\n CLEAR_OPTIONS.map{|o| signed_h.delete(o) }\n marshaled = ActionController::Routing::Route.new.build_query_string(signed_h)\n marshaled = marshaled.gsub(/^\\?/, '').split(/&/).sort.join('&')\n digest.call(self, Base64.encode64(marshaled.to_s.reverse)).to_s\n ensure\n end\n end",
"title": ""
}
] |
0c94b1523d91059f0b3355293b42e24f
|
Undo a frame to their payload
|
[
{
"docid": "ec862e8c48d53f027f9724eafc3d9302",
"score": "0.7773335",
"text": "def undo(frame)\n @xorify.unpack( undo_bypass(frame) )\n end",
"title": ""
}
] |
[
{
"docid": "94320ebd718612b1b500dc0b1a606560",
"score": "0.7907078",
"text": "def undo buffer\n @frames[buffer].undo buffer\n end",
"title": ""
},
{
"docid": "d10e437a7a805f2be342f52d6b73ed85",
"score": "0.67724067",
"text": "def undo!\n bb = @stack.pop\n set_black(bb[:black])\n set_white(bb[:white])\n end",
"title": ""
},
{
"docid": "a6c573bd91b1655d9bf2e697b8f3d7c3",
"score": "0.66550267",
"text": "def remove_frame(frame)\n end",
"title": ""
},
{
"docid": "2f3af8492966c3be57c6006afc681131",
"score": "0.64369875",
"text": "def undo_bypass(frame)\n # !! always return a boolean\n if !!frame.match(/1{5}0/)\n frame.gsub(/1{5}0/, \"11111\")\n end\n end",
"title": ""
},
{
"docid": "3e1167809ed175b413927b8183962d8a",
"score": "0.63257635",
"text": "def restore()\n state = @stack.pop()\n @angle = state[0]\n @pos = state[1]\n @down = state[2] \n end",
"title": ""
},
{
"docid": "0eaa3ea031b0e4ec904b8b8acc647f8b",
"score": "0.628224",
"text": "def undo\n\t\t\n\tend",
"title": ""
},
{
"docid": "0eaa3ea031b0e4ec904b8b8acc647f8b",
"score": "0.628224",
"text": "def undo\n\t\t\n\tend",
"title": ""
},
{
"docid": "af81db29c7d1d38bd5530d337e009a0b",
"score": "0.62502956",
"text": "def undo\n\t\t@moves.undo\n\tend",
"title": ""
},
{
"docid": "cc61f2c4420588890f9481faf9688119",
"score": "0.61586225",
"text": "def undo\n if(@history != nil)\n @history.undo\n end\n end",
"title": ""
},
{
"docid": "61757eae25fdcf426b75ca9ce057e46d",
"score": "0.6156756",
"text": "def restore_graphics_state\n @stack.pop\n end",
"title": ""
},
{
"docid": "24ff7dd0dfd5ad293a6093aba1861f72",
"score": "0.61467755",
"text": "def restore\r\n @status = @stack.shift if @stack.size > 0\r\n end",
"title": ""
},
{
"docid": "092f62c7a7a3660b7189270fb708815a",
"score": "0.6123824",
"text": "def undo\n\t\t@space.entities.delete @clone\n\t\t\n\t\t@already_added = false\n\tend",
"title": ""
},
{
"docid": "230b3b82afed668237cf6b7bd139f360",
"score": "0.612157",
"text": "def undo\n {\n method: \"DOM.undo\"\n }\n end",
"title": ""
},
{
"docid": "dcc67cf42ea4a3dea49fdd95e7bbfae7",
"score": "0.6065056",
"text": "def debuffer_frame r\n orig = @buffer_mutex.synchronize do\n @buffer.detect { |f| f[:receipt] == r[:'receipt-id'] }\n end\n if orig\n # COMMIT and ABORT debuffer the whole transaction sequence\n if ['COMMIT', 'ABORT'].include? orig.command\n remove_from_transactions orig\n # Otherwise, if this isn't part of a transaction, debuffer the\n # particular frame (if it's not a SUBSCRIBE)\n elsif orig.command != 'SUBSCRIBE' && !orig.header?(:transaction)\n @buffer_mutex.synchronize { @buffer.delete orig }\n end\n end\n end",
"title": ""
},
{
"docid": "12e25486397de0ef6bcd783b87a80593",
"score": "0.6043284",
"text": "def swithOverwrite buffer\n @frames[buffer].switchOverWrite\n end",
"title": ""
},
{
"docid": "0017e00878b4f7597c57fa4772f40c7c",
"score": "0.5974482",
"text": "def undo_dirty_event!\n decrement_version!\n @_dirty_events.pop\n\n self\n end",
"title": ""
},
{
"docid": "16cb291d5b853c8645d2eeb1b65d0b1d",
"score": "0.5916566",
"text": "def revert\n end",
"title": ""
},
{
"docid": "96e8f7b3b87666104d86282806f27b3e",
"score": "0.59131426",
"text": "def cancel_frame\n end",
"title": ""
},
{
"docid": "74aea98325b93f433e0a540f84bfe0af",
"score": "0.59111464",
"text": "def undo\n fan.off\n end",
"title": ""
},
{
"docid": "281d14db997fa82908e03e63c6b685ba",
"score": "0.5906879",
"text": "def clearFrame(frame)\n if frame>=0 && frame<@animation.length\n for i in 0...PBAnimation::MAXSPRITES\n if self.deletable?(i)\n @animation[frame][i]=nil\n else\n pbResetCel(@animation[frame][i])\n end\n @dirty[i]=true if frame==@currentframe \n end\n end\n end",
"title": ""
},
{
"docid": "b773ffd07620ee1242dfdd322bc131b8",
"score": "0.5895134",
"text": "def undo\n $log.debug \" got UNDO call #{@pointer}, sz:#{@actions.size} \"\n return if @pointer == 0\n @reject_update = true\n @pointer -=1 #if @pointer > 0\n @source.repaint_required true\n @reject_update = false\n edit = @actions[@pointer]\n perform_undo edit\n end",
"title": ""
},
{
"docid": "1dd95f48ebc476887a1aff6cab737aaa",
"score": "0.58801085",
"text": "def undo\n if !(isAtBeginning)\n @actions[@index].applyOpposite\n @index -= 1\n end\n end",
"title": ""
},
{
"docid": "36c182f638e20b6223242789f3dc6ac9",
"score": "0.58789676",
"text": "def pop_frame\n stack.pop if stack.last[:prepared]\n stack.pop\n end",
"title": ""
},
{
"docid": "f6fd2adc2e45b7dc514d050bddf4e4f4",
"score": "0.587702",
"text": "def clearFrame(frame)\r\n if frame>=0 && frame<@animation.length\r\n for i in 0...PBAnimation::MAX_SPRITES\r\n if self.deletable?(i)\r\n @animation[frame][i]=nil\r\n else\r\n pbResetCel(@animation[frame][i])\r\n end\r\n @dirty[i]=true if frame==@currentframe\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "5ad1a5d1b3b638c42f1f9ffbcfd283a6",
"score": "0.58736867",
"text": "def unshift_write_buffer data, frame\n @write_mutex.synchronize { @write_buffer.unshift [data, frame] }\n end",
"title": ""
},
{
"docid": "4040bffc6315b9021b1fb3750f11ce3c",
"score": "0.58538413",
"text": "def undo\n\t\t\t\t\n\t\t\tend",
"title": ""
},
{
"docid": "047fff36a185dc2f3bbac2b3acdab233",
"score": "0.5837799",
"text": "def redo buffer\n @frames[buffer].redo buffer\n end",
"title": ""
},
{
"docid": "aa7206c7dbf0f5002d9e5b57f7076457",
"score": "0.58302104",
"text": "def deanimate\r\n @frame = 0\r\n @currentIndex = 0\r\n end",
"title": ""
},
{
"docid": "2d3a9bd8a5a91fa0478bf0e383a462b6",
"score": "0.57982904",
"text": "def undo()\n return @history.pop\n end",
"title": ""
},
{
"docid": "8db16ec79e6fcdb94bb8e693feadebff",
"score": "0.5760362",
"text": "def frame_drop _value=0\n send_cmd(\"frame_drop #{_value}\")\n end",
"title": ""
},
{
"docid": "f38185fe0d2bd1dd7a4680a4bf4cfe93",
"score": "0.57555354",
"text": "def temporary_frame(frame, &block)\n old = current_frame\n @current_frame = frame\n block.call\n @current_frame = old\n end",
"title": ""
},
{
"docid": "b04be47c4c7f491cf649b1a604df31e2",
"score": "0.566974",
"text": "def undo\n light.off\n end",
"title": ""
},
{
"docid": "dcd0fed2d4e145e731dfaabf9bb8b948",
"score": "0.5668301",
"text": "def revert_pos(data); end",
"title": ""
},
{
"docid": "50b8b1ec2a0d702610b37e5943ba976d",
"score": "0.5648393",
"text": "def undo\n return unless applied = self.applied\n\n applied.undo\n\n self.applied = applied.parent\n self.pending = applied\n end",
"title": ""
},
{
"docid": "134b9000ce63f184122c2e2745e027ab",
"score": "0.56237954",
"text": "def deanimate\n @frame=0\n @currentIndex=0\n @actualBitmap.clear\n @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))\n end",
"title": ""
},
{
"docid": "134b9000ce63f184122c2e2745e027ab",
"score": "0.56237954",
"text": "def deanimate\n @frame=0\n @currentIndex=0\n @actualBitmap.clear\n @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))\n end",
"title": ""
},
{
"docid": "d74af711dda95cadef1aae07a520f1be",
"score": "0.5601506",
"text": "def undo\n\t\t@space.entities.delete @ui_entity\n\tend",
"title": ""
},
{
"docid": "175531eadd014a44cc0ef10b3a764c52",
"score": "0.5594887",
"text": "def undo\n\t\t@entity[:physics].body.p = @start\n\tend",
"title": ""
},
{
"docid": "4be6d2e5d4eba90a6d6af32cbe65a8ff",
"score": "0.55856043",
"text": "def undo\n fan.medium\n end",
"title": ""
},
{
"docid": "4be6d2e5d4eba90a6d6af32cbe65a8ff",
"score": "0.55856043",
"text": "def undo\n fan.medium\n end",
"title": ""
},
{
"docid": "9b0445e7b9cc709553d1713d66bb91ad",
"score": "0.55719846",
"text": "def rollback\n @original_squares.each do |square|\n @board.set_at(square[:coords], square[:piece])\n end\n end",
"title": ""
},
{
"docid": "ddbdac2cc0aaa51dec1b8b33509fec1d",
"score": "0.55555046",
"text": "def restore\n end",
"title": ""
},
{
"docid": "7f58c636e1d23ce22f0f6aa76d30eb0f",
"score": "0.5554498",
"text": "def restore; end",
"title": ""
},
{
"docid": "57af80d1ee8404dac01d0281f60d52cb",
"score": "0.5521952",
"text": "def reset\n @payload_object = nil\n end",
"title": ""
},
{
"docid": "39be6fdad9b4db3b4f9dd94c7cd7a6bb",
"score": "0.5513653",
"text": "def discard_saved_state\n end",
"title": ""
},
{
"docid": "986ea7063bfe9af0b94e92cdc075a309",
"score": "0.5504195",
"text": "def rollback!\n restore_attributes\n end",
"title": ""
},
{
"docid": "5b0c2cf246d3885e40e07a81ed0d37d9",
"score": "0.5488546",
"text": "def discard!\n update!(adjustment: 0)\n end",
"title": ""
},
{
"docid": "977a519c226ae5b9503eb75721ba7aa1",
"score": "0.54695284",
"text": "def killBuffer buffer\n @frames.delete buffer\n end",
"title": ""
},
{
"docid": "9ce77fcba4dc6442f30c2457769ddd70",
"score": "0.5466589",
"text": "def revert\n @name_1 = @ori_backdrop1\n @name_2 = @ori_backdrop2\n end",
"title": ""
},
{
"docid": "7f17acc5bb300e8100dddc7c8466e5e3",
"score": "0.54661846",
"text": "def undo(times = 1)\n @commands.pop(times)\n self\n end",
"title": ""
},
{
"docid": "bd358f165f9cc613676afad9ef09d59f",
"score": "0.54619867",
"text": "def frame_reset\n @delta_time = @frame_to_skip = 0\n @ruby_time = @current_time = @last_time = @last_second_time = Time.new\n reset_gc_time\n reset_ruby_time\n @last_frame_count = Graphics.frame_count\n end",
"title": ""
},
{
"docid": "8578d25bf345add7c18d80221d162ab6",
"score": "0.54353106",
"text": "def revert\n self.class.revert [self]\n end",
"title": ""
},
{
"docid": "3017b67bcd33b37785415553909a97bf",
"score": "0.54303426",
"text": "def restore(*args); end",
"title": ""
},
{
"docid": "e8bb299ea3ff2a6aeee69c23e1c5a9b4",
"score": "0.5424794",
"text": "def detach\n set_current_buffer @frame.window.buffer\n @frame.mini_buffer = nil\n @frame = nil\n end",
"title": ""
},
{
"docid": "b1d2d6259a8624ada3926dbe38c4428c",
"score": "0.5407291",
"text": "def stack_unstack\n\n new_top = stack_top - 1\n new_top = 0 if new_top < 0\n #\n # there are no safeguard in Lua, setting top to -2 work well\n # when the stack is crowded, but it has bad side effects when the\n # stack is empty... Now safeguarding by ourselves.\n\n Lib.lua_settop(@pointer, new_top)\n end",
"title": ""
},
{
"docid": "c348bbb9751a0f91d44dc65ff3624902",
"score": "0.5387084",
"text": "def pop\n CGContextRestoreGState(@ctx)\n @stacksize = @stacksize - 1\n end",
"title": ""
},
{
"docid": "beaf22346821bbebf48e16208deb3542",
"score": "0.53779393",
"text": "def restore_original_value\n @buffer = @original_value.dup\n # earlier commented but trying again, since i am getting IndexError in insert 2188\n # Added next 3 lines to fix issue, now it comes back to beginning.\n cursor_home\n\n @repaint_required = true\n end",
"title": ""
},
{
"docid": "e79310da39aa4ec243c6368c6b3fc13e",
"score": "0.53724426",
"text": "def drop_frame f\n if !@ext__sent_dropped_frame[f.type]\n @ext__sent_dropped_frame[f.type] = true\n g = Frame.new FrameTypes::DROPPED_FRAME, 0x00, 0, [f.type].pack('C')\n send_frame g\n end\n end",
"title": ""
},
{
"docid": "990c16ead3fe1d7750255909602f36a3",
"score": "0.53720623",
"text": "def undo\n raise \"Can't undo unless there are commands in past\" unless can_undo?\n\n @actions[@last_done].undo\n @last_done -= 1\n\n nil\n end",
"title": ""
},
{
"docid": "950d99f21799cace6059f4606b42a237",
"score": "0.5361914",
"text": "def unmove\n\t\t@board[@movelist.pop] = \"-\"\n\t\t@turn = other_turn\n\t\tself\n\tend",
"title": ""
},
{
"docid": "1a6ffe9b4c3f341125b2575a1ffb343c",
"score": "0.535934",
"text": "def revert_pos(data)\n self.pos = data[0]\n @previous_pos, @previous_line_number = data[1], data[2]\n end",
"title": ""
},
{
"docid": "11804b164682e7d29d867923fb3c7d32",
"score": "0.53592694",
"text": "def rollback\n each {|transition| transition.machine.write(object, :event, transition.event)}\n super\n end",
"title": ""
},
{
"docid": "1515b06845f2e30753cc19285fe1b6cf",
"score": "0.53500164",
"text": "def undo!\n Namespace.root.executed_blueprints.delete self\n end",
"title": ""
},
{
"docid": "496be4bef0115853859b0bbe80d89e03",
"score": "0.53297305",
"text": "def restore_original_value\n $log.debug \" FIELD: buffer:#{@buffer}. orig:#{@original_value}: \"\n $log.debug \" original value is null \" unless @original_value\n $log.debug \" buffer value is null \" unless @buffer\n @buffer = @original_value.dup\n # earlier commented but trying again, since i am getting IndexError in insert 2188\n # Added next 3 lines to fix issue, now it comes back to beginning.\n cursor_home\n\n @repaint_required = true\n end",
"title": ""
},
{
"docid": "967748702d263366e773f8c57a13a1a9",
"score": "0.53034246",
"text": "def change_frame_to(index, run_whereami = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "4f60c1cfe433f6600ac4e914c4b1a56b",
"score": "0.5294151",
"text": "def reset!\n @context = [context[0]]\n end",
"title": ""
},
{
"docid": "37fafabde4d870b6ad342caff60d1351",
"score": "0.52820414",
"text": "def reset_current_session\n\n pop_session_frame\n push_session_frame\n\n end",
"title": ""
},
{
"docid": "fd7dd9ce42c4eaf4f310bf0e5afa15e5",
"score": "0.525286",
"text": "def undoMove(index)\n @board[index] = \" \"\n end",
"title": ""
},
{
"docid": "0d70a98a178236bb7a35fbf368ee8173",
"score": "0.52526826",
"text": "def restore\n RESTORE\n end",
"title": ""
},
{
"docid": "adf08e2e13252cdb78fd628fad0afb4d",
"score": "0.5251143",
"text": "def restore_buffer(buf_was)\n @_out_buf = buf_was\n end",
"title": ""
},
{
"docid": "fc3499102e8c1f2ee434e3b784f23464",
"score": "0.5249542",
"text": "def undo\n\n if @upload.nil?\n notify_user(:alert, \"Record not found!\")\n redirect_to uploads_url\n return\n end\n\n @upload.reset\n @upload.update(file_status_type: FileStatusType.find_by(name: \"Reverted\"))\n\n notify_user(:notice, \"Upload has been reverted.\")\n\n # show the original upload\n redirect_to(upload_url(@upload))\n\n end",
"title": ""
},
{
"docid": "a650bff5d95d968c1e4f9bb58ceae333",
"score": "0.5244834",
"text": "def revert_code()\n\t\t\n\tend",
"title": ""
},
{
"docid": "2858a60dca46c3ccae3aa974832291c1",
"score": "0.52422816",
"text": "def undo\n\t\t@memo.call\n\tend",
"title": ""
},
{
"docid": "1bdba5fac877b2dbc19812db3b9e1f89",
"score": "0.5233155",
"text": "def unwrap\n frame = pop\n if @msg_frames.first.size == 0\n pop\n end\n frame\n end",
"title": ""
},
{
"docid": "1ae0e216aea4e0fb9ea4937b92b7df81",
"score": "0.5229982",
"text": "def undo_changes\r\n return synchronize( true )\r\n end",
"title": ""
},
{
"docid": "ddc0526b8f460720bcffd065208627ec",
"score": "0.5222868",
"text": "def end_frame\n @frame = false\n end",
"title": ""
},
{
"docid": "8f7ee8ec10958470f59fbc0fed48ccdb",
"score": "0.5222246",
"text": "def revert\n current_node = @header\n\n while current_node\n current_node.next, current_node.prev = current_node.prev, current_node.next\n\n current_node = current_node.prev\n end\n\n @header, @trailer = @trailer, @header\n end",
"title": ""
},
{
"docid": "44cf8576cee446472532b807fe28f4a0",
"score": "0.52174306",
"text": "def reverse_copy_stack\n self.arr[0...self.curr].dup\n end",
"title": ""
},
{
"docid": "03ccad5a63fb1c4d13cdebf07da13c10",
"score": "0.52164996",
"text": "def frame=(pos); end",
"title": ""
},
{
"docid": "923ee214dc98c60690c7f8aa70beee73",
"score": "0.5206744",
"text": "def replace_external_frame\n end",
"title": ""
},
{
"docid": "a80f3cd527084c195d3943ee2d0eb703",
"score": "0.5203364",
"text": "def frame_teardown\n @top_frame = @frame = @current_thread = nil \n @threads2frames = {}\n end",
"title": ""
},
{
"docid": "06ced3b35cd85d551ecee7ce769decdd",
"score": "0.51931614",
"text": "def discard\n @args = nil\n @block = nil\n end",
"title": ""
},
{
"docid": "3795dd4dcf2d9feee45765765256e8fc",
"score": "0.51930964",
"text": "def undo(value)\n merge(undo: value.to_s)\n end",
"title": ""
},
{
"docid": "46cdaa10f4504f5febfa6140a052f7f1",
"score": "0.5189075",
"text": "def remove_internal_frames(bindings); end",
"title": ""
},
{
"docid": "0327a8976ba2d29ea884872aa0b946b8",
"score": "0.5182377",
"text": "def undo\n @workout.undo\n redirect_to workout_path(@workout),\n notice: t('.success')\n end",
"title": ""
},
{
"docid": "fc52c2d0483125eb4e3d84b03e4b03f6",
"score": "0.5175299",
"text": "def resets; end",
"title": ""
},
{
"docid": "c482053d2f3a7026ffd7e9c5d9934846",
"score": "0.5172619",
"text": "def undo\n light.on\n end",
"title": ""
},
{
"docid": "d3b2944a8f67e174dc2220505695b1ed",
"score": "0.5165199",
"text": "def undo\n if current_ident == @undo.last\n # reset\n self.current_db_value = current_question[\"question\"].value\n @undo.pop\n update_toolbar\n else\n old = @all_failed_questions.assoc(@undo.last)\n return unless old\n self.current_question = old[1]\n end\n end",
"title": ""
},
{
"docid": "e24357c7aef184548c55180edb4c7c07",
"score": "0.51640415",
"text": "def payload_for_reverted\n super\n end",
"title": ""
},
{
"docid": "f574322ade2d1ea6ecaaa66eef081a00",
"score": "0.5154136",
"text": "def replace_current_flow(flow)\n @_flow_stack.pop\n @_flow_stack.push flow\n end",
"title": ""
},
{
"docid": "fb9ed368ece1f8158d7e4ce6b382e4ea",
"score": "0.5152188",
"text": "def undo\n if done\n @text = text.sub(DONE_REGEX, '').strip\n @done = false\n end\n end",
"title": ""
},
{
"docid": "43c6292f8d6939d728c8d4ca2e9a5614",
"score": "0.5148237",
"text": "def dont_undo\n @should_undo = false\n return nil\n end",
"title": ""
},
{
"docid": "0c00e760e5696fb636ba0376bd6e6309",
"score": "0.51452017",
"text": "def restore_pop\n\nend",
"title": ""
},
{
"docid": "ccbf2efb81d8b4f8572c64b9e48a9b24",
"score": "0.51417935",
"text": "def clean_buffer; self.input_buffer = self.input_buffer[self.input_buffer.length-4,self.input_buffer.length-1]; end",
"title": ""
},
{
"docid": "2f1ae4c7788b1ae5b3ce4b1431a3e9ae",
"score": "0.51307076",
"text": "def restore\n {}\n end",
"title": ""
},
{
"docid": "86d5c08455019264d9faa49cf768f991",
"score": "0.5121221",
"text": "def rollback()\n oldpos = @checkpoints.pop\n unless oldpos\n oldpos = 0\n end\n self.pos = oldpos\n return self \n end",
"title": ""
},
{
"docid": "2303a5627bbf99a98c2af183cdb9549f",
"score": "0.5118267",
"text": "def inject(frame)\n\t\t@sock.send(frame, 0)\n\tend",
"title": ""
},
{
"docid": "2303a5627bbf99a98c2af183cdb9549f",
"score": "0.51159936",
"text": "def inject(frame)\n\t\t@sock.send(frame, 0)\n\tend",
"title": ""
},
{
"docid": "f33a42302ace996e4741cc147ec7e1f4",
"score": "0.5112326",
"text": "def reset_session_stack\n\n # remove existing reference in persistence\n if persistence_id\n cease!\n end\n \n \tself.persistence_id = nil\n\n @session_stack.clear\n\n push_session_frame\n\n end",
"title": ""
},
{
"docid": "ef0a064d1154c75e73f449d4322ca022",
"score": "0.51111346",
"text": "def remove_frames(id)\n end",
"title": ""
}
] |
db6983e9697e7f76af0254468f903f4c
|
x y = z z + y = x try different values for z until you get z + y = x
|
[
{
"docid": "f1872d428faf4e75990c91d0b33f7a01",
"score": "0.6064864",
"text": "def subtract(x, y)\n z = 0\n return z if x == y\n direction = (z + y > x ) ? -1 : 1\n until (z + y ) == x\n z = z + direction\n end\n z\nend",
"title": ""
}
] |
[
{
"docid": "a5be3014a3100abbe40494287cf7eee5",
"score": "0.6891104",
"text": "def do_something(a, b)\n x = a\n y = b\n z = 0\n until x == 0\n z += y\n x -= 1\n end\n z\nend",
"title": ""
},
{
"docid": "6829d27cb561fd8ce0ea38abcf1824be",
"score": "0.6607513",
"text": "def alg_three\r\n (1000).times do |a|\r\n (1).upto(1000 - a) do |b|\r\n c = 1000 - (a + b)\r\n next if a == b || b == c || a == c\r\n return a, b, c if a**2 + b**2 == c**2\r\n end\r\n end\r\nend",
"title": ""
},
{
"docid": "f0e8d46389baeb629d03f2a9b31b51cc",
"score": "0.64150846",
"text": "def find_xyz\n x = 0\n y = 0\n z = 0\n\n while x.to_s.length <= 2\n while y.to_s.length <= 2\n while z.to_s.length <= 2\n puts \"X: #{x}, Y:#{y}, Z:#{z}\"\n if x.to_i + y.to_i + z.to_i == \"#{x.to_s[0]}#{y.to_s[0]}#{z.to_s[0]}\".to_i and x.to_i + y.to_i + z.to_i != 0\n return \"#{x.to_s[0]}#{y.to_s[0]}#{z.to_s[0]}\".to_i\n end\n z += 11\n end\n z = 11\n y += 11\n end\n y = 11\n x += 11\n end\nend",
"title": ""
},
{
"docid": "29bbb67359c09b63be823ee4b60ce4a0",
"score": "0.6263885",
"text": "def act(x1,y1,x2,y2,z)\n\t(x1..x2).each do |x|\n\t\t(y1..y2).each do |y|\n\t\t\ti = y*1000+x\n\t\t\t$g[i] = z == 2 ? ($g[i] == 0 || $g[i] == nil ? 1 : 0) : z\n\t\t\t$g2[i] += z == 0 ? -1 : z == 1 ? 1 : 2\n\t\t\t$g2[i] = 0 if $g2[i] < 0\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "a4aa9da1505969d6df360302d0218355",
"score": "0.625446",
"text": "def alg_one\r\n (1000).times do |a|\r\n (1000).times do |b|\r\n (1000).times do |c|\r\n return a, b, c if a + b + c == 1000 && \r\n a**2 + b**2 == c**2 &&\r\n a != b && b != c && a != c\r\n end\r\n end\r\n end\r\nend",
"title": ""
},
{
"docid": "afb1336de38d590fb931a548b1a6e7ab",
"score": "0.6077678",
"text": "def multisum(num)\n list = []\n x=0; y=0; z = 0\n while x < num\n x += 3 ; y += 5\n list.push(x) unless x > num || list.include?(x)\n list.push(y) unless y > num\n end\n list.each {|i| z += i}\n return z\nend",
"title": ""
},
{
"docid": "2b08892bd4731ddb306e26e95c9e4f98",
"score": "0.6072004",
"text": "def sum3(x, y, z)\n x + y + z\nend",
"title": ""
},
{
"docid": "2b08892bd4731ddb306e26e95c9e4f98",
"score": "0.6072004",
"text": "def sum3(x, y, z)\n x + y + z\nend",
"title": ""
},
{
"docid": "35dbbec1ca36df779ddeed59e3effc3a",
"score": "0.6034018",
"text": "def sum3(x,y,z)\n x + y + z\nend",
"title": ""
},
{
"docid": "df88536e947c86671af722ee67fd78ab",
"score": "0.59378743",
"text": "def euler\n a = 100\n b = 100\n c = 200\n while (a < 500)\n if (a**2 + b**2 == c**2) && (a + b + c == 1000)\n return a*b*c\n else\n while b < 500\n if (a**2 + b**2 == c**2) && (a + b + c == 1000)\n return a*b*c\n else\n while c < 500\n if (a**2 + b**2 == c**2) && (a + b + c == 1000)\n return a*b*c\n else\n c += 1\n end\n end\n c = b\n b += 1\n end\n end\n b = a\n a += 1\n end\n end\nend",
"title": ""
},
{
"docid": "0d4f6ce20e2f63a390525a89980b490f",
"score": "0.5908166",
"text": "def value\n z = @number\n previous = z\n loop do\n z = z - (z*z-@number)/(2.0*z)\n break if (previous-z) < 0.000000001\n previous = z\n end\n z\n end",
"title": ""
},
{
"docid": "ee02808102d00ca12a82e347e07171b5",
"score": "0.58998996",
"text": "def solution(x)\nl = m = 0\n\nwhile x > 0 do \n\nm = m + x if x%5 == 0 && !x.eql?(5)\nl = l + x if x%3 == 0 && !x.eql?(3)\nx -=1\nend\n\n\nl+m\nend",
"title": ""
},
{
"docid": "0639f53f304750dae83667fddbb0b4a8",
"score": "0.58757555",
"text": "def sum_of_three\n i = 0\n k = expenses.size - 1\n j = findex_j(i,k)\n\n while true\n if i == j\n k -= 1\n i = 0\n j = findex_j(i,k)\n next\n end\n\n case sum(i,j,k) <=> SUM\n when -1\n # too small\n i += 1\n when 1\n # too big\n j -= 1\n when 0\n # found match\n break mult(i,j,k)\n end\n end\n end",
"title": ""
},
{
"docid": "19b96b381cd6f5e69563d1a073c0ff0c",
"score": "0.5870218",
"text": "def problem9\n #loop through a's\n c = 0\n 1.upto(300) do |a|\n #loop through b's\n (a + 1).upto(a + 300) do |b|\n if 1000 - (c = Math.sqrt(a**2 + b**2)) == b + a\n puts(a * b * c)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "13580e7674dd4c0f12758e9ee599c14d",
"score": "0.57918775",
"text": "def pitagoras(a,b,c)\n a_init = a\n b_init = b\n c_init = c\n while ((a + b + c == 1000) && (a < b) && (b < c))\n if (c**2 > a**2 + b**2) && (c**2 != a**2 + b**2)\n c -= 1\n b += 1\n if b >= c || a >= b\n a = a_init + 2\n b = b_init - 1\n c = c_init - 1\n a_init = a\n b_init = b\n c_init = c\n end\n elsif (a**2 + b**2 > c**2)\n b -= 1\n a += 1\n if (a**2 + b**2 > c**2)\n a -= 3\n b += 1\n c += 2\n end\n\n elsif (c**2 == a**2 + b**2)\n break\n end\n end\n if a + b + c != 1000\n puts \"La suma no da 1000\"\n end\n puts [\"a = #{a}\",\"b = #{b}\",\"c = #{c}\"]\n puts [a**2, b**2, c**2]\n print a*b*c\nend",
"title": ""
},
{
"docid": "34d7665259a4aa4de07657def691f1f2",
"score": "0.57877785",
"text": "def broken_calc(x, y)\n operations = 0\n until y == x\n return x - y + operations if y < x\n y = y.even? ? y/2 : y+1 \n operations += 1\n end\n operations\nend",
"title": ""
},
{
"docid": "40e3f8b600ab07e0f728d44fef44a7be",
"score": "0.5762183",
"text": "def test\n if @a.to_i != 0 && @b.to_i != 0 && @c.to_i != 0\n if @a == @b && @a == @c\n return 1\n elsif @a**2 == @b**2 + @c**2 || @b**2 == @a**2 + @c**2 || @c**2 == @b**2 + @a**2\n return 4\n elsif (@a == @b && @a != @c) || (@b == @c && @a != @c) || (@a == @c && @b != @c)\n return 2\n elsif @a != @b && @a != @c && @c != @b\n return 3\n end\n else\n return 5\n end\n end",
"title": ""
},
{
"docid": "965e607d39177eb6196595df14ff3773",
"score": "0.5752829",
"text": "def solution(x)\n sum = 0\n (1...x).each do |element|\n next if element % 3 != 0 && element % 5 != 0\n next if element % 3 == 0 && element % 5 == 0\n \n sum += element\n end\n sum\nend",
"title": ""
},
{
"docid": "7f41a095c0f72abba183d47cd467e30d",
"score": "0.57463944",
"text": "def b?\n puts \"wojofiewf\"\n y = 1\n z = if y == 1 then y+1 else y+2 end\n z = z + ( if y == 1 then 3 else 9 end ) + 2 \\\n if y == 1\nend",
"title": ""
},
{
"docid": "ed2ccbe77d8b579982a050c4265cfa9f",
"score": "0.5729393",
"text": "def next_dio_sol(xy)\n x, y = xy\n return 2 * x + 3 * y, x + 2 * y\nend",
"title": ""
},
{
"docid": "ea881f97bc6c54ecaab8d648b29caebb",
"score": "0.56874603",
"text": "def three_numbers(array, x)\n array.each do |num|\n array.each do |num2|\n array.each do |num3|\n if num + num2 + num3 == x\n return true\n end\n end\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "df26f19b86e39eae52e1ebf1eae82b64",
"score": "0.5681049",
"text": "def pythagorean_triplet(sum)\n y = 1\n z = 2\n max = (sum / 3).truncate\n\n while y < max\n while z < max\n a = (z*z) - (y*y)\n b = 2 * (y * z)\n c = (z*z) + (y*y)\n if a + b + c == sum && (a*a + b*b) == c*c\n puts \"FOUND IT\"\n puts \"#{a}, #{b}, #{c}\"\n return a, b, c\n else\n z += 1\n end\n end\n z = 1\n y += 1\n end \nend",
"title": ""
},
{
"docid": "3ae7365d2df7f5508d55d721285e942d",
"score": "0.5667248",
"text": "def first_solution\n add(30, 5) + subtract(3, 20)\n end",
"title": ""
},
{
"docid": "0bc9b4bf206dee77d94e1bb56aed5e27",
"score": "0.5646748",
"text": "def sum\n @t += 1\n return unless @t == 3\n\n @k += 1\n @t = 0\n end",
"title": ""
},
{
"docid": "1eb5e3c22e2dfac03df11dac8025961c",
"score": "0.56457955",
"text": "def find_triplet\n # define possible values for a, b and c\n # keep end values under 500(half total) to start to reduce calculations\n a_values = (1..500)\n b_values = (1..500)\n c_values = (1..500)\n a_final = 0\n b_final = 0\n c_final = 0\n a_values.each do|a|\n b_values.each do|b|\n c_values.each do |c|\n if (a + b + c == 1000) && a**2 + b**2 == c**2\n a_final = a\n b_final = b\n c_final = c\n break\n end\n end\n end\n end\n puts \"a is #{a_final}, b is #{b_final}, c is #{c_final}\"\n a_final * b_final * c_final\nend",
"title": ""
},
{
"docid": "8cef975b0a2431e9b4ea0fc27a3af92b",
"score": "0.55935687",
"text": "def next_value\n k = 0\n\n t = @prng.next_f\n while t > self.z\n k = k + 1\n t = t * @prng.next_f\n end\n \n k\n end",
"title": ""
},
{
"docid": "f60c7805edef407d2cf511b6adba0477",
"score": "0.5593073",
"text": "def minimum(x, z) #INPUT: two numbers\n return x if x < z\n return z if z < x\n return x if x == z\n end",
"title": ""
},
{
"docid": "f07b378cd56d4a97024762734ebf371a",
"score": "0.5591012",
"text": "def add_three n1, n2, n3\n\tn1 + n2 + n3\nend",
"title": ""
},
{
"docid": "987e442d916093c999cb1433a71ab613",
"score": "0.5590228",
"text": "def pyg(limit)\n # We can limit the range of a and b because of the following requirements:\n # a < b < c\n # a + b + c = 1000\n (1..limit / 3).each do |a|\n (a..limit / 2).each do |b|\n c = 1000 - b - a\n return (a * b * c) if (a * a) + (b * b) == (c * c)\n end\n end\nend",
"title": ""
},
{
"docid": "28e2eb8137d0a4b8ce0c68581a55c4d2",
"score": "0.55891937",
"text": "def control_sum(numbers)\n a = numbers[0]\n b = numbers[1]\n c = numbers[2]\n d = numbers[3]\n e = numbers[4]\n f = numbers[5]\n g = numbers[6]\n h = numbers[7]\n i = numbers[8]\n j = numbers[9]\n\n zm = (a + 3*b + 7*c + 9*d + e + 3*f + 7*g + 9*h + i + 3*j) % 10\n zm = (10 - zm) % 10\n\n return zm\n end",
"title": ""
},
{
"docid": "864a1c8e61ff7e56cae2d1440140cb40",
"score": "0.55768627",
"text": "def pathag\n arr = 0\n (1..500).each do |x|\n (x..500).each do |y|\n (y..500).each do |z|\n if (x**2 + y**2 == z**2) && (x+y+z==1000)\n return arr = (x*y*z)\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "be6ca6e05b8e66835d6b79b0557fefe2",
"score": "0.55716395",
"text": "def sum_of_cubes(a,b)\n iter = a \n total = 0\n if a > b \n return \"Please set b to be bigger than a.\"\n end\n while iter <= b \n total = total + iter**3\n iter+=1\n end\n total\nend",
"title": ""
},
{
"docid": "ea3cbeaaa9b5b4a40c91ec6ed4f56184",
"score": "0.557157",
"text": "def abc\n\tx, y, z, k = gets.chomp.split(\" \").map(&:to_i)\n\tas = gets.chomp.split(\" \").map(&:to_i).sort{|a, b| b <=> a }\n\tbs = gets.chomp.split(\" \").map(&:to_i).sort{|a, b| b <=> a }\n\tcs = gets.chomp.split(\" \").map(&:to_i).sort{|a, b| b <=> a }\n\tk.times do |i|\n\t\t# puts calc(as, bs, cs)\n\t\tputs as[0] + bs[0] + cs[0]\n\t\t\n\tend\nend",
"title": ""
},
{
"docid": "b59dc15c7446b5f1a950ed48439b1351",
"score": "0.55598813",
"text": "def add_all(n)\n if n / 3 - 2 < 3\n return n\n else \n (n / 3 - 2) + add_all(n / 3 - 2)\n end\nend",
"title": ""
},
{
"docid": "f030603e686cf7d9f9de185ac8dcc4e8",
"score": "0.555836",
"text": "def trips(a,b,c)\n (a ** 2) + (b ** 2) == c**2\nend",
"title": ""
},
{
"docid": "d23474d442996a50cfaffaecbf3d457d",
"score": "0.5549613",
"text": "def three_add_to_zero?(nums)\n for i in (0...nums.size())\n for j in (i+1...nums.size())\n for k in (j+1...nums.size())\n if nums[i]+nums[j]+nums[k] == 0\n return true;\n end\n end\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "59687c55eee8393135e2dbc9b0e7e105",
"score": "0.55459404",
"text": "def problem\n a = 100\n while a < 500\n b = a + 1\n while b < 500\n c = b + 1\n while c < 500\n if (a + b + c) == 1000 && (a**2 + b**2) == c**2\n return a * b * c\n end\n c += 1\n end\n b += 1\n end\n a += 1\n end\n end",
"title": ""
},
{
"docid": "8977a04472e1401ffae0b1c22c7c04ed",
"score": "0.5545712",
"text": "def add_three num1, num2, num3\n\treturn num1 + num2 + num3\nend",
"title": ""
},
{
"docid": "9a58eda6e360a51536b5e8efd6484c92",
"score": "0.5544111",
"text": "def test?\n\t\t@a+@b > @c && @a+@c > @b && @b+@c > @a\n\tend",
"title": ""
},
{
"docid": "c2e2ead40e3b50101b38a3e39e30f213",
"score": "0.55392164",
"text": "def find_triples_that_sum_to(sum)\n a = 1\n found = false\n while (a < (sum/3))\n b=a\n while (b < (sum/2))\n c = sum - a - b\n\n found = true if ((a*a) + (b*b) == (c*c))\n break if found\n b += 1\n end\n break if found\n a += 1\n end\n puts \"#{a}, #{b}, #{c}\"\n puts a*b*c\nend",
"title": ""
},
{
"docid": "0d1ddcd0c399deca2f5f1c0a795ee968",
"score": "0.55314106",
"text": "def sum_of_cubes(x,y)\n calc = 0\n (x..y).each {|i| calc += i**3 }\n return calc\nend",
"title": ""
},
{
"docid": "883424bf23e35ef8a5fe630998014a99",
"score": "0.55241394",
"text": "def solution(number)\n (1..number-1).select { |num| num % 3 == 0 || num % 5 == 0}.inject(:+)\n # (1..number-1).select { |num| num % 3 == 0 || num % 5 == 0}.inject(0, :+)\n # (1..number-1).select { |num| num % 3 == 0 || num % 5 == 0}.inject(:+) || 0\nend",
"title": ""
},
{
"docid": "72d25e69aa75a6c898352fd401ead744",
"score": "0.5517988",
"text": "def sum_of_three(number,number1,number2)\n\treturn number+number1+number2\nend",
"title": ""
},
{
"docid": "aab47703bf760898edb618f20bd23511",
"score": "0.5515171",
"text": "def triple2(sum)\n (1..sum).each {|m|\n (1..sum).each {|n|\n a = n*n - m*m\n b = 2*n*m\n c = n*n + m*m\n return (a*b*c) if a + b + c == sum\n }\n }\nend",
"title": ""
},
{
"docid": "fee8181b425826f91d6b1759c31a319e",
"score": "0.5515121",
"text": "def add_three(number)\n return number + 3 #=> evalutes to 7 then returns\n number + 4 #=> doesnt output two 7 because we have already returned\nend",
"title": ""
},
{
"docid": "a872fa9dc7ab056af8cebfce2dc338c8",
"score": "0.55045676",
"text": "def attempt2(number)\n\n #a, b, c = number, number - 1, 0\n \n number.times do |b|\n b.times do |a|\n c = Math.sqrt(a**2 + b**2)\n if c + a + b == number\n puts \"a: #{a}, b: #{b}, c: #{c}\"\n return c*a*b\n end\n end\n \n end\n \n return 0\n \nend",
"title": ""
},
{
"docid": "e02fff17c112368683423ce2b27f91b7",
"score": "0.5501222",
"text": "def pl_bicip(x, y, z)\n\t\t@pl_bic = x + y + z\n\t\t@pl_bic /= 3\n\t\t@pl_bic.truncate(2)\n\tend",
"title": ""
},
{
"docid": "b2f78988324998d84518103ed298ee94",
"score": "0.54994154",
"text": "def solve(puzz)\n candidate_values = [] # pairs: [tile,value,cost]\n # examine candidates\n puzz.each_index do |y|\n row = puzz[y]\n row.each_index do |x|\n tile = puzz[y][x]\n cur_mask = tile.value_mask\n cur_val = 1\n while cur_mask > 0 do\n if cur_val & 1 > 0\n cur_cost = tile.cost_to_place(cur_val)\n candidate_values << [tile,cur_val,cur_cost]\n # puts \"cost of #{cur_val} => (#{tile.x},#{tile.y}) is #{cur_cost}\"\n end\n cur_val = cur_val+1\n cur_mask = cur_mask >> 1\n end\n end\n end\n # puts candidate_values.inspect\n if candidate_values.length == 0\n success(puzz)\n else\n while candidate_values.length > 0 do\n # puts \"choose a good candidate to set the value on\"\n candidate_values.sort! {|one,two| one[2] <=> two[2] }\n # puts candidate_values.inspect\n next_puz = copy_puzz(puzz)\n chosen = candidate_values.shift\n begin\n next_puz[chosen.y][chosen.x].value = chosen[1]\n solve(next_puzz)\n rescue\n puts \"learned that #{chosen[1]} does NOT go at #{chosen[0].x},#{chosen[0].y}\"\n puzz[chosen[0].y][chosen[0].x].mask(~(1<<(chosen[1]-1)))\n end\n end\n end\n panic(puzz)\nend",
"title": ""
},
{
"docid": "57deb84bba3378d231da9067c6d677e3",
"score": "0.5493746",
"text": "def always_three(number_1)\nnumber_1 = (((((number_1 + 5)*2)-4)/2) - number_1)\nend",
"title": ""
},
{
"docid": "efacd5dfff517658946c5ea6faef349b",
"score": "0.54898673",
"text": "def complex_numbering(a, x , b, placeholder=[])\n while a < x\n puts \"At the top number is this: #{a}\"\n placeholder.push(a)\n a += b\n puts \"Numbers now: \", placeholder\n puts \"At the bottom number is now this: #{a}\"\n puts \"Ta-na-naa! Staring again?\" unless a == x\n end\n placeholder\nend",
"title": ""
},
{
"docid": "8b001535a505aaeb3b8d31026d84f503",
"score": "0.54861605",
"text": "def calculate(x,y)\n base_case = [Complex(x,y), 0]\n Array.new(max_iterations, base_case).inject(base_case) do |prev ,base|\n z, itr = prev\n c, _ = base\n val = z*z + c\n itr += 1 unless val.abs < 2\n [val, itr]\n end\n end",
"title": ""
},
{
"docid": "586ac9a1977639c2e0f89f28d4f2b734",
"score": "0.5481182",
"text": "def add_three num1, num2, num3\n\tans = num1 + num2 + num3\nend",
"title": ""
},
{
"docid": "03f6d7b889c041ba3c9aa6cfe11a11dc",
"score": "0.54789066",
"text": "def experiment equation, multi_count, sum_count, target, operands\n # recursion exit condition\n if operands.size == 1\n if target.to_f == operands[0].to_f\n @guesses -= 1\n return operands[0].to_s\n else\n result_string = \"#{operands[0]}#{equation}\"\n @prune_flag_multi = true if equation.count(\"*\") == @@operands_length - 1\n @prune_flag_sum = true if equation.count(\"+\") == @@operands_length - 1\n print_guess(result_string, false)\n @guesses -= 1\n return nil\n end\n end\n\n operands.each_with_index do |operand, index|\n operators = operation_priority\n operators.each do |operator|\n if operator[1] == :*\n # if continue multiplication duplicated occur go to \"next\" loop\n next if @prune_flag_multi && multi_count == @@operands_length - 2\n multi_count += 1\n end\n if operator[1] == :+\n # if continue sum duplicated occur go to \"next\" loop\n next if @prune_flag_sum && sum_count == @@operands_length - 2\n sum_count += 1\n end\n mid_result = target.send(operator[0], operand.to_f)\n next if mid_result < 0\n sub_operands = operands.clone\n sub_operands.delete_at(index)\n final_result = experiment(\"#{equation} #{operator[1]} #{operand}\", multi_count, sum_count, mid_result, sub_operands)\n # restore previous recursion counts\n multi_count -= 1 if operator[1] == :*\n sum_count -=1 if operator[1] == :+\n best_guess = \"(#{final_result} #{operator[1]} #{operand})\" unless final_result.nil?\n return best_guess unless final_result.nil?\n return if @guesses == 0\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "5445e6755b16f65d89a5e1cf76b91859",
"score": "0.5465935",
"text": "def optimize\n\t\tcase @m\n\t\twhen 0\n\t\t\treturn @n+1\n\t\twhen 1\n\t\t\treturn @n+2\n\t\twhen 2\n\t\t\treturn 2*@n+3\n\t\twhen 3\n\t\t\treturn (2**(@n+3)) - 3\n\t\twhen 4\n\t\t\treturn tetration(2,(@n+3)) - 3\n\t\twhen 5\n\t\t\treturn pentation(2,(@n+3)) - 3\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "232a6d13f232894e4f0aa3af2ccae56e",
"score": "0.54617774",
"text": "def solution\n if @part == 1\n (@input-1).times {\n # figure out value\n a = @cart.adjacent(@x, @y)\n @cart[@x, @y] = a.min + 1\n\n update_direction\n }\n else # assume part 2\n until @cart.last > @input\n a = @cart.surrounding(@x, @y)\n @cart[@x, @y] = a.inject(0, :+)\n\n update_direction\n end\n end\n\n @cart.last\n end",
"title": ""
},
{
"docid": "4f25ab5c44a443b1b326b56c8b6a159a",
"score": "0.5455691",
"text": "def add_three num1, num2, num3\n return num1 + num2 + num3\nend",
"title": ""
},
{
"docid": "4f25ab5c44a443b1b326b56c8b6a159a",
"score": "0.5455691",
"text": "def add_three num1, num2, num3\n return num1 + num2 + num3\nend",
"title": ""
},
{
"docid": "a1690539b40254eba7d6ab85ae3d5a48",
"score": "0.54476935",
"text": "def isTriplet(x, y, z)\n if (x**2 + y**2 == z**2)\n return true\n end\nend",
"title": ""
},
{
"docid": "136d8fd8f523633e0c31424ba0919e66",
"score": "0.5442533",
"text": "def triple_step_brute_force(stairs)\n if stairs.negative?\n 0\n elsif stairs.zero?\n 1\n else\n triple_step_brute_force(stairs - 1) + triple_step_brute_force(stairs - 2) + triple_step_brute_force(stairs - 3)\n end\nend",
"title": ""
},
{
"docid": "435f6e9f1d3c0826ccbece375e77bea7",
"score": "0.543257",
"text": "def always_three (number)\n\n\t(((number + 5)*2-4) / 2 - number)\n\n\n#final_number = start_number\n#final_number +=5\n#final_number *=2\n#final_number -=4\n#final_number /=2\n#final_number -= start_number \n\nend",
"title": ""
},
{
"docid": "7034c632e0dd2c71a3879b0783c44714",
"score": "0.54236805",
"text": "def sum( x , y , z )\n x + y + z\nend",
"title": ""
},
{
"docid": "11fe2c05564201b5f0ef3c7b634ee05f",
"score": "0.54179126",
"text": "def add_three num1, num2, num3\n sum = num1+num2+num3\n return sum\nend",
"title": ""
},
{
"docid": "6a9bec42511ba10bad9a07e0cd20b35c",
"score": "0.5415289",
"text": "def min_of_three(n1, n2, n3)\n if n1 < n2 && n1 < n3\n return n1\n elsif n2 < n3 && n2 < n1\n return n2\n else\n return n3\n end\n\n=begin # Alternativ implementation, kanske är snabbare\n if n1 < n2\n if n1 < n3\n return n1\n else\n return n3\n end\n else\n if n2 < n3\n return n2\n else\n return n3\n end\n end\n=end\nend",
"title": ""
},
{
"docid": "3b0753f7e22cec202020a418509483bb",
"score": "0.5396668",
"text": "def z\n mu=(@n1*@n2).quo(2)\n if(!@ties)\n ou=Math::sqrt(((@n1*@n2)*(@n1+@n2+1)).quo(12))\n else\n n=@n1+@n2\n first=(@n1*@n2).quo(n*(n-1))\n second=((n**3-n).quo(12))-@t\n ou=Math::sqrt(first*second)\n end\n (@u-mu).quo(ou)\n end",
"title": ""
},
{
"docid": "81afb2811c4ed8c343737481f79940b6",
"score": "0.5392627",
"text": "def always_three(number)\n (((number + 5) * 2 - 4) / 2 - number)\nend",
"title": ""
},
{
"docid": "75400cacd7bafb21545d63b6b22d9b35",
"score": "0.5391367",
"text": "def calculate!\n dx,dy,rsqr,drsqr = []\n cached = cache && cache[[p1, p2, p3]]\n xc, yc, r = []\n rsqr = 0\n\n if cached\n \t\t\txc, yc, r, rsqr = cached\n else\n @result = DEFAULT_RES and return if coincidental_points?(p1, p2, p3)\n\n if (p2.y-p1.y).abs < Point::EPSILON\n xc = mx(p2, p1)\n yc = m(p2, p3) * (xc - mx(p2,p3)) + my(p2,p3)\n elsif (p3.y-p2.y).abs < Point::EPSILON\n xc = mx(p3, p2)\n yc = m(p1, p2) * (xc - mx(p1, p2)) + my(p1,p2)\n else\n xc = (m(p1, p2) * mx(p1, p2) - m(p2, p3) * mx(p2,p3) + my(p2,p3) - my(p1,p2)) / (m(p1, p2) - m(p2, p3))\n yc = m(p1, p2) * (xc - mx(p1, p2)) + my(p1,p2)\n end\n\n \t\t\trsqr = rsqr(dx(p2, xc), dy(p2, yc))\n \t\t\tr = Math.sqrt(rsqr)\n cache[[p1, p2, p3]] = [ xc, yc, r, rsqr ] if cache\n end\n\n drsqr = drsqr(p, xc, yc)\n @result = { contained: (drsqr <= rsqr), center: Point.new([xc, yc]), radius: r }\n end",
"title": ""
},
{
"docid": "e26045ebe218045027e04b9a9ff985d4",
"score": "0.53863204",
"text": "def problem9(val) \n a = 3\n b = 4\n c = 5\n mod = 1\n while true do\n sum = a + b + c\n puts \"(#{a}, #{b}, #{c}) = #{sum}\"\n mod += 1\n a = 8 * mod\n b = 15 * mod\n c = 17 * mod\n if sum > 1000 \n return\n end\n end\nend",
"title": ""
},
{
"docid": "a0df48c68e35442ee2cc76ab935ced02",
"score": "0.5386205",
"text": "def solution_1\n (1...1000).select { |x| x % 3 == 0 or x % 5 == 0 }.reduce(:+)\n end",
"title": ""
},
{
"docid": "14e21a41b4c446f08e170fb6189162e4",
"score": "0.5380905",
"text": "def sum(a,b,c)\n return a*a, b*b, c*c\nend",
"title": ""
},
{
"docid": "1a89f82c999aef8cd1e26b24928923aa",
"score": "0.5380637",
"text": "def solution_1\n starting_time = Time.now\n\n # starting numbers\n product = nil\n c = 5\n\n while !product\n b = 4\n while b < c\n a = 3\n while a < b\n if a + b + c == 1000 && a**2 + b**2 == c**2\n product = a * b * c\n end\n a += 1\n end\n b += 1\n end\n c += 1\n end\n\n p \"Triplet product: #{product}\"\n p \"In #{Time.now - starting_time} seconds\"\nend",
"title": ""
},
{
"docid": "2fbb97ca563deab31a51163b1d39e962",
"score": "0.53773266",
"text": "def p1 \n sum = 0 \n (1..999).each do |n|\n if n % 3 == 0 || n % 5 == 0 then\n sum = sum + n\n end\n end\n sum\nend",
"title": ""
},
{
"docid": "d0025ccf3f463fd93ad06d1b4a7fb515",
"score": "0.5372309",
"text": "def multisum(input)\n\n counter1, counter2 = [0, 0]\n arr = []\n\n loop do \n counter1 += 1 \n multiple1 = 3 * counter1\n break if multiple1 > input\n arr << multiple1\n end\n \n loop do \n counter2 += 1 \n multiple2 = 5 * counter2\n break if multiple2 > input\n arr << multiple2\n end\n\n p arr.uniq.reduce(:+)\nend",
"title": ""
},
{
"docid": "359c637c2fb68a477cfb9b956529c4ee",
"score": "0.536503",
"text": "def triple(sum)\n (1...sum).each {|a|\n (1...sum).each {|b|\n c = Math.sqrt(a*a + b*b)\n return (a*b*c) if a + b + c == sum\n }\n }\nend",
"title": ""
},
{
"docid": "d652624104b5e93ff4c1af26f386e119",
"score": "0.53591186",
"text": "def takes_3(num1, num2, num3)\n sum = num1 + num2 + num3\n return sum/3.0\nend",
"title": ""
},
{
"docid": "68bebb09606a1c20f916a72959b495d6",
"score": "0.535889",
"text": "def euler_one_three(n)\n def three(x)\n x % 3 == 0\n end\n def five(x)\n x % 5 == 0\n end\n (1...n).collect { |i| i if (three(i) || five(i)) }.compact.inject(:+)\nend",
"title": ""
},
{
"docid": "dc96a57bc77ff2b3aab73dfe165b96f7",
"score": "0.5356183",
"text": "def funz(x)\n if x <= 1 then\n return 1\n else\n if x <= 2 then\n return 2\n else\n if x <= 4 then\n return 3\n else\n if x <= 6 then\n return 4\n else\n if x <= 8 then\n return 5\n else\n return 6\n end\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "425cfe7e1e5a366b81d70b8506e1c1cc",
"score": "0.5350457",
"text": "def compute\n ans = 0\n a = 1\n b = 2 \n while a < 4000000\n ans += a if a % 2 == 0\n c = a + b \n a = b \n b = c \n end\n ans\nend",
"title": ""
},
{
"docid": "bcba70e6162563461ec541114e6959c2",
"score": "0.53486323",
"text": "def adds_up(a1, a2, a3)\n #Your Code Here!\n arr = (a1 + a2).combination(2).to_a\n result = []\n i = 0\n while i < arr.length\n single = arr[i]\n sum = single[0] + single[1]\n if a3.include? sum\n result.push(single.push(sum))\n end\n i += 1\n end\n result\nend",
"title": ""
},
{
"docid": "ba76f78a3b9b321a7ce45e92ede4c3dd",
"score": "0.5348559",
"text": "def always_3 (number)\n\t\n\tfinal_number = ((number + 5)*2-4)/2-number #calculate the final number to end in 3\nend",
"title": ""
},
{
"docid": "72c50cb7026af50a7cffb57c258f697e",
"score": "0.5344634",
"text": "def compute\n ans = 0\n for i in 1..999\n ans += i if i % 3 == 0 or i % 5 == 0\n end\n ans\nend",
"title": ""
},
{
"docid": "c7a230cc9d11c946fa2475006fef2b78",
"score": "0.5341354",
"text": "def solution(x)\n sum = 0\n (1..x).each do |num|\n if ((num/3).zero? || (num/5).zero?)\n sum += num\n end\n end\n return sum\nend",
"title": ""
},
{
"docid": "27eaf0c5106050ab43be6b2e30f63fe3",
"score": "0.53374404",
"text": "def solution(x)\n numbers = []\n 1.upto(x) do |i|\n if (i%3).zero? ^ (i%5).zero?\n numbers.push i\n end\n end\n numbers.reduce(:+)\nend",
"title": ""
},
{
"docid": "9587a61faf60a264f29ca70fe1e6af13",
"score": "0.53370595",
"text": "def mult_then_add(n_1, n_2, n_3)\n\tn_1 * n_2 + n_3\nend",
"title": ""
},
{
"docid": "db4d53f9b76b08f5859c096f7d08e4a0",
"score": "0.53316075",
"text": "def always_three(number)\n (((number + 5) * 2 - 4) / 2 - number)\nend",
"title": ""
},
{
"docid": "db4d53f9b76b08f5859c096f7d08e4a0",
"score": "0.53316075",
"text": "def always_three(number)\n (((number + 5) * 2 - 4) / 2 - number)\nend",
"title": ""
},
{
"docid": "db4d53f9b76b08f5859c096f7d08e4a0",
"score": "0.53316075",
"text": "def always_three(number)\n (((number + 5) * 2 - 4) / 2 - number)\nend",
"title": ""
},
{
"docid": "8868a37ff2973fc37cbdc5a079305e33",
"score": "0.533128",
"text": "def pick_sum(a, b, c)\n (b > c) ? (a + b) : (a + c)\nend",
"title": ""
},
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.5325875",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
},
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.5325875",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
},
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.5325875",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
},
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.5325875",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
},
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.5325875",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
},
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.5325875",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
},
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.5325875",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
},
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.5325875",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
},
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.5325875",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
},
{
"docid": "13ecd1288830b1787a10e8d74ba89193",
"score": "0.5325396",
"text": "def solve_problem_one\n under = 1000\n 3.multiples(under).sum + 5.multiples(under).sum - 15.multiples(under).sum\n end",
"title": ""
},
{
"docid": "78ebfdd48907eb502cb5c3da5cdb6c16",
"score": "0.5322258",
"text": "def z\n @z ||= calculate_z\n end",
"title": ""
},
{
"docid": "9fa5cdc77ef71f819130f64c04d415ca",
"score": "0.5320104",
"text": "def add_three a, b, c\n\ta + b + c\nend",
"title": ""
},
{
"docid": "360b6171dfbb173602b8d70d64258423",
"score": "0.53177756",
"text": "def methThree\r\n\t\t100.times do |num|\r\n\t\t\tsquare = num*num\r\n\t\t\treturn num,square if square > 1000\r\n\t\tend\r\n\tend",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "e6bda07fdc0fe2026afe37d2ef2af037",
"score": "0.0",
"text": "def set_a_brief_about_yourself\n @a_brief_about_yourself = ABriefAboutYourself.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5946146",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.591683",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58349305",
"text": "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",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.5776858",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5652805",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5621621",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54210985",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53402257",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53394014",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53321576",
"text": "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",
"title": ""
},
{
"docid": "97c8901edfddc990da95704a065e87bc",
"score": "0.53124547",
"text": "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",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.529654",
"text": "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",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5296262",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.52952296",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.52600986",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52442724",
"text": "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",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.5232394",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.523231",
"text": "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",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5227454",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.52201617",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.5212327",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52079266",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52050185",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.51754695",
"text": "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",
"title": ""
},
{
"docid": "72ccb38e1bbd86cef2e17d9d64211e64",
"score": "0.51726824",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5166172",
"text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"title": ""
},
{
"docid": "5531df39ee7d732600af111cf1606a35",
"score": "0.5159343",
"text": "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",
"title": ""
},
{
"docid": "bb6aed740c15c11ca82f4980fe5a796a",
"score": "0.51578903",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.51522785",
"text": "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",
"title": ""
},
{
"docid": "199fce4d90958e1396e72d961cdcd90b",
"score": "0.5152022",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.51518047",
"text": "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",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.51456624",
"text": "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",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "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",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.5133759",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5112076",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5106169",
"text": "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",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.509231",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.50873137",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.5081088",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.508059",
"text": "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",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50677156",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50562143",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5050554",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5036181",
"text": "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",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.5026331",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "4224d3231c27bf31ffc4ed81839f8315",
"score": "0.5022976",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5015441",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.50121695",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.5000944",
"text": "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",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.5000019",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.4996878",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "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",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "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",
"title": ""
},
{
"docid": "5aa51b20183964c6b6f46d150b0ddd79",
"score": "0.49864885",
"text": "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",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.49797225",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49785787",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.4976161",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49683493",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.4965126",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.4958034",
"text": "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",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49559742",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.4954353",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.49535993",
"text": "def save_action; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.4952725",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49467874",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49423352",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49325448",
"text": "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",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.49282882",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49269363",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49269104",
"text": "def default_action; end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49252945",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.4923091",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49194667",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49174926",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.49173003",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49171105",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.4915879",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49155936",
"text": "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",
"title": ""
}
] |
5681e10dd30168f17e6655942cfd166c
|
GET /master/employes GET /master/employes.json
|
[
{
"docid": "426bd5ecb4907728c1b3e145616f8a44",
"score": "0.69661796",
"text": "def index\n @master_employes = Master::Employe.all\n end",
"title": ""
}
] |
[
{
"docid": "919f47800251143c266484531b3b0f05",
"score": "0.7691129",
"text": "def index\n @employes = Employe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employes }\n end\n end",
"title": ""
},
{
"docid": "652a45da3aa45ad7d9d7ec3dbb0567ab",
"score": "0.75681335",
"text": "def index\n @employers = Employer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employers }\n end\n end",
"title": ""
},
{
"docid": "0154aa16f5a7d9587dcbe1ed172489b9",
"score": "0.7324762",
"text": "def index\n @employments = Employment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employments }\n end\n end",
"title": ""
},
{
"docid": "903a82cd3914eb506a40cedcd812e917",
"score": "0.7279695",
"text": "def index\n @employees = current_owner.employees.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"title": ""
},
{
"docid": "87b594c4c2ddca1271f6c338faa02414",
"score": "0.7264804",
"text": "def show\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employ }\n end\n end",
"title": ""
},
{
"docid": "74fb20bdf35a04d542b7477c8eeb4bdb",
"score": "0.71791506",
"text": "def show\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employe }\n end\n end",
"title": ""
},
{
"docid": "892afed0f1863e0226c4fb0a41bd2aa6",
"score": "0.7085791",
"text": "def show\n @employer = Employer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employer }\n end\n end",
"title": ""
},
{
"docid": "a665b05d8060b79c165d67ec274c99e8",
"score": "0.6942391",
"text": "def index\n @employes = Employe.all\n end",
"title": ""
},
{
"docid": "6d717221bc0eb5b0e595d9856ebfd091",
"score": "0.6835527",
"text": "def index\n @employers = Employer.all\n end",
"title": ""
},
{
"docid": "6d717221bc0eb5b0e595d9856ebfd091",
"score": "0.6835527",
"text": "def index\n @employers = Employer.all\n end",
"title": ""
},
{
"docid": "b374a63adec6c9e1c66dfc18a1ccd63f",
"score": "0.6751512",
"text": "def index\n employees = manager.employees.active\n render json: employees.all, each_serializer: EmployeeSerializer, status: 200\n end",
"title": ""
},
{
"docid": "c99db3c8ada6f8e17ecf4381da483f2c",
"score": "0.67291576",
"text": "def show\n @employment = Employment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employment }\n end\n end",
"title": ""
},
{
"docid": "fc63b027d4675c4f9f288a72bc43fe4a",
"score": "0.67190546",
"text": "def list_customers_manager\n @manager = User.find(params[:id])\n @employees = @manager.employee\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"title": ""
},
{
"docid": "4eb739719e37c6f20fc867ea186e7234",
"score": "0.6717731",
"text": "def index\n if request.xhr?\n branch_id = Branch.find_by_id(params[:branch])\n lastname = params[:surname].mb_chars.downcase if params[:surname]\n @employees = Employee.with_lastname(lastname).with_branch(branch_id).all\n html_employees = render_to_string(partial: 'employees', layout: false,\n locals: { employees: @employees })\n unless @employees.blank?\n html_employee = render_to_string(partial: 'employee', layout: false,\n locals: { employee: @employees.first })\n end\n render json: { html_employees: html_employees, html_employee: html_employee }\n else\n @employees = Employee.all\n end\n end",
"title": ""
},
{
"docid": "1e86676580d3cdf4cf0f7a2cf68c6ef4",
"score": "0.6635508",
"text": "def index\n @employeds = Employed.all\n end",
"title": ""
},
{
"docid": "086ece6956aac49198402833e30e01d0",
"score": "0.6546878",
"text": "def index\n org = Organization.find(current_employee.organization_id)\n @alerts = org.alerts\n render \"index.json.jbuilder\", status: :ok\n end",
"title": ""
},
{
"docid": "6b916e2da7eb864b09e40ceb7260822e",
"score": "0.65441203",
"text": "def jobfamily\n @jobfamilies = @company.jobfamilies\n respond_to do |format|\n format.json { render json: @jobfamilies}\n end\n end",
"title": ""
},
{
"docid": "d2048eea5a22fdace6b5f7954ffe6ad8",
"score": "0.6512588",
"text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "92b1e8299ef199e3791aaf917e498b98",
"score": "0.6510129",
"text": "def show\n @employee = Employee.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "5c972d7b49f872445fb1ad4907d6ce78",
"score": "0.64906436",
"text": "def new\n @employ = Employ.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employ }\n end\n end",
"title": ""
},
{
"docid": "980e1d1c5c4ca8087ab1ea86c60d8f38",
"score": "0.6472107",
"text": "def show\n @company = Company.find(params[:id])\n employees_and_bio_signals\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "22c56365e2c2c2899f91afe56d9295f3",
"score": "0.64605576",
"text": "def companies\n render \"company/companies.json.jbuilder\", status: :ok\n end",
"title": ""
},
{
"docid": "cae70eb65b175fabecffb6ea9a1546d9",
"score": "0.64237165",
"text": "def employee(employee_id)\n get(\"employees/#{employee_id}\")\n end",
"title": ""
},
{
"docid": "56efbff7d140de6f8aad9a26b565ef5f",
"score": "0.64016867",
"text": "def new\n @employe = Employe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employe }\n end\n end",
"title": ""
},
{
"docid": "bfe06846ad5dbb0e7065267ec50626f4",
"score": "0.6400041",
"text": "def show\n @emp_job = EmpJob.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emp_job }\n end\n end",
"title": ""
},
{
"docid": "f863277ce61a800d288285601edeff4a",
"score": "0.6371092",
"text": "def index\n @employees = @client.employees\n @events = fetch_events\n end",
"title": ""
},
{
"docid": "3e3ea21f8f03f5ce6b89593be314efe9",
"score": "0.63550574",
"text": "def index\n @intelcompanies = IntelCompany.all\n render json: @intelcompanies.to_json(include: [:intel, :company])\n end",
"title": ""
},
{
"docid": "d7ba820ad2c9bd61b2cb57b24bc62c62",
"score": "0.635461",
"text": "def show\n @organisme_employe = Organisme.where(:api_id => @employe.organisme_id)\n @role_employe = Role.where(:id => @employe.role_id)\n end",
"title": ""
},
{
"docid": "bfdf71258d154a57d2b2cbb30f766930",
"score": "0.6330728",
"text": "def new\n @employer = Employer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employer }\n end\n end",
"title": ""
},
{
"docid": "0ca90587977a118aae3e22ba8d79e979",
"score": "0.63295335",
"text": "def index\n @handbook_place_employees = HandbookPlaceEmployee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @handbook_place_employees }\n end\n end",
"title": ""
},
{
"docid": "fa46668756fc40691ae7862ae991b8f4",
"score": "0.63129497",
"text": "def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"title": ""
},
{
"docid": "e1b1a6c4818a601e2ecf07aed65116b5",
"score": "0.6297637",
"text": "def list_employees_manager\n @manager = User.find(params[:id])\n @employees = @manager.employee\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n format.xls\n end\n end",
"title": ""
},
{
"docid": "fe105c06f484ca17edd478a76b065da0",
"score": "0.62654036",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "fe105c06f484ca17edd478a76b065da0",
"score": "0.62654036",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "fe105c06f484ca17edd478a76b065da0",
"score": "0.62654036",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "fe105c06f484ca17edd478a76b065da0",
"score": "0.62654036",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "abac24e3c03af970251788107d9310ac",
"score": "0.62460357",
"text": "def index\n @laboratories = Laboratory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laboratories }\n end\n end",
"title": ""
},
{
"docid": "aee4052fd89d3589cf8bb304d4dd7e9e",
"score": "0.6245476",
"text": "def show\n #Find the employee with id supplied from the front-end and return direct subtree of that node including the parent node\n begin @employees = Employee.find(params[:id]).subtree.arrange_serializable(:order => :id)\n render json: @employees\n rescue => err \n render json: {error: err}\n end\n end",
"title": ""
},
{
"docid": "f940191de59ef1e93a95099b026bf5ca",
"score": "0.62354445",
"text": "def show\n @employee_association = EmployeeAssociation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee_association }\n end\n end",
"title": ""
},
{
"docid": "2ec5e441b4c19bac741eccb6e5426e99",
"score": "0.6233161",
"text": "def index\n @company_authorities = CompanyAuthority.all\n\n render json: @company_authorities\n end",
"title": ""
},
{
"docid": "68c8200bec668076b5c4148bee4377fa",
"score": "0.6224751",
"text": "def index\n @empskeds = Empsked.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empskeds }\n end\n end",
"title": ""
},
{
"docid": "4be50341b36c195e96ab43c3e888d45f",
"score": "0.6189844",
"text": "def index\n @exhibits = Exhibit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exhibits }\n end\n end",
"title": ""
},
{
"docid": "fd353cc607876d12bd33871bb110df84",
"score": "0.61690456",
"text": "def show\n @hisd_employee = HisdEmployee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hisd_employee }\n end\n end",
"title": ""
},
{
"docid": "6475f9c783bba260e7421cf2182ba666",
"score": "0.61677223",
"text": "def index\n @companies = Company.all\n @com_info = Company.last\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "02a0db92995459f60a4c5b1a8fca79d6",
"score": "0.61675966",
"text": "def employee_details\n if current_user.role == \"SuperAdmin\"\n @employees = Employee.all\n \n render :status => 200,\n :json => { :success => true,\n \n :data => {:employees => @employees} }\n else\n render :status => 201,\n :json => { :success => false,\n \n :data => {:error => \"You dont have authority!\" }}\n end\n \nend",
"title": ""
},
{
"docid": "44e7ae9d8ffc58dfb2c5b2d4eb1efe8f",
"score": "0.61631554",
"text": "def index\n @companies = Company.all\n if @companies\n render json: {\n companies: @companies\n }\n else\n render json: {\n status: 500,\n errors: ['No companies']\n }\n end\n end",
"title": ""
},
{
"docid": "b55351dc21998a22df712d10738332a7",
"score": "0.61602306",
"text": "def show\n render json: Record.where(employee_id: params[:id])\n end",
"title": ""
},
{
"docid": "d092386d022b402070534f1fa34090cf",
"score": "0.61596555",
"text": "def index\n @jobs = Job.all\n render json: @jobs\n end",
"title": ""
},
{
"docid": "b05184576f36a846b09061fba069f04e",
"score": "0.61565316",
"text": "def index\n @resumes = Resume.all\n render json: @resumes, include: %i[headers educations work_experiences skills]\n end",
"title": ""
},
{
"docid": "3bc2606635c5a859f5986f0894dbceca",
"score": "0.61415184",
"text": "def index\n @jobs = Job.all\n\n render json: @jobs\n end",
"title": ""
},
{
"docid": "f0fd4f949d0d5fb883016ccd71e74426",
"score": "0.61345136",
"text": "def employee_index\n @v1_employee = V1::Employee.find(params[:employee_id])\n\n if @current_user.admin? or @current_user.company_id === @v1_employee.company.id\n @v1_activity = V1::Activity.where( employee_id: @v1_employee.id )\n\n render json: @v1_activity\n else\n render json: {error: 'forbidden'}, status: :forbidden\n end\n end",
"title": ""
},
{
"docid": "68635cf2543c6d77012c50be84682b6b",
"score": "0.6128686",
"text": "def index\n @employee_associations = EmployeeAssociation.paginate(:page => params[:page], :per_page => 5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employee_associations }\n end\n end",
"title": ""
},
{
"docid": "42218628bf5010e914da073e2be6ca82",
"score": "0.6123253",
"text": "def index\n if current_company.users.include?(current_user)\n @employees = current_company.employees\n else\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "431ea3fafead1b16a5c0119d362caf49",
"score": "0.6114427",
"text": "def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"title": ""
},
{
"docid": "3371c51aae91616f0116e311d26d4ea7",
"score": "0.6106941",
"text": "def index\n @empolyees = Empolyee.all\n end",
"title": ""
},
{
"docid": "211f31beaba71ec6ee0952eb0eec44ca",
"score": "0.6101864",
"text": "def index\n\n #@user_role = params[:user_role]\n #@user_id = params[:user_id]\n\n if params[:api_id]\n @api_id = params[:api_id]\n @employes = Employe.where(:organisme_id => @api_id).all\n else\n @employes = Employe.all\n end\n\n end",
"title": ""
},
{
"docid": "9e74eeacd9dd5de0d55ba26e0cfe3adc",
"score": "0.60980403",
"text": "def show\n respond_with(@sicoss_format_employer)\n end",
"title": ""
},
{
"docid": "d365280cea394fb2a21e9ab5f9c37c73",
"score": "0.60941315",
"text": "def index\n @jobs = current_user.jobs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6091573",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "4b6e8e4be62b4dd4271ffaa3faa57ac8",
"score": "0.6090653",
"text": "def index\n @employees = Employee.all\n end",
"title": ""
},
{
"docid": "9294efe1c6f6d89cc99b85dd0ba5433d",
"score": "0.609008",
"text": "def index\n @employeurs = Employeur.all\n end",
"title": ""
},
{
"docid": "e3898bfb9446a61bdec3976d831e965e",
"score": "0.6085613",
"text": "def show\n render json: [*@company]\n end",
"title": ""
},
{
"docid": "c67f97249b4b4ee00eff177046bc707f",
"score": "0.60762703",
"text": "def show\n render json: @company\n end",
"title": ""
},
{
"docid": "6e664a9a5750fd05cd20e86ea12a3db6",
"score": "0.6075563",
"text": "def index\n \t@people = Person.all\n respond_to do |format|\n format.json { render json: @people, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "12cab66b3e2f1ab8a9125acd94088466",
"score": "0.6073971",
"text": "def index\n @environments = @project.environments.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @environments }\n end\n end",
"title": ""
},
{
"docid": "c91346dde526da8038863cf613cb23c3",
"score": "0.60687065",
"text": "def show\n @emp_month = EmpMonth.find(params[:id])\n @employees = Employee.where(\"grade IN (1,2)\").order(:name)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emp_month }\n end\n end",
"title": ""
},
{
"docid": "795491ee196e1d41f198871e0669f9ab",
"score": "0.6063052",
"text": "def index\n\t\t@people = People.all\n\t\t#render json: \"test\"\n\t\tresponse = @people\n\t\trender json: response\n\t\treturn response\n\tend",
"title": ""
},
{
"docid": "cfad47fdcf9f3cb9de91b967d3892ff5",
"score": "0.60590976",
"text": "def get_employees\n @employees = User.find_user_not_admin_not_client(get_company_id)\n end",
"title": ""
},
{
"docid": "ebba22ebd95156055a38bf446fd19721",
"score": "0.6058944",
"text": "def index\n @employee = Employee.all\n end",
"title": ""
},
{
"docid": "6af41848a14a9ba2b6fdaf39ffbb2044",
"score": "0.60529166",
"text": "def show\n @employing_unit = EmployingUnit.find(params[:id])\n @job=Job.new\n @jobs=@employing_unit.jobs\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employing_unit }\n end\n end",
"title": ""
},
{
"docid": "d59cc4ffc69a2a205d5367f1e2f4379b",
"score": "0.6052277",
"text": "def index\n @enrolls = Enroll.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enrolls }\n end\n end",
"title": ""
},
{
"docid": "d709e975d6f34765bbd7b1b7baf0aea7",
"score": "0.6051739",
"text": "def index\n # To restrict so only views you occupations, see omrails, Add Associations . . ., 33:00\n @occupations = Occupation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @occupations }\n end\n end",
"title": ""
},
{
"docid": "ccc802d16617dfc6d459d86ac70814d0",
"score": "0.6050282",
"text": "def index\n @projects_people = ProjectsPerson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects_people }\n end\n end",
"title": ""
},
{
"docid": "035bb6acaba0196ebaf755937fb9e16d",
"score": "0.6043373",
"text": "def index\n @occupants = Occupant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @occupants }\n end\n end",
"title": ""
},
{
"docid": "c918123b789d8e15ea6d0d248bb5fdae",
"score": "0.60429573",
"text": "def index\n @offices = Office.all\n json_response(@offices)\n end",
"title": ""
},
{
"docid": "1e0a61dfb1e6abe1d1f83cd45a1712b9",
"score": "0.60405016",
"text": "def index\n @rowempls = Rowempl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rowempls }\n end\n end",
"title": ""
},
{
"docid": "1debc24edcd83db7f14a585d9cf326f8",
"score": "0.6037347",
"text": "def index\n @employments = @cinema.employments\n end",
"title": ""
},
{
"docid": "47bb58798fd8a88219215220b0d4cc36",
"score": "0.60369515",
"text": "def index\n @organizations = Organization.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @organizations }\n end\n end",
"title": ""
},
{
"docid": "d1b5180d2f73e2921aa1db95b2476f31",
"score": "0.6027598",
"text": "def index\n @companies = Company.all\n respond_to do |format|\n format.html {}\n format.json {render json: {message: @companies}, status: 200}\n end\n end",
"title": ""
},
{
"docid": "410d69f14d53dea3322983107597e196",
"score": "0.60227734",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "151d8e7b52f4f7982c26264c2d3142f9",
"score": "0.6019911",
"text": "def index\n @eobs = Eob.assigned\n @title = \"Posted EOBs\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eobs }\n end\n end",
"title": ""
},
{
"docid": "64ce695abb304fbc090aa2f237ccf20d",
"score": "0.60190725",
"text": "def show\n if request.xhr?\n html = render_to_string(partial: 'employee', layout: false, locals: { employee: @employee })\n render json: { html: html }\n end\n end",
"title": ""
},
{
"docid": "64a81ed18a25197503715d59cb0d5a82",
"score": "0.6018654",
"text": "def index\n #Para no mostrar el empleado oculto que se usa como superuser en la base de datos y el sistema\n @employees = Employee.where(\"id != 1\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"title": ""
},
{
"docid": "627627ce1fd0714364d5c8d121420435",
"score": "0.60074276",
"text": "def index\n @company = Company.find(params[:company_id])\n @roles = Role.where(:company_id => @company.id)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles }\n end\n end",
"title": ""
},
{
"docid": "77942ed4c8bfc310ba7b9d4b1e3e47a9",
"score": "0.6002528",
"text": "def index\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "70922712827734fb9962c0d69eae55cf",
"score": "0.60022634",
"text": "def find_office_by_career\n @office_careers = OfficeCareer.find_office_by_career(params[:career_id])\n json_response(@office_careers)\n end",
"title": ""
},
{
"docid": "699302cab1984a6afcec58aad245d3e0",
"score": "0.60013413",
"text": "def index\n @employees = User.all\n end",
"title": ""
},
{
"docid": "699302cab1984a6afcec58aad245d3e0",
"score": "0.60013413",
"text": "def index\n @employees = User.all\n end",
"title": ""
},
{
"docid": "699302cab1984a6afcec58aad245d3e0",
"score": "0.60013413",
"text": "def index\n @employees = User.all\n end",
"title": ""
},
{
"docid": "b0676ed35d889aac4616a29218ccdea0",
"score": "0.6001185",
"text": "def index\n @employees_projects = EmployeesProject.all\n end",
"title": ""
}
] |
8706aa336bc82f961ad98ead371ba12b
|
PUT /time_tables/1 PUT /time_tables/1.xml
|
[
{
"docid": "3369a994e974db51edc5f02437a383b7",
"score": "0.5749907",
"text": "def update\n @time_table = TimeTable.find(params[:id])\n\n respond_to do |format|\n if @time_table.update_attributes(params[:time_table])\n #format.html { redirect_to(@time_table, :notice => 'Time table was successfully updated.') }\n format.html { redirect_to :controller => :courses, :action => :show, :id => @time_table.grid.course.id, :notice => 'Time table was successfully created.' }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @time_table.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "48ced90d32c35c88ece0e9d4bb429dd5",
"score": "0.57947695",
"text": "def set_time_table\n @time_table = TimeTable.find(params[:id])\n end",
"title": ""
},
{
"docid": "74f7f7d1f33860170fe9ebfacd2440e8",
"score": "0.57891697",
"text": "def update\n @event = Event.from_param(params[:event_id])\n @time_table = @event.time_tables.where(:permalink => params[:id]).first\n success = params[:time_table] && params[:time_table][:times] && \n @time_table.update_attributes(:times => JSON.parse(params[:time_table][:times]))\n success ? update_success : update_failure\n rescue JSON::ParserError\n update_failure\n end",
"title": ""
},
{
"docid": "bedd80789043b36cefd75db89ddacc16",
"score": "0.574378",
"text": "def update\n @time_table_entry = TimeTableEntry.find(params[:id])\n\n respond_to do |format|\n if @time_table_entry.update_attributes(params[:time_table_entry])\n flash[:notice] = 'TimeTableEntry was successfully updated.'\n format.html { redirect_to(@time_table_entry) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @time_table_entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd7104d204af43e84665eb5287a84158",
"score": "0.56459135",
"text": "def update\n @timetable = Timetable.find(params[:id])\n\n respond_to do |format|\n if @timetable.update_attributes(params[:timetable])\n format.html { redirect_to @timetable, notice: 'Timetable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timetable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2c0b673628fdc28b181d18c0afd2d5b",
"score": "0.56129146",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"title": ""
},
{
"docid": "cd5fee1926197ccd4353e26b354eeddd",
"score": "0.55519015",
"text": "def update\n @timetable = Timetable.find(params[:id])\n\n respond_to do |format|\n if @timetable.update_attributes(timetable_params)\n format.html { redirect_to @timetable, notice: 'Timetable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timetable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d6957299681d515f6adbddc10d2972e",
"score": "0.5440206",
"text": "def update\n @timetable = Timetable.find(params[:id])\n\n respond_to do |format|\n if @timetable.update_attributes(params[:timetable])\n format.html { redirect_to @timetable, notice: 'Rozrvh byl úspěšně upraven.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timetable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bd06c8d9594f544a3c5d42c2d1c9bb9",
"score": "0.5431901",
"text": "def update\n @time_task = TimeTask.find(params[:id])\n\n respond_to do |format|\n if @time_task.update_attributes(params[:time_task])\n flash[:notice] = 'TimeTask was successfully updated.'\n format.html { redirect_to(@time_task) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @time_task.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e631b376ae2ccb776680432bf94b01cc",
"score": "0.5408639",
"text": "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"title": ""
},
{
"docid": "fe3244e5f697a7d7d97593bd3a3c510c",
"score": "0.5398191",
"text": "def update\n @timetables = TimeTable.all\n\n @timetables.each do |t|\n t.destroy\n end\n\n session.delete(:return_to)\n session[:return_to] ||= request.referer\n respond_to do |format|\n if @time_table_setting.update(time_table_setting_params)\n format.html { redirect_to session.delete(:return_to), notice: 'Time table setting was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_table_setting }\n else\n format.html { render :edit }\n format.json { render json: @time_table_setting.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c173b532e643e8c7d6b1073997746f5e",
"score": "0.5391315",
"text": "def destroy\n @time_table = TimeTable.find(params[:id])\n @time_table.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_tables_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5667e5ddafc93238112d1e5e3fe2c420",
"score": "0.5363634",
"text": "def update\n @tso = Tso.find(params[:id])\n\n respond_to do |format|\n if @tso.update_attributes(params[:tso])\n flash[:notice] = 'Tso was successfully updated.'\n format.html { redirect_to(@tso) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d7bff3c5c29dd9585d939e5cd4a15ca",
"score": "0.52882683",
"text": "def update\n @time_slot = TimeSlot.find(params[:id])\n\n respond_to do |format|\n if @time_slot.update_attributes(params[:time_slot])\n flash[:notice] = 'TimeSlot was successfully updated.'\n format.html { redirect_to(@time_slot) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @time_slot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ac22efef2396d8d09889a5f6d092c37",
"score": "0.5268362",
"text": "def index\n @timetables = Timetable.all\n end",
"title": ""
},
{
"docid": "6bdb30bfaea70775e7dc46904022cb75",
"score": "0.5224071",
"text": "def update\n respond_to do |format|\n if @timetable.update(timetable_params)\n format.html { redirect_to request.referer, notice: 'Timetable was successfully updated.' }\n format.json { render :show, status: :ok, location: @timetable }\n else\n format.html { render :edit }\n format.json { render json: @timetable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f63a9a3530d6655da0166662b4b54401",
"score": "0.5217704",
"text": "def update\n \n @timesheet = Timesheet.find(params[:id])\n\n respond_to do |format|\n if @timesheet.update_attributes(params[:timesheet])\n format.html { redirect_to @timesheet, notice: 'Timesheet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06efd1dfc6d8a9222128482f376d8b38",
"score": "0.5209352",
"text": "def set_timesheet\n @timesheet = Logtime.find_by_id(params[:id])\n if @timesheet\n else\n \trender json: { valid: false}, status: 404\n end\n end",
"title": ""
},
{
"docid": "ba58e1155424d03db0c010b604c0bb3a",
"score": "0.52063644",
"text": "def update\n @time_entry = current_firm.all_time_entries.find(params[:id])\n\n respond_to do |format|\n if @time_entry.update_attributes(params[:time_entry])\n format.html { redirect_to firm_time_entry_path(current_firm, @time_entry), notice: 'Time entry was successfully updated.' }\n format.json { head :ok }\n else\n format.html { index }\n format.json { render json: @time_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abee45cd1eb7927e8c9eac626f0cbecb",
"score": "0.52033114",
"text": "def set_timetable\n @timetable = Timetable.find(params[:id])\n end",
"title": ""
},
{
"docid": "abee45cd1eb7927e8c9eac626f0cbecb",
"score": "0.52033114",
"text": "def set_timetable\n @timetable = Timetable.find(params[:id])\n end",
"title": ""
},
{
"docid": "71ffdcc131e911510cb1f3ec4d1eb938",
"score": "0.5198333",
"text": "def update\n @timing = Timing.find(params[:id])\n\n respond_to do |format|\n if @timing.update_attributes(params[:timing])\n flash[:notice] = 'Timing was successfully updated.'\n format.html { redirect_to(@timing) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @timing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "566700827c17f6f69d8c3e79de782f09",
"score": "0.5198154",
"text": "def update\n \trespond_to do |format|\n\t\tformat.html {\n\t\t\tgatherEntries\n\t\t\terrorMsg = nil\n\t\t\tTimeEntry.transaction do\n\t\t\t\tbegin\n\t\t\t\terrorMsg = l(:error_wktime_save_nothing) if @entries.blank?\n\t\t\t\t@entries.each do |entry|\n\t\t\t\t\t\tif entry.hours.blank?\n\t\t\t\t\t\t\t# delete the time_entry\n\t\t\t\t\t\t\t# if the hours is empty but id is valid\n\t\t\t\t\t\t\t# entry.destroy() unless ids[i].blank?\n\t\t\t\t\t\t\tif !entry.id.blank?\n\t\t\t\t\t\t\t\tif !entry.destroy()\n\t\t\t\t\t\t\t\t\terrorMsg = entry.errors.full_messages.join('\\n')\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t#if id is there it should be update otherwise create\n\t\t\t\t\t\t\tif !entry.save()\n\t\t\t\t\t\t\t\terrorMsg = entry.errors.full_messages.join('\\n')\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tend\t\t\t\t\t\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\trescue Exception => e\n\t\t\t\t\terrorMsg = e.message\n\t\t\t\tend\n\t\t\t\tif errorMsg.nil?\n\t\t\t\t\tflash[:notice] = l(:notice_successful_update)\n\t\t\t\t\tredirect_back_or_default :action => 'index'\n\t\t\t\telse\n\t\t\t\t\tflash[:error] = l(:error_wktime_save_failed, errorMsg)\n\t\t\t\t\trender_edit\n\t\t\t\t\traise ActiveRecord::Rollback\n\t\t\t\tend\n\t\t\tend\n\t\t} \n\t\tformat.api {\n\t\t}\n\tend \n end",
"title": ""
},
{
"docid": "27c78477bd447fd066b64ed72715893f",
"score": "0.5193454",
"text": "def update\n respond_to do |format|\n if @table.update(table_params)\n format.html { redirect_to events_path, notice: 'Table was successfully updated.' }\n format.json { render :show, status: :ok, location: @table }\n else\n format.html { render :edit }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b12a0b8565473d53dcaf4e44d8485b5f",
"score": "0.519042",
"text": "def updated(date_or_time = nil)\n @xml.updated((date_or_time || Time.now.utc).xmlschema)\n end",
"title": ""
},
{
"docid": "4c6059272baabee2212510e015eb7d8d",
"score": "0.5188611",
"text": "def test_put\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end",
"title": ""
},
{
"docid": "d5893eb9ade40329e2751a3bb435d53f",
"score": "0.5179834",
"text": "def update\n @eventtime = Eventtime.find(params[:id])\n\n respond_to do |format|\n if @eventtime.update_attributes(params[:eventtime])\n format.html { redirect_to(@eventtime, :notice => 'Eventtime was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @eventtime.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93a8d556b94a82a996640f846dd10b9b",
"score": "0.5179829",
"text": "def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "24b695af051de6eedc85b25737670611",
"score": "0.5159729",
"text": "def update\n @timeslot = current_event.timeslots.find(params[:id])\n respond_to do |format|\n @timeslot.start_time_will_change!\n @timeslot.slot_date_will_change!\n if @timeslot.update_attributes(params[:timeslot])\n flash[:notice] = \"Timeslot was successfully updated.\"\n format.html { redirect_to(timeslots_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @timeslot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb81f4a4910d5c6385ed0305c79c5da4",
"score": "0.5147908",
"text": "def update\n params[:task][:time] = parse_task_time(params[:task][:time], params[:anytime][:anytime])\n \n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to(tasks_url, :notice => 'Task was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @task.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce8f372167bc139eb18b988da9b21ffd",
"score": "0.51423854",
"text": "def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e.response \n end",
"title": ""
},
{
"docid": "2a883e27d7c2ac9dc7142cf4483f6815",
"score": "0.5138326",
"text": "def _update(type, current_name, metadata={})\n type = type.to_s.camelize\n request :update do |soap|\n soap.body = {\n :metadata => {\n :current_name => current_name,\n :metadata => prepare(metadata),\n :attributes! => { :metadata => { 'xsi:type' => \"ins0:#{type}\" } }\n }\n }\n end\n end",
"title": ""
},
{
"docid": "ff3cbc6417a7bfc869fc82afacdf167d",
"score": "0.51360434",
"text": "def update\n\t respond_to do |format|\n\t\t\tparams[:timetable].each do |day, hours|\n\t\t\t\texisting = Timetable.first :conditions => {\n\t\t\t\t\t\t:employer_id => selected_employer_id,\n\t\t\t\t\t\t:user_id => current_user.id,\n\t\t\t\t :day => day\n\t\t\t\t}\n\n\t\t\t\tif (existing) then\n\t\t\t\t\tsuccess = existing.update :hours => hours unless hours.empty?\n\t\t\t\t\tsuccess = existing.delete if hours.empty?\n\t\t\t\telsif not hours.empty? then\n\t\t\t\t\tt = Timetable.new :employer_id => selected_employer_id,\n\t\t\t\t\t\t:user_id => current_user.id, :day => day, :hours => hours\n\t\t\t\t\tsuccess = t.save\n\t\t\t else\n\t\t\t\t\tsuccess = true\n\t\t\t\tend\n\n\t\t\t\tunless success then\n\t\t\t\t\tformat.html { render action: 'show', error: sprintf(\"%s has wrong format.\", I18n.t('date.day_names')[day]) }\n\t\t\t\t\tformat.json { render json: sprintf(\"%s has wrong format.\", I18n.t('date.day_names')[day]), status: :unprocessable_entity }\n\t\t\t\tend\n\t\t\tend\n\t\t\tformat.html { redirect_to timetable_path, notice: 'Timetable was successfully updated.' }\n\t\t\tformat.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c056da1e8293189ef6b2143ad848a898",
"score": "0.5126552",
"text": "def update\n @operation_hour = OperationHour.find(params[:id])\n @operation_hour.update_attributes(params[:operation_hour])\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end",
"title": ""
},
{
"docid": "1f3323b1dab6a09de6f3477594535b2f",
"score": "0.5114022",
"text": "def index\n @timetables = Timetable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timetables }\n end\n end",
"title": ""
},
{
"docid": "409fe80050584419cb5939f87418e267",
"score": "0.5086671",
"text": "def update\n respond_to do |format|\n if @schema_table.update(schema_table_params)\n format.html { redirect_to @schema_table, notice: 'Schema table was successfully updated.' }\n format.json { render :show, status: :ok, location: @schema_table }\n else\n format.html { render :edit }\n format.json { render json: @schema_table.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d98d1fd188a1177a81b5a7cbd6566b6",
"score": "0.50748086",
"text": "def set_time_table_item\n @time_table_item = TimeTableItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "931858758893fcf8bcb0cb8313ff4ea5",
"score": "0.5065106",
"text": "def update\n @table = Table.find(params[:id])\n\n respond_to do |format|\n if @table.update_attributes(params[:table].permit(:name, :notes, :x, :y, :table_type, :guest_ids => []))\n format.html { redirect_to @table, notice: 'Table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.5063646",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "81aaed52cd0456c809e046a98c4de79f",
"score": "0.5057284",
"text": "def update\n @timing = Timing.find(params[:id])\n if @timing.update_attributes(params[:timing].slice(:start, :stop, :days, :active))\n render json: @timing\n else\n render json: { error: 'error: could not update timing' }\n end\n end",
"title": ""
},
{
"docid": "c4bedb49a65bc472889c30ef58690306",
"score": "0.5046416",
"text": "def update\n @offset_time = OffsetTime.find(params[:id])\n\n respond_to do |format|\n if @offset_time.update_attributes(params[:offset_time])\n format.html { redirect_to @offset_time, notice: 'Offset time was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @offset_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1abe4b48b96f9c8fd89ccd5066229402",
"score": "0.50463694",
"text": "def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "d7dbd5782c7c0c152b09f1c85f54affe",
"score": "0.50408965",
"text": "def update\n @one_time_stop = OneTimeStop.find(params[:id])\n\n respond_to do |format|\n if @one_time_stop.update_attributes(params[:one_time_stop])\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a098a6882fad73e5dd5479fe32ae2d2",
"score": "0.50365674",
"text": "def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "e88f96293a7fba2dcfb8f2b36a88d113",
"score": "0.50349844",
"text": "def update\n @timeunit = Timeunit.find(params[:id])\n\n respond_to do |format|\n if @timeunit.update_attributes(params[:timeunit])\n format.html { redirect_to(@timeunit, :notice => 'Timeunit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @timeunit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0324ebde362cbba3a7f3a899b938ec12",
"score": "0.5014534",
"text": "def update\n @timesheet = current_user.timesheets.find(params[:id])\n\n respond_to do |format|\n if @timesheet.update_attributes(params[:timesheet])\n format.html { redirect_to @timesheet, notice: 'Timesheet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9686ecec6aa83d0f1d3c861164056585",
"score": "0.5012276",
"text": "def update\n #raise params.inspect\n\n @weeklytimetable = Weeklytimetable.find(params[:id])\n \n respond_to do |format|\n if @weeklytimetable.update_attributes(params[:weeklytimetable])\n format.html { redirect_to(@weeklytimetable, :notice => t('weeklytimetable.title2')+\" \"+t('updated')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @weeklytimetable.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e29da5af2c7c5d39a04cf2836a878beb",
"score": "0.5009909",
"text": "def set_time_sheet\n @time_sheet = ProjectTimeSheet.find_by_id(params[:id])\n if @time_sheet\n else\n \trender json: { valid: false}, status: 404\n end\n end",
"title": ""
},
{
"docid": "e143fd4b2d2f060281d5381a14c19a6c",
"score": "0.50085795",
"text": "def set_time_table_setting\n @time_table_setting = TimeTableSetting.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.5006769",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.5006769",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.5006769",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.5006769",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d8d5693754b073bd209fa7beda7af2e",
"score": "0.5006769",
"text": "def set_timesheet\n @timesheet = Timesheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "adc2e978338ce3de11e0974f9020eb21",
"score": "0.5001543",
"text": "def update_time_entry(options = {})\n object_from_response(:put, \"time_entries/#{id}\", \"time-entry\", \"time-entry\" => options)\n end",
"title": ""
},
{
"docid": "8c3ff7d978d3d2fc78c97c55a38b850c",
"score": "0.4994703",
"text": "def update\n if @timeslot.update(timeslot_params)\n render :show, status: :ok, location: @timeslot\n else\n render json: @timeslot.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "42036b00fb6ca946fbc34fb3d3699bf8",
"score": "0.4982713",
"text": "def update\n @time_entry = TimeEntry.find(params[:id])\n\n respond_to do |format|\n if @time_entry.update_attributes(params[:time_entry])\n format.html { redirect_to @time_entry, notice: 'Time entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @time_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42036b00fb6ca946fbc34fb3d3699bf8",
"score": "0.4982713",
"text": "def update\n @time_entry = TimeEntry.find(params[:id])\n\n respond_to do |format|\n if @time_entry.update_attributes(params[:time_entry])\n format.html { redirect_to @time_entry, notice: 'Time entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @time_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31b4752a8a11b40bfa4c80bf6f99e8e8",
"score": "0.49797335",
"text": "def update\n @ztime = Ztime.find(params[:id])\n\n respond_to do |format|\n if @ztime.update_attributes(params[:ztime])\n format.html { redirect_to(\"/ztimes\", :notice => 'Ztime was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ztime.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdb6eb3141217f988c68dc0165c61869",
"score": "0.49762794",
"text": "def update\n respond_to do |format|\n if @timesheet.update(timesheet_params)\n format.html { redirect_to @timesheet, notice: 'Timesheet was successfully updated.' }\n format.json { render :show, status: :ok, location: api_v1_timesheet_url(@timesheet) }\n else\n format.html { render :edit }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27166a4b3b1094a206bd7bef9f1a414c",
"score": "0.49743807",
"text": "def update\n @time_off_request = TimeOffRequest.find(params[:id])\n respond_to do |format|\n if @time_off_request.update_attributes(params[:time_off_request])\n format.html { redirect_to admin_time_off_requests_url, notice: 'Time off request was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @time_off_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "449cdda4653268c4848b78501cf3817e",
"score": "0.4964985",
"text": "def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"title": ""
},
{
"docid": "63f7ed29d7559787bbfd2e267d341835",
"score": "0.49620262",
"text": "def update\n @table = Table.find(params[:id])\n\n respond_to do |format|\n if @table.update_attributes(params[:table])\n format.html { redirect_to @table, notice: 'Table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ff8cbbab9a633f23bb385fc86660b1e",
"score": "0.49554336",
"text": "def update\n @outcome_timepoint = OutcomeTimepoint.find(params[:id])\n\n respond_to do |format|\n if @outcome_timepoint.update_attributes(params[:outcome_timepoint])\n format.html { redirect_to(@outcome_timepoint, :notice => 'Outcome timepoint was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @outcome_timepoint.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "598ce05f6082b7f191b55f93bdaf11d0",
"score": "0.49545136",
"text": "def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end",
"title": ""
},
{
"docid": "a47a29e5d085a3caa94a2cdf3b064897",
"score": "0.49509135",
"text": "def update\n @working_time = WorkingTime.find(params[:id])\n\n respond_to do |format|\n if @working_time.update_attributes(params[:working_time])\n format.html { redirect_to time_tables_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @working_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d814ae9939c1e4362016de27758fa1b",
"score": "0.49479368",
"text": "def update\n respond_to do |format|\n if @task_table.update(task_table_params)\n format.html { redirect_to @task_table, notice: 'Task table was successfully updated.' }\n format.json { render :show, status: :ok, location: @task_table }\n else\n format.html { render :edit }\n format.json { render json: @task_table.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ad2834b6a62867453ae63ac0a3cfae1",
"score": "0.49392772",
"text": "def update\n @timeline = Timeline.find(params[:id])\n\n respond_to do |format|\n if @timeline.update_attributes(params[:timeline])\n flash[:notice] = 'Timeline was successfully updated.'\n format.html { redirect_to([:admin, @timeline]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @timeline.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8caba4d0d6dccbfb2bf01b3d1912a87d",
"score": "0.49358758",
"text": "def update\n respond_to do |format|\n if @timesheet.update(timesheet_params)\n format.html { redirect_to @timesheet, notice: 'Timesheet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cc642e3bf5f44f1f394798b0bc54676",
"score": "0.49357846",
"text": "def update\n @timesheet = Timesheet.find(params[:id])\n\n respond_to do |format|\n if @timesheet.update_attributes(params[:timesheet])\n #flash[:notice] = 'Timesheet was successfully updated.'\n #format.html { redirect_to(@timesheet) }\n #format.xml { head :ok }\n #session['status'] if session[\"status\"] && session[\"status\"].empty?\n #session['timesheet_user_id'] if session[\"timesheet_user_id\"] && session[\"timesheet_user_id\"].empty?\n format.html { redirect_to :controller => \"admin/timesheets\", :action => \"index\" }\n #format.xml { render :xml => @timesheet, :status => :created, :location => @timesheet }\n else\n #format.html { render :action => \"edit\" }\n #format.xml { render :xml => @timesheet.errors, :status => :unprocessable_entity }\n\n format.html { render :action => \"new\" }\n #format.xml { render :xml => @timesheet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35b4e83651ba227beaa12be8874f1edc",
"score": "0.49340886",
"text": "def time_table_params\n params.require(:time_table).permit(:id, :first_time, :first_timex, :last_time, :last_timex, :employee_id, :date, :row_order_position)\n end",
"title": ""
},
{
"docid": "a93bc30e532bde1448e3a24c62d243b1",
"score": "0.49241316",
"text": "def request_put(path)\n\ttimestamp = Time.now.utc.iso8601\n\tauth = create_hmac_auth(\"PUT\", path, timestamp)\n\t\n\turi = URI($baseUrl + path)\n\n\trequest = Net::HTTP::Put.new(uri)\n\trequest.add_field(\"x-hp-hmac-authentication\", auth)\n\trequest.add_field(\"x-hp-hmac-date\", timestamp)\n\n\tresponse = Net::HTTP.start(uri.host, uri.port,\n\t\t:use_ssl => uri.scheme == 'https',\n\t\t:verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|\n\t\thttp.request(request)\n\tend\n\n\treturn response\nend",
"title": ""
},
{
"docid": "5d20fbfda2dcd71c3ec0da51841d3a8e",
"score": "0.49204355",
"text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @gettable = args[:gettable] if args.key?(:gettable)\n @ready = args[:ready] if args.key?(:ready)\n end",
"title": ""
},
{
"docid": "5d20fbfda2dcd71c3ec0da51841d3a8e",
"score": "0.49204355",
"text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @gettable = args[:gettable] if args.key?(:gettable)\n @ready = args[:ready] if args.key?(:ready)\n end",
"title": ""
},
{
"docid": "975423499100cb9621994c5a51cd18d3",
"score": "0.49133068",
"text": "def update\n @timesheet = Timesheet.find(params[:id])\n @tasks = @company.tasks\n @week = @timesheet.start_date.beginning_of_week\n respond_to do |format|\n if @timesheet.update_attributes(params[:timesheet])\n format.html { redirect_to(timesheets_path, :notice => 'Timesheet was successfully updated.') }\n format.xml { head :ok }\n else\n @week = params[:timesheet][:start_date].to_date.beginning_of_week\n @tasks = @company.tasks\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @timesheet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "641933f33a804157342f52ffe184d760",
"score": "0.49051428",
"text": "def update\n @ip_table = IpTable.find(params[:id])\n\n respond_to do |format|\n if @ip_table.update_attributes(params[:ip_table])\n format.html { redirect_to @ip_table, notice: 'Ip table was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ip_table.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd23911957a654d4134c529b06a5b919",
"score": "0.4902456",
"text": "def update\n if @time_slot.update(time_slot_params)\n render :show, status: :ok, location: @time_slot\n else\n render json: @time_slot.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ce0878190bc7c0859ec84ad080ef31ac",
"score": "0.4894958",
"text": "def update\n respond_to do |format|\n if @stime.update(stime_params)\n format.html { redirect_to @stime, notice: 'Stime was successfully updated.' }\n format.json { render :show, status: :ok, location: @stime }\n else\n format.html { render :edit }\n format.json { render json: @stime.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae5fb82effc733bee8eb354853d40308",
"score": "0.48943672",
"text": "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"title": ""
},
{
"docid": "c1334d481ecf7a586eef5af1d9d14dd2",
"score": "0.48937413",
"text": "def update_timecard(timecard_id:,\n body:)\n warn 'Endpoint update_timecard in V1EmployeesApi is deprecated'\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v1/me/timecards/{timecard_id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'timecard_id' => { 'value' => timecard_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",
"title": ""
},
{
"docid": "831214dec0651b5cdcd12e9ebf0d1007",
"score": "0.48907363",
"text": "def update\n # authorize @timesheet\n respond_to do |format|\n if @timesheet.update(timesheet_params)\n format.html { redirect_to @timesheet, notice: 'Timesheet was successfully updated.' }\n format.json { render :show, status: :ok, location: @timesheet }\n else\n format.html { render :edit }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "831214dec0651b5cdcd12e9ebf0d1007",
"score": "0.48907363",
"text": "def update\n # authorize @timesheet\n respond_to do |format|\n if @timesheet.update(timesheet_params)\n format.html { redirect_to @timesheet, notice: 'Timesheet was successfully updated.' }\n format.json { render :show, status: :ok, location: @timesheet }\n else\n format.html { render :edit }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d37b39a795a6e081d6480942ece1c538",
"score": "0.488873",
"text": "def put!\n request! :put\n end",
"title": ""
},
{
"docid": "4a4a805a1641c8536a4ab6533500c0eb",
"score": "0.48884237",
"text": "def update\n @outcome_timepoint = OutcomeTimepoint.find(params[:id])\n\t@outcome_timepoint.update_attributes(params[:outcome_timepoint])\n end",
"title": ""
},
{
"docid": "97d9a388199c530d07a34f5c1a0a0e26",
"score": "0.48880562",
"text": "def update engine, time, dt\n end",
"title": ""
},
{
"docid": "41bb7c20c819cee9c89cfa89d5cac8a1",
"score": "0.4883676",
"text": "def update!(**args)\n @finish_time = args[:finish_time] if args.key?(:finish_time)\n @original_request = args[:original_request] if args.key?(:original_request)\n @request_time = args[:request_time] if args.key?(:request_time)\n @tables = args[:tables] if args.key?(:tables)\n end",
"title": ""
},
{
"docid": "41bb7c20c819cee9c89cfa89d5cac8a1",
"score": "0.4883676",
"text": "def update!(**args)\n @finish_time = args[:finish_time] if args.key?(:finish_time)\n @original_request = args[:original_request] if args.key?(:original_request)\n @request_time = args[:request_time] if args.key?(:request_time)\n @tables = args[:tables] if args.key?(:tables)\n end",
"title": ""
},
{
"docid": "9abd6bb22832fe5fa255f9e645805b7c",
"score": "0.48799506",
"text": "def update\n\n if @teetime.update(teetime_params)\n\n render json: @teetime,status: :ok\n\n else\n\n render json: {error: true,errors: @teetime.errors},status: :unprocessable_entity\n\n end\n\n \t\tend",
"title": ""
},
{
"docid": "dd5a238e3f7411ab25a8e51c823e8ebc",
"score": "0.48775935",
"text": "def destroy\n @time_table_entry = TimeTableEntry.find(params[:id])\n @time_table_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_table_entries_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4940ac9835e6724155ca0a0f4a6dedac",
"score": "0.48764372",
"text": "def update\n save_file\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3ae92b21a8c64ef3e14f66c3d552793",
"score": "0.48761982",
"text": "def update\n @timechart = Timechart.find(params[:id])\n\n respond_to do |format|\n if @timechart.update_attributes(params[:timechart])\n format.html { redirect_to @timechart, notice: 'Timechart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timechart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cbcb2cda6e100042f124dacd474f3be",
"score": "0.4873026",
"text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "3f0ff7f4310f6dae7c29eb0e00b1bf4a",
"score": "0.48695013",
"text": "def update\n if @timetable.update(timetable_params)\n redirect_to @timetable, notice: 'Timetable was successfully updated.'\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "1c63a792d65a1d618a11c3b0767c9dac",
"score": "0.4868335",
"text": "def show\n @time_table_entry = TimeTableEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @time_table_entry }\n end\n end",
"title": ""
},
{
"docid": "984fead9b1b75ff1046d50d64bb35e97",
"score": "0.48664597",
"text": "def update\n if @can_edit\n\n # Clear out all other blocks\n @timetable.free_times.destroy_all\n times = JSON::Parser.new(params[:times]).parse\n\n # There's an array for each day of the week\n times.each_with_index do |day, i|\n # Each day of the week then has a list of blocks\n day.each_with_index do |block, j|\n unless block.empty?\n # Each block has a start time and an end time for a free block\n @timetable.free_times.create(:start_time => block[0], :end_time => block[1], :day_of_week => i, :weight => block[2], :css_class => block[3])\n end\n end\n end\n\n @person ||= get_person\n @timetable.update_attributes(:updated_by_person_id => @my.id)\n @timetable.touch\n return if @signup\n\n flash[:notice] = I18n.t('timetable.save_confirm')\n\n elsif !@can_edit\n flash[:notice] = I18n.t('timetable.not_allowed_update')\n end\n\n respond_to do |format|\n format.html { redirect_to(person_timetable_path(@timetable.person, @timetable)) }\n format.js\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2538b1da122ef1a99e4a18e62fa5056e",
"score": "0.48635793",
"text": "def update\n @timerecord = TimeRecord.find(params[:id])\n respond_to do |format|\n if @timerecord.update(timerecord_params)\n format.html { redirect_to time_records_url, notice: 'Time Record was successfully updated.' }\n format.json { render :show, status: :ok, location: @timerecord }\n else\n format.html { render :edit }\n format.json { render json: @timerecord.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2538b1da122ef1a99e4a18e62fa5056e",
"score": "0.48635793",
"text": "def update\n @timerecord = TimeRecord.find(params[:id])\n respond_to do |format|\n if @timerecord.update(timerecord_params)\n format.html { redirect_to time_records_url, notice: 'Time Record was successfully updated.' }\n format.json { render :show, status: :ok, location: @timerecord }\n else\n format.html { render :edit }\n format.json { render json: @timerecord.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24f8a6caec9642196bdef2c7241011b0",
"score": "0.48602614",
"text": "def set_time_sheet\n @time_sheet = TimeSheet.find(params[:id])\n end",
"title": ""
},
{
"docid": "bfa43545247dd8171c49636eaf173931",
"score": "0.48569143",
"text": "def update\n respond_to do |format|\n if @timetable_entry.update(timetable_entry_params)\n format.html { redirect_to @timetable_entry, notice: 'Timetable entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @timetable_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c6cd1411275fed159e14a6188f7dcb6",
"score": "0.48537105",
"text": "def update\n Time.xmlschema(get('posts/update', 'update')[0]['time'])\n end",
"title": ""
},
{
"docid": "c5d3a8748b0325a90f44f542d008b0be",
"score": "0.48493263",
"text": "def update\n @stable = Stable.find(params[:id])\n\n respond_to do |format|\n if @stable.update_attributes(params[:stable])\n format.html { redirect_to @stable, notice: 'Stable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
1f39af86ecd6c804fa51864f70d0c6d8
|
DELETE /admin/brokers/1 DELETE /admin/brokers/1.json
|
[
{
"docid": "3d6ffcb4baeb428fd1a78bf77c70b111",
"score": "0.0",
"text": "def destroy\n @agent.destroy\n respond_to do |format|\n format.html { redirect_to admin_agents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "efaa3819db82da012b78522c5ccd0eea",
"score": "0.755506",
"text": "def destroy\n @broker.destroy\n respond_to do |format|\n format.html { redirect_to admin_brokers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f760de6051578dd3c2ad84520a8063fb",
"score": "0.71701884",
"text": "def destroy\n @broker.destroy\n respond_to do |format|\n format.html { redirect_to brokers_url, notice: 'Broker was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f760de6051578dd3c2ad84520a8063fb",
"score": "0.71701884",
"text": "def destroy\n @broker.destroy\n respond_to do |format|\n format.html { redirect_to brokers_url, notice: 'Broker was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "765dafb23987e21dc2b36836aab41321",
"score": "0.66479987",
"text": "def destroy\n chef_rest_v1.delete(\"clients/#{@name}\")\n end",
"title": ""
},
{
"docid": "850c74a5fb0f1b6b2e18cf98a629af88",
"score": "0.6414618",
"text": "def delete *args, &block\n res = @conn.delete *args, &block\n handle res, parse: false\n end",
"title": ""
},
{
"docid": "544c39bc57271463ca11b53a3f84d2d9",
"score": "0.6373889",
"text": "def destroy\n @broker_account.destroy\n respond_to do |format|\n flash_message 'danger', 'Broker account was successfully destroyed.'\n\n format.html { redirect_to broker_accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ce1e7cf90aa82857889c1b10e9f7d91a",
"score": "0.63129413",
"text": "def destroy\n @client.delete( name )\n end",
"title": ""
},
{
"docid": "b0f7bbc46e4642ac27858d420f39579f",
"score": "0.6267029",
"text": "def cancelReservation(lease_uuid)\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s \n cert_path = APP_CONFIG['cert_path']\n \n header = {\"Content-Type\" => \"application/json\"}\n options = {uuid: lease_uuid}\n\n #puts options.to_json \n uri = URI.parse(broker_url+\"/resources/leases\")\n pem = File.read(cert_path)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.cert = OpenSSL::X509::Certificate.new(pem)\n http.key = OpenSSL::PKey::RSA.new(pem)\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Delete.new(uri.request_uri, header)\n request.body = options.to_json\n\n response = http.request(request)\n puts response\n if response.header.code != '200'\n puts \"Something went wrong\"\n puts response\n end\n end",
"title": ""
},
{
"docid": "a5af5d880a8a7c15d6d94e7760bef8d3",
"score": "0.6257098",
"text": "def destroy\n @broker_acl.destroy\n respond_to do |format|\n flash_message 'danger', 'Broker acl was successfully destroyed.'\n\n format.html { redirect_to broker_acls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "240d1666f8572b7b02d242b521aa1135",
"score": "0.6219796",
"text": "def delete\n start { |connection| connection.request http :Delete }\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.62137586",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "963f3a976b55db599fafa5037cd74103",
"score": "0.6190502",
"text": "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d2f2b7e27bbbe134661361074c399275",
"score": "0.6176466",
"text": "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"title": ""
},
{
"docid": "b3d5cc7be98c38ed2845836ab57352e3",
"score": "0.617255",
"text": "def destroy\n @client.delete(@name)\n end",
"title": ""
},
{
"docid": "9a8afbb13480a485f5d0a2ab8a0c4239",
"score": "0.61353755",
"text": "def destroy\n # @bill_quorum = BillQuorum.find(params[:id])\n @bill_quorum.destroy\n\n respond_to do |format|\n format.html { redirect_to bill_quorums_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1d1b92eb57853d2f7a59149b381565e3",
"score": "0.6126441",
"text": "def destroy\n @server = Server.find(params[:id])\n checkaccountobject(\"servers\",@server)\n @server.send_delete\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5237067a91627b2b076ea8d91a607ef5",
"score": "0.61143327",
"text": "def destroy\n @blocking_client = BlockingClient.find(params[:id])\n @blocking_client.destroy\n\n respond_to do |format|\n format.html { redirect_to blocking_clients_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "98938b7c8f2ea265c7fe34a11ec31b05",
"score": "0.6089596",
"text": "def do_delete(uri = \"\")\n @connection.delete do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n end\n end",
"title": ""
},
{
"docid": "10d20d96139e7682124adc5962bc8d0f",
"score": "0.6085963",
"text": "def destroy\n @bless_message.destroy\n\n render json: {}\n end",
"title": ""
},
{
"docid": "0dd3979ddf714821583260d45ef64d20",
"score": "0.6082928",
"text": "def delete(args)\n args = {:path => args} unless args.is_a?(Hash)\n assert_supported_keys(args, [:path, :version, :callback, :context])\n assert_required_keys(args, [:path])\n args[:version] ||= -1\n\n if args[:callback] ## asynchronous\n raise KeeperException::BadArguments unless args[:callback].kind_of?(VoidCallback)\n return zoo_adelete(@zk_handle, args[:path], args[:version], args[:callback].proc, YAML.dump(args[:context]))\n end\n\n ## synchronous\n rc = zoo_delete(@zk_handle, args[:path], args[:version])\n raise KeeperException.by_code(rc), ZooKeeperFFI::zerror(rc) unless rc == ZOK\n return rc\n end",
"title": ""
},
{
"docid": "82a26bbe3a72593be23359545adcfddc",
"score": "0.6063541",
"text": "def destroy_btc\n item = read\n item.delete('btc')\n item['active'] = 0\n @aws.put_item(table_name: 'zold-wallets', item: item)\n end",
"title": ""
},
{
"docid": "33b888c8f2b033bb54789de80c57d692",
"score": "0.60624295",
"text": "def delete\n client.delete(url)\n @deleted = true\nend",
"title": ""
},
{
"docid": "7bd5d3fdf18be6f730ea5501c2d9a2be",
"score": "0.6062213",
"text": "def delete(username)\n perform_request({:action => \"client-delete\", :username => username})\n end",
"title": ""
},
{
"docid": "bd482867b0832a5c83f26687166f5ef0",
"score": "0.60575867",
"text": "def destroy\n @bacon.destroy\n respond_to do |format|\n format.html { redirect_to bacons_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6660f8f62027412929d7b78d182281c",
"score": "0.6055973",
"text": "def delete endpoint\n do_request :delete, endpoint\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.60447526",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d",
"score": "0.6021818",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d",
"score": "0.6021818",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "3bbe532f009f1a184b0c02732cbe4aaf",
"score": "0.6017645",
"text": "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"title": ""
},
{
"docid": "ee3b36d94e9fa9123f5e7ac28e6d7020",
"score": "0.60085475",
"text": "def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end",
"title": ""
},
{
"docid": "a9cdf07abd2f7a88bb3bcc4c652167b8",
"score": "0.5989077",
"text": "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",
"title": ""
},
{
"docid": "fb622696b3cadaef2a0d459cf3572785",
"score": "0.5967548",
"text": "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"title": ""
},
{
"docid": "03b9a3a27f640574b351157d6ef7539d",
"score": "0.59567416",
"text": "def delete\n connection.delete(\"/#{URI.escape(@key)}\", @bucket_name)\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.5949282",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.5949282",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.5949282",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.5949282",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "3633e737644dae5f5d8d49f3248f7a12",
"score": "0.5948069",
"text": "def delete\n api(\"Delete\")\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.5945802",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "d63602d7158bb10b138569ae708b5cb2",
"score": "0.59343135",
"text": "def destroy\n @secubat_client = SecubatClient.find(params[:id])\n @secubat_client.destroy\n\n respond_to do |format|\n format.html { redirect_to secubat_clients_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9b13db260e5e94120052ed2793f2b8cc",
"score": "0.5929079",
"text": "def destroy\n @kb = Kb.find(params[:id])\n @kb.destroy\n\n respond_to do |format|\n format.html { redirect_to kbs_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.59289724",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "522e787502895f0a05c9b2c6ca4e5ced",
"score": "0.59219146",
"text": "def delete\n request(:delete)\n end",
"title": ""
},
{
"docid": "ef5c256ea12251d857dfec9af872317e",
"score": "0.5915494",
"text": "def destroy\n orden@client.destroy\n end",
"title": ""
},
{
"docid": "97ea27c7130d7e8769f026346da4ff9b",
"score": "0.59107965",
"text": "def destroy\n @qa_client = QaClient.find(params[:id])\n @qa_client.destroy\n\n respond_to do |format|\n format.html { redirect_to qa_clients_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3673f5b4865916f6278654b20718ce9e",
"score": "0.59048086",
"text": "def delete_account\n @connection.request({\n :method => 'DELETE'\n }) \n end",
"title": ""
},
{
"docid": "44433b2fd31cb7ba9fc3049e93f62902",
"score": "0.58998305",
"text": "def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end",
"title": ""
},
{
"docid": "be503c512ffea7c29ce2f4412e705f28",
"score": "0.58990794",
"text": "def delete(context, name)\n res = context.transport.delete_request(context, \"blobstores/#{name}\")\n\n context.err(res.body) unless res.success?\n end",
"title": ""
},
{
"docid": "d0de4af2759eccaf2993ba8bd9b4bf6e",
"score": "0.58983237",
"text": "def service_group_delete(a10, name)\n a10.send(:axapi, 'slb.service_group.delete', 'post', {name: name, format: 'json'})\nend",
"title": ""
},
{
"docid": "82638edd700f30d04414a7c8abd45ee1",
"score": "0.5889613",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "82638edd700f30d04414a7c8abd45ee1",
"score": "0.5889613",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "5739b357c9dca8ab8b63a4a74b33ad69",
"score": "0.58888835",
"text": "def destroy\n @bluetooth = Bluetooth.find(params[:id])\n @bluetooth.destroy\n\n respond_to do |format|\n format.html { redirect_to bluetooths_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a3001b23415993e687b7fbcf6856f0fe",
"score": "0.5884837",
"text": "def delete(path, params = {})\n debug_log \"DELETE #{@host}#{path} params:#{params}\"\n res = connection.delete path, params\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end",
"title": ""
},
{
"docid": "d0abab1b810661d08d8784e7733869db",
"score": "0.58830476",
"text": "def destroy\n @bdatabase = Bdatabase.find(params[:id])\n @bdatabase.destroy\n\n respond_to do |format|\n format.html { redirect_to bdatabases_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "975bd8a11ffeaa45d96f4e8745874ecd",
"score": "0.58716786",
"text": "def destroy\n @keyclientorder.destroy\n respond_to do |format|\n format.html { redirect_to keyclientorders_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7d3c63b7953786567365eebd7e48340",
"score": "0.5868445",
"text": "def delete(options={})\n connection.delete(\"/\", @name)\n end",
"title": ""
},
{
"docid": "f7b8871a4dd0a74a1a1c441c4850b0e4",
"score": "0.58556616",
"text": "def destroy\n @v1_message = V1::Message.find(params[:id])\n @v1_message.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "82bf14778521500239ea2d00ee3d1822",
"score": "0.58553755",
"text": "def delete( queue_name )\n req = KJess::Request::Delete.new( :queue_name => queue_name )\n resp = send_recv( req )\n return KJess::Response::Deleted === resp\n end",
"title": ""
},
{
"docid": "7cb9eca8e36ca08c593f40fddb371adc",
"score": "0.5852275",
"text": "def delete(key)\n\n # FIXME: insert code that connects to the backend and affects the delete\n # operation\n #\n # - This delete should be done atomically\n # - Convert any exceptions into a failed status result with a meaningful\n # error message.\n #\n\n { :result => false, :err_msg => 'FIXME: not implemented' }\n end",
"title": ""
},
{
"docid": "d796fd1591d75626bc4cdba96b9e43c0",
"score": "0.58494276",
"text": "def destroy\n @bread_store.destroy\n respond_to do |format|\n format.html { redirect_to bread_store_managers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "efff4a4301f51be0318fba5313697dad",
"score": "0.5846738",
"text": "def destroy\n @oncokb.destroy\n respond_to do |format|\n format.html { redirect_to oncokbs_url, notice: 'Oncokb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "515d46c9b0a32657fce2af736d12be22",
"score": "0.5828611",
"text": "def delete\n if body.empty? && params[:id]\n client.delete(params)\n elsif body.empty?\n client.delete_by_query(params.merge(body: body.merge(ALL)))\n else\n client.delete_by_query(params.merge(body: body))\n end\n end",
"title": ""
},
{
"docid": "30fc9e44c2b99529d801849a7cf8d875",
"score": "0.5823853",
"text": "def delete options={}, headers={}\n @connection.delete \"subscriptions.json\", options, headers\n end",
"title": ""
},
{
"docid": "43b05185546567abd57878feb7925734",
"score": "0.58178747",
"text": "def destroy\n @qb.destroy\n respond_to do |format|\n format.html { redirect_to qbs_url, notice: 'Qb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e9be98ca69f769b8f05268c55079bd3a",
"score": "0.5817231",
"text": "def delete(*args)\n execute(:delete, *args)\n end",
"title": ""
},
{
"docid": "40a807de69597305c89e7c21639a0479",
"score": "0.5810809",
"text": "def destroy\n @backup.destroy\n respond_to do |format|\n format.html { redirect_to backups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2993700721988a232d30fabe1ebb332a",
"score": "0.58032084",
"text": "def delete!\n server.delete(name)\n end",
"title": ""
},
{
"docid": "74a7067c1545057497db9cd23ff3d844",
"score": "0.57999814",
"text": "def destroy\n @cashbox.destroy\n respond_to do |format|\n format.html { redirect_to cashbox_index_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "43c3c9d465942328d7be68c9cae1fd82",
"score": "0.57908076",
"text": "def couchdb_delete(urn, host = '127.0.0.1', options = @@default_options)\n query_couchdb(urn, 'DELETE', host, options)\n end",
"title": ""
},
{
"docid": "652aeef89bfc76acff7a25100c15c0d4",
"score": "0.5790304",
"text": "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end",
"title": ""
},
{
"docid": "f3c077a2a4c54399fcfd90e36561a690",
"score": "0.5789272",
"text": "def destroy\n @bid = Bid.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/admin/transaction\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac23039e82f793639ed84f35b6bfc003",
"score": "0.57888776",
"text": "def destroy\n @v1_order = V1::Order.find(params[:id])\n @v1_order.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "642b4bd4b513d285f22799eb616d786c",
"score": "0.5787831",
"text": "def delete(path)\n make_call(mk_conn(path), :delete)\n end",
"title": ""
},
{
"docid": "0aabfd70910b8480a97cffeb53be8800",
"score": "0.57875305",
"text": "def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"title": ""
},
{
"docid": "534e8461e0e4608d4f50b059f02c00c4",
"score": "0.5787245",
"text": "def destroy\n @block_list_server = BlockListServer.find(params[:id])\n @block_list_server.destroy\n\n respond_to do |format|\n format.html { redirect_to block_list_servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "624d8ab720d27356ae0c79fae407af36",
"score": "0.5773605",
"text": "def destroy\n respond_to do |format|\n unless @client_sync.nil?\n client_sync_hash()\n @client_sync.destroy\n format.html { redirect_to client_syncs_url, notice: $gcMsgDeleteRecord }\n format.json { render :json => @client_sync_hash }\n format.xml { render :xml => @client_sync_hash }\n else\n lcHashError = { return_status: false }\n format.html { render :edit }\n format.json { render :json => lcHashError }\n format.xml { render :xml => lcHashError }\n end\n end\n end",
"title": ""
},
{
"docid": "c69f2bfa7c00dd79c2e6faf42ad8f84b",
"score": "0.57716906",
"text": "def delete\n @server.make_json_request('show.delete', tvdbid: @tvdbid)['message']\n end",
"title": ""
},
{
"docid": "e8eb30a0416aa087718565c31a341437",
"score": "0.5770791",
"text": "def destroy\n @backup_check = BackupCheck.find(params[:id])\n internal_check = InternalCheck.find(params[:internal_check_id])\n @backup_check.destroy\n\n respond_to do |format|\n format.html { redirect_to internal_check }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "626fa91d3138b330fefc32abdf92602a",
"score": "0.57691884",
"text": "def destroy\n @bitcoin.destroy\n respond_to do |format|\n format.html { redirect_to bitcoins_url, notice: 'Bitcoin was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "93d41b3a53bd4334f8688bcac1ad8926",
"score": "0.5766002",
"text": "def destroy\n @exchange.destroy\n respond_to do |format|\n format.html { redirect_to exchanges_url, notice: 'La cotizacion de elemento se eliminó con exito.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "adba8ee21ff81bb1fc794f42211ba8b9",
"score": "0.57589334",
"text": "def bucket_delete_object(key)\n http.delete(\"/#{key}\", bucket: bucket, key: key)\n end",
"title": ""
},
{
"docid": "b5693456e56347a0e63e0d7dc848ba04",
"score": "0.57580775",
"text": "def delete_message(data); end",
"title": ""
},
{
"docid": "b5693456e56347a0e63e0d7dc848ba04",
"score": "0.57580775",
"text": "def delete_message(data); end",
"title": ""
},
{
"docid": "1377e2e285b05ab792ddf06289bffa1b",
"score": "0.57569873",
"text": "def destroy\n @bmc.destroy\n respond_to do |format|\n format.html { redirect_to proyect_bmcs_path(@proyect), notice: 'Bmc ha sido eliminado.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ca47d5e938df99eb744c55c8a8b7a3df",
"score": "0.5756624",
"text": "def delete(*args)\n request(:delete, *args)\n end",
"title": ""
},
{
"docid": "d1e0bd0ff08cca05e4638384149cc80a",
"score": "0.5752099",
"text": "def destroy\n @exchange = Exchange.find(params[:id])\n @exchange.destroy\n\n respond_to do |format|\n format.html { redirect_to exchanges_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2f7c42d4307437cd075ad72473bf8102",
"score": "0.5750513",
"text": "def destroy\n @browsenodeid = Browsenodeid.find(params[:id])\n @browsenodeid.destroy\n\n respond_to do |format|\n format.html { redirect_to(browsenodeids_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d7f30696733b143af613647ef05572f5",
"score": "0.5747242",
"text": "def destroy\n @boc.destroy\n respond_to do |format|\n format.html { redirect_to bocs_url, notice: 'Boc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ec4d71779bb8bc8fc22e076c92e2ad70",
"score": "0.5745935",
"text": "def destroy\n @redis_database = RedisDatabase.find(params[:id])\n @redis_database.destroy\n tflash('delete', :success, {:model=>@@model, :count=>1})\n respond_to do |format|\n format.html { redirect_to(redis_databases_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6358e88618563621ed7019bdc0eb4e3f",
"score": "0.5741099",
"text": "def destroy\n @enqueue.destroy\n respond_to do |format|\n format.html { redirect_to enqueues_url, notice: 'Enqueue was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d13afa3c75d9626cc5ed2be1a7405e5e",
"score": "0.57300144",
"text": "def delete(address)\n \tMailgun.submit :delete, list_url(address)\n end",
"title": ""
},
{
"docid": "f231c3493f2dbef89706f339a02897e8",
"score": "0.5729496",
"text": "def delete_consumer(username)\n url = '/consumers/' + username\n payload = {}\n process_kong_request(url, :DELETE, payload)\n end",
"title": ""
},
{
"docid": "4c5509f8d684163515a97f44e22b1de9",
"score": "0.5727977",
"text": "def destroy\n @otg_client.destroy\n respond_to do |format|\n format.html { redirect_to otg_clients_url, notice: 'Otg client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1b59231cd2676c9a8493f81c50fa719b",
"score": "0.5725063",
"text": "def delete(nonce)\n _resetCount()\n runMbxTransaction(@hpk, 'delete') do\n rds.del msg_tag nonce\n rds.hdel hpk_tag, nonce\n logger.info \"#{INFO} deleting #{dumpHex b64dec nonce} in mbx #{dumpHex b64dec @hpk}\"\n end\n end",
"title": ""
},
{
"docid": "ca79983a60446ff55251b83f46a41a6e",
"score": "0.5724864",
"text": "def delete(*args)\n commit(\"delete\", *args)\n end",
"title": ""
},
{
"docid": "3f47b99d44a515efe964fd3207d68b31",
"score": "0.57218045",
"text": "def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end",
"title": ""
},
{
"docid": "85f75fa87a735d6adea643b100ac7d02",
"score": "0.5721504",
"text": "def delete_account\n @connection.request({\n :method => 'DELETE'\n })\n end",
"title": ""
},
{
"docid": "7a523517f186271d33490180a5ef4b0d",
"score": "0.57193273",
"text": "def delete(server, backup_id)\n run_barman_command(\"delete #{server} #{backup_id}\")\n end",
"title": ""
},
{
"docid": "ad0c36135de0490ca71e281a94cd49f9",
"score": "0.57193077",
"text": "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end",
"title": ""
},
{
"docid": "eda8d0cad950f3dc8ca6212a1ac6a126",
"score": "0.5719083",
"text": "def delete\n Iterable.request(conf, base_path).delete\n end",
"title": ""
},
{
"docid": "641152d73a6448c0811933abbac01623",
"score": "0.57181007",
"text": "def destroy\n @sm_backend_config = SmBackendConfig.find(params[:id])\n @sm_backend_config.destroy\n\n respond_to do |format|\n format.html { redirect_to sm_backend_configs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
c27c7f259b30f9c5c2c1c4149e52cea6
|
Determines whether a value has changed for dirty checking. +old_value+ and +new_value+ will always be typecast. Types should not need to override this method.
|
[
{
"docid": "d9973c45ff908406ef6cfe56b785928a",
"score": "0.83004713",
"text": "def changed?(old_value, new_value, _new_value_before_type_cast)\n old_value != new_value\n end",
"title": ""
}
] |
[
{
"docid": "97491f27fcc1ae9a0cb3a3eeb51d3cd8",
"score": "0.8403192",
"text": "def changed?(old_value, new_value, _new_value_before_type_cast) # :nodoc:\n old_value != new_value\n end",
"title": ""
},
{
"docid": "6f592dbc55fb932a937e76ba568d95b0",
"score": "0.749155",
"text": "def changed?\n @value_was != value\n end",
"title": ""
},
{
"docid": "231bcc68dd4baec2f4ee48340928ef34",
"score": "0.7285014",
"text": "def changed_in_place?(raw_old_value, new_value)\n deserialize(raw_old_value) != new_value\n end",
"title": ""
},
{
"docid": "231bcc68dd4baec2f4ee48340928ef34",
"score": "0.7285014",
"text": "def changed_in_place?(raw_old_value, new_value)\n deserialize(raw_old_value) != new_value\n end",
"title": ""
},
{
"docid": "980d60bcae4edbfc0117b1ce4310a206",
"score": "0.7078665",
"text": "def changed_in_place?(raw_old_value, new_value)\n false\n end",
"title": ""
},
{
"docid": "1e10b835dcd51c5795d11da05a09519d",
"score": "0.6647063",
"text": "def modified?\n getvalue() != @original_value\n end",
"title": ""
},
{
"docid": "1e10b835dcd51c5795d11da05a09519d",
"score": "0.6647063",
"text": "def modified?\n getvalue() != @original_value\n end",
"title": ""
},
{
"docid": "104f5b9ca94751a6cf0a42a025c583af",
"score": "0.6454779",
"text": "def changed?\n !!@changed\n end",
"title": ""
},
{
"docid": "cf7260d6c0bfb00bfe795e2c1483f152",
"score": "0.63831",
"text": "def calculate_corrective_change(old_system_value)\n # Only idempotent properties, and cases where we have an old system_value\n # are corrective_changes.\n if @property_instance.idempotent? &&\n !@property_instance.sensitive &&\n !old_system_value.nil?\n\n # If the values aren't insync, we have confirmed a corrective_change\n insync = @property_instance.insync_values?(old_system_value, previous_value)\n\n # Preserve the nil state, but flip true/false\n @corrective_change = insync.nil? ? nil : !insync\n else\n @corrective_change = false\n end\n end",
"title": ""
},
{
"docid": "32b46dbb04774e3a3e0317713621719f",
"score": "0.6352383",
"text": "def changed?\n @changed\n end",
"title": ""
},
{
"docid": "10c87de00fc551ad691aa2ee668f5b01",
"score": "0.63369447",
"text": "def changed?\r\n @changed\r\n end",
"title": ""
},
{
"docid": "d5a352440f22b1e7b2ef5eb914adc183",
"score": "0.63198525",
"text": "def changed?\n @changed\n end",
"title": ""
},
{
"docid": "3a36eb0bbae55ec9a592fe900bc71d63",
"score": "0.63027996",
"text": "def changed?\n\t\tchanged = (@price_new != @price_old)\n\t\t@price_old = @price_new\n\t\treturn changed\n\tend",
"title": ""
},
{
"docid": "04c02016b72b9dff0ec63ab48db74603",
"score": "0.6217903",
"text": "def changed?(*args)\n attributes.changed?(*args)\n end",
"title": ""
},
{
"docid": "a515d98a6898de336dfea5e485e288a3",
"score": "0.620072",
"text": "def changed?(old_status, prop)\n (old_status == nil && self[prop] > 0) ||\n (old_status != nil && self[prop] != old_status[prop])\n end",
"title": ""
},
{
"docid": "db05297d984cf1e9753878c96f667a36",
"score": "0.6199651",
"text": "def changed? \n @changed == true\n end",
"title": ""
},
{
"docid": "12a9de08d40893752376f9c919d496e9",
"score": "0.61966705",
"text": "def changed?\n !!@previous\n end",
"title": ""
},
{
"docid": "08dddf98b695758a5337ba6a65041ddb",
"score": "0.6182449",
"text": "def _compare_and_set(old_value, new_value)\n return false unless @mutex.try_lock\n begin\n return false unless @value.equal? old_value\n @value = new_value\n ensure\n @mutex.unlock\n end\n true\n end",
"title": ""
},
{
"docid": "8d6eda08a67f95a25b1f3b0f195c217c",
"score": "0.6109379",
"text": "def changed?\n changes.changed?\n end",
"title": ""
},
{
"docid": "5183dc9423efa11be09e0278f14b10a1",
"score": "0.6015716",
"text": "def changed?(other)\n !unchanged?(other)\n end",
"title": ""
},
{
"docid": "27320c54497e72c1986bf9879c623002",
"score": "0.597326",
"text": "def changed?\n !changed_attributes.empty?\n end",
"title": ""
},
{
"docid": "7e6727597398169987fdb5a65aee688a",
"score": "0.59149647",
"text": "def changed?\n\t\treturn self.changed_reason ? true : false\n\tend",
"title": ""
},
{
"docid": "05919ec56159e0277cb7ddcba6cf05aa",
"score": "0.5905185",
"text": "def changed? \n @values.any { |v| v.changed? || v.deleted? }\n end",
"title": ""
},
{
"docid": "e4201f4376d404c359c9de52bcbe0b78",
"score": "0.5893616",
"text": "def anything_changed?\n self.changed?;\n end",
"title": ""
},
{
"docid": "d77a279bdd74c9540599e8f15b2dd175",
"score": "0.5874211",
"text": "def attribute_changed?(attribute_name)\n (self.diff['attributes']['new']||{})[attribute] != (self.diff['attributes']['old']||{})[attribute]\n end",
"title": ""
},
{
"docid": "003f05adce2824dc89ee53bb5b7ab41c",
"score": "0.58399177",
"text": "def changed?\n eav_attributes.each do |attribute|\n return true if ( attribute.changed? || attribute.new_record? )\n end\n\n super\n end",
"title": ""
},
{
"docid": "cfa1cd1b6d558fdb7f1e4cf4ab2e9f8f",
"score": "0.58308744",
"text": "def values_changed?\n unless tracked_attributes.present?\n raise TrackChangesError, 'Object has not been configured for change tracking.'\n end\n changed = marked_for_destruction? ? true : false\n tracked_attributes.each do |attr|\n break if changed\n if send(\"#{attr}_changed?\")\n changed = send(attr) == send(\"#{attr}_was\") ? false : true\n end\n end\n self.exclude_from_save = !changed\n changed\n end",
"title": ""
},
{
"docid": "e88da9a96caccd0004ab0333634eb95f",
"score": "0.5802478",
"text": "def changed\n self.class.fields.select do |field|\n field[0] != '_' and self._old_values[field] != self.send(field)\n end\n end",
"title": ""
},
{
"docid": "08d59c0c3659824ef2adaa5c512f50e5",
"score": "0.57884735",
"text": "def changed?\n if update_type == :no_change\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "a48f715568a95cb996b825673d73060c",
"score": "0.5743673",
"text": "def changed?\n self.event_state.include? :changed\n end",
"title": ""
},
{
"docid": "ed9feb6d4a4c98ab2a1212adb858920c",
"score": "0.5737788",
"text": "def changed?(attr)\n @is[attr] != @should[attr]\n end",
"title": ""
},
{
"docid": "3ba9a28363def32f6714161f95d9e3e1",
"score": "0.57257986",
"text": "def changed?\n raw?\n end",
"title": ""
},
{
"docid": "509b75d223da6a1814ae10bf5910c295",
"score": "0.5687134",
"text": "def updated?(new_payload)\n payload != new_payload\n end",
"title": ""
},
{
"docid": "7e248e8ae881640d29acb0079ff3e31c",
"score": "0.5677079",
"text": "def changed?\n true\n end",
"title": ""
},
{
"docid": "3b5880f68365180fc88602c388647837",
"score": "0.5673876",
"text": "def changed=(value)\n @changed = value\n @deleted = false if value == true\n end",
"title": ""
},
{
"docid": "08b55d0839010519b271ffd77cf3b387",
"score": "0.56726474",
"text": "def value?(value)\n\t\treturn self.value == value\n\tend",
"title": ""
},
{
"docid": "08b55d0839010519b271ffd77cf3b387",
"score": "0.56726474",
"text": "def value?(value)\n\t\treturn self.value == value\n\tend",
"title": ""
},
{
"docid": "0bf726e61f5b4f14452a3a289fcc467e",
"score": "0.5660185",
"text": "def was_changed?\n attributes = get_attributes \n previous_revision = self.last_revision\n return true unless previous_revision\n \n # Check page attributes for changing\n attributes.each do |field, value|\n return true if value.to_s != previous_revision[field].to_s\n end\n \n return false\n end",
"title": ""
},
{
"docid": "fadbfd1000bd563b8c0d4299d18d183d",
"score": "0.5631145",
"text": "def changed?(attribute=nil)\n @snapshot.nil? or not snapshot_equal_content?(attribute)\n end",
"title": ""
},
{
"docid": "fed24004d77bf3ea260e8db2b79e4991",
"score": "0.56294376",
"text": "def anything_changed?\n self.changed? || collection_anything_changed([self.general_fields, self.input_parameters, self.method_fields])\n end",
"title": ""
},
{
"docid": "db37de01f91ab5c18adc818f68c42d25",
"score": "0.56256026",
"text": "def changed?\n #card_type_changed?\n ret=(changed & DB_FIELDS).present? || VIRTUAL_FIELDS.any? {|attr| self.send(attr).present?}\n ret\n end",
"title": ""
},
{
"docid": "fa1d0e9a1aad8e465bb6fc219bf429b0",
"score": "0.5579723",
"text": "def changed?\n return false unless ldp_object.present?\n ldp_object.changed?\n end",
"title": ""
},
{
"docid": "97decead643df284d684a02dca3261a7",
"score": "0.5550116",
"text": "def changed_notably?\n if ignored_attr_has_changed?\n timestamps = @record.send(:timestamp_attributes_for_update_in_model).map(&:to_s)\n (notably_changed - timestamps).any?\n else\n notably_changed.any?\n end\n end",
"title": ""
},
{
"docid": "adf070143085a76dd7f9b8d8a92229fd",
"score": "0.5525208",
"text": "def changed?\n # Allow the timeout to be disabled entirely.\n return true if Puppet[:filetimeout] < 0\n current_stamp = current_timestamp\n\n # We use a different internal variable than the stamp method\n # because it doesn't keep historical state and we do -- that is,\n # we will always be comparing two timestamps, whereas\n # stamp just always wants the latest one.\n if current_stamp == @previous_timestamp\n false\n else\n @previous_timestamp = current_stamp\n true\n end\n end",
"title": ""
},
{
"docid": "23759583ce6682d3637a95fcb5ceddf1",
"score": "0.55251414",
"text": "def data_changed?(current_data, previous_data)\n if current_data && previous_data\n current_data != previous_data\n else\n true\n end\n end",
"title": ""
},
{
"docid": "b53433ede8fdc3579fd37565a3c117a8",
"score": "0.55170083",
"text": "def attribute_changed?(attr)\n changed_attributes.include?(attr)\n end",
"title": ""
},
{
"docid": "7507b2ecfcb9320bd4908f8b7513dffc",
"score": "0.5497725",
"text": "def changed?\n to_h != self.class.find(id).to_h\n end",
"title": ""
},
{
"docid": "eab08b2333c1ddc6a49d69b8a5f98652",
"score": "0.5474373",
"text": "def == other\n (self.start_value == other.start_value) &&\n (self.value_changes == other.value_changes)\n end",
"title": ""
},
{
"docid": "cdfa2918f295bd9c84637b83e3d99d26",
"score": "0.5442163",
"text": "def changed?(key=nil)\n if key\n # return the changed values for the keys\n changed_attributes.key?(key)\n else\n changed_attributes.present?\n end\n end",
"title": ""
},
{
"docid": "65856acf99e672d167238506e1aad072",
"score": "0.54099745",
"text": "def record_unchanged?(record_new, record_old)\n # NOTE: Using the dirty state would be great here, but it doesn't keep track of\n # in-place changes.\n\n allow_indexing?(record_old) == allow_indexing?(record_new) &&\n !@fields.map { |field| record_old.send(field) == record_new.send(field) }.include?(false)\n end",
"title": ""
},
{
"docid": "cda799dedbca5bbbbfe4f61bdea96cc3",
"score": "0.5400181",
"text": "def admin_changed?\n # no change: false\n # false <-> nil: false\n # false|nil <-> true: true\n !!changes['admin'].try {|from, to| !!from != !!to}\n end",
"title": ""
},
{
"docid": "1938bc93851f82a7ed4a880487cda9dc",
"score": "0.5399697",
"text": "def old_value; end",
"title": ""
},
{
"docid": "05c2df3b190f30d067fe3a3b34a8efc1",
"score": "0.5399415",
"text": "def value=(value)\n @changed = true if value != @value\n @value = value\n end",
"title": ""
},
{
"docid": "4039ec04c0cf3e9acfe0794337c57e9c",
"score": "0.53978324",
"text": "def changed?\n return true if attributes_changed?\n return true if associations_changed?\n false\n end",
"title": ""
},
{
"docid": "29e01c07585a1653f0a6f2b596f89a24",
"score": "0.53968674",
"text": "def change?\n updated? || deleted?\n end",
"title": ""
},
{
"docid": "40cc8df4b345ef7c6d48fc7024a5a5f4",
"score": "0.5389508",
"text": "def change?\n type == 'change'\n end",
"title": ""
},
{
"docid": "e109e721093cf6bd456777b1722c7eb8",
"score": "0.5347627",
"text": "def value=(value)\n if @value.class == value.class\n @value = value\n @updater = nil\n else\n raise \"Class of new value (#{value.class}) does not match class of current value (#{@value.class})\"\n end\n end",
"title": ""
},
{
"docid": "6e0877d0e5d9a1b8a26ecb5cbeb13ba5",
"score": "0.5341025",
"text": "def old?\n if modified_at.nil?\n false\n else\n modified_at < self.class.old_in_days.days.ago.to_i\n end\n end",
"title": ""
},
{
"docid": "79293ad5915bc6be38b603caae68efdb",
"score": "0.5332659",
"text": "def changed?\n mutations_from_database.any_changes?\n end",
"title": ""
},
{
"docid": "3b9f6a8cd710cbf27b581ce7b67cb719",
"score": "0.53242326",
"text": "def any_changed?(*fields)\n fields.any? do |field|\n model_field = self.class.model_field_cache_inverse[field]\n value_changed = true\n\n if model_field\n value_changed = send(model_field).send(field) != send(field)\n end\n\n given?(field) && value_changed\n end\n end",
"title": ""
},
{
"docid": "b61c231f838e7e92a700d1edd29812bf",
"score": "0.5254345",
"text": "def content_changed?\n changed? && changes.keys != ['is_current']\n end",
"title": ""
},
{
"docid": "e4acb6886258e1f07188be2ec61b9b54",
"score": "0.52400297",
"text": "def changed?(key)\n changed.has_key?(key)\n end",
"title": ""
},
{
"docid": "e4acb6886258e1f07188be2ec61b9b54",
"score": "0.52400297",
"text": "def changed?(key)\n changed.has_key?(key)\n end",
"title": ""
},
{
"docid": "ff25154fc98d45ffaca16c04f2bd3872",
"score": "0.52393186",
"text": "def changed_value(property)\n new_value = new_resource.send(property)\n return new_value if current_resource.nil?\n\n current_value = current_resource.send(property)\n\n return current_value if required_properties.include? property\n\n new_value == current_value ? nil : new_value\n end",
"title": ""
},
{
"docid": "ffdf47db45e25c07126144a991578389",
"score": "0.523602",
"text": "def local_changed?\n # TODO\n end",
"title": ""
},
{
"docid": "85e087114d98cddcf4f35b25a411221c",
"score": "0.52200806",
"text": "def value_coerced?(value)\n @primitive === value\n end",
"title": ""
},
{
"docid": "ee8d648c4330da1616e81022ec846236",
"score": "0.5198437",
"text": "def new_value(old_value)\n raise 'to be implemented in subclass'\n end",
"title": ""
},
{
"docid": "2477299f175ded11f3d7c545a27b5d31",
"score": "0.5196955",
"text": "def changed?\n if defined? @observer_state and @observer_state\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "a0a44681cac381304dcd9debae4968e3",
"score": "0.5196731",
"text": "def updated_values?\n change_set.changed?(:source_metadata_identifier) || (\n change_set.respond_to?(:apply_remote_metadata?) &&\n change_set.apply_remote_metadata?\n )\n end",
"title": ""
},
{
"docid": "54105b30293a9c1e70e8676f68a427d3",
"score": "0.51937985",
"text": "def eql?(other)\n self.class == other.class && value == other.value\n end",
"title": ""
},
{
"docid": "54105b30293a9c1e70e8676f68a427d3",
"score": "0.51937985",
"text": "def eql?(other)\n self.class == other.class && value == other.value\n end",
"title": ""
},
{
"docid": "063044a1692e33871bc4e07b866b8f0b",
"score": "0.51912534",
"text": "def old?\n\t\t@mutex.synchronize {\n\t\t\t@old\n\t\t}\n\tend",
"title": ""
},
{
"docid": "1e336d8de3e88b65532e8f422dc23529",
"score": "0.5185525",
"text": "def hasChanged?(key)\n\t\treturn self[key] != @oldConfig[key]\n\tend",
"title": ""
},
{
"docid": "572733d5029ed49e4870a6439b428fff",
"score": "0.5178065",
"text": "def data_changed?\n changes.include?(\"data\")\n end",
"title": ""
},
{
"docid": "eabba88b1aebf1e91fb6ea2caa1beeae",
"score": "0.51718336",
"text": "def geo_location_changed?\n self.changed.include?(\"lat\") || self.changed.include?(\"lng\")\n end",
"title": ""
},
{
"docid": "7c3a741594aeb194e05862c39271605a",
"score": "0.5150139",
"text": "def changed?\n !!parent\n end",
"title": ""
},
{
"docid": "442fa3671fe02aef7f582521cf4d60b0",
"score": "0.5141954",
"text": "def eql?(other)\n self.class.equal?(other.class) && value == other.value\n end",
"title": ""
},
{
"docid": "442fa3671fe02aef7f582521cf4d60b0",
"score": "0.5141954",
"text": "def eql?(other)\n self.class.equal?(other.class) && value == other.value\n end",
"title": ""
},
{
"docid": "161a6ad7453dd44aaa1c4d80bdf89b60",
"score": "0.513939",
"text": "def changed_notably?\n if @is_touch && changes_in_latest_version.empty?\n true\n else\n super\n end\n end",
"title": ""
},
{
"docid": "9d9f930d2bddb75355bd3512baaa43e1",
"score": "0.51379263",
"text": "def visibility_changed?\n !(@old_visible_value == visible)\n end",
"title": ""
},
{
"docid": "2e6729e6f614c408af6dd7554bcaec33",
"score": "0.51340616",
"text": "def changed?(attr=nil)\n @_hr_changed ||= Hash.new(false)\n return @_hr_changed[attr.to_sym] if attr\n return @_hr_changed.keys.count > 0\n end",
"title": ""
},
{
"docid": "2e6729e6f614c408af6dd7554bcaec33",
"score": "0.51340616",
"text": "def changed?(attr=nil)\n @_hr_changed ||= Hash.new(false)\n return @_hr_changed[attr.to_sym] if attr\n return @_hr_changed.keys.count > 0\n end",
"title": ""
},
{
"docid": "35193073c0ffe1dfacdb9707d41fb45d",
"score": "0.51309913",
"text": "def changed?\n @observer_state\n end",
"title": ""
},
{
"docid": "99be25f425389035fbfca001f44a2b0c",
"score": "0.51305",
"text": "def password_changed?\n orig_pw_hash = self.instance_variable_get(:@old_password_hash)\n self.new_record? || (!orig_pw_hash.nil? && orig_pw_hash != self.password_hash)\n end",
"title": ""
},
{
"docid": "4306aa960a8bf91fca12cd9acc093cae",
"score": "0.5103901",
"text": "def is_equal?(old_values,new_values,multivalued_field=false)\n new_values_split = (multivalued_field && new_values.class != Array && !new_values.blank?) ? new_values.to_s.split(\"|\") : new_values # if the user has indicated the first value is coming a special multivalued field entered as a single value, let's split along the delimiter\n compare_values1=self.to_array(old_values).collect{|val| val.to_s.strip.gsub(/\\r\\n?/, \"\\n\")}.delete_if(&:blank?).sort\n compare_values2=self.to_array(new_values_split).collect{|val| val.to_s.strip.gsub(/\\r\\n?/, \"\\n\")}.delete_if(&:blank?).sort\n compare_values1 == compare_values2\n end",
"title": ""
},
{
"docid": "41bb3872bec2a95e9a5850eb328cdbcb",
"score": "0.5086637",
"text": "def files_changed?\n # initialise variables for the \n new_snapshot = snapshot_filesystem\n has_changed = false\n\n # take a new snapshot and subtract this from the old snapshot in order to get forward changes\n # then add the snapshot to the oposite subtraction to get backward changes\n changes = (@snapshot.to_a - new_snapshot.to_a) + (new_snapshot.to_a - @snapshot.to_a)\n \n # determine the event for each change\n changes.each do |change|\n if @snapshot.keys.include? change[0]\n @changed = {change[0] => change[1]}\n @event = (new_snapshot.keys.include? change[0]) ? :change : :delete\n has_changed = true\n else\n @changed = {change[0] => change[1]}\n @event = :new\n has_changed = true\n end\n end\n \n # lets reset the snapshot so that we don't create a forever loop\n @snapshot = new_snapshot\n\n return has_changed\n end",
"title": ""
},
{
"docid": "48455f2e749b0d905765ba1402f57750",
"score": "0.5078674",
"text": "def attribute_previously_changed?(attr_name, **options) # :nodoc:\n mutations_before_last_save.changed?(attr_name.to_s, **options)\n end",
"title": ""
},
{
"docid": "965eddf90968c59bed47a0ec0b3d675f",
"score": "0.5077408",
"text": "def track_attribute _name, _new_value\n unless self.send(_name).eql?(_new_value)\n self.modified_attributes << _name.to_sym\n end\n end",
"title": ""
},
{
"docid": "6596b165cc7a66f682032720cad9779d",
"score": "0.50748885",
"text": "def change\n if work.genre_string.include? OLD_VALUE\n # << doesn't work on this property in all versions\n work.genre_string = work.genre_string.map { |s| s == OLD_VALUE ? NEW_VALUE : s }\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "fd4c6780a7d2104df626d709b96d8f63",
"score": "0.5062172",
"text": "def password_changed?\n !@new_password.blank?\n end",
"title": ""
},
{
"docid": "b15915858f19893e5cb85a5edf2b686c",
"score": "0.50483674",
"text": "def changed?; not pristine?; end",
"title": ""
},
{
"docid": "104d3522bee7b56eb553ad09cd6fd93a",
"score": "0.5048327",
"text": "def changed\n return added + removed unless added.nil? || removed.nil?\n return added unless added.nil?\n return removed unless removed.nil?\n end",
"title": ""
},
{
"docid": "54fa0fdcc6c7ec82007c3b8bac6763b2",
"score": "0.5038548",
"text": "def changed? tag=false\n if tag\n @changed_values.include? tag\n else\n !@changed_values.empty?\n end\n end",
"title": ""
},
{
"docid": "0882dc80a33483f7ce736e6acc7e5af1",
"score": "0.5037756",
"text": "def update_stock_on_update\n # What has changed?\n product_has_changed = product_changed? rescue false\n store_has_changed = store_changed? rescue false\n quantity_has_changed = quantity_changed? rescue false\n # Previous values\n product_prev = product_was rescue product\n store_prev = store_was rescue store\n quantity_prev = quantity_was rescue quantity\n # Stock\n if product_has_changed || store_has_changed\n # Current Stock\n if !update_stock(product, store, quantity, true)\n return false\n end\n # Roll back Previous Stock\n if !update_stock(product_prev, store_prev, quantity_prev, false)\n return false\n end\n elsif quantity_has_changed\n # Current Stock\n if !update_stock(product, store, quantity - quantity_prev, true)\n return false\n end\n end\n true\n end",
"title": ""
},
{
"docid": "2b93c7c13e086d2e4ef2bc602cb980db",
"score": "0.50348884",
"text": "def config_changed?\n self.class.find(id)&.to_config != to_config\n end",
"title": ""
},
{
"docid": "84c35aa26d7e3dcd1d466d00cf44bb33",
"score": "0.5025597",
"text": "def changed?(comparison)\n attributes.any? do |attribute, value|\n next unless comparison.key?(attribute)\n comparison[attribute] != value\n end\n end",
"title": ""
},
{
"docid": "9a68f52b2d9b60f03bc16a1d97533ce9",
"score": "0.5023253",
"text": "def has_changes?\n @has_changed_the_db\n end",
"title": ""
},
{
"docid": "2c48eb0f7a606defe8db7dc805249671",
"score": "0.50217694",
"text": "def changed?(olds, news) ; olds != news ; end",
"title": ""
},
{
"docid": "e61c428b2db89a93ec32ee8b0c970e8f",
"score": "0.5011929",
"text": "def ==(other)\n self.class == other.class && value == other.value\n end",
"title": ""
},
{
"docid": "9d3f3597c450f17482629345a0ece549",
"score": "0.5010161",
"text": "def core_changed?\n qtype_name_changed? || option_set_id_changed? || constraint_changed?\n end",
"title": ""
}
] |
9838e5b1e88ee33cab776cf421746212
|
fetchdata_google_blog fetches data from bing for the given kw of given category and stores it in DB
|
[
{
"docid": "c10f04094089ce25b50296e51a4de9de",
"score": "0.66019267",
"text": "def fetchdata_bing(kw,cat)\n\tputs \"#{Time.new}:fetching from bing...\"\n\tres = Hash.new\n\tqurl = \"http://api.bing.com/rss.aspx?Source=News&Market=en-US&Version=2.0&Query=\"\n\tqurlx = qurl + kw\n \tputs qurlx\n \thtml = fetch_link(qurlx) \t\n\tdoc = Nokogiri::XML(html)\n\tdoc.xpath(\"//item\").each do |it|\n#\t\tputs it.to_html\n\t\tres[\"title\"] = it.xpath(\"./title\").text\n#\t\tputs title\n\t\tlink = it.xpath(\"./link\").text\n\t\tres[\"link\"] = link\n\t\t#\t\tputs link\n\t\tdate = it.xpath(\"./pubDate\").text\n\t\tres[\"date\"] =DateTime.parse(date)\n#\t\tputs date\n#\t\tres[\"desc\"] = it.xpath(\"./description\").text\n#\t\ttt = it.xpath(\"./description\")\n\t\tres[\"desc\"] = Nokogiri::HTML(it.xpath(\"./description\").text).text\n\t\tres[\"source\"] = \"bing_news\"\n\t\tres[\"cat\"] = cat\n\t\tres[\"kw\"]\t = kw\n#\t\tputs res[\"desc\"]\n\t\tputs \"saving #{res['title']} ...\"\n\t\tsave_content(res)\n\tend\t\n\t\t\t\nend",
"title": ""
}
] |
[
{
"docid": "d750f69705d729e0e84807c493c5b27b",
"score": "0.7211806",
"text": "def fetchdata_google_blog(kw, cat)\n\tputs \"#{Time.new}:fetching from google_blog...\"\n\tres = Hash.new\n\tqurl = \"https://www.google.com/search?hl=en&tbm=blg&num=20&output=rss&q=\"\n\tqurlx = qurl + kw\n \tputs qurlx\n \thtml = fetch_link(qurlx) \t\n\tdoc = Nokogiri::XML(html)\n\tdoc.xpath(\"//item\").each do |it|\n#\t\tputs it.to_html\n\t\tres[\"title\"] = Nokogiri::HTML(it.xpath(\"./title\").text).text\n#\t\tputs title\n\t\tlink = it.xpath(\"./link\").text\n\t\tres[\"link\"] = link\n#\t\tputs link\n\t\tdate = it.xpath(\"./dc:date\").text\n\t\tres[\"date\"] =DateTime.parse(date)\n#\t\tputs date\n#\t\tres[\"desc\"] = it.xpath(\"./description\").text\n#\t\ttt = it.xpath(\"./description\")\n\t\tres[\"desc\"] = Nokogiri::HTML(it.xpath(\"./description\").text).text\n\t\tres[\"source\"] = \"google_blog\"\n\t\tres[\"cat\"] = cat\n\t\tres[\"kw\"]\t = kw\n#\t\tputs res[\"desc\"]\n\t\tputs \"saving #{res['title']} ...\"\n\t\tsave_content(res)\n\tend\t\n\t\t\t\nend",
"title": ""
},
{
"docid": "59838fef1d9eff030a2bcb393d245fc1",
"score": "0.6427573",
"text": "def fetchdata_google(kw,cat)\n\tputs \"#{Time.new}:fetching from google...\"\n\tres = Hash.new\n\tqurl = \"http://news.google.co.in/news?hl=en&um=1&ie=UTF-8&output=rss&q=\"\n\tqurlx = qurl + kw\n \tputs qurlx\n \thtml = fetch_link(qurlx) \t\n\tdoc = Nokogiri::XML(html)\n\tdoc.xpath(\"//item\").each do |it|\n#\t\tputs it.to_html\n\t\tres[\"title\"] = it.xpath(\"./title\").text\n#\t\tputs title\n\t\tlink = it.xpath(\"./link\").text\n\t\tx = link.split(\"url=\")\n\t\tres[\"link\"] = x[1]\n#\t\tputs link\n\t\tdate = it.xpath(\"./pubDate\").text\n\t\tres[\"date\"] =DateTime.parse(date)\n#\t\tputs date\n#\t\tres[\"desc\"] = it.xpath(\"./description\").text\n#\t\ttt = it.xpath(\"./description\")\n\t\tres[\"desc\"] = Nokogiri::HTML(it.xpath(\"./description\").text).text\n\t\tres[\"source\"] = \"google_news\"\n\t\tres[\"cat\"] = cat\n\t\tres[\"kw\"]\t = kw\n#\t\tputs res[\"desc\"]\n\t\tputs \"saving #{res['title']} ...\"\n\t\tsave_content(res)\n\tend\t\n\t\t\t\nend",
"title": ""
},
{
"docid": "f54dbf1602d231a3dba47bf0a99c807d",
"score": "0.6133117",
"text": "def fetch_type(category)\n\tkwfile = File.dirname(__FILE__)+\"/\"+ category+\".kw\"\n\tputs \"#{Time.new}: start #{kwfile} category\"\t\n\tcounter = 1\n\tfile = File.new(kwfile, \"r\")\n\twhile (kw = file.gets)\n\t\tkw = kw.chomp\n\t\tputs \"#{counter}: processing #{kw} ...\"\n\t\tfetchdata_google_blog(kw,category)\n\t\tfetchdata_yahoo(kw,category)\n\t\tfetchdata_bing(kw,category)\n\t\tfetchdata_google(kw,category)\n\t\t\n\t\tputs\n\t\tcounter = counter + 1\n\tend\n\tputs \"total #{counter-1} keywords processed for #{kwfile} category\"\n\tputs \"#{Time.new}: end #{kwfile} category\"\t\n\tputs\n\tfile.close\t\t\nend",
"title": ""
},
{
"docid": "81a02cbcc9c317a418c9204a368fcadc",
"score": "0.612516",
"text": "def search_mealdb_category(category)\n request_api(\n \"https://themealdb.p.rapidapi.com/filter.php?c=#{category}\"\n )\n end",
"title": ""
},
{
"docid": "8597dd9129ad3d612c47ab0f906a632d",
"score": "0.5826393",
"text": "def fetch_data(query); end",
"title": ""
},
{
"docid": "0c275717ea871bd60ecea70e931e84bf",
"score": "0.5659703",
"text": "def mealdb_url_category(category)\n request_api(\n \"https://themealdb.p.rapidapi.com/search.php?c=list\"\n )\n end",
"title": ""
},
{
"docid": "7c3b6b9e00e1cc478da3269d178db1cf",
"score": "0.56445926",
"text": "def eventbrite(category,city = 'nyc',amount = '100',page = false)\r\n eb_key = ApiSettings.eventbrite_key\r\n # for repeat query searches\r\n @e_brites = []\r\n\r\n # loop through each category to make a query\r\n if category == 'all' or category.empty? or category == 'reset'\r\n @all_cats.each do |ac, image|\r\n startDate = Time.parse(\"#{@weekend['all']['day']}\").strftime('%Y-%m-%d')\r\n endDate = Time.parse(\"#{@weekend['all']['night']}\").strftime('%Y-%m-%d')\r\n query = \"http://www.eventbrite.com/json/event_search?app_key=#{eb_key}&latitude=#{@cities[city][\"lat\"]}&longitude=#{@cities[city][\"lon\"]}&max=#{amount}&within=#{@cities[city][\"radius\"]}&category=#{ac}&date=#{startDate}%20#{endDate}\"\r\n e_array = get_http_response(query)\r\n if e_array\r\n e_array[\"events\"].push(image)\r\n @e_brites.push(e_array[\"events\"])\r\n else\r\n return nil\r\n end\r\n end\r\n else\r\n\r\n # run api query and filter by category\r\n @all_cats.each do |ac, image|\r\n # category id's are 1 char while day filters are spelled out\r\n if category == 'friday' or category == 'saturday' or category == 'sunday'\r\n # run query for particular day as param\r\n date = Time.parse(\"#{@weekend[category]['night']}\").strftime('%Y-%m-%d')\r\n query = \"http://www.eventbrite.com/json/event_search?app_key=#{eb_key}&latitude=#{@cities[city][\"lat\"]}&longitude=#{@cities[city][\"lon\"]}&max=#{amount}&within=#{@cities[city][\"radius\"]}&category=#{ac}&date=#{date}\"\r\n e_array = get_http_response(query)\r\n if e_array\r\n @e_brites.push(e_array[\"events\"])\r\n else\r\n return nil\r\n end\r\n else\r\n if image == category\r\n startDate = Time.parse(\"#{@weekend['all']['day']}\").strftime('%Y-%m-%d')\r\n endDate = Time.parse(\"#{@weekend['all']['night']}\").strftime('%Y-%m-%d')\r\n query = \"http://www.eventbrite.com/json/event_search?app_key=#{eb_key}&latitude=#{@cities[city][\"lat\"]}&longitude=#{@cities[city][\"lon\"]}&max=#{amount}&within=#{@cities[city][\"radius\"]}&category=#{ac}&date=#{startDate}%20#{endDate}\"\r\n e_array = get_http_response(query)\r\n if e_array\r\n @e_brites.push(e_array[\"events\"])\r\n else\r\n return nil\r\n end\r\n end\r\n end\r\n end\r\n end\r\n\r\n # filter the results through these fine methods\r\n count = 0\r\n @e_brites.each do |event|\r\n count = count + event.count - 1\r\n event.each do |e|\r\n if e[\"event\"] and e[\"event\"][\"venue\"]\r\n eb = e[\"event\"][\"num_attendee_rows\"]\r\n # manually set each popularity key by its num_attendee_rows data\r\n if eb < 10\r\n pop = 9\r\n elsif eb > 9 and eb < 20\r\n pop = 8\r\n elsif eb > 19 and eb < 30\r\n pop = 7\r\n elsif eb > 29 and eb < 40\r\n pop = 6\r\n elsif eb > 39 and eb < 50\r\n pop = 5\r\n elsif eb > 49 and eb < 60\r\n pop = 4\r\n elsif eb > 59 and eb < 70\r\n pop = 3\r\n elsif eb > 69 and eb < 80\r\n pop = 2\r\n elsif eb > 79\r\n pop = 1\r\n end\r\n # insert key value pair of imageMarker in hash\r\n e[\"event\"][\"mapImageMarker\"] = pop\r\n # insert popularity Measure value in hash\r\n e[\"event\"][\"popularityMeasure\"] = e[\"event\"][\"num_attendee_rows\"]\r\n end\r\n end\r\n end\r\n average = count / 9\r\n\r\n replace_dups(@e_brites,'eventbrite')\r\n\r\n # return the e_brites array with nested events\r\n return @e_brites\r\n end",
"title": ""
},
{
"docid": "b2db721142c397334adc9ce5ff79fb66",
"score": "0.5583759",
"text": "def fetchdata_yahoo(kw,cat)\n\tputs \"#{Time.new}:fetching from yahoo...\"\n\tres = Hash.new\n\tqurl = \"http://news.search.yahoo.com/rss?ei=UTF-8&p=\"\n\tqurlx = qurl + kw\n \tputs qurlx\n \thtml = fetch_link(qurlx) \t\n\tdoc = Nokogiri::XML(html)\n\tdoc.xpath(\"//item\").each do |it|\n#\t\tputs it.to_html\n\t\tres[\"title\"] = it.xpath(\"./title\").text\n#\t\tputs title\n\t\tlink = it.xpath(\"./link\").text\n\t\tx = link.split(\"\\/\\*\\*\")\n\t\tputs link\n#\t\tputs \" lenth is #{x.length}\"\n\t\tif x.length ==1\n\t\t\tres[\"link\"] = URI.unescape(link)\n\t\telse\n\t\t\tres[\"link\"] = URI.unescape(x[1])\n\t\tend\n\n\t\tdate = it.xpath(\"./pubDate\").text\n\t\tres[\"date\"] =DateTime.parse(date)\n#\t\tputs date\n#\t\tres[\"desc\"] = it.xpath(\"./description\").text\n#\t\ttt = it.xpath(\"./description\")\n\t\tres[\"desc\"] = Nokogiri::HTML(it.xpath(\"./description\").text).text\n\t\tres[\"source\"] = \"yahoo_news\"\n\t\tres[\"cat\"] = cat\n\t\tres[\"kw\"]\t = kw\n#\t\tputs res[\"desc\"]\n\t\tputs \"saving #{res['title']} ...\"\n\t\tsave_content(res)\n\tend\t\n\t\t\t\nend",
"title": ""
},
{
"docid": "603c4ea75f2d2912e1d91dd4d4bee448",
"score": "0.5527837",
"text": "def fetch_by_keyword\n\t# Fetch related keywords by the keyword\n\n \t@keyword = params[:keyword]\n\n\tif @keyword==nil\n\t\t@result = nil # Not found\n\telse\n\t\t@key = Keyword.find_by_name(@keyword.downcase)\n\t\t@categories = []\n\n\t\tif @key != nil\n\t\t\t@key.categories.each{ |k| @categories += [k.name] }\n\t\t\t@result = {:name => @key.name, :display_name => @key.display_name, :categories => @categories}\n\t\telse\n\t\t\t@result = nil\n\t\tend\n\n\tend\n\n\t# Return in the format of JSON object\n\trespond_to do |format|\n\t\tformat.json { render :json => @result }\n\tend\n\n end",
"title": ""
},
{
"docid": "e0323fa750a5e6fe90220d637166b4c4",
"score": "0.5518705",
"text": "def get_articles_by_pub(db, format_opt=\"short\", category)\n query = col_format[format_opt] + sql_from + sql_search_by_cat\n db.execute(query, category)\nend",
"title": ""
},
{
"docid": "7d5bc5a2d3cd18d32d9bd40ec6cff86c",
"score": "0.5477046",
"text": "def fetch_type(category)\n\tkwfile = File.dirname(__FILE__)+\"/\"+ category+\".kw\"\n\tputs \"#{Time.new}: start #{kwfile} category\"\t\n\tcounter = 1\n\tfile = File.new(kwfile, \"r\")\n\twhile (kw = file.gets)\n\t\tkw = kw.chomp\n\t\tputs \"#{counter}: processing #{kw} ...\"\n\t\tsearch_twits(kw,category)\n\t\tputs\n\t\tcounter = counter + 1\n\tend\n\tputs \"total #{counter-1} keywords processed for #{kwfile} category\"\n\tputs \"#{Time.new}: end #{kwfile} category\"\t\n\tputs\n\tfile.close\t\t\nend",
"title": ""
},
{
"docid": "7873dcabb6ddc3a68c64eb563f2eedc6",
"score": "0.547141",
"text": "def fetch\n\t# Open MySQL connection.\t\n\tdb = Mysql.new(MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE)\n\t# If not yet visited enouth keywords, fetch more (URLs and relative kws)\n\twhile @visited.length < MAX_KEYWORDS do\n\t\tkw = \"\"\n\t\tgot_kw = false\n\t\twhile not got_kw do\n\t\t\t@mutex.lock\n\t\t\tkw = @to_visit.shift\n\t\t\t@mutex.unlock\n\t\t\tif kw == nil then\n\t\t\t\tnext\n\t\t\tend\n\t\t\t@mutex.lock\n\t\t\tif not @visited.include?(kw)\n\t\t\t\tgot_kw = true\n\t\t\t\t@visited << kw\n\t\t\tend\n\t\t\t@mutex.unlock\n\t\tend\n\t\t\n\t\t# Open socket\n\t\t# TODO Exception handling.\n\t\tsocket = TCPSocket.open(HOST, PORT)\n\t\t# Read web content.\n\t\trequest = \"GET #{PATH}#{kw} HTTP/1.0\\r\\n\\r\\n\"\n\t\tsocket.print(request)\n\t\tresponse = socket.read\n\t\theaders,body = response.split(\"\\r\\n\\r\\n\", 2)\n\t\tsocket.close\n\t\tprint \"DEBUG-FETCHING #{kw}\\n\"\n\t\tcontent_handle(kw,body,db)\n\tend\n\t# Close MySQL connection.\n\tdb.close\nend",
"title": ""
},
{
"docid": "01799fd5d489b2b46de15cdac95b10b9",
"score": "0.5449109",
"text": "def download_data\n scraper_data = {}\n\n @data_to_get.each do |data_category|\n if /liked_(.*)/ =~ data_category\n argument = $1.to_sym # :tracks, :artists, :stations or :albums\n scraper_data[data_category] = @scraper.public_send(:likes, argument)\n else\n scraper_data[data_category] = @scraper.public_send(data_category)\n end\n end\n\n scraper_data\n end",
"title": ""
},
{
"docid": "235acb489538d8b1da28549710ecee0d",
"score": "0.5378585",
"text": "def fetch_blog(count=5)\n json = File.read(\"blog/_site/posts.json\")\n blog = JSON.parse(json)\n # import to database\n source = 'blog'\n imported = 0\n blog.each do |remote|\n # sanitise uids, stripping non-alphanumerics and leading slash\n uid = remote['id'].to_s.gsub(/[^A-Za-z0-9-]/,'-')[1..(remote['id'].to_s.length)]\n if Item.where('uid = ? and source = ?', uid, source).count.zero?\n sc = unique_shortcode\n Item.create(:uid => uid,\n :title => remote['title'],\n :body => remote['summary'],\n :url => remote['url'],\n :source => source,\n :shortcode => sc,\n :imported_at => Time.now,\n :created_at => remote['posted'])\n imported += 1\n end\n end\n imported\nend",
"title": ""
},
{
"docid": "90f07b84dae172c9fe0b3fa97bbafabf",
"score": "0.52903765",
"text": "def blog_search\n #@page = Page.find(:first, :conditions => ['page_name = ?', \"blog\"]) \n @results = []\n \n if params[:search].length > 30 then params[:search] = params[:search][0,30] end\n blogPosts = BlogPost.find(:all, :conditions => [\"blog_post_text like ? or title like ? \", \"%#{params[:search]}%\", \"%#{params[:search]}%\"])\n @results.concat(blogPosts)\n @words = params[:search].split(\" \")\n for word in @words\n if word.length > 15 then word = word[0,15] end\n blogPosts = BlogPost.find(:all, :conditions => [\"blog_post_text like ? or title like ?\", \"%#{word}%\", \"%#{word}%\"])\n @results.concat(blogPosts)\n end\n @results = @results.uniq \n \n #@page = Page.find(:first, :conditions => ['page_name = ?', \"blog\"])\n @blogCategories = BlogCategory.find(:all, :order => 'position')\n @blogPosts = @results\n @blogPostYear = BlogPost.getPostsYears()\n end",
"title": ""
},
{
"docid": "56e596c1d16a9684228ad6bf86ce6216",
"score": "0.5260495",
"text": "def load_report\n \t@report = GoogleKeyword.all_data(params[:page] || 1)\n end",
"title": ""
},
{
"docid": "d9b936f3737d149cfdcd85374685f270",
"score": "0.5230985",
"text": "def search_naver(category = 'news')\n\t\tquery = search_query\n\t\tquery = URI.encode(\"#{query}\")\n\n\t\tnaver_key = \"key=\" + SEARCH_KEY\n\t\tnaver_options = \"&query=#{query}&display=5&target=#{category}&sort=sim\"\n\t\tnaver_url = \"http://openapi.naver.com/search?#{naver_key}#{naver_options}\"\n\n\t\titems = Nokogiri::XML(open(naver_url)).xpath(\"//item\")\n\t\t\n\t\tnaver_blogs = []\n\t\titems.each do |item|\n\t\t\ttemp = Hash.new\n\t\t\ttemp[:title] = item.xpath(\"title\").text \n\t\t\ttemp[:link] = item.xpath(\"originallink\").text\n\t\t\ttemp[:description] = item.xpath(\"description\").text\n\t\t\ttemp[:pub_date] = item.xpath(\"pubDate\").text\n\t\t\tnaver_blogs << temp\n\t\tend\n\n\t\tnaver_blogs\n\tend",
"title": ""
},
{
"docid": "377d36e1fd84cd5d6936177548d39879",
"score": "0.52269995",
"text": "def posts\n $stderr.puts 'checking...'\n @cl.category(@category).limit(@max).fetch\n end",
"title": ""
},
{
"docid": "24b44f9e8df3265d0bca5280d169c87f",
"score": "0.5187096",
"text": "def fetchCats(dataDir, minConfidence)\n return NellELoad.allCategories(dataDir, minConfidence)\nend",
"title": ""
},
{
"docid": "1595b5d2b6a8b97322ae9fe95291defe",
"score": "0.51793295",
"text": "def fetch_category category_id\n category = \"\"\n data.site.categories.each do |id, c|\n if category_id == c.id\n category = c\n break\n end\n end\n category\n end",
"title": ""
},
{
"docid": "2fa3b206edd479d0ecf528f8f3047bb8",
"score": "0.5127483",
"text": "def blog_by_category\n @selectedCategory = BlogCategory.find(params[:category])\n #@page = Page.find(:first, :conditions => ['page_name = ?', \"blog\"])\n @blogCategories = BlogCategory.find(:all, :order => 'position')\n @blogPosts = @selectedCategory.blog_posts\n @blogPostYear = BlogPost.getPostsYears()\n blog_calculate_pagination() \n render :action => 'blog'\n end",
"title": ""
},
{
"docid": "90062739709809ef5fb459b909193ee7",
"score": "0.51178193",
"text": "def category\n @category_id = params[:category_id]\n response = HTTParty.get('https://www.boardgameatlas.com/api/search?categories=' + @category_id + '&order_by=name&ascending=true&client_id=' + ENV['CLIENT_ID'])\n @boardgames = response[\"games\"]\n end",
"title": ""
},
{
"docid": "c72628a1c73ff2dc5f4c453a7270dfe5",
"score": "0.50823003",
"text": "def google\n feed = \"\"\n xml = Builder::XmlMarkup.new(:target => feed, :indent => 1)\n# Product.find(:all, :conditions => [\"status = ?\", \"Y\"]).each do |p|\n xml.instruct!\n xml.feed \"xmlns\" => \"http://www.w3.org/2005/Atom\", \"xmlns:g\" => \"http://base.google.com/ns/1.0\",\n \"xmlns:batch\" => \"http://schemas.google.com/gdata/batch\" do\n Product.find_all_by_status(\"Y\").each do |p|\n# p=Product.find(3040)\n if !p.category.nil?\n case p.category.id\n when 1,10,12,14,16,217\n xml.entry do\n xml.batch :id do xml.text! p.id.to_s end\n xml.batch :operation, \"type\" => \"insert\"\n xml.title(p.name)\n xml.id(p.id.to_s)\n xml.link :rel => \"alternate\", :type => \"text/html\", :href => \"http://www.theprinterdepot.net/#{p.url}\"\n xml.summary(p.description)\n xml.author \"The Printer Depot\"\n\n xml.g :item_type do xml.text! \"products\" end\n xml.g :brand do xml.text! p.brand.name end\n xml.g :price_units do xml.text! \"USD\" end\n xml.g :model_number do xml.text! p.model end\n xml.g :condition do xml.text! p.condition end\n xml.g :image_link do xml.text! \"http://www.theprinterdepot.net/images/products/#{p.model}_thumb.jpg\" end\n xml.g :price do xml.text! p.price(\"customer\").to_s end\n xml.g :department do xml.text! p.category.text end\n xml.g :product_type do xml.text! p.category.text end\n end\n end\n else\n end\n end\n end\n\n send_to_google(feed)\n # puts data\n\nend",
"title": ""
},
{
"docid": "1adf8cfe3c13090dcc3586e8aa9c955c",
"score": "0.5068227",
"text": "def get_by_category cid, flg\n exec_query(flg, set_params(cid, nil))\n end",
"title": ""
},
{
"docid": "d3563f90b0c698c6ae0ed4dcad8af117",
"score": "0.5048988",
"text": "def retrieve_data\n # Define the URL\n url = 'http://api.nytimes.com/svc/search/v2/articlesearch.json?q='\n url += 'science'\n url += '&sort=newest&page=1&api-key=4368bba38fc93f9f546ca5a320bafad0%3A13%3A72738011'\n\n # Define the HTTP object\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port)\n\n # Get the response\n response = http.get(uri)\n\n # Parse the response body\n forecast = JSON.parse(response.body)\n\n # Start parsing\n forecast['response']['docs'].each do |each_article|\n # If the title of thie article matches the title of the last saved article,\n # stop scraping to avoid from saving duplicates in database\n if !@last_title.nil? && @last_title.eql?(each_article['headline']['main'])\n break\n end\n\n # If thie article is already stored then ignore\n next if Article.find_by(title: each_article['headline']['main'])\n\n # Try to get the author of this article\n # If any error occurs doing it, set author as nil\n begin\n author = ''\n each_article['byline']['person'].each do |person|\n author += person['firstname'] + ' '\n author += person['lastname']\n break\n end\n rescue\n author = nil\n end\n\n # If the length of the author is zero, set it as nil\n author = nil if !author.nil? && author.length == 0\n\n # Author field is sometimes an empty array, prevent a TypeError\n # Standardize the author input\n # COMMENTED OUT BECAUSE THIS USES `each_article['byline']` WHICH IS NOT AN ACCURATE\n # REPRESENTATION OF AUTHOR (eg. 'The Associated Press')\n # author = each_article['byline'].is_a?(Array) ?\n # nil : each_article['byline']['original'].sub('By ', '').split.map(&:capitalize).join(' ')\n\n # Get the largest image\n image = each_article['multimedia'] != [] ?\n url_of_largest_image(each_article['multimedia']) : nil\n\n # Get all the keywords to use as tags\n keywords = []\n each_article['keywords'].each do |keyword|\n keywords << keyword['value']\n end\n keywords = keywords.join(',')\n\n # Make a template dictionary to put @articles\n temp = {\n author: author,\n title: each_article['headline']['main'],\n summary: each_article['snippet'],\n image: image,\n date_time: DateTime.parse(each_article['pub_date'].to_s),\n link: each_article['web_url'],\n categories: keywords\n }\n\n # put this article into the array of articles\n @articles << temp\n end\n end",
"title": ""
},
{
"docid": "5738093163132ee4998c1af1f38afc77",
"score": "0.50438726",
"text": "def retrieve_comments\n NotLoggedInError.new(\"You aren't logged into Blogger.\").raise unless @blog.account.authenticated?\n \n path = \"/feeds/#{@blog.id}/#{@id}/comments/default\"\n \n resp = GoogleAuth.get(path, @blog.account.auth_token)\n \n raise Blogger::RetrievalError.new(\"Error while retrieving comments for post id ##{@id}: #{resp.message}\") unless resp.code.eql? '200'\n feed = Atom::Feed.parse(resp.body)\n \n @comments = []\n feed.entries.each do |entry|\n @comments << Comment.new(:atom => entry, :post => self)\n end\n @comments\n end",
"title": ""
},
{
"docid": "027e531c1dd2cb37922a39b39afeee3f",
"score": "0.50366664",
"text": "def fetch_category\n category_list\n puts \"TYPE THE ID OF WHAT YOU WANT TO SEE IN DETAIL\"\n fetch = gets.to_i\n result = Category.find(\"categories\", fetch)\n result.display_attributes\n end",
"title": ""
},
{
"docid": "41d167487311616f1128785c954c92dd",
"score": "0.50089103",
"text": "def retrieve_data\n # Define the URL\n url = 'http://content.guardianapis.com/search?q=food&api-key=uggudpb34qwz47bxb3rn7e4q&page=1&page-size=50'\n start_date = (Date.today - 7).strftime('%Y-%m-%d')\n end_date = (Date.today).strftime('%Y-%m-%d')\n url += '&from-date=' + start_date + '&to-date=' + end_date\n\n # Define the HTTP object\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port)\n\n # Get the response\n response = http.get(uri)\n\n # Parse the response body\n forecast = JSON.parse(response.body)\n\n # Start parsing\n forecast['response']['results'].each do |each_article|\n # If the title of thie article matches the title of the last saved article,\n # stop scraping to avoid from saving duplicates in database\n break if !@last_title.nil? && @last_title.eql?(each_article['webTitle'])\n\n # If thie article is already stored then ignore\n next if Article.find_by(title: each_article['webTitle'])\n\n # Make a template dictionary to put in @articles\n temp = {\n author: nil,\n title: each_article['webTitle'],\n summary: nil,\n image: nil,\n date_time: DateTime.parse(each_article['webPublicationDate'].to_s),\n link: each_article['webUrl'],\n categories: each_article['sectionId']\n }\n\n # put this article into the array of articles\n @articles << temp\n end\n end",
"title": ""
},
{
"docid": "f09077fff0c40fc3709f750f7697d586",
"score": "0.5004067",
"text": "def get_input_digg(stories) #get stories from Digg\n response = JSON.parse(RestClient.get 'http://digg.com/api/news/popular.json')\n response['data']['feed'].each do |story|\n story[:title] = story['content']['title_alt']\n story[:category] = story['content']['tags'][0]['display']\n story[:upvotes] = calculate_upvotes(story[:title], story[:category])\n stories << { s_title: story[:title], s_story: story[:category], s_upvotes: story[:upvotes]}\n end\n stories \nend",
"title": ""
},
{
"docid": "2835e36765e50db8491c2b112c2aee9c",
"score": "0.5001063",
"text": "def get_blog_posts(json_data)\n blog_posts = {}\n json_data.each do |record|\n blog = {\n id: record[\"id\"].to_i,\n title: record[\"title\"],\n summary: record[\"summary\"],\n posted: DateTime.parse(record[\"posted\"]),\n user_id: record[\"author\"][\"id\"]\n }\n blog_posts[blog[:id]] = blog\n end\n\n return blog_posts\nend",
"title": ""
},
{
"docid": "73e5d56e15ba5451f5bf86f55cdaa98f",
"score": "0.4999803",
"text": "def fetch_raw_data(query); end",
"title": ""
},
{
"docid": "818258b05ee3bee1ed4a1f11bba390f5",
"score": "0.49921215",
"text": "def get_keys_by_keyword(keyword)\n return nil if not keyword\n puts \"% Downloading citations for keyword #{keyword}.\" if @options.verbose\n\n dblpkeys = []\n body = fetch_body(DBLP_MIRROR + \"index.php?query=#{keyword}&qp=H1.60\")\n body.each do |line|\n hits = $1 if line =~ /^\\s*AC\\.result\\.H_boxes\\[1\\]=(.+)$/\n hits.gsub(/href=\\\\\"#{DBLP_BIBTEX}([^\\\\]+)\\\\\"/) {|l| dblpkeys << $1} if hits\n end\n return dblpkeys\n end",
"title": ""
},
{
"docid": "9abf839f50b0a5a555536a44efe6c9b1",
"score": "0.4989322",
"text": "def get_worldcat_recs_by_query(query, num_records = 1)\n response = worldcat_conn.get do |req|\n req.params['query'] = query\n req.params['maximumRecords'] = num_records.to_s\n req.params['servicelevel'] = 'full'\n req.params['sortKeys'] = 'LibraryCount,,0'\n req.params['wskey'] = WORLDCAT_API_KEY\n req.params['frbrGrouping'] = 'off'\n end\n return nil unless response.body =~ /<recordData>/\n records_from_record_body(response.body)\nend",
"title": ""
},
{
"docid": "a4a1fbb845a46aa0f16a9767e49e7cee",
"score": "0.49885076",
"text": "def get_reddit_data(dataset_tag=\"main\")\n `mkdir -p #{project_folder}/data/baumgartner/submissions`\n `mkdir -p #{project_folder}/data/baumgartner/comments`\n submission_files(dataset_tag).each do |year, months|\n months.each do |month|\n get(\"http://files.pushshift.io/reddit/submissions/RS_#{year}-#{month}.bz2\", \"data/baumgartner/submissions\")\n end\n end\n comment_files(dataset_tag).each do |year, months|\n months.each do |month|\n get(\"http://files.pushshift.io/reddit/comments/RC_#{year}-#{month}.bz2\", \"data/baumgartner/comments\")\n end\n end\n if @full\n get_missing_data(dataset_tag)\n end\n end",
"title": ""
},
{
"docid": "7d1db6859269ebccef742532df212692",
"score": "0.49830866",
"text": "def fetch(permalink, kclass_name)\n get_json_response(api_url + \"#{kclass_name}/#{permalink}\")\n end",
"title": ""
},
{
"docid": "29b3a113a42a8f436f6e95241cabc620",
"score": "0.49823505",
"text": "def get_category_urls\n raw_data = RestClient.get('http://www.thecocktaildb.com/api/json/v1/1/list.php?c=list')\n category_data = JSON.parse(raw_data)\n base_url = 'http://www.thecocktaildb.com/api/json/v1/1/filter.php?c='\n category_urls = []\n category_data['drinks'].each do |category|\n category_urls << (base_url + category['strCategory'])\n end\n category_urls\nend",
"title": ""
},
{
"docid": "95f1333d7fd1a1dd8731b1917d5f8f74",
"score": "0.49714154",
"text": "def content_handle(kw,content,db)\n\n\t# Put kw into Database\n\tdb_result = db.query(\"INSERT INTO #{KW_TBL_NAME}(keyword) VALUES(\\\"#{kw}\\\")\")\n\t\n\t# Get more keywords\n\tresult_div = /<div id=\\\"rs\\\">(.*?)<\\/div><div id=/m.match(content) # Match <div id = \"rs\">\n\tif not result_div.respond_to?(\"[]\") then return end\n\tresult_kw = result_div[1].scan(/<a.*?>(.*?)<\\/a>/m)\t\t# Match keywords\n\t# Put keywords into to_visit.\n\tif result_kw.respond_to?(\"each\") and @to_visit.length <= MAX_TO_VISIT \n \tresult_kw.each do |rkw|\n\t\t\t@mutex.lock\n \t@to_visit << rkw\n\t\t\t@mutex.unlock\t\n\t\t\tputs \"Got kw: #{rkw}\\n\"\n \tend\n\tend\n\n\t# Get search results, URLs and titles\n\t# and put them into database\n\turls_h3 = content.scan(/<h3 class=\\\"t.*?>(.*?)<\\/h3>/m) # Match all <h3> tags.\n\tif urls_h3.respond_to?(\"each\")\n \turls_h3.each do |url_h3|\n \turl_match = /(http:\\/\\/.*?)\\\"/.match(url_h3[0])\n\t\t\tif not url_match.respond_to?(\"[]\") then next end\n\t\t\turl = url_match[1]\n \ttitle_match = />(.*?)<\\/a>/.match(url_h3[0])\n \t\tif not title_match.respond_to?(\"[]\") then next end\n\t\t\ttitle = title_match[1].gsub(\"<em>\",\"\").gsub(\"</em>\",\"\")\n\t\t\tprint title\n \tprint \"\\n\"\n \tprint url\n \tprint \"\\n\\n\"\n\t\t\t# Put url into database\n\t\t\ttitle = Mysql.escape_string(title);\n\t\t\turl = Mysql.escape_string(url);\n\t\t\tdb.query( \"INSERT INTO #{URL_TBL_NAME}(keyword, title, url) VALUES(\\'#{kw}\\',\\'#{title}\\',\\'#{url}\\')\" )\n \tend\n\tend\t\n\nend",
"title": ""
},
{
"docid": "ef5b70f56c391ff38d1aa71c7819aaf3",
"score": "0.49688584",
"text": "def fetch_recipe(meal_category, event)\n @recipies = search_mealdb_category(meal_category) # fetch array of recipes by search category\n @recipe = @recipies[rand(0...@recipies.length)] # Get one random recipe in the array\n @my_recipe = get_recipe_by(@recipe[\"idMeal\"]) # fetch recipe details with the id\n save_recipe(@my_recipe, event) \n end",
"title": ""
},
{
"docid": "54a4d8eab7043bd2852db86c76ba589b",
"score": "0.49651736",
"text": "def power_search_content(category_id)\r\n JSON.parse(api_get('PowerSearchContent.egg', '0', \"#{category_id}/-1\").body)\r\n end",
"title": ""
},
{
"docid": "c47eaace2a9cbe68127227c5685b2cf6",
"score": "0.4964826",
"text": "def blog\n feed_url = 'http://www.mysociety.org/category/projects/whatdotheyknow/feed/'\n all_url = 'http://www.mysociety.org/category/projects/whatdotheyknow/'\n @output = ''\n content = open(feed_url).read\n @data = XmlSimple.xml_in(content)\n @channel = @data['channel'][0]\n @items = @channel['item']\n\n @feed_autodetect = [ { :url => @channel['link'][0]['href'], :title => \"WhatDoTheyKnow blog\"} ]\n end",
"title": ""
},
{
"docid": "79d8319dc75809341611afae74d1d6d2",
"score": "0.49645546",
"text": "def fetch\n fetch_data_by_key(:data)\n end",
"title": ""
},
{
"docid": "3b75d9e33099e3e04af9b5c6d47add46",
"score": "0.4955652",
"text": "def categoryPost(category)\n @currentPost.where(:category => category).to_hash(:title, :content)\n end",
"title": ""
},
{
"docid": "e5d9733d1929eb60aa67121f0143b8e0",
"score": "0.49473682",
"text": "def create\n keyword_col = params[:keyword_column]\n \n arr_key = keyword_col[:keyword].split(\",\")\n \n arr_key.each do |key|\n create_or_update_feed_info(key,params[:category])\n end\n keyword = KeywordColumn.find_by_user_id_and_feed_account_id(current_user.id, keyword_col[:feed_account_id])\n unless keyword\n @keyword_column = KeywordColumn.create(keyword_col)\n else\n keyword.update_attributes(params[:keyword_column])\n @keyword_column = keyword.reload\n end\n respond_to do |format|\n if @keyword_column\n respond_to_do(format, @keyword_column)\n else\n respond_error_to_do(format,@keyword_column,\"new\")\n end\n end\n end",
"title": ""
},
{
"docid": "6f5b1199df94a0f382a0f5270eb32454",
"score": "0.4901133",
"text": "def fetch_categories\r\n c_url = BASE_URL + \"categories/list?\" + \"app_key=\" + API_KEY\r\n\r\n uri = URI.parse(c_url)\r\n body = uri.read\r\n resp = Net::HTTP.get_response(uri)\r\n data = JSON.parse(resp.body)\r\n\r\n categories = data[\"category\"]\r\n # binding.pry\r\n categories.each do |c|\r\n Category.new(c[\"name\"])\r\n end\r\n end",
"title": ""
},
{
"docid": "cdeb383965ae89ddcec78a5517071953",
"score": "0.4861291",
"text": "def load_ad_cat_datas\n # load main categories\n @ad_root_cats = Category.roots.order(:name) \n @root_cat_options = @ad_root_cats.map{|root| [root.name,root.id]}\n \n # load subcategories\n get_sub_categories(@ad_root_cats.first)\n end",
"title": ""
},
{
"docid": "9813fe31bee5445f60731fd9247468d8",
"score": "0.48590344",
"text": "def category\n key = params['p']\n @categories = Category.search(key)\n end",
"title": ""
},
{
"docid": "329a12052be3a53da6c7547c5766e482",
"score": "0.48580265",
"text": "def run\n query = get_user_input\n url = \"https://www.googleapis.com/books/v1/volumes?q=#{query}\"\n book_data = fetch_data(url)\n display_books(book_data)\nend",
"title": ""
},
{
"docid": "809a1e9bb549bb5333c1d1fa90b9d1ed",
"score": "0.48524788",
"text": "def load_blog\n feed = Array.new\n articles = Article.all.order(created_at: :desc).limit(5)\n articles.each do |item|\n feed.push(item.generate_metadata)\n end\n @blog = feed\n end",
"title": ""
},
{
"docid": "d6101a301c8aae3479876c1ae219c469",
"score": "0.4852034",
"text": "def collect_places_by_city_sublocality_category(city_code, sublocality, category_name)\n \n name_address_mapping = {}\n \n #VCR.use_cassette(\"collect_places_by_city_sublocality_category_#{city_code}_#{sublocality}_#{category_name}\") do\n\n \n\n \n # get 'total pages' info, find the content with max \n # TODO: this can be done when getting the first page of the list(query result).\n url = page_url_for_city_sublocality_category(1, city_code, sublocality, category_name )\n\n puts \"[INFO] starting page ... #{url}\"\n max_page = helper_find_total_page_num(url)\n puts \"[INFO] max page found .... #{} \"\n \n if max_page > $DDMAP_PAGINATION_RESULT_LIMIT\n puts \"[INFO] #{max_page} pages of data found!\"\n puts \"---------------------------------------------------------------\"\n puts \"ddmap only allows 25 pages of query results. Following info may be partial.\"\n puts \"link(starting page): #{url} \"\n puts \"---------------------------------------------------------------\"\n \n \n # NOTE:because searching by locality has limited pages for grabing, we have to dig down to sub area for all the district\n subareas = helper_find_subarea_name_links(url)\n puts subareas\n \n # print out self made links\n subareas.each do | area|\n # TODO: see if memory is limited or not, we create many doc in each method call, otherwise, employ some kind of cassette mechanism for limiting web access.\n \n # first page\n first_page_link = page_url_for_city_subarea_category(1, city_code, area, category_name)\n puts \"[Info] Processing sub area via #{first_page_link}\" if $VERBOSE\n mappings_of_first_page = helper_process_name_address_mapping_for_url(first_page_link)\n name_address_mapping.merge!(mappings_of_first_page)\n # other pages\n paginations = helper_find_total_page_num(first_page_link)\n puts \"[Info] Found pages #{paginations} (#{first_page_link}, CITY_CODE: #{city_code}, sub area: #{area}, category: #{category_name})\" if $VERBOSE\n \n (2..paginations).each do | page_num |\n other_page_link = page_url_for_city_subarea_category(page_num, city_code, area, category_name)\n puts \"[Info] Processing sub area of page #{page_num}, via#{other_page_link}\" if $VERBOSE\n mappings_of_other_pages = helper_process_name_address_mapping_for_url(other_page_link)\n name_address_mapping.merge!(mappings_of_other_pages)\n \n \n puts name_address_mapping\n # raise \"Intentional break!\"\n \n end\n end\n else\n \n # NOTE: pagination under the limit, following search will not get sub area(one level deeper beyond the sublocality)\n puts \"[INFO] #{max_page} pages of data found! Processing ...\"\n \n # grabbing the first page which we already got when we try to find the total page\n mappings_of_first_page = helper_process_name_address_mapping_for_url(url)\n name_address_mapping.merge!(mappings_of_first_page)\n \n # grabbing the following page\n pages_to_grab = [max_page, $DDMAP_PAGINATION_RESULT_LIMIT].min\n (2..pages_to_grab).each do |page_num|\n puts \"processing page .... #{page_num}\" if $VERBOSE\n url = page_url_for_city_sublocality_category(page_num, city_code, sublocality, category_name )\n \n mappings = helper_process_name_address_mapping_for_url(url)\n name_address_mapping.merge!(mappings)\n end\n end\n \n #end # of vcr recording\n\n name_address_mapping\nend",
"title": ""
},
{
"docid": "a2542bbf4d54fccffe84a1c75d91d7a8",
"score": "0.48482376",
"text": "def get_all_infos page, category\n p \"get all...\"\n\n link = page.uri.to_s\n index = 1\n \n begin\n p page.uri.to_s\n p page.search('#dtlP a')\n\n list_items = page.search('#dtlP a')\n list_items.each_with_index{|item,index|\n p item\n\n href = item[:href]\n page = @agent.get(href)\n desc= page.search('.chitiet').first.text\n img = page.search('.ptdl img').first[:src]\n date = page.search('.ptd1').first.text\n\n # get all items in page -------------------\n info = page.search('.bd i')\n id = info[0].text\n count = info[1].text\n price = info[2].text\n area = info[3].text\n\n info = page.search('.bd b')\n yc = info[0].text\n record = {\n :id => id,\n :count => count,\n :price => price,\n :area => area,\n :yc => yc,\n :desc => desc,\n :img => img,\n :date => date\n }\n\n begin\n ScraperWiki.save_sqlite([], record)\n rescue\n end\n }\n index += 1\n page = @agent.get(link.gsub(\".html\",\"\") + \"/page-#{index}.html\")\n end while list_items.count > 0\nend",
"title": ""
},
{
"docid": "a2542bbf4d54fccffe84a1c75d91d7a8",
"score": "0.48482376",
"text": "def get_all_infos page, category\n p \"get all...\"\n\n link = page.uri.to_s\n index = 1\n \n begin\n p page.uri.to_s\n p page.search('#dtlP a')\n\n list_items = page.search('#dtlP a')\n list_items.each_with_index{|item,index|\n p item\n\n href = item[:href]\n page = @agent.get(href)\n desc= page.search('.chitiet').first.text\n img = page.search('.ptdl img').first[:src]\n date = page.search('.ptd1').first.text\n\n # get all items in page -------------------\n info = page.search('.bd i')\n id = info[0].text\n count = info[1].text\n price = info[2].text\n area = info[3].text\n\n info = page.search('.bd b')\n yc = info[0].text\n record = {\n :id => id,\n :count => count,\n :price => price,\n :area => area,\n :yc => yc,\n :desc => desc,\n :img => img,\n :date => date\n }\n\n begin\n ScraperWiki.save_sqlite([], record)\n rescue\n end\n }\n index += 1\n page = @agent.get(link.gsub(\".html\",\"\") + \"/page-#{index}.html\")\n end while list_items.count > 0\nend",
"title": ""
},
{
"docid": "a2542bbf4d54fccffe84a1c75d91d7a8",
"score": "0.48482376",
"text": "def get_all_infos page, category\n p \"get all...\"\n\n link = page.uri.to_s\n index = 1\n \n begin\n p page.uri.to_s\n p page.search('#dtlP a')\n\n list_items = page.search('#dtlP a')\n list_items.each_with_index{|item,index|\n p item\n\n href = item[:href]\n page = @agent.get(href)\n desc= page.search('.chitiet').first.text\n img = page.search('.ptdl img').first[:src]\n date = page.search('.ptd1').first.text\n\n # get all items in page -------------------\n info = page.search('.bd i')\n id = info[0].text\n count = info[1].text\n price = info[2].text\n area = info[3].text\n\n info = page.search('.bd b')\n yc = info[0].text\n record = {\n :id => id,\n :count => count,\n :price => price,\n :area => area,\n :yc => yc,\n :desc => desc,\n :img => img,\n :date => date\n }\n\n begin\n ScraperWiki.save_sqlite([], record)\n rescue\n end\n }\n index += 1\n page = @agent.get(link.gsub(\".html\",\"\") + \"/page-#{index}.html\")\n end while list_items.count > 0\nend",
"title": ""
},
{
"docid": "a2542bbf4d54fccffe84a1c75d91d7a8",
"score": "0.48482376",
"text": "def get_all_infos page, category\n p \"get all...\"\n\n link = page.uri.to_s\n index = 1\n \n begin\n p page.uri.to_s\n p page.search('#dtlP a')\n\n list_items = page.search('#dtlP a')\n list_items.each_with_index{|item,index|\n p item\n\n href = item[:href]\n page = @agent.get(href)\n desc= page.search('.chitiet').first.text\n img = page.search('.ptdl img').first[:src]\n date = page.search('.ptd1').first.text\n\n # get all items in page -------------------\n info = page.search('.bd i')\n id = info[0].text\n count = info[1].text\n price = info[2].text\n area = info[3].text\n\n info = page.search('.bd b')\n yc = info[0].text\n record = {\n :id => id,\n :count => count,\n :price => price,\n :area => area,\n :yc => yc,\n :desc => desc,\n :img => img,\n :date => date\n }\n\n begin\n ScraperWiki.save_sqlite([], record)\n rescue\n end\n }\n index += 1\n page = @agent.get(link.gsub(\".html\",\"\") + \"/page-#{index}.html\")\n end while list_items.count > 0\nend",
"title": ""
},
{
"docid": "3aaf86ec7e90d660c24ec2ab0c07858d",
"score": "0.4839344",
"text": "def search_google_books\n @google_books_results = GoogleBooks.search(params[:google_books_query], country: 'uk')\n end",
"title": ""
},
{
"docid": "f425f26af3bdbb5a14501feb5d9773b2",
"score": "0.48391598",
"text": "def getFeed\n login_user_id = params[:my_id].to_i\n login_user = User.find(login_user_id)\n\n hobby_id = params[:hobby_id].to_i\n\n limit_num = 20\n\n articles_new_hash = make_articles_hash(Article.where(hobby_id: hobby_id).order('id DESC').limit(limit_num), login_user)\n\n articles_hot_hash = make_articles_hash(Article.where(hobby_id: hobby_id).where('published_at >= ?', 1.weeks.ago).limit(limit_num), login_user)\n\n articles_legend_hash = make_articles_hash(Article.where(hobby_id: hobby_id).order('point DESC').limit(limit_num), login_user)\n\n if articles_new_hash.blank? && articles_hot_hash.blank? && articles_legend_hash.blank?\n res = {\n result: false,\n data: nil\n }\n else\n res = {\n result: true,\n data: [\n {\n segment_type: 'new',\n articles: articles_new_hash\n },\n {\n segment_type: 'hot',\n articles: articles_hot_hash\n },\n {\n segment_type: 'legend',\n articles: articles_legend_hash\n }\n ]\n }\n end\n\n render json: res\n end",
"title": ""
},
{
"docid": "18ec8f9ec85383b35d64bceaf32575f3",
"score": "0.48362657",
"text": "def fetch_posts(params = {})\n @client.authorize if @client.expiration <= Time.now\n @client.get(SEARCH_URL, @cmn_params.merge(params))\n end",
"title": ""
},
{
"docid": "f713335baf1c1a1f3e54b1629b11bada",
"score": "0.48300293",
"text": "def campaign_name_bid\n #campaigns details from Master db\n begin\n dbconn = DBI.connect(\"DBI:MYSQL:zestadz_analytics:#{@analytics_ip}\", WriteDBServer::USERNAME, WriteDBServer::PASSWORD)\n sql=\"select id,campaign_name,bid_range_avg from campaigns\"\n campaigns = dbconn.execute(sql)\n campaign_details=Hash.new\n rescue Exception => e\n puts \"error in dbconn :: #{e}\"\n ensure\n dbconn.disconnect unless dbconn==nil\n dbconn=nil\n end\n sql=nil\n while campaign = campaigns.fetch do\n campaign_details.store(campaign['id'],[campaign['campaign_name'],campaign['bid_range_avg']])\n end\n campaigns=nil\n return campaign_details\n end",
"title": ""
},
{
"docid": "66edc44df6380d33f8ab027508dfc1bb",
"score": "0.48188877",
"text": "def get_category_tags\n @textbooks = Tag.find_by_id(88)\n @appliances = Tag.find_by_id(4)\n @sports = Tag.find_by_id(27)\n @electronics = Tag.find_by_id(36)\n @clothing = Tag.find_by_id(40)\n @books = Tag.find_by_id(21)\n @furniture = Tag.find_by_id(3)\n @full_post_categories = PostCategory.all\n @browse_by_array_tags = [@appliances, @sports, @electronics, @clothing, @books, @furniture, @textbooks]\n @browse_by_array = []\n @browse_by_array_tags.each do |a|\n if !a.nil?\n @browse_by_array << a\n end\n end\n @full_post_categories.each do |c|\n @browse_by_array << c\n end\n \n @browse_by_array.sort! {|a,b| (a.name.downcase <=> b.name.downcase) || nil}\n end",
"title": ""
},
{
"docid": "75d81f38921f025fe4be0f6384acd284",
"score": "0.48167276",
"text": "def image_grab(event_title, city, category)\n suckr = ImageSuckr::GoogleSuckr.new\n query = event_title + \" \" + category #Appending city name to increase positive image result\n grabbed_image = suckr.get_image_url({\"q\" => query.to_s, \"imgsz\" => \"medium\", \"rsz\" => \"1\"})\n end",
"title": ""
},
{
"docid": "3d129295a4ef84c980045112dbf03dae",
"score": "0.48110065",
"text": "def category(cat = 'all')\n if cat !~ /\\ball\\b/i\n re = /\\b#{cat}\\b/i\n @feeds.select { |feed| feed['category'] =~ re }\n else\n @feeds\n end\n end",
"title": ""
},
{
"docid": "0c53f3a1a678a555e1fcf9b458406d6d",
"score": "0.48067614",
"text": "def fetch_data\n records = Object.const_get(model_class_name).all\n records.map { |k| { title: k.try(:name) || k.try(:title), id: k.try(:permalink) || k.try(:slug) || k.try(:id) } }\n end",
"title": ""
},
{
"docid": "10fb6223b9d395506fa7b0fd6b53fbed",
"score": "0.47930878",
"text": "def fx_blogthis\n\n logger.info(\"Blog Info :#{params['data']}\")\n result = JSON.parse(params['data'])\n if(result['id']==0)\n @blog=Blog.new()\n else\n @blog=Blog.find(result['id'])\n end\n @blog['blog_type']=result['type']\n @blog['blog_type_id']=result['blog_type_id']\n @blog['added_date']=result['date']\n @blog['user_id']=session[:hmm_user]\n @blog['title']=result['title']\n @blog['description']=result['description']\n if @blog.save\n render :text => @blog.id\n else\n render :text => \"0\"\n end\n\n end",
"title": ""
},
{
"docid": "ac670ebe6cf8106841522a415bf7672a",
"score": "0.47912604",
"text": "def get_DPLA_url(title, author, start_pub_year, end_pub_year)\n search_prep(title, author, start_pub_year, end_pub_year)\n base_url = 'http://api.dp.la'\n search_url = '/v2/items?'\n search_url += ('sourceResource.title=' + @new_title + '&sourceResource.creator=' + @new_author + '&sourceResource.date.after=' + @start_date + '&sourceResource.date.before=' + @stop_date + '&api_key=' + @api_key )\n final_url = base_url + search_url\n response_num = check_response(final_url)\n if response_num.eql? '200'\n final_url_uri = URI.parse(final_url)\n response = Net::HTTP.get_response(final_url_uri)\n response_body = response.body\n data_hash = JSON.parse(response_body)\n #json_data = Net::HTTP.get(URI.parse(search_url))\n #file = file.read(json_data)\n #data_hash = JSON.parse(json_data)\n\n #add DPLA content to hash\n count = data_hash[\"count\"]\n dpla_hash= @result_hash[:DPLA]= {:count=>count}\n if count> 10\n count = 10\n end\n if count > 0\n for i in 0..(count-1)\n begin\n title = data_hash[\"docs\"][i][\"sourceResource\"][\"title\"]\n creator = data_hash[\"docs\"][i][\"sourceResource\"][\"creator\"]\n pub_date = data_hash[\"docs\"][i][\"sourceResource\"][\"date\"][\"end\"]\n provider = data_hash[\"docs\"][i][\"provider\"][\"name\"]\n publisher = data_hash[\"docs\"][i][\"sourceResource\"][\"publisher\"]\n url = data_hash[\"docs\"][i][\"isShownAt\"]\n begin\n city = data_hash[\"docs\"][i][\"sourceResource\"][\"spatial\"][\"city\"]\n country = data_hash[\"docs\"][i][\"sourceResource\"][\"spatial\"][\"country\"]\n location = city + \", \" + country\n dpla_hash[i]= {:title=>title, :author => creator, :pub_date=> pub_date, :provider=> provider, :publisher=> publisher, :location=> location, :url => url}\n rescue Exception => e\n dpla_hash[i]= {:title=>title, :author => creator, :pub_date=> pub_date, :provider=> provider, :publisher=> publisher, :url => url}\n end\n rescue\n url = nil\n end\n end\n end\n else\n dpla_hash=@result_hash[:DPLA]={:count=>\"Error: \"+response_num}\n end\n\n #build url to send request to api (Ex. api.dpla.com/?title....)\n # figure out how to make GET request with ruby\n #http://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html this looks like a good resoruce to figure out get requests on ruby\n #request should be made here\n # request should either return the direct url to the content or nil if nothing found\n #url+=\"title=\"+title+\",author=\"+author+\",start_pub_year\"+start_pub_year+\",end_pub_year=\"+end_pub_year\n\n end",
"title": ""
},
{
"docid": "8597b928644d2d53ede1ed107fb86767",
"score": "0.4790957",
"text": "def searchable_fields_for(category)\n db_path = @env == 'test' ? 'test/db' : 'db'\n @data[category] ||= extract_hashes_from_json_file(\"#{db_path}/#{category}.json\")\n @data[category].first.keys\n end",
"title": ""
},
{
"docid": "39c123a4ac73838a207fc01706ccb2e7",
"score": "0.47906736",
"text": "def yql_search(query)\n base_url = \"http://query.yahooapis.com/v1/public/yql?format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys\"\n url = \"#{base_url}&q=#{URI.encode(query)}\"\n resp = Net::HTTP.get_response(URI.parse(url))\n data = resp.body\n\n # we convert the returned JSON data to native Ruby\n # data structure - a hash\n result = JSON.parse(data)\n\n # if the hash has 'Error' as a key, we raise an error\n if result.has_key? 'Error'\n raise \"web service error\"\n end\n ## @blogs = \n return result['query']['results']\n end",
"title": ""
},
{
"docid": "a83b27913b5c530b41514efa31612295",
"score": "0.47894642",
"text": "def fetch_content(url, section, seq, selectors)\n # Need error handling\n entry = FeedEntry.where(url: url.to_s).first\n if entry.blank?\n puts \"Fetching #{url}\"\n # Fill out basic info\n entry = FeedEntry.create do |article|\n article.url = url.to_s\n article.category = section\n article.tag_list = \"#{section}, #{@src}\"\n article.source = @src\n article.name = @src_name\n article.order_seq = seq\n article.feed_stream = @fstream\n end\n\n doc = Nokogiri::HTML(open(url))\n entry = update_article_content(entry, doc, selectors)\n else\n puts \"Skipping #{url}\"\n # Update columns for an existing entry\n # update sequence order if changed\n entry.tag = section # updates tag\n entry.order_seq = seq unless entry.order_seq == seq\n end\n\n # write to db\n entry.save!\n\n end",
"title": ""
},
{
"docid": "61e207fea3b969dac6343e4f33966190",
"score": "0.47882837",
"text": "def get_DPLA_url(title, author, start_pub_year, end_pub_year)\n search_prep(title, author, start_pub_year, end_pub_year)\n base_url = 'http://api.dp.la'\n search_url = '/v2/items?'\n search_url += ('sourceResource.title=' + @new_title + '&sourceResource.creator=' + @new_author + '&sourceResource.date.after=' + @start_date + '&sourceResource.date.before=' + @stop_date + '&api_key=' + @api_key )\n final_url = base_url + search_url\n final_url_uri = URI.parse(final_url)\n response = Net::HTTP.get_response(final_url_uri)\n response_body = response.body\n data_hash = JSON.parse(response_body)\n #json_data = Net::HTTP.get(URI.parse(search_url))\n #file = file.read(json_data)\n #data_hash = JSON.parse(json_data)\n\n #add DPLA content to hash\n count = data_hash[\"count\"]\n dpla_hash= @result_hash[:DPLA]= {:count=>count}\n if count> 10\n count = 10\n end\n if count > 0\n for i in 0..(count-1)\n begin\n title = data_hash[\"docs\"][i][\"sourceResource\"][\"title\"]\n creator = data_hash[\"docs\"][i][\"sourceResource\"][\"creator\"]\n pub_date = data_hash[\"docs\"][i][\"sourceResource\"][\"date\"][\"end\"]\n provider = data_hash[\"docs\"][i][\"provider\"][\"name\"]\n publisher = data_hash[\"docs\"][i][\"sourceResource\"][\"publisher\"]\n url = data_hash[\"docs\"][i][\"isShownAt\"]\n begin\n city = data_hash[\"docs\"][i][\"sourceResource\"][\"spatial\"][\"city\"]\n country = data_hash[\"docs\"][i][\"sourceResource\"][\"spatial\"][\"country\"]\n location = city + \", \" + country\n dpla_hash[i]= {:title=>title, :author => creator, :pub_date=> pub_date, :provider=> provider, :publisher=> publisher, :location=> location, :url => url}\n rescue Exception => e\n dpla_hash[i]= {:title=>title, :author => creator, :pub_date=> pub_date, :provider=> provider, :publisher=> publisher, :url => url}\n end\n rescue\n url = nil\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b0a8c15b14e7ba9b7bc6f8b4ec65e998",
"score": "0.4787198",
"text": "def by_category\n @articles = Hash.new\n if params[:category_id]\n @categories = Category.where(id: params[:category_id])\n else\n @categories = Category.all\n end\n @categories.each do |cat|\n @articles[cat.name] = cat.articles\n end\n @all_categories = Category.all\n end",
"title": ""
},
{
"docid": "3ccab5906a163b87d86ff032213b982e",
"score": "0.47849107",
"text": "def fetch_data\n # Relevance\n #@rl.calc_count_rel\n return if @data_fetched && !$o[:redo]\n @data_fetched = true\n h_rl = @rl.docs.map_hash{|d| [[d.did,d.qid].join , d.relevance]}\n @rs.each{|k,v| v.docs.each{ |d| d.fetch_relevance(h_rl) }}\n info \"relevance fetched...\"\n end",
"title": ""
},
{
"docid": "42f63e1771f44b031d0ec7c49b723144",
"score": "0.47821298",
"text": "def retrieve_data\n # Define the url\n url = 'http://feeds.smh.com.au/rssheadlines/entertainment.xml'\n # Open the url and parse the rss feed\n open(url) do |rss|\n # Start parsing\n feed = RSS::Parser.parse(rss, false)\n # Iterate each item and scrape information\n feed.items.each do |item|\n # If the title of thie article matches the title of the last saved article,\n # stop scraping to avoid from saving duplicates in database\n break if !@last_title.nil? && @last_title.eql?(item.title)\n\n # If thie article is already stored then ignore\n next if Article.find_by(title: item.title.to_s)\n\n # Define regex to pull out img url from description\n rgx_img1 = /http:(.)+.jpg-90x60.jpg/\n rgx_img2 = /http:(.)+.png-90x60.png/\n\n # Pull out img url\n img = item.description.match(rgx_img1).to_s\n img = item.description.match(rgx_img2).to_s unless img\n\n # Define regex to pull out a pure description from description\n rgx_sum = /<\\/p>[A-Z](.)+\\./\n\n # Pull out a pure description\n summary = item.description.to_s.match(rgx_sum).to_s.slice!(/[A-Z](.)+\\./)\n\n # Make a template dictionary to put @articles\n # TODO: Update date_time String to DateTime\n temp = {\n author: nil,\n title: item.title,\n summary: summary,\n image: img,\n link: item.link,\n date_time: DateTime.parse(item.pubDate.to_s),\n categories: nil\n }\n\n # Put the object into articles array\n @articles << temp\n end\n end\n end",
"title": ""
},
{
"docid": "159978e79bc00ec3e515727fdc9934fc",
"score": "0.4779428",
"text": "def find_by_keyword(response)\n db = init_db\n keywords = response.matches[0][0]\n result = db[\"\n select id, data->'img' as img, data->'title' as title, data->'alt' as alt\n from comics\n where data->>'title' ilike ? order by RANDOM() limit 1\", \"%#{keywords}%\"]\n if row = result[:data]\n comic = Comic.new(row[:id], row[:img], row[:title], row[:alt])\n reply_with_comic response, comic\n end\n end",
"title": ""
},
{
"docid": "f867d914d1131b804aed2ec70d1177d7",
"score": "0.4776272",
"text": "def fetch( start_date, end_date, dimensions, metrics, filters=nil, max_results=nil, sort=nil )\n opts = query_opts( start_date, end_date, dimensions, metrics, filters, max_results, sort )\n code, body = @middle.get( \"www.google.com\", \"/analytics/feeds/data\", opts )\n if code == 200\n return code, parse( body )\n else\n return code, nil\n end\n end",
"title": ""
},
{
"docid": "8dd843d8bf622cdc376b48688f4f99e1",
"score": "0.47749096",
"text": "def find\n \"http://ajax.googleapis.com/ajax/services/feed/find\"\n end",
"title": ""
},
{
"docid": "ead31ad9b4e591f00c5d5ecf64eedd1f",
"score": "0.47733447",
"text": "def category_search(opts={})\r\n Yahoo::Request.get(\"http://shopping.yahooapis.jp/ShoppingWebService/V1/json/categorySearch\", Yahoo::Api.merge(opts))\r\n end",
"title": ""
},
{
"docid": "3ab681d920264ea83842c53142cee452",
"score": "0.47662318",
"text": "def load \n \"http://ajax.googleapis.com/ajax/services/feed/load\"\n end",
"title": ""
},
{
"docid": "75378a54d4e889532127367933df231c",
"score": "0.47588077",
"text": "def fetch_data(klass, type, missing_ids)\n path = URI(link_definition.url_for(type, missing_ids)).path\n\n query = Query::Linked.new(path)\n results = klass.run_request(query)\n\n key = link_definition.attribute_name_for(type).to_s\n add_data(key, results)\n end",
"title": ""
},
{
"docid": "f477230c33075803bfb6dd600eb6cf1b",
"score": "0.47533584",
"text": "def categorize\n out = {}.to_json\n if params[:url]\n # uri_enc_url = Rack::Utils.escape(params[:url])\n endpoint = \"http://access.alchemyapi.com/calls/url/URLGetCategory\"\n q = \"#{endpoint}?apikey=#{ENV[\"ALCHEMY_KEY\"]}&url=#{params[:url]}&outputMode=json\"\n out = RestClient.get(q)\n end\n respond_to do |format|\n format.html\n format.json { render :json => out.body }\n end\n end",
"title": ""
},
{
"docid": "7e0a925772143b568dcba08edaedbbd9",
"score": "0.47497872",
"text": "def crawl\n update_all_feeds\n fetch_and_store_articles\n end",
"title": ""
},
{
"docid": "f9a0362cfdb3a3e6543fdbcab70199f8",
"score": "0.4748468",
"text": "def search_bib_data(request) \n client = self.init_bib_client\n client.search_by_referent(request.referent)\n self.collect_record_attributes(client, request) \n end",
"title": ""
},
{
"docid": "b7021490557c190908515814e720ac9d",
"score": "0.47443926",
"text": "def load_comments user\n if @comment_count > 0\n req_uri = \"https://picasaweb.google.com/data/feed/api/user/default/albumid/#{@album_id}/photoid/#{@id}\"\n results = GoogleOAuth.make_request req_uri, {kind: \"comment\", access_token: user.access_token}, {format: \"xml\"}\n doc = Nokogiri::XML results\n entries = doc.xpath(\"xmlns:feed/xmlns:entry\")\n @comments = entries.map do |entry|\n {\n author: entry.xpath(\"xmlns:title\").text,\n content: entry.xpath(\"xmlns:content\").text\n }\n end\n end\n end",
"title": ""
},
{
"docid": "ec722b48c002ef0ef55fd017e11d00d5",
"score": "0.4740304",
"text": "def get_category_books_api(categories)\n json_categories = JSON.parse(get_book_categories(\"json\"))[\"booksCategory\"]\n return json_categories[\"url\"] if categories.size==1 && categories.first==\"Books\"\n categories.drop(1).inject(json_categories){|json_categories, category| json_categories[\"subCategories\"].select{|sub_category| sub_category[\"name\"]==category}.first}[\"url\"]\n end",
"title": ""
},
{
"docid": "18d96d192d6001ddd575576b96162dfa",
"score": "0.47398308",
"text": "def fetch_data\n return @data if @data[\"/type/reflect/any_master\"]\n @data = Basuco.search.mqlread(define_query.merge!(:id => id))\n end",
"title": ""
},
{
"docid": "c77eb2ecc10eda75ae320940422c9f8b",
"score": "0.47381875",
"text": "def get_api_data(cityname)\n\t # parse special characters\n\t encoded_cityname = URI.encode(cityname);\n # make yelp api call\n search_url = \"/v2/search?location=#{encoded_cityname}\"\\\n \"&cc=EN&lang=en&limit=#{@limit}&category_filter=landmarks\"\n json_response = @access_token.get(search_url)\n # parse response to json\n response = JSON.parse(json_response.body)\n end",
"title": ""
},
{
"docid": "03dd4404c7b5a55dfe0774d312d38e68",
"score": "0.47308588",
"text": "def sql_search_by_cat\n <<-SQL\n WHERE topic = ?\n SQL\nend",
"title": ""
},
{
"docid": "9ad801081a5f43e535f726ea0c286067",
"score": "0.47261512",
"text": "def fetch_posts\n posts = []\n disqus = JSON.parse(File.read('auto/data/disqus.json'))\n files = Dir.entries('auto/data/posts').keep_if { |a| a.end_with? '.yml' }\n blog_img_dir = 'assets/images/blog'\n Dir.mkdir(blog_img_dir) unless Dir.exist? blog_img_dir\n files.each do |file|\n data = {}\n data = YAML.safe_load(File.read(\"auto/data/posts/#{file}\"))\n # File.open(\"auto/data/posts/#{file}\", \"w\") { |file| file.write(JSON.pretty_generate([initialize_empty_fields(data)])) }\n data['filename'] = file.gsub('.yml','').gsub(' ','_')\n posts.push(data)\n data['disqus_identifier'] = disqus[data['filename']]\n data['date'] = data['datetime_index'][6..7] + '/' + data['datetime_index'][4..5] + '/' + data['datetime_index'][0..3]\n data['time'] = if data['datetime_index'][8..9].to_i > 12\n (data['datetime_index'][8..9].to_i - 12).to_s + ':' + data['datetime_index'][10..11] + ' PM'\n else\n data['datetime_index'][8..9] + ':' + data['datetime_index'][10..11] + ' AM'\n end\n data['tag_data'] = []\n data['x_minutes_read'] = data['html_content'].count(' ')/READING_SPEED + 1\n image_dir = \"assets/images/blog/#{data['filename']}\"\n if Dir.exist? image_dir\n data['image_preview'] = '' unless File.exist? \"#{image_dir}/#{data['image_preview']}\"\n else\n Dir.mkdir(\"assets/images/blog/#{data['filename']}\")\n end\n data['html_content'] = Redcarpet::Markdown.new(\n Redcarpet::Render::HTML.new(\n no_intra_emphasis: true,\n tables: true,\n autolink: true,\n strikethrough: true,\n with_toc_data: true\n )\n ).render(data['html_content'])\n data['html_content'] = data['html_content']\n .gsub('<a',\"<a target='_blank'\")\n .gsub('<img src=\"',\"<img src='#{$lazy_load_img}' class='ui centered image' data-src=\\\"../../../assets/images/blog/#{data['filename']}/\")\n .gsub('<ul>',\"<h4> <ul class='ui list'>\")\n .gsub('</ul>','</ul> </h4>')\n .gsub('<code',\"<code class='language-ruby' style='background-color : #fff;'\")\n .gsub('</code>','</code></pre>')\n i = 1\n first = data['html_content'].split('<p>')[i][0]\n while first == '<'\n i += 1\n first = data['html_content'].split('<p>')[i][0]\n end\n data['html_content'] = data['html_content'].sub(\"<p>#{first}\",\"<p><span style='display:block; float:left; font-size: 200%; color:#ffffff; margin-top:5px; margin-right:8px; padding: 10px 20px 10px 20px; text-align:center; background-color: #000;'>#{first}</span>\")\n str = data['html_content']\n rep_i = 0\n while str.include? '---'\n text_inbetween = str.split('---')[1]\n\n if rep_i.zero?\n str.sub!('---', \"<br><div class='ui horizontal divider' id='#{text_inbetween}'>\")\n else\n str.sub!('---', '</div>')\n end\n rep_i = rep_i == 1 ? 0 : 1\n end\n data['html_content'] = str\n $tags.each do |t|\n data['tag_data'].push(t) if data['tags'].include? t['index']\n end\n end\n posts = posts.sort_by { |row| row['datetime_index'].to_i }\n posts = posts.reverse\n puts 'Reading and manipulating all posts from json format.'\n posts\nend",
"title": ""
},
{
"docid": "12211baab795ccc979f5f79215949035",
"score": "0.47251275",
"text": "def scrap_data_from_page link\n p link\n page = @agent.get(link)\n\n # get all categories\n get_items_with_all_category(page)\nend",
"title": ""
},
{
"docid": "12211baab795ccc979f5f79215949035",
"score": "0.47251275",
"text": "def scrap_data_from_page link\n p link\n page = @agent.get(link)\n\n # get all categories\n get_items_with_all_category(page)\nend",
"title": ""
},
{
"docid": "12211baab795ccc979f5f79215949035",
"score": "0.47251275",
"text": "def scrap_data_from_page link\n p link\n page = @agent.get(link)\n\n # get all categories\n get_items_with_all_category(page)\nend",
"title": ""
},
{
"docid": "12211baab795ccc979f5f79215949035",
"score": "0.47251275",
"text": "def scrap_data_from_page link\n p link\n page = @agent.get(link)\n\n # get all categories\n get_items_with_all_category(page)\nend",
"title": ""
},
{
"docid": "fcea064d52994d9848d59cd7f79a160e",
"score": "0.47249746",
"text": "def query_google\n postData = Net::HTTP.post_form(URI.parse('http://www.google.com/trends/hottrends/hotItems'), {\"ajax\"=>\"1\",\"pn\"=>\"p1\",\"htv\"=>\"m\"})\n parse_trends(JSON.parse(postData.body))\n end",
"title": ""
},
{
"docid": "fabf7283445b2292523608120e3ac6b1",
"score": "0.47213516",
"text": "def category(flavor, data, options = {})\n unless @@ENDPOINTS['category'].key?(flavor)\n return { 'status' => 'ERROR', 'statusInfo' => 'text categorization for ' + flavor + ' not available' }\n end\n\n # Add the URL encoded data to the options and analyze\n options[flavor] = data\n return analyze(@@ENDPOINTS['category'][flavor], options)\n end",
"title": ""
},
{
"docid": "da94d9ce7c1016efef0096f9d35bf654",
"score": "0.47212115",
"text": "def naver_blog_search\n\t\tquery = short_name + \" \" + short_addrs\n\t\tFILTER_RULES.each do |rule|\n\t\t\tquery += \" -\" + rule\n\t\tend\n\t\tquery = URI.encode(\"#{query}\")\n\n\t\tnaver_key = \"key=\" + SEARCH_KEY\n\t\tnaver_options = \"&query=#{query}&display=5&target=blog&sort=sim\"\n\t\tnaver_url = \"http://openapi.naver.com/search?#{naver_key}#{naver_options}\"\n\n\t\titems = Nokogiri::XML(open(naver_url)).xpath(\"//item\")\n\t\t\n\t\tnaver_blogs = []\n\t\titems.each do |item|\n\t\t\ttemp = Hash.new\n\t\t\ttemp[:title] = item.xpath(\"title\").text \n\t\t\ttemp[:link] = item.xpath(\"link\").text\n\t\t\ttemp[:description] = item.xpath(\"description\").text\n\t\t\ttemp[:blogger_name] = item.xpath(\"bloggername\").text\n\t\t\ttemp[:blogger_link] = item.xpath(\"bloggerlink\").text\n\t\t\tnaver_blogs << temp\n\t\tend\n\n\t\tnaver_blogs\n\tend",
"title": ""
},
{
"docid": "a70b8605215e795a1969ed01a96d9735",
"score": "0.47211492",
"text": "def load\n cats = []\n conn.call('wp.getCategories', conn.blog_id, conn.username, conn.password).each do |c|\n cats << WpRpc::Category.new_from_xmlrpc(c, :conn => conn)\n end\n @categories = cats\n end",
"title": ""
},
{
"docid": "6060cef9a6c02d618e2816a0b98e88d6",
"score": "0.47136664",
"text": "def find_blogger\n @blogger = Blogger.find(params[:id])\n end",
"title": ""
},
{
"docid": "fb7a357e46089eac1147bb671c669da5",
"score": "0.4708432",
"text": "def search\n @keyword = \"\"\n if params[:keyword].present?\n @keyword = params[:keyword]\n p @keyword\n @entries = Entry.where({oauth_id: @oauth.id}).order(\"id DESC\").search(:description_cont => @keyword).result.page(params[:page])\n else\n @entries = []\n end\n end",
"title": ""
},
{
"docid": "ac3e8b0be85c4c871f4cdf0031f22ef2",
"score": "0.47077134",
"text": "def categories(int, api_key, app_id)\n final = nil\n arr = []\n res = sslVal('https://touch-rate.com/o?method=events&api_key='+api_key+'&app_id='+app_id+'&event=Categories&segmentation=title&period=30days')\n data = res[\"2016\"]\n title = res[\"meta\"][\"title\"]\n algo = data.slice(*title).to_a\n algo2 = algo.sort_by { |k,v| v[\"c\"] }\n if algo2[int] == nil\n return \"No Data\"\n else\n final = algo2[int][0].gsub(\"\\\\nGames\",\" \").gsub(\"Games\\\\n\",\" \")[0,24]\n end\n end",
"title": ""
},
{
"docid": "ca2362930b65120cc658282f3e83bb31",
"score": "0.47068775",
"text": "def reportsCat(api_key, app_id, app_key)\n var = id = name = event = nil\n arr = []\n res = sslVal('https://touch-rate.com/o?method=user_details&api_key='+api_key+'&app_id='+app_id)\n res[\"aaData\"].each do |n|\n id = n[\"_id\"]\n name = n[\"name\"][6, 15]\n uid = Digest::SHA1.hexdigest app_key+name # creates uid for the call below\n res1 = sslVal('https://touch-rate.com/o?method=user_details&uid='+uid+'&api_key='+api_key+'&app_id='+app_id)\n res1[\"events\"].each do |c|\n if c[\"ts\"] >= getDateRange('from').to_i && c[\"ts\"] < getDateRange('to').to_i\n if c[\"key\"] == \"Categories\"\n c.merge!(\"name\" => name)\n arr.push(c)\n end\n end\n end\n end\n return arr\n end",
"title": ""
},
{
"docid": "57c69d85ece07b9e7d5f77a3a7603e0f",
"score": "0.4704884",
"text": "def search_news(key)\n queue = []\n\n Google::Search::News.new(:query => key, :tbs => 'sbd:1,qdr:w', 'tbm' => 'nws').each do |s|\n queue.push({:url => s.uri, :date_published => s.published})\n end\n queue\nend",
"title": ""
},
{
"docid": "60a2250f91ca2ab85dc5f89dd27f68b5",
"score": "0.47018564",
"text": "def fetch\n @jobs = fetch_rss(@discipline_url, Sources::ACUK)\n end",
"title": ""
},
{
"docid": "0324d09bd47aa4626b1ca9b7739bf864",
"score": "0.470019",
"text": "def load_stuff_ads\n @cities = City.all\n @price_types = PriceType.all\n @categories = Category.all\n\n end",
"title": ""
}
] |
287b0a0d9a834817c4f5b3a8cede0a15
|
This method is a public interface that allows the associated resource to reset the token completely.
|
[
{
"docid": "b2d6f7d479e18171b27c66189df6cd68",
"score": "0.670016",
"text": "def reset!\n reset_secret\n refresh_expiry\n reset_confirmation\n save!\n end",
"title": ""
}
] |
[
{
"docid": "846d50b01a7779355bf4c6aaf39be364",
"score": "0.82656264",
"text": "def reset\n reset_token\n end",
"title": ""
},
{
"docid": "8e7c1723abc132a37f210709321bd600",
"score": "0.7904651",
"text": "def reset_token\r\n authentication_token true\r\n end",
"title": ""
},
{
"docid": "3c33a381dcb15fa18c1e92de37669ffc",
"score": "0.78662217",
"text": "def reset_token\n @@token = nil\n end",
"title": ""
},
{
"docid": "0fb8f6dec00b0c6e5c4a28fd4a2cca93",
"score": "0.7754297",
"text": "def reset_token\n self.token = ''\n end",
"title": ""
},
{
"docid": "7ce3af6cd720882cd27fda8e7cb8795c",
"score": "0.76326036",
"text": "def reset_token\n set_new_token\n save!\n temporary_token\n end",
"title": ""
},
{
"docid": "ebd6d4a9a6ccdfb9bb8a47c085d594a2",
"score": "0.75292194",
"text": "def reset_reset_token!\n self.set_reset_token\n self.save\n self.reset_token\n end",
"title": ""
},
{
"docid": "917911d1e9947b22bd50de8fb3f8d14a",
"score": "0.75157356",
"text": "def revoke_token\n raise 'To be implemented in child classes'\n end",
"title": ""
},
{
"docid": "4a9dc355a2372f268e3169b8580677cf",
"score": "0.7476437",
"text": "def token_reset\n current_owner.gen_api_token\n current_owner.save\n redirect_to \"/account\"\n end",
"title": ""
},
{
"docid": "c7a61fd9c60e4e0d44ede45d4c473719",
"score": "0.7277704",
"text": "def reset_auth_token!\n reset_auth_token\n save(:validate => false)\n end",
"title": ""
},
{
"docid": "8a93bd37b8c1729ac2f18bfd0e3391ff",
"score": "0.72518533",
"text": "def reset_authentication_token!\n reset_authentication_token\n save(:validate => false)\n end",
"title": ""
},
{
"docid": "d26fc89f8861f9ee33b4fce749098f47",
"score": "0.71898854",
"text": "def reset_token!\n api_key.delete if api_key.present?\n assign_api_key!\n end",
"title": ""
},
{
"docid": "17490075e058b5dcbf04c4e4f6248c0d",
"score": "0.71790034",
"text": "def reset_authentication_token!\n reset_authentication_token\n save(validate: false)\n end",
"title": ""
},
{
"docid": "fd8cd7af6b961efc73e7b590f6784a40",
"score": "0.7145909",
"text": "def reset_authentication_token!\n reset_authentication_token\n self.save\n end",
"title": ""
},
{
"docid": "0eb61ca61c28cdb80dd9c17f3a9bb0e2",
"score": "0.7132932",
"text": "def reset_auth_token\n self.auth_token = generate_token(:auth_token)\n end",
"title": ""
},
{
"docid": "d350b27b38590f0548a29321fbe5350e",
"score": "0.7097585",
"text": "def reset_perishable_token!\n update_attribute(:perishable_token, reset_perishable_token)\n end",
"title": ""
},
{
"docid": "f37c1bcbedb27795cdf8bc8c95213d97",
"score": "0.7097157",
"text": "def reset_perishable_token\n self.perishable_token = self.class.make_token\n end",
"title": ""
},
{
"docid": "69b9b50df14576d9128b1ea53150edbf",
"score": "0.7087473",
"text": "def reset_authentication_token!\n self.authentication_token = generate_authentication_token\n end",
"title": ""
},
{
"docid": "ebf11fe377582ee0e15c85b4f6e29cf3",
"score": "0.7053597",
"text": "def clear_reset_password_token; end",
"title": ""
},
{
"docid": "0343023d3f935f9d5099e3ba73c758e4",
"score": "0.70401734",
"text": "def reset_token!(instance)\n write_new_token(instance)\n instance.save! if Gitlab::Database.read_write?\n end",
"title": ""
},
{
"docid": "41bbd292084d453a2829271db0e22992",
"score": "0.7039712",
"text": "def reset_authentication_token\n self.authentication_token = self.class.authentication_token\n end",
"title": ""
},
{
"docid": "41bbd292084d453a2829271db0e22992",
"score": "0.7039712",
"text": "def reset_authentication_token\n self.authentication_token = self.class.authentication_token\n end",
"title": ""
},
{
"docid": "41bbd292084d453a2829271db0e22992",
"score": "0.7039712",
"text": "def reset_authentication_token\n self.authentication_token = self.class.authentication_token\n end",
"title": ""
},
{
"docid": "bb99bbfbc2dfe3836c7cb5bbff2c0168",
"score": "0.70232177",
"text": "def reset_authentication_token!\n self.authentication_token = generate_authentication_token\n self.save!\n end",
"title": ""
},
{
"docid": "b8df88c9e06daab8c663229692ace277",
"score": "0.6975288",
"text": "def reset\n @token = params[:tokens]\n @id = params[:id]\n end",
"title": ""
},
{
"docid": "b8df88c9e06daab8c663229692ace277",
"score": "0.6975288",
"text": "def reset\n @token = params[:tokens]\n @id = params[:id]\n end",
"title": ""
},
{
"docid": "3acf990b3f64ef3248990abc0b3c4b95",
"score": "0.6974153",
"text": "def reset_perishable_token!\n reset_perishable_token\n save_without_session_maintenance(validate: false)\n end",
"title": ""
},
{
"docid": "bf536a06d41f7af066ee65d3b35c4d0a",
"score": "0.6945584",
"text": "def invalidate_token\n update_attribute(:token, nil)\n update_attribute(:token_created_at, Time.now)\n end",
"title": ""
},
{
"docid": "ef1f67a7bd1190be856dd150c753159a",
"score": "0.6888924",
"text": "def clear_request_token\n @request_token = nil\n end",
"title": ""
},
{
"docid": "978cf5ab27e28553255dffca18991fd9",
"score": "0.68681633",
"text": "def reset_token!\n self.session_token = User.generate_session_token\n self.save!\n self.session_token\n end",
"title": ""
},
{
"docid": "ff425d7e5e2ae541b9c1547a03212990",
"score": "0.6843219",
"text": "def token_reset\n item = read\n item['token'] = SecureRandom.uuid.gsub(/[^a-f0-9]/, '')\n @aws.put_item(table_name: 'zold-wallets', item: item)\n end",
"title": ""
},
{
"docid": "ec1cfc396818c2e5eb54cb3da2fa0f65",
"score": "0.6822419",
"text": "def token\n refresh_token! if token_expired?\n super\n end",
"title": ""
},
{
"docid": "e6bab83a0c6de1177824a4643fb65776",
"score": "0.6806986",
"text": "def reset(resource)\n reset_value(resource)\n end",
"title": ""
},
{
"docid": "aea88f5fd79980a51865ee40bad49592",
"score": "0.67972654",
"text": "def reset\n self.reset_token = User.new_token\n self.update_attributes(reset_digest: User.digest(reset_token),\n reset_sent_at: Time.zone.now)\n end",
"title": ""
},
{
"docid": "110b3904465bafd19fd3ecda446ac047",
"score": "0.66602194",
"text": "def invalidate_token\n self.update_columns(auth_token: nil)\n end",
"title": ""
},
{
"docid": "52885373c65f990119ac47c8027b4202",
"score": "0.6654741",
"text": "def reset_token!\n token = Devise.friendly_token[0,20]\n self.password = self.password_confirmation = token\n self.email = \"#{name}@scribe\"\n save! validate: false\n token\n end",
"title": ""
},
{
"docid": "f71e4977a9f12fd7ada1044404561f79",
"score": "0.6617574",
"text": "def revoke!\n self.class.transaction do\n update_attribute :revoked, Time.now\n client.increment! :tokens_revoked\n end\n end",
"title": ""
},
{
"docid": "666c2c1879a6ec46da506f9678fc2e7a",
"score": "0.6583055",
"text": "def invalidate_token \n self.update_columns(auth_token: nil)\n end",
"title": ""
},
{
"docid": "a5436a2fccdf48541000057111cdee03",
"score": "0.6581483",
"text": "def logout\r\n self.update(token: nil) \r\n end",
"title": ""
},
{
"docid": "b3b7cda7ae849d27c79d31c911381e78",
"score": "0.6554927",
"text": "def reset\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "8d4bf07cc64a9e049a8ff84619038d55",
"score": "0.6545789",
"text": "def reset\n do_url 'reset', :put\n end",
"title": ""
},
{
"docid": "f17234e2cf05cab2d245d10876a0d908",
"score": "0.6512292",
"text": "def regenerate_token\n self.auth_token = nil\n generate_token\n save!\n end",
"title": ""
},
{
"docid": "6ee8ec51c5cfc00436959ceb8caac835",
"score": "0.65076685",
"text": "def reset\n invoke_on_reset_callbacks\n self\n end",
"title": ""
},
{
"docid": "033e5b9c9061dc1c7c34bb1676918243",
"score": "0.64889437",
"text": "def token_refresh!\n self.access_token = access_token.refresh!\n end",
"title": ""
},
{
"docid": "92cfaca2f1dae24e616474dfbce3a1aa",
"score": "0.6484061",
"text": "def invalidate_token\n self.update_columns(token: nil)\n end",
"title": ""
},
{
"docid": "92cfaca2f1dae24e616474dfbce3a1aa",
"score": "0.6484061",
"text": "def invalidate_token\n self.update_columns(token: nil)\n end",
"title": ""
},
{
"docid": "de8035d86e741f69512ec1f7b1f263f1",
"score": "0.6480898",
"text": "def reset_single_access_token!\n update_attribute(:single_access_token, User.encrypt_token(Time.now.to_i, \"password reset--\"))\n end",
"title": ""
},
{
"docid": "d21bf059fee476b3005265d394d9bc12",
"score": "0.6477449",
"text": "def ensure_authentication_token! \n reset_authentication_token! if authentication_token.blank? \n end",
"title": ""
},
{
"docid": "d344e4e434541b1bd2580a4bf5ea5703",
"score": "0.6476277",
"text": "def reset_session_token!\n self.session_token = self.class.generate_session_token\n self.save!\n self.session_token\n end",
"title": ""
},
{
"docid": "d344e4e434541b1bd2580a4bf5ea5703",
"score": "0.6476277",
"text": "def reset_session_token!\n self.session_token = self.class.generate_session_token\n self.save!\n self.session_token\n end",
"title": ""
},
{
"docid": "2ff2ec355d004031e9e8131697311d74",
"score": "0.6452469",
"text": "def reset_email_token!\n reset_email_token\n save_without_session_maintenance(validate: false)\n end",
"title": ""
},
{
"docid": "b2fc70d23d27c22a3d3d8d7114314bd1",
"score": "0.6439561",
"text": "def invalidate_token\n self.update_columns(token: nil)\n end",
"title": ""
},
{
"docid": "b2fc70d23d27c22a3d3d8d7114314bd1",
"score": "0.6439561",
"text": "def invalidate_token\n self.update_columns(token: nil)\n end",
"title": ""
},
{
"docid": "246df4bef83ffe42fe41e3563bd4f0ef",
"score": "0.64362806",
"text": "def invalidate_token(user)\n user.renew_token\n user.save\n end",
"title": ""
},
{
"docid": "b794200e94ae72ad0a41f662e805f567",
"score": "0.6433417",
"text": "def reset()\n \n end",
"title": ""
},
{
"docid": "dfb0dcc6374cc828fd1375aaaf1a591a",
"score": "0.63997513",
"text": "def reset_session_token!\n self.session_token = SecureRandom::urlsafe_base64\n self.save!\n # save! to persist. when not checking if worked, bang version\n end",
"title": ""
},
{
"docid": "44c8a703e06402261f685d8a65723e6f",
"score": "0.6399385",
"text": "def revoke!\n self[:revoked] = Time.now\n save\n Client[client_id].token_revoked\n end",
"title": ""
},
{
"docid": "68f4b30e3a12b993096647c8fa96adce",
"score": "0.63953537",
"text": "def reset\n session.delete(:access_token)\n session.delete(:refresh_token)\n redirect('/auth/gowalla')\n end",
"title": ""
},
{
"docid": "fa64e3013c76358e6ff54d35785a726e",
"score": "0.6361125",
"text": "def remove_token\n update(token: nil)\n end",
"title": ""
},
{
"docid": "24159f9951d251d4b612700bc6319ecb",
"score": "0.63550484",
"text": "def reset_session_token!\n self.session_token = User.generate_session_token\n self.save!\n self.session_token\n end",
"title": ""
},
{
"docid": "28ae49506da572baba64dbdb883d86e7",
"score": "0.63442564",
"text": "def refresh!(params={})\n @token = token.refresh!(params)\n end",
"title": ""
},
{
"docid": "9e79c748a4773da813a22e744ce2ca58",
"score": "0.6324309",
"text": "def invalidate_token\n update_columns(token: nil)\n end",
"title": ""
},
{
"docid": "0254f7713beae4039e005d57310b661b",
"score": "0.6322994",
"text": "def reset!\n client.reset!\n end",
"title": ""
},
{
"docid": "29bf4204e61ee325176a4eae7a4af8de",
"score": "0.63118017",
"text": "def reset\n\n end",
"title": ""
},
{
"docid": "fb419b687bd78866df36b202fdb46d54",
"score": "0.6300866",
"text": "def reset_session_token!\n self.session_token = SecureRandom::urlsafe_base64(16)\n self.save!\n self.session_token\n end",
"title": ""
},
{
"docid": "16e7263732d2522aa71dff263cebe964",
"score": "0.6299806",
"text": "def reset()\n end",
"title": ""
},
{
"docid": "d707fa7dfa05a9d2e86f020ce50ff331",
"score": "0.62975645",
"text": "def reset_session_token!\n self.session_token = User.generate_session_token\n self.save\n self.session_token\n end",
"title": ""
},
{
"docid": "683ba2d945a4d376804da04ef64c664d",
"score": "0.62951493",
"text": "def refresh_token\n if remember_token?\n self.remember_token = self.class.make_token \n save(false) \n end\n end",
"title": ""
},
{
"docid": "0f730447f560272972c049f3b73d842a",
"score": "0.6290896",
"text": "def invalidate_auth_token\n self.update_columns(auth_token: nil)\n end",
"title": ""
},
{
"docid": "0f730447f560272972c049f3b73d842a",
"score": "0.6290896",
"text": "def invalidate_auth_token\n self.update_columns(auth_token: nil)\n end",
"title": ""
},
{
"docid": "08f435a539585befa31c99873418efa0",
"score": "0.62846875",
"text": "def reset!\n @session_key = nil\n end",
"title": ""
},
{
"docid": "e947e4370d0fad6ab23047b2bb1da566",
"score": "0.6281623",
"text": "def reset_admin_login_token\n update_attribute(:admin_login_token, nil)\n end",
"title": ""
},
{
"docid": "b0ce2fbd14ba95e25724db2785ca29fa",
"score": "0.6267529",
"text": "def reset_session_token!\n self.update!(session_token: SecureRandom::urlsafe_base64)\n end",
"title": ""
},
{
"docid": "61e2f25ca2cdf0f4e2b6506d55c87a69",
"score": "0.62621564",
"text": "def reset_session_token!\n self.session_token = SecureRandom.urlsafe_base64(16)\n self.save!\n self.session_token\n end",
"title": ""
},
{
"docid": "0d4471fd03642c3f5a50c4f233b8936b",
"score": "0.625015",
"text": "def token\n #@user = User.where(:id => params[:user_id]).first\n #@user.reset_authentication_token!\n redirect_to edit_user_registration_path(@user)\n end",
"title": ""
},
{
"docid": "05dce50517cf557258c3f12dae87df02",
"score": "0.62496805",
"text": "def regenerate_auth_token\n self.auth_token = nil\n generate_token\n save!\n end",
"title": ""
},
{
"docid": "05dce50517cf557258c3f12dae87df02",
"score": "0.62496805",
"text": "def regenerate_auth_token\n self.auth_token = nil\n generate_token\n save!\n end",
"title": ""
},
{
"docid": "3a631863b80bf321d695dd950e4c2bbd",
"score": "0.6249473",
"text": "def reset_session_token!\n self.session_token = User.generate_session_token\n self.save!\n self.session_token\nend",
"title": ""
},
{
"docid": "a8c83d77a02abf68c44521094ff32ab1",
"score": "0.62482953",
"text": "def reset!\n # this should be overridden by concrete adapters\n end",
"title": ""
},
{
"docid": "098fc0478eeafa530299fc236d4e6cfd",
"score": "0.6247383",
"text": "def reset\n \n end",
"title": ""
},
{
"docid": "5b50adfa27df7901a36016e57e7cbb73",
"score": "0.624581",
"text": "def reset_token\n self.reset_password_token = BCrypt::Engine.generate_salt\n self.save(:validate => false)\n end",
"title": ""
},
{
"docid": "c4965315c3d79f2aeeaee4154560a682",
"score": "0.6242796",
"text": "def reset_autosignin_token!\n reset_autosignin_token\n self.save\n end",
"title": ""
},
{
"docid": "fee6e52c1caa79866d0ffcd4c4c168ee",
"score": "0.6235693",
"text": "def reset()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "184a0950909a31a88127bcada91ce547",
"score": "0.62351555",
"text": "def reset!; end",
"title": ""
},
{
"docid": "184a0950909a31a88127bcada91ce547",
"score": "0.62351555",
"text": "def reset!; end",
"title": ""
},
{
"docid": "184a0950909a31a88127bcada91ce547",
"score": "0.62351555",
"text": "def reset!; end",
"title": ""
},
{
"docid": "184a0950909a31a88127bcada91ce547",
"score": "0.62351555",
"text": "def reset!; end",
"title": ""
},
{
"docid": "12ac7c0f67b29f06a45042207fdbffe5",
"score": "0.6232512",
"text": "def reset\n end",
"title": ""
},
{
"docid": "12ac7c0f67b29f06a45042207fdbffe5",
"score": "0.6232512",
"text": "def reset\n end",
"title": ""
},
{
"docid": "12ac7c0f67b29f06a45042207fdbffe5",
"score": "0.6232512",
"text": "def reset\n end",
"title": ""
},
{
"docid": "12ac7c0f67b29f06a45042207fdbffe5",
"score": "0.6232512",
"text": "def reset\n end",
"title": ""
},
{
"docid": "a8239f8fb7226f2a3e1db850e8acef51",
"score": "0.6231759",
"text": "def revoke\n raise \"Implement me!\"\n end",
"title": ""
},
{
"docid": "cf0f38b880709f5df7a38dce392befb1",
"score": "0.62268376",
"text": "def reset\n end",
"title": ""
},
{
"docid": "cf0f38b880709f5df7a38dce392befb1",
"score": "0.62268376",
"text": "def reset\n end",
"title": ""
},
{
"docid": "789dbce87baa186bd1b17d3849386bcd",
"score": "0.6225879",
"text": "def reset\n self\n end",
"title": ""
},
{
"docid": "2d843c7076f915396501254f9ea463f1",
"score": "0.62141675",
"text": "def reset\n resp = connection.post do |req|\n req.url \"#{workspace_path}/reset\"\n end\n raise_exception_based_on_response!(resp, object_identifier) unless resp.success?\n end",
"title": ""
},
{
"docid": "a6b12549214cf1581bd0f43eedc94539",
"score": "0.6208955",
"text": "def reset_session_token!\n\n self.session_token = User.generate_session_token\n self.save!\n self.session_token\n\nend",
"title": ""
},
{
"docid": "434e2e239a15fd5cc9bc338e69281056",
"score": "0.62039757",
"text": "def reset_persistence_token\n record.reset_persistence_token\n end",
"title": ""
},
{
"docid": "aa55795959ae5eb4af049616a71e7a10",
"score": "0.62020063",
"text": "def reset() end",
"title": ""
},
{
"docid": "806bea8bbfc2228eebb388587cc071e1",
"score": "0.61974376",
"text": "def refresh_token\n return if token\n refresh_token!\n end",
"title": ""
},
{
"docid": "416b840132cd0b3d6ad06a7b5a026f25",
"score": "0.61940134",
"text": "def reset\n # TODO\n end",
"title": ""
}
] |
fa0202191ac68e0921bd9663d42abd61
|
Fixes issues sorting as per
|
[
{
"docid": "d3135dc4158098626ce14234e6148cc2",
"score": "0.0",
"text": "def gantt_issue_compare_with_sorting(x, y, issues = nil)\n [(x.root.start_date or x.start_date or Date.new()), x.root_id, (x.start_date or Date.new()), x.lft] <=> [(y.root.start_date or y.start_date or Date.new()), y.root_id, (y.start_date or Date.new()), y.lft]\n end",
"title": ""
}
] |
[
{
"docid": "02f49c93e72b2a8de7272166ba44c351",
"score": "0.7518271",
"text": "def sort_labeled_issues(issues); end",
"title": ""
},
{
"docid": "716bfc5dce35f6e9e9bd2ab68b58028c",
"score": "0.71300197",
"text": "def sort_issues!(issues)\n issues.sort! { |a, b| gantt_issue_compare(a, b, issues) }\n end",
"title": ""
},
{
"docid": "a3fc9142647ac03c8829b7cb910b8ee7",
"score": "0.7076181",
"text": "def sort_issues!(issues)\n issues.sort! { |a, b| gantt_issue_compare(a, b) }\n end",
"title": ""
},
{
"docid": "b66eefef3423b43e3a85240c573376d9",
"score": "0.70460063",
"text": "def sort_entries; end",
"title": ""
},
{
"docid": "63d1a57a6638ed72c44d545c59d60145",
"score": "0.6923418",
"text": "def sort_into_sections(pull_requests, issues); end",
"title": ""
},
{
"docid": "b0b212c1d5230a9b8d9562c050ef7d4f",
"score": "0.67709893",
"text": "def sort!\n # no op\n end",
"title": ""
},
{
"docid": "77f7d0e9c0de6dc934c0adc52864a665",
"score": "0.6764971",
"text": "def secondary_sort\n # This function is empty as it's a placeholder for custom code...\n end",
"title": ""
},
{
"docid": "86b32eb4800a951d13204044419a2a59",
"score": "0.67161095",
"text": "def sort\n return unless @model\n return if @sort_keys.empty?\n $log.debug \"TABULAR SORT KEYS #{sort_keys} \"\n # first row is the header which should remain in place\n # We could have kept column headers separate, but then too much of mucking around\n # with textpad, this way we avoid touching it\n header = @model.delete_at 0\n begin\n # next line often can give error \"array within array\" - i think on date fields that \n # contain nils\n @model.sort!{|x,y| \n res = 0\n @sort_keys.each { |ee| \n e = ee.abs-1 # since we had offsetted by 1 earlier\n abse = e.abs\n if ee < 0\n xx = x[abse]\n yy = y[abse]\n # the following checks are since nil values cause an error to be raised\n if xx.nil? && yy.nil?\n res = 0\n elsif xx.nil?\n res = 1\n elsif yy.nil?\n res = -1\n else\n res = y[abse] <=> x[abse]\n end\n else\n xx = x[e]\n yy = y[e]\n # the following checks are since nil values cause an error to be raised\n # whereas we want a nil to be wither treated as a zero or a blank\n if xx.nil? && yy.nil?\n res = 0\n elsif xx.nil?\n res = -1\n elsif yy.nil?\n res = 1\n else\n res = x[e] <=> y[e]\n end\n end\n break if res != 0\n }\n res\n }\n ensure\n @model.insert 0, header if header\n end\n end",
"title": ""
},
{
"docid": "2363161df98d01a39ea8d448d0d94311",
"score": "0.6693723",
"text": "def sort!\n # define sorting heuristics in a subclass\n end",
"title": ""
},
{
"docid": "7e30cc32000a0ae826a49d69c02f7428",
"score": "0.66933036",
"text": "def sort\n return unless @model\n return if @sort_keys.empty?\n $log.debug \"TABULAR SORT KEYS #{sort_keys} \"\n # first row is the header which should remain in place\n # We could have kept column headers separate, but then too much of mucking around\n # with textpad, this way we avoid touching it\n header = @model.delete_at 0\n begin\n # next line often can give error \"array within array\" - i think on date fields that\n # contain nils\n @model.sort!{|x,y|\n res = 0\n @sort_keys.each { |ee|\n e = ee.abs-1 # since we had offsetted by 1 earlier\n abse = e.abs\n if ee < 0\n xx = x[abse]\n yy = y[abse]\n # the following checks are since nil values cause an error to be raised\n if xx.nil? && yy.nil?\n res = 0\n elsif xx.nil?\n res = 1\n elsif yy.nil?\n res = -1\n else\n res = y[abse] <=> x[abse]\n end\n else\n xx = x[e]\n yy = y[e]\n # the following checks are since nil values cause an error to be raised\n # whereas we want a nil to be wither treated as a zero or a blank\n if xx.nil? && yy.nil?\n res = 0\n elsif xx.nil?\n res = -1\n elsif yy.nil?\n res = 1\n else\n res = x[e] <=> y[e]\n end\n end\n break if res != 0\n }\n res\n }\n ensure\n @model.insert 0, header if header\n end\n end",
"title": ""
},
{
"docid": "c58b0fe67cd640e73369e65b79eae726",
"score": "0.6682828",
"text": "def effort_sort\n @issues = Issue.all.order_by_effort \n render :index \n end",
"title": ""
},
{
"docid": "396f2144345bfbcf4f56904d1134de76",
"score": "0.6667172",
"text": "def sort_text; end",
"title": ""
},
{
"docid": "4aad4204a9e04cc12275caca839eff7a",
"score": "0.66488606",
"text": "def sort!()\n @results.each_value do |jobs|\n jobs.sort! do |x , y|\n d_x = Date.parse(posting_date(x))\n d_y = Date.parse(posting_date(y))\n d_y <=> d_x\n end\n end\n end",
"title": ""
},
{
"docid": "b22b3546c20a91573ef3c2c8c18b3a0f",
"score": "0.66338605",
"text": "def main_sort_running_order; end",
"title": ""
},
{
"docid": "df8ebbc1c591323cd85c50328186462e",
"score": "0.6607021",
"text": "def sort_array",
"title": ""
},
{
"docid": "5c710d6e77021b12e2316e692a119128",
"score": "0.6576719",
"text": "def sort\n super.defer\n end",
"title": ""
},
{
"docid": "288975bb654deeb64ce92cc3b5996244",
"score": "0.65428823",
"text": "def match_when_sorted?; end",
"title": ""
},
{
"docid": "7cf7ee9455e9abb3b0b46e91ea294c0b",
"score": "0.65287066",
"text": "def sort_parts!; end",
"title": ""
},
{
"docid": "42d2566d1dfd7495fd9395612660e386",
"score": "0.65240145",
"text": "def resort\r\n @ls.set_sort_column_id(0)\r\n @ls.set_sort_func(0, &lambda{|iter1, iter2|\r\n item_id_1 = iter1[1].to_i\r\n item_id_2 = iter2[1].to_i\r\n \r\n item_name_1 = iter1[0].to_s.downcase\r\n item_name_2 = iter2[0].to_s.downcase\r\n \r\n if item_id_1 == 0\r\n return -1\r\n elsif item_id_2 == 0\r\n return 1\r\n else\r\n return item_name_1 <=> item_name_2\r\n end\r\n })\r\n end",
"title": ""
},
{
"docid": "41c9353ac05a443d3cd340ddea6d662b",
"score": "0.65086746",
"text": "def fix_ci_pipelines_not_sorted_on_legacy_project_json!\n return unless @relation_reader.legacy?\n\n @relation_reader.sort_ci_pipelines_by_id\n end",
"title": ""
},
{
"docid": "67f4018b090981168fe1919b682d6d53",
"score": "0.6499127",
"text": "def merge_sort\nend",
"title": ""
},
{
"docid": "2c2f1bcda5138218dcc607c820fa4cc5",
"score": "0.6483666",
"text": "def my_array_sorting_method(source)\n source.sort_by {|x| x.to_s}\n # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"title": ""
},
{
"docid": "2c2f1bcda5138218dcc607c820fa4cc5",
"score": "0.6483666",
"text": "def my_array_sorting_method(source)\n source.sort_by {|x| x.to_s}\n # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"title": ""
},
{
"docid": "dd6fd6570270e54dc72555ada9dfc1e6",
"score": "0.64748144",
"text": "def main_sort_big_done; end",
"title": ""
},
{
"docid": "3a19ceba7cdcb752bb2cba11e625d9c2",
"score": "0.6459572",
"text": "def sort_by\n end",
"title": ""
},
{
"docid": "d2e34790a5f00c7b936666332829e97b",
"score": "0.6444911",
"text": "def main_sort_copy; end",
"title": ""
},
{
"docid": "5b69602a57ab57141b4443056d95e582",
"score": "0.64254993",
"text": "def sort_entries=(_arg0); end",
"title": ""
},
{
"docid": "1a851f0f95a6341ed9afe1655d0f67e7",
"score": "0.6415803",
"text": "def index\n @issues = Issue.order(sort_column + \" \" + sort_direction)\n end",
"title": ""
},
{
"docid": "fe6be8fca7965de78379f9aa96d45e51",
"score": "0.64094466",
"text": "def sort_lab_entries(entries)\n entries.sort_by! do |entry|\n case entry\n when FHIR::DiagnosticReport\n -(entry.effectiveDateTime&.to_i || 0)\n when FHIR::DocumentReference\n -(entry.date&.to_i || 0)\n else\n 0\n end\n end\n end",
"title": ""
},
{
"docid": "bd91c5144eb45e67a1a3648de1e5f34e",
"score": "0.63869625",
"text": "def insertion_sort\n end",
"title": ""
},
{
"docid": "5e332ec65460ec46c963dd1026394db8",
"score": "0.6382498",
"text": "def sort_column_order\n array_for_numeric = [\"opportunities.amount\",\"opportunities.probability\",\"contacts.phone\",\"accounts.phone\",\"member_count\",\"responded_date\",\"campaign_member_status_type_id\",\"opportunity\",\"opportunity_amount\",\"matter_risks.details\",\"matter_facts.details\",\"documents.description\"]\n null_position = params[:dir].eql?(\"up\")? \"NULLS FIRST\":\"NULLS LAST\"\n #--------- SETTING THE SORTING ORDER HERE\n secondary_sort = params[:secondary_sort_direction].eql?(\"up\")? \"asc\" : \"desc\"\n sort = params[:dir].eql?(\"up\")? \"asc\" : \"desc\"\n if params[:col] && params[:secondary_sort]\n# if(params[:col]=='contacts.assigned_to_employee_user_id' || params[:col]=='accounts.assigned_to_employee_user_id' || params[:col]=='matter_tasks.assigned_to_user_id' )\n# @ord = \"users.first_name\" + ' ' + sort + ',' + \"users.last_name\" + ' ' + sort + ',' + params[:secondary_sort] + ' ' + secondary_sort\n if params[:col] == \"contacts.last_name\" && params[:controller] != \"opportunities\"\n @ord = \"coalesce(#{params[:col]+\",'')||''||contacts.first_name||''||coalesce(middle_name,'') \" + sort + ',' +params[:secondary_sort] + ' ' + secondary_sort}\"\n else\n @ord = params[:col] + ' ' + sort + ',' +params[:secondary_sort] + ' ' + secondary_sort\n end\n elsif params[:col] && !params[:secondary_sort]\n# if(params[:col]=='contacts.assigned_to_employee_user_id' || params[:col]=='accounts.assigned_to_employee_user_id' || params[:col]=='matter_tasks.assigned_to_user_id' )\n# @ord = \"users.first_name\"+ ' ' +sort\n if params[:col] == \"contacts.last_name\" && params[:controller] != \"opportunities\"\n @ord = \"coalesce(#{params[:col]+\",'')||''||contacts.first_name||''||coalesce(middle_name,'') \" +sort}\"\n else\n @ord = params[:col] + ' ' + sort\n end\n end\n end",
"title": ""
},
{
"docid": "65c3d885fcb4124af98b6d79f5d76ef8",
"score": "0.6349032",
"text": "def merge_sort()\nend",
"title": ""
},
{
"docid": "c31918bc4cf104d2f061be436d814391",
"score": "0.63482827",
"text": "def sort_cells(cells); end",
"title": ""
},
{
"docid": "242eff1e11a17167dbff5f9bf2f15fb0",
"score": "0.63235486",
"text": "def fix_order\n raise NotImplementedError, \"metodo aun no implementado\"\n end",
"title": ""
},
{
"docid": "53bb1ec84030c6690c05b8fce64fed31",
"score": "0.62880385",
"text": "def sort_order\n -100\n end",
"title": ""
},
{
"docid": "2bc1a300c6f4b81e74f88525aba1e9da",
"score": "0.62321377",
"text": "def sort_column\n end",
"title": ""
},
{
"docid": "2bc1a300c6f4b81e74f88525aba1e9da",
"score": "0.62321377",
"text": "def sort_column\n end",
"title": ""
},
{
"docid": "c9d3e8a8160f8fcce42ae61c54ad66af",
"score": "0.6230173",
"text": "def sort_direction\n end",
"title": ""
},
{
"docid": "d458f2422408b9066fd1cdd032ecf13e",
"score": "0.62200236",
"text": "def _sort!\n unless @sorted\n @a.sort! do | a, b |\n x = a.name <=> b.name\n if x == 0\n x = b.version <=> a.version\n end\n x\n end\n @sorted = true\n end\n @a\n end",
"title": ""
},
{
"docid": "6a3340b2c4c5b7e1184b67ec075426ae",
"score": "0.62177914",
"text": "def custom_sort(items)\n items.sort do |a, b|\n [b[:description][/\\d+/].to_i, a[:library]] <=>\n [a[:description][/\\d+/].to_i, b[:library]]\n end\n end",
"title": ""
},
{
"docid": "8f26dd2635c1eb29aca80bc1bd5bd467",
"score": "0.62174016",
"text": "def sort_method; end",
"title": ""
},
{
"docid": "74b9973aff033a27f44b0f56a1937126",
"score": "0.6211699",
"text": "def resort_array\n @target.sort! {|x,y| x[position_column].to_i <=> y[position_column].to_i} if @target\n end",
"title": ""
},
{
"docid": "365d638fa6653c5711dca4f960281d8d",
"score": "0.62068456",
"text": "def prio_sort(elements); end",
"title": ""
},
{
"docid": "825d1499c1dab49a08d5564691b4b751",
"score": "0.6200521",
"text": "def sort\n return unless @model\n return if @sort_keys.empty?\n $log.debug \"TABULAR SORT KEYS #{sort_keys} \"\n @model.sort!{|x,y| \n res = 0\n @sort_keys.each { |ee| \n e = ee.abs-1 # since we had offsetted by 1 earlier\n abse = e.abs\n if ee < 0\n res = y[abse] <=> x[abse]\n else\n res = x[e] <=> y[e]\n end\n break if res != 0\n }\n res\n }\n end",
"title": ""
},
{
"docid": "0be483b9b38e044aaf87c833a33bc8a8",
"score": "0.61967415",
"text": "def my_array_sorting_method(source)\n# This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"title": ""
},
{
"docid": "0be483b9b38e044aaf87c833a33bc8a8",
"score": "0.61967415",
"text": "def my_array_sorting_method(source)\n# This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"title": ""
},
{
"docid": "e61021d0adaf45b089453bce99401bd7",
"score": "0.61732614",
"text": "def resort_items_after_CUD!(items)\n sort! { |a, b| (items.index { |val| primary_key(val) == a.primary_key } || -1) <=> (items.index { |val| primary_key(val) == b.primary_key } || -1) }\n end",
"title": ""
},
{
"docid": "bc42dd2fbc7c1cd4bea616e597d46e89",
"score": "0.6168072",
"text": "def my_array_sorting_method(source)\nreturn source.sort {|item1, item2| item1.to_s <=> item2.to_s}\nend",
"title": ""
},
{
"docid": "9564895af3047d53664f42914d30aff5",
"score": "0.6133833",
"text": "def sort\n working_cards = create_working_array\n sorted_cards = []\n working_cards.count.times do\n low_index = index_lowest_remaining(working_cards)\n #Put the lowest remaining card into the sorted_cards array\n sorted_cards << working_cards[low_index][:card]\n #Put nil in the sort value to signify that the card has been placed\n working_cards[low_index][:sort_value] = nil\n end\n return sorted_cards\n end",
"title": ""
},
{
"docid": "f00edf2bfb36857a1aa48f7930aa6be0",
"score": "0.61290187",
"text": "def sort_checks_on_new_jobs\n @total_jobs_hash = @total_jobs.index_by(&:id)\n @checks.sort_by! do |check|\n if check.job.split_parent_job_id.present? || check.job.parent_job_id.present?\n split_image_values = check.job.initial_image_name.split('.').first.split('_').from(1)\n @compare_job = check.job\n split_image_values.length.times do |t|\n if check.job.split_parent_job_id.present?\n @compare_job = @total_jobs_hash[@compare_job.split_parent_job_id]\n elsif check.job.parent_job_id.present?\n @compare_job = @total_jobs_hash[@compare_job.parent_job_id]\n end\n end\n \"#{@compare_job.id}.#{split_image_values.present? ? split_image_values.join() : '0'}\".to_f\n else\n check.job_id.to_f\n end\n end\n end",
"title": ""
},
{
"docid": "a6802d7ef7d02ba41c4c5dc1d87716ee",
"score": "0.61253095",
"text": "def Reorderbymodel(newtypenbr)\n # the following line are put different model numbers into an array \n differentmodels = Array.new\n File.open(\"inventory.txt\") do |f|\n f.each_line do |line|\n if line[0] == newtypenbr\n unless differentmodels.include?(line[1,3])\n differentmodels << line[1,3]\n end\n end\n end\n end\n # The following codes are sort the model numbers\n \n# *BUBBLE SORT* |\n# *BUBBLE SORT* |\n# *BUBBLE SORT* |\n# *BUBBLE SORT* |\n# *BUBBLE SORT* |\n# *BUBBLE SORT* V\n differentmodels.each do |i|\n i = 0\n j = 1\n while (j < differentmodels.size)\n if differentmodels[i] >= differentmodels[j]\n differentmodels[i],differentmodels[j] = differentmodels[j],differentmodels[i]\n end \n i+=1\n j+=1\n end\n end\n \n return differentmodels.last\nend",
"title": ""
},
{
"docid": "b283ff9b329cabdcbb99cc9898e5d307",
"score": "0.61108226",
"text": "def sort_order\n if ministry_or_title == 'Prime Minister'\n 'AAAAA' # force first\n else\n ministry_or_title\n end\n end",
"title": ""
},
{
"docid": "4959c45aa76d42c0a05439156d0a0b2a",
"score": "0.6110784",
"text": "def issuable_sorting_field\n nil\n end",
"title": ""
},
{
"docid": "ba93838f1f50be0243febeb6ceb8097d",
"score": "0.6108041",
"text": "def events_sort()\n $new_events = $new_events.sort {|left, right| (@items[left])[:event] <=> (@items[right])[:event]}\n $old_events = $old_events.sort {|left, right| (@items[left])[:event] <=> (@items[right])[:event]}\n $old_events = $old_events.reverse\nend",
"title": ""
},
{
"docid": "ba93838f1f50be0243febeb6ceb8097d",
"score": "0.6108041",
"text": "def events_sort()\n $new_events = $new_events.sort {|left, right| (@items[left])[:event] <=> (@items[right])[:event]}\n $old_events = $old_events.sort {|left, right| (@items[left])[:event] <=> (@items[right])[:event]}\n $old_events = $old_events.reverse\nend",
"title": ""
},
{
"docid": "5c6584c38506f22a65f21fb5e6b3f852",
"score": "0.6097702",
"text": "def hs_sort_alls()\n\t$alls.each { |k, v|\n\t\tresult = v.sort {|left, right| (@items[left])[:created] <=> (@items[right])[:created]}\n\t\tv = result\n\t}\nend",
"title": ""
},
{
"docid": "6714e46e52fb72fdef03ef853b92655a",
"score": "0.6093675",
"text": "def sort\n dup.sort!\n end",
"title": ""
},
{
"docid": "f6a37dee8dabfd55036df47bb21a51a9",
"score": "0.6092097",
"text": "def sort_by_major\n sort_by 'Major'\n end",
"title": ""
},
{
"docid": "168163620d5b1ff4a4f89dcb7e1c169f",
"score": "0.6090124",
"text": "def sort\n params[:bugs].each_with_index do |id, index|\n Bug.update_all(['position=?', index+1], ['id=?', id])\n end\n render :nothing => true\n end",
"title": ""
},
{
"docid": "8b398683b0f34f578410ffce5eff3679",
"score": "0.6089651",
"text": "def my_array_sorting_method(source)\n\treturn source.map{|x| x.to_s}.sort \n\t#return source.sort_by{|x| x.to_s} => see comment A below regarding this line\nend",
"title": ""
},
{
"docid": "84bad70fffd317c3a7581f4334640132",
"score": "0.60881996",
"text": "def patched_merge_sort!\n return self if empty?\n\n merge_sort_private(self)\n end",
"title": ""
},
{
"docid": "dbf1e24852d227965390964deb65470c",
"score": "0.6084788",
"text": "def sort_by\n super.defer\n end",
"title": ""
},
{
"docid": "68c186aec387423a8a1a0aa9968270c2",
"score": "0.6084414",
"text": "def my_array_sorting_method(source)\n # sort by converting the integers, if there are, into strings for the purpose of sorting only\n return source.sort {|a,b| a.to_s <=> b.to_s }\nend",
"title": ""
},
{
"docid": "d395664962cc104663446ea3443065a3",
"score": "0.60573816",
"text": "def insertion_sort(arr)\n return arr\n>>>>>>> dab67fda06d0a272bd575d9f294d4c234c05b701\nend",
"title": ""
},
{
"docid": "9047765e03b8e9ae2c29d56dfb41f77d",
"score": "0.6051489",
"text": "def sort_by_title(problems)\n\t\t@problems = @problems.sort_by &:problem_title #if params[:SortName].present?\n\tend",
"title": ""
},
{
"docid": "277d120f20b29c380b5c2c42cbd533c9",
"score": "0.6047605",
"text": "def set_sort_order(order); end",
"title": ""
},
{
"docid": "4c088746c0a02869c06c8a62e212ac62",
"score": "0.60462505",
"text": "def clean_sort(params)\n case @sort_override || params[:sort_column_name]\n when 'response_due_on' # Soonest to end first\n (column = 'response_due_on') && (order = 'asc')\n when 'first_published_at' # Newest posted to oldest\n (column = 'first_published_at') && (order = 'desc')\n when 'updated_at' # Most recently updated\n (column = 'updated_at') && (order = 'desc')\n when 'relevance' # Most relevant first\n (column = 'response_due_on') && (order = 'asc') # TODO: Add relevance. Temporary fix\n else\n (column = 'response_due_on') && (order = 'asc')\n end\n OpportunitySort.new(default_column: column, default_order: order)\n end",
"title": ""
},
{
"docid": "d834ef0e37d7e8604eb131c56c1256cf",
"score": "0.60362846",
"text": "def mergeSort\n\nend",
"title": ""
},
{
"docid": "d0f32909d7de43ea7295dd819f7eaff0",
"score": "0.6028265",
"text": "def sort(formatted_records)\n formatted_records.sort do |first, second|\n [first.datetime, first.index] <=> [second.datetime, second.index]\n end\n end",
"title": ""
},
{
"docid": "db6a83b9efb5b1a780654b7cf529275b",
"score": "0.60269463",
"text": "def display_sorted\nend",
"title": ""
},
{
"docid": "bbbbef158bcf88e9980914dddf5bb79b",
"score": "0.6025465",
"text": "def my_array_sorting_method(source)\n\n source.sort do |x,y|\n if x.class == y.class\n x <=> y\n else\n x.to_s <=> y.to_s\n end\n end\nend",
"title": ""
},
{
"docid": "f1a92c71ee29b2a26f860b8ecac5336d",
"score": "0.60120904",
"text": "def sort_results(formatted_results)\n formatted_results.sort do |a, b|\n [b[:page_views], b[:url]] <=> [a[:page_views], a[:url]]\n end\n end",
"title": ""
},
{
"docid": "b3353ff594a3b91c8d8be88076be0ec2",
"score": "0.6010397",
"text": "def my_array_sorting_method(source)\n source.sort_by {|x| x.to_s } #used the sort method\nend",
"title": ""
},
{
"docid": "5fb1f841a85877b60e4b19523201afa6",
"score": "0.60078466",
"text": "def sortgoods\n @goods = @goods.flatten.sort { |x, y|\n $values[x[0].chr] <=> $values[y[0].chr]\n }\n end",
"title": ""
},
{
"docid": "72aa19f2a646297928936bd2475ed9de",
"score": "0.5999264",
"text": "def my_array_sorting_method(source)\n \nend",
"title": ""
},
{
"docid": "aae21dc09f0c1a9c8a0abbeba4bff503",
"score": "0.59945583",
"text": "def sorted(items)\n items.sort do |a, b|\n if a.abbreviation && b.abbreviation\n a.abbreviation.downcase <=> b.abbreviation.downcase\n else\n a.title.downcase <=> b.abbreviation.try(:downcase)\n end\n a.partner_led.to_s <=> b.partner_led.to_s\n end\n end",
"title": ""
},
{
"docid": "9b56268ab2c73bc4bae5c61144e8615e",
"score": "0.5991237",
"text": "def sort!\n l_arr, m_arr = [ ], [ ]\n self.pool.each do |line|\n m_arr.push(line.mar)\n l_arr.push(line)\n end\n\n m_arr, out = m_arr.sort, [ ]\n m_arr.each do |mar|\n l_arr.each do |line|\n if line.mar == mar\n out.push(line)\n l_arr.delete(line)\n end\n end\n end\n\n self.pool = out.reverse\n end",
"title": ""
},
{
"docid": "678d031f9c7cb79c2d96181c841629b6",
"score": "0.5983048",
"text": "def sorted_bug_stats\n stat_hash = {}\n for stat in @bug_stats\n if (stat.wins+stat.losses)>=20\n stat_hash[stat.bug_id] = stat.elo_score\n end\n end\n\n stat_hash.values.sort\n stat_hash.each do |key, value|\n puts('key='+key+', value='+value)\n end\n end",
"title": ""
},
{
"docid": "837889639168c8d40710d976178942e7",
"score": "0.5963441",
"text": "def ordered_issues(column, issue_numbers)\n issue_numbers.map do |number|\n issues_by_columns[column.id].detect do |issue|\n number.to_i == issue.number && !issue.archive?\n end\n end.\n compact.\n uniq(&:number) # NOTE Need for remove magic duplication.\n end",
"title": ""
},
{
"docid": "9670d6ba200c73ee58f85b7506f2ec1e",
"score": "0.59570616",
"text": "def full_merge_sort(array)\n MergeSortCollection.new(array).sort!.to_a.map do |data|\n # fetch the letters, not the numbers\n data.match(/\\A(\\d+)\\s(.+)\\Z/)[2]\n end\nend",
"title": ""
},
{
"docid": "45ff6a3a91a698f500afaa2b5de0bcba",
"score": "0.59521866",
"text": "def my_array_sorting_method(source)\n return source.sort! {|x,y| x.to_s <=> y.to_s}\nend",
"title": ""
},
{
"docid": "b6f69ac92877bf4dca717bbe7bf4f559",
"score": "0.59467196",
"text": "def reorder\n end",
"title": ""
},
{
"docid": "da44ab86b789551275b9d157d8cc1c1c",
"score": "0.5945656",
"text": "def sort_data \n @drivers = @drivers.to_a \n @drivers.sort! {|a, b| b[1].total_miles_driven <=> a[1].total_miles_driven} \n @drivers = @drivers.to_h \n end",
"title": ""
},
{
"docid": "dbd0753febd3eeea44c491e8211fafa6",
"score": "0.5945252",
"text": "def sort_rankings(teams_array_w_record)\n rec_sort_rankings(teams_array_w_record, [])\nend",
"title": ""
},
{
"docid": "1f92f0a4d3179ef78462d94d9b135b15",
"score": "0.5942162",
"text": "def sort_collections_desc\n @orignal_pages = @orignal_pages.sort_by { |_key, value| -value }\n @no_id_pages = @no_id_pages.sort_by { |_key, value| -value }\n end",
"title": ""
},
{
"docid": "30ab3d165e3958df85852da028ff070b",
"score": "0.5939752",
"text": "def special_fulladvisory_sort_helper(fulladvisory)\n case fulladvisory\n when /^RHSA/\n \"1000_#{fulladvisory}\"\n when /^RHBA/\n \"2000_#{fulladvisory}\"\n when /^RHEA/\n \"3000_#{fulladvisory}\"\n else\n # should never get here?\n \"4000_#{fulladvisory}\"\n end\n end",
"title": ""
},
{
"docid": "6f35d460f860d86e18c1ea8eac5f1600",
"score": "0.593823",
"text": "def my_array_sorting_method(source)\r\n return source.sort {|item1, item2| item1.to_s <=> item2.to_s}\r\nend",
"title": ""
},
{
"docid": "38c955ea02c53b0e12bb1f6bb206b14e",
"score": "0.5937129",
"text": "def my_array_sorting_method(source)\n\tsource.sort {|a,b| a.to_s <=> b.to_s}\nend",
"title": ""
},
{
"docid": "697515404c334f1546b4e56553597f75",
"score": "0.5934195",
"text": "def my_array_sorting_method(source)\n\nend",
"title": ""
},
{
"docid": "697515404c334f1546b4e56553597f75",
"score": "0.5934195",
"text": "def my_array_sorting_method(source)\n\nend",
"title": ""
},
{
"docid": "697515404c334f1546b4e56553597f75",
"score": "0.5934195",
"text": "def my_array_sorting_method(source)\n\nend",
"title": ""
},
{
"docid": "89cd91a9a128cf8d5b72c6e26786a4d6",
"score": "0.59333557",
"text": "def mergesort\n working_cards = create_working_array\n sorted_cards = branch_n_merge(working_cards)\n sorted_cards.map { |card_record| card_record[:card] }\n end",
"title": ""
},
{
"docid": "38527acb436c8054570de2586b51cc05",
"score": "0.5933208",
"text": "def sort_scoreboard\n @sort_rows = @top_names_and_scores\n @sort_rows = @sort_rows.sort_by(&:last).reverse.first(10)\n end",
"title": ""
},
{
"docid": "93bd84b76e800586552cb92b3df97dfe",
"score": "0.5930597",
"text": "def reset_array_to_sort\n @original_array.each do |visual_data|\n visual_data.type = :unsorted\n end\n\n @array_to_sort = @original_array.dup\n end",
"title": ""
},
{
"docid": "91d3f681cd96146a25662e140c622c58",
"score": "0.59244186",
"text": "def sort_snps\n @snps.sort!{|x,y| x.location <=> y.location}\n end",
"title": ""
},
{
"docid": "e7b663fbb8195f18a964090afd1c04a0",
"score": "0.59233946",
"text": "def sort_params; end",
"title": ""
},
{
"docid": "e7b663fbb8195f18a964090afd1c04a0",
"score": "0.59233946",
"text": "def sort_params; end",
"title": ""
},
{
"docid": "88f9dc38b6c67ff8d7efa723d3174d1f",
"score": "0.59217674",
"text": "def my_array_sorting_method(source)\n sourceDup = source.dup\n # p sourceDup.sort_by{|word| word.to_s}\n\n return sourceDup.sort_by{|word| word.to_s}\nend",
"title": ""
},
{
"docid": "9c24e8464d801337a7c391c099daf199",
"score": "0.5913628",
"text": "def sortByDifficulty(arr, index)\n return arr.sort {|a,b| b[index].to_f <=> a[index].to_f}\nend",
"title": ""
},
{
"docid": "9c24e8464d801337a7c391c099daf199",
"score": "0.5913628",
"text": "def sortByDifficulty(arr, index)\n return arr.sort {|a,b| b[index].to_f <=> a[index].to_f}\nend",
"title": ""
},
{
"docid": "7f16cf45c7d88e51613d6afbcd0e1740",
"score": "0.59121215",
"text": "def my_array_sorting_method(source)\nend",
"title": ""
}
] |
98d7ece9d18455fde1f9e7786633a8fc
|
there are multiple acceptable answers for this one. What is the output of the following code
|
[
{
"docid": "6fae7d3e6db57691bbb5931d09bf5256",
"score": "0.0",
"text": "def recursion(x)\n return \"HEYO!\" if x >= 5\n puts x\n recursion(x += 1)\nend",
"title": ""
}
] |
[
{
"docid": "991b6f12a63ef51664b84eb729f67eed",
"score": "0.57259",
"text": "def formation; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.55684644",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.55684644",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.55684644",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.55684644",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.55684644",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.55684644",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.55684644",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.55684644",
"text": "def result; end",
"title": ""
},
{
"docid": "b9960478999684c2b536f76e22f6fc63",
"score": "0.55617577",
"text": "def solution4(input)\n end",
"title": ""
},
{
"docid": "2b4524c253fc8ff4ba97c8baa763dc35",
"score": "0.5553934",
"text": "def cardinal; end",
"title": ""
},
{
"docid": "1978988b65d903f81fde1624b9e5eb67",
"score": "0.5509319",
"text": "def primordial; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5496689",
"text": "def anchored; end",
"title": ""
},
{
"docid": "67e1e5bcf13dadff381ca08b8b2f3258",
"score": "0.54959726",
"text": "def ismn; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.5422671",
"text": "def probers; end",
"title": ""
},
{
"docid": "5971f871580b6a6e5171c35946a30c95",
"score": "0.5380385",
"text": "def stderrs; end",
"title": ""
},
{
"docid": "a7e46056aae02404670c78192ffb8f3f",
"score": "0.5371445",
"text": "def original_result; end",
"title": ""
},
{
"docid": "94a9f9cebb96ca3b29ccb5ba3cfcdd94",
"score": "0.53403056",
"text": "def alternatives; end",
"title": ""
},
{
"docid": "d88aeca0eb7d8aa34789deeabc5063cf",
"score": "0.532259",
"text": "def offences_by; end",
"title": ""
},
{
"docid": "942b1919f4cb16e88236a84e6be81d0e",
"score": "0.52937806",
"text": "def most_specific_subdivision; end",
"title": ""
},
{
"docid": "ed7a9159acf7052543149b17bef5c833",
"score": "0.52759975",
"text": "def out; end",
"title": ""
},
{
"docid": "76172a64c7a34508bda812effb98588f",
"score": "0.5250562",
"text": "def explain_the_situation(hand, who)\n v = value_of_hand(hand)\n puts \"#{who}'s cards are: #{hand.join(\", \")}\"\n puts \"They add up to: #{v}\"\nend",
"title": ""
},
{
"docid": "13289d4d24c54cff8b70fcaefc85384e",
"score": "0.52380264",
"text": "def verdi; end",
"title": ""
},
{
"docid": "b8f5977f9c482ac7435d89a341265465",
"score": "0.52344346",
"text": "def sisoku(a, b)\r\n puts a+b\r\n puts a-b\r\n puts a*b\r\n puts a/b\r\n end",
"title": ""
},
{
"docid": "68a3dd7faf49ea65ce0d5401c9a04f57",
"score": "0.52313733",
"text": "def result_of_checking; end",
"title": ""
},
{
"docid": "264cacd22ec67ef709fab7ac35bc522c",
"score": "0.52269554",
"text": "def p15\n\t\nend",
"title": ""
},
{
"docid": "d996063a1bda83fd8644c8cbac831e61",
"score": "0.5221423",
"text": "def rassoc(p0) end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.51775503",
"text": "def inspect; end",
"title": ""
},
{
"docid": "ebbbccb5e4658f740b7b2b6ae088c831",
"score": "0.5175192",
"text": "def desc() summary; end",
"title": ""
},
{
"docid": "3045a5401bcc838e0aadfbd339a02da9",
"score": "0.51673555",
"text": "def number_returned; 0; end",
"title": ""
},
{
"docid": "f64337f68710b6e55a87e68bde8c4693",
"score": "0.5164691",
"text": "def king_richard_iii; end",
"title": ""
},
{
"docid": "cf862ee5a12d195b7c191da90773b8cf",
"score": "0.51608956",
"text": "def another; return []; end",
"title": ""
},
{
"docid": "3b4df29992323899033bb22a35a64989",
"score": "0.5112805",
"text": "def malts; end",
"title": ""
},
{
"docid": "cc4075893c4b8d356b33c7b933150b1f",
"score": "0.5106753",
"text": "def numerator() end",
"title": ""
},
{
"docid": "eb111f1fb32bc31204771f35c9524a9d",
"score": "0.5103756",
"text": "def most_interesting_man_in_the_world; end",
"title": ""
},
{
"docid": "5cf20d5aba71d434e3118cf082e5b244",
"score": "0.51011616",
"text": "def schumann; end",
"title": ""
},
{
"docid": "0ebbf3e1ad3e179a40e9276001e4b52d",
"score": "0.50906163",
"text": "def question\r\n num1, num2 = self.values\r\n \"What does #{num1} plus #{num2} equal?\"\r\n end",
"title": ""
},
{
"docid": "54daf6b93940e3e4e685ffea5be30ead",
"score": "0.5089776",
"text": "def alg; end",
"title": ""
},
{
"docid": "704a59e4c7a5c29ca1e0eb5d828736e1",
"score": "0.5084271",
"text": "def get_adjective\n\t\t[\"pretty\", \"ugly\", \"hideous\"].sample\n\tend",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5082125",
"text": "def inspect() end",
"title": ""
},
{
"docid": "53a81908ab8713ac5c3970028227d744",
"score": "0.50810426",
"text": "def get_output(stacks, blocks, put_shulkers=false)\n s = \"\"\n put_stacks, put_blocks = stacks.nonzero?, blocks.nonzero?\n\n if put_shulkers\n s += pluralize boxes = (stacks / 27).floor, \"shulker\"\n\n # Strip the necessary # of stacks off the count.\n stacks -= boxes * 27\n put_stacks = stacks.nonzero?\n\n s += \", \" if put_stacks or put_blocks\n end\n\n if put_stacks\n s += pluralize stacks, \"stack\"\n s += \", \" if put_blocks\n end\n\n s += pluralize blocks, \"block\" if put_blocks\n\n s\nend",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.5079432",
"text": "def schubert; end",
"title": ""
},
{
"docid": "9ee853e5ba249722f6bfacc1f524232f",
"score": "0.5077224",
"text": "def value() end",
"title": ""
},
{
"docid": "0225a9f23a0fa436bcdab339adc872dd",
"score": "0.50734633",
"text": "def same; end",
"title": ""
},
{
"docid": "cdd16ea92eae0350ca313fc870e10526",
"score": "0.50716484",
"text": "def who_we_are\r\n end",
"title": ""
},
{
"docid": "b1cdddbbe55254be1a196c7f5374f593",
"score": "0.5068799",
"text": "def print_result(w)\nputs \"\\n\" if @debug == true\nputs \"\\n\" if @debug == true\n\tn = w.count\n\tfor i in Range.new(0, n-1)\n\t\tprint \"+\" if i > 0 && w[i] > 0 && w[i-1] != 0\n\t\tprint \"#{w[i]}*\" unless w[i] == 0 || w[i] == 1 || w[i] == -1\n\t\tprint \"-\" if w[i] == -1\n\t\tprint \"x^#{i}\" unless w[i] == 0\n\tend\nend",
"title": ""
},
{
"docid": "4a8a45e636a05760a8e8c55f7aa1c766",
"score": "0.5063355",
"text": "def terpene; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5060335",
"text": "def r; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5060335",
"text": "def r; end",
"title": ""
},
{
"docid": "7fa37695c4f11cea891dcae8314efd7c",
"score": "0.5059911",
"text": "def test(num)\n return \"cowboy bebop\", 1990, num * num * num\nend",
"title": ""
},
{
"docid": "d2f660b1dee19cd89ce7fa813afd2173",
"score": "0.50538206",
"text": "def y; end",
"title": ""
},
{
"docid": "d2f660b1dee19cd89ce7fa813afd2173",
"score": "0.50538206",
"text": "def y; end",
"title": ""
},
{
"docid": "d2f660b1dee19cd89ce7fa813afd2173",
"score": "0.50538206",
"text": "def y; end",
"title": ""
},
{
"docid": "1f60ec3e87d82a4252630cec8fdc8950",
"score": "0.5051745",
"text": "def berlioz; end",
"title": ""
},
{
"docid": "3905471fee3a3b7ba36c5d16a9f7c73e",
"score": "0.5050144",
"text": "def describe_problem(p)\n return p[0].to_s+\"-\"+p[1]\nend",
"title": ""
},
{
"docid": "d8216257f367748eea163fc1aa556306",
"score": "0.5045178",
"text": "def bs; end",
"title": ""
},
{
"docid": "5c3defa03180c258d1517518f3f618c1",
"score": "0.5023876",
"text": "def basic_feature(str)\n\tputs str + \" \" + str\n\tputs str * 3\n\tputs \"1\" + \"2\"\n\tputs \"1\" * 2\n\tputs str.size\n\tputs str.length\n\tputs str.capitalize\n\tputs str.reverse\n\tputs str.upcase\n\tputs str.downcase\n\tputs str.swapcase\nend",
"title": ""
},
{
"docid": "8742865b78eb755e40bb1bff22199433",
"score": "0.50217205",
"text": "def internship_passed; end",
"title": ""
},
{
"docid": "bf12558134d51a34e62da7291fe95772",
"score": "0.5008422",
"text": "def getc() end",
"title": ""
},
{
"docid": "bf12558134d51a34e62da7291fe95772",
"score": "0.5008422",
"text": "def getc() end",
"title": ""
}
] |
eadf21cd6951df881afb390b6898318a
|
GET /photo_products/1 GET /photo_products/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "36d50e04a4ef2252a56364a370abb544",
"score": "0.7878689",
"text": "def show\n @photo_product = PhotoProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo_product }\n end\n end",
"title": ""
},
{
"docid": "1d07f3d6710389b46ede0fb792825a17",
"score": "0.76605505",
"text": "def index\n api_method = 'products'\n path = Rails.configuration.MprProductsAPI.to_s + api_method.to_s\n @products = ActiveSupport::JSON.decode http_get(path).body\n @images = @products['images']\n @products = @products['product']\n # render json: @products\n\tend",
"title": ""
},
{
"docid": "fbfc58ca19bd779db6ff9a60623bfa9e",
"score": "0.74146014",
"text": "def index\n @photo_products = PhotoProduct.all\n end",
"title": ""
},
{
"docid": "c04f31e06d216cdd65e41533c81deba4",
"score": "0.73793846",
"text": "def show\n\t\tapi_method = 'products/' + params[:id]\n path = Rails.configuration.MprProductsAPI.to_s + api_method.to_s\n @product = ActiveSupport::JSON.decode http_get(path).body\n puts @product['image'].inspect\n\tend",
"title": ""
},
{
"docid": "8162988bbe444bbbeb85cfe4d7d70fcf",
"score": "0.7268593",
"text": "def show\n @product = Product.find(params[:id])\n if @product.present?\n render json: {\n status: 'OK', results: @product.as_json(include: %i[pictures]), error: nil\n }, status: :ok\n else\n not_process\n end\n end",
"title": ""
},
{
"docid": "32e5617d59b8b89392a699aa9f343df8",
"score": "0.72671616",
"text": "def show\n @images_product = ImagesProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @images_product }\n end\n end",
"title": ""
},
{
"docid": "59e027d85dee8e90a08ab6a4cba2d639",
"score": "0.72340125",
"text": "def index\n @photos = Photo.where(product_id: @product)\n \n end",
"title": ""
},
{
"docid": "8e03544ff02d8f3a0d284484ed6eca0f",
"score": "0.7209545",
"text": "def show\n @photo = Photo.find(params[:id])\n\n render json: @photo\n end",
"title": ""
},
{
"docid": "eca8ca422a8855535278466bb5503d74",
"score": "0.7197223",
"text": "def new\n @photo_product = PhotoProduct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo_product }\n end\n end",
"title": ""
},
{
"docid": "76feaa62a83866f00852ba6aaaade83d",
"score": "0.71536016",
"text": "def show\n #@picture = Picture.find(params[:id])\n @picture = @product.pictures.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "5446fe298f4e02d4a65cb77226cf7e38",
"score": "0.7047206",
"text": "def index\n @product_images = ProductImage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_images }\n end\n end",
"title": ""
},
{
"docid": "11dc43844b8c77ad98591c22151fcd29",
"score": "0.70408195",
"text": "def index\n @photos = @coin.photos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @photos }\n end\n end",
"title": ""
},
{
"docid": "316326f05277174394e98a14114db018",
"score": "0.7032488",
"text": "def show\n @photo = @coin.photos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @photo }\n end\n end",
"title": ""
},
{
"docid": "6a45798ff6c692bca2e96db34acfcb98",
"score": "0.70176345",
"text": "def images\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "da3f44581f63cc851049d11be9250f14",
"score": "0.7010198",
"text": "def index\n @photos = Photo.all\n render json: @photos\n end",
"title": ""
},
{
"docid": "a491c9ed4e629cf104ccb479d11ccdac",
"score": "0.7005747",
"text": "def show\n render json: @photo\n end",
"title": ""
},
{
"docid": "9c406b14339a08665c1345c89e6eda17",
"score": "0.6997043",
"text": "def show\n @product_photos = @product.product_photos.all\n end",
"title": ""
},
{
"docid": "9e0b6b9ed5cc7b75668037b98b41d9f1",
"score": "0.6991891",
"text": "def index\n @product = Product.all\n if @product.present?\n render json: { status: 'OK', results: @product.as_json(include: %i[pictures]), error: nil \n }, status: :ok\n else\n render json: {\n status: 'FAIL', results: nil, error: 'Data is empty'\n }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "267bc4eadea5cb3ae063591993b4366e",
"score": "0.69889075",
"text": "def index\n @photos = Photo.all\n\n render json: @photos\n end",
"title": ""
},
{
"docid": "cb6d3d0c42067537bed1feb6c2c1fbe5",
"score": "0.69746464",
"text": "def show\n @photo_item = PhotoItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @photo_item }\n end\n end",
"title": ""
},
{
"docid": "3863f0bf5ed374246e3b8a4fbd82fb6c",
"score": "0.69597995",
"text": "def show\n \n @photo = @gallery.photos.find(params[:id])\n\n respond_to do |format|\n\n format.html # show.html.erb\n format.json { render json: @photo }\n \n end\n \n end",
"title": ""
},
{
"docid": "73b1cf3c46ffda85ba02d07886276263",
"score": "0.6954675",
"text": "def index\n #@pictures = Picture.all\n @pictures = @product.pictures.order('updated_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"title": ""
},
{
"docid": "0fc9d5605a766733ee48bbe84dd2fd01",
"score": "0.69470865",
"text": "def show\n @product_image = ProductImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_image }\n end\n end",
"title": ""
},
{
"docid": "fa392815c1ca9f0c959bcb30679ff237",
"score": "0.69412583",
"text": "def photo_finder\n @photos = Photo.where(user_id: @current_user.id)\n render :json => @photos\n end",
"title": ""
},
{
"docid": "7373352a9083256998ea2ac125673b12",
"score": "0.6883394",
"text": "def show\n @redcarpet = Redcarpet.find(params[:id])\n @photos = @redcarpet.photos\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @redcarpet }\n end\n end",
"title": ""
},
{
"docid": "0402191c5779cb4aa13875d21ac6d1c2",
"score": "0.6878978",
"text": "def show\n @shop_photo = ShopPhoto.find(params[:id])\n render json: @shop_photo, meta: { status: :ok }, meta_key: 'result'\n end",
"title": ""
},
{
"docid": "e28d2678c4641de97d48a64202fb5ec5",
"score": "0.68746144",
"text": "def show\n @product = Product.find(params[:id])\n\t@photos = @product.photos.all(:conditions => \"id != #{@product.photo_id.to_s}\") if @product.photo_id?\n\t@comments = @product.comments\n\t@component_types = @product.component_types\n\t@title = @product.s_name\n\t@header = @product.s_name\n\t@meta_description = @product.note\n\t@robots_meta = [{:name => 'ROBOTS', :content => 'INDEX, FOLLOW'}]\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product }\n end\n end",
"title": ""
},
{
"docid": "8c8d1f0e6cbe4cdcbd626c5f3ede9547",
"score": "0.68684494",
"text": "def index\n \n @photos = @gallery.photos\n\n respond_to do |format|\n\n format.html # index.html.erb\n format.json { render json: @photos }\n \n end\n \n end",
"title": ""
},
{
"docid": "9c7547895e910eb8a56dfa591e246b06",
"score": "0.68435895",
"text": "def index\n @products = Product.includes(:photo).order('id DESC').page(params[:page]).per(5)\n end",
"title": ""
},
{
"docid": "ba804550491979189defa17bce876a77",
"score": "0.6843002",
"text": "def show\n @photo_cart = PhotoCart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo_cart }\n end\n end",
"title": ""
},
{
"docid": "437a94bf87a764ae3ac1887a58d6d0cd",
"score": "0.6841391",
"text": "def new\n @resource_title = \"Produk Baru\"\n @product = Product.new\n @product.photo_products.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product }\n end\n end",
"title": ""
},
{
"docid": "88651f1f779e8f793630dcc9aa5845c6",
"score": "0.6837113",
"text": "def index\n @photos = @gallery.photos.order(\"id ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photos }\n end\n end",
"title": ""
},
{
"docid": "b4b28cd3d622f32a8398a02f689e4baf",
"score": "0.6827016",
"text": "def get_product\n product = Product.find(params[:product_id])\n json_response(product)\n end",
"title": ""
},
{
"docid": "804e4397e674d31783072c88bc7ec4e6",
"score": "0.6820329",
"text": "def show\n render json: @gallery_photo\n end",
"title": ""
},
{
"docid": "800775077412e5e12d640ae54034b36a",
"score": "0.6815249",
"text": "def index\n @product_attach_images = ProductAttachImage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_attach_images }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "abdf4c20483cc4f35fbb3a3fd4b673d6",
"score": "0.68100977",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "b49ba7f99948034cd8e0722ea70c5468",
"score": "0.6798745",
"text": "def show\n @item = Item.find(params[:id])\n @photos = ItemPhoto.find_all_by_item_id(@item.id)\n @photos ||= []\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "6d94e5a0c4f62651aaddf6d56b2562f9",
"score": "0.6792691",
"text": "def show\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n format.html #show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "31001d16680bcb8f390179ab0fc26a53",
"score": "0.67864996",
"text": "def show\n @product = Product.find(params[:id])\n\t\t@picture = Picture.new(product_id: @product.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end",
"title": ""
},
{
"docid": "78bbd095b2e47de79ac12eb594bd58ad",
"score": "0.6782808",
"text": "def index\n @photos = @gallery.photos.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photos }\n end\n end",
"title": ""
},
{
"docid": "a7009d219c829c403af9ef2e8ca18b2e",
"score": "0.6778281",
"text": "def show\n # Pull the selected photo, if approved.\n @photo = Photo.approved.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: {\n id: @photo.id,\n photo_album_id: @photo.photo_album_id,\n file: {\n url: @photo.file.url,\n filename: File.basename(@photo.file.url)\n },\n caption: @photo.caption,\n from_user_username: @photo.from_user_username,\n from_user_full_name: @photo.from_user_full_name,\n from_user_id: @photo.from_user_id,\n from_service: @photo.from_service,\n position: @photo.position,\n from_twitter_image_service: @photo.from_twitter_image_service,\n tags: @photo.photo_tags.select([:id, :tag]),\n created_at: @photo.created_at,\n updated_at: @photo.updated_at\n }\n end\n end\n end",
"title": ""
},
{
"docid": "cb5481bcf55d86cb3aa146e38679b655",
"score": "0.67775303",
"text": "def index\n @photos = Photo.all\n\n respond_to do |format|\n format.html\n format.json\n end\n end",
"title": ""
},
{
"docid": "426376c42a79f1d27b711075fd546179",
"score": "0.676617",
"text": "def show\n @apartment_photos = @apartment.apartment_photos\n respond_to do |format|\n format.html\n format.json { render :json => @apartment.attributes.merge( {photo: @apartment_photos.first&.photo_url} ) }\n end\n end",
"title": ""
},
{
"docid": "d41d64cc8095e407cdaee5a874f4fd73",
"score": "0.6765049",
"text": "def index\n @photos = @resource.photos\n end",
"title": ""
},
{
"docid": "a2cb45827ba56e8ae7ed8a528e6caa44",
"score": "0.67602384",
"text": "def index\n render json: @photos.page(params[:page])\n end",
"title": ""
},
{
"docid": "9ef17eb985efc99df297cc387fb52477",
"score": "0.6746277",
"text": "def new\n\t\t@product = Product.new\n\t\t5.times { @product.photos.build }\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @product }\n\t\tend \n\tend",
"title": ""
},
{
"docid": "920009c9e7a700480e17cad535224938",
"score": "0.6741713",
"text": "def index\n @photos = Photo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photos }\n end\n end",
"title": ""
},
{
"docid": "920009c9e7a700480e17cad535224938",
"score": "0.6741713",
"text": "def index\n @photos = Photo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photos }\n end\n end",
"title": ""
},
{
"docid": "920009c9e7a700480e17cad535224938",
"score": "0.6741713",
"text": "def index\n @photos = Photo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photos }\n end\n end",
"title": ""
},
{
"docid": "ddb1729328683b26b9b7bc543f5058bb",
"score": "0.6730157",
"text": "def show\n @photo_gallery = PhotoGallery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo_gallery }\n end\n end",
"title": ""
},
{
"docid": "29fb6332d10e11d6d2a7debf12829e90",
"score": "0.6715847",
"text": "def show\r\n @photo = Photo.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @photo }\r\n end\r\n end",
"title": ""
},
{
"docid": "29fb6332d10e11d6d2a7debf12829e90",
"score": "0.6715847",
"text": "def show\r\n @photo = Photo.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @photo }\r\n end\r\n end",
"title": ""
},
{
"docid": "a06eb43eff1d37c3950104b8608b37f8",
"score": "0.6710812",
"text": "def show\n @v1_product = V1::Product.find(params[:id])\n\n render json: @v1_product\n end",
"title": ""
},
{
"docid": "5fd096cd4e34710c44ded8f2c8483ace",
"score": "0.6691053",
"text": "def show\n @photos = @post.photos\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "84cc5f8577478e0bbefe5cbc423b0ed9",
"score": "0.6687031",
"text": "def show\n @photo_package = PhotoPackage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo_package }\n end\n end",
"title": ""
},
{
"docid": "c60aa19ba32cbda7bc323f71e1302b4a",
"score": "0.6683573",
"text": "def show\n @photo_gallery = PhotoGallery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @photo_gallery }\n end\n end",
"title": ""
},
{
"docid": "d61a24e087fc5819b3d304f0c6bbe537",
"score": "0.6676696",
"text": "def show\n @restaurant_photo = RestaurantPhoto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restaurant_photo }\n end\n end",
"title": ""
},
{
"docid": "a3552a192e8a5f1826af12e2def1de0b",
"score": "0.6667522",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "a3552a192e8a5f1826af12e2def1de0b",
"score": "0.6666274",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "a3552a192e8a5f1826af12e2def1de0b",
"score": "0.6666274",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo }\n end\n end",
"title": ""
},
{
"docid": "9f050271c955244e9ae8f13d553acfbd",
"score": "0.6658682",
"text": "def index\n @products = Product.select('id', 'name', 'description', 'price', 'quantity').all\n @images = @products.map { |product| product.product_images[0].image.url(:thumb) }\n end",
"title": ""
},
{
"docid": "a20f187869d5686cda40eeef822789e4",
"score": "0.66582876",
"text": "def show\n # render json: @attraction\n photos = @attraction.photos\n render json: { attraction: @attraction, photos: photos }\n \n end",
"title": ""
},
{
"docid": "b1cd3afadc395fc7642760193a0db680",
"score": "0.66516626",
"text": "def user_products\n @user = User.find(params[:id])\n @products = @user.products\n render json: @products\n end",
"title": ""
},
{
"docid": "f655155a9be48cd73cf6e2a3b72be25f",
"score": "0.66492754",
"text": "def index\n shop = Shop.find(params[:shop_id])\n @shop_photos = shop.shop_photos\n render json: @shop_photos, meta: { status: :ok, total: @shop_photos.count }, meta_key: 'result'\n end",
"title": ""
},
{
"docid": "eac267c94e82c9ebf4ed1238f2d8bcaa",
"score": "0.6630884",
"text": "def images\n # find all of the images where images.product_id == product.id\n Image.where(:product_id => id)\n end",
"title": ""
},
{
"docid": "0d39494ae7fd9578d7b3e24e02afb0fb",
"score": "0.662618",
"text": "def show\n @photo_array = PhotoArray.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo_array }\n end\n end",
"title": ""
},
{
"docid": "d9dcf601aa7732be84924f2a2e38caad",
"score": "0.66210383",
"text": "def index\n @photos = Photo.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photos }\n end\n end",
"title": ""
},
{
"docid": "dd932e8371f5758d385c47944fb9437a",
"score": "0.6619985",
"text": "def fresh\n response = @client.get('photos?rpp=100&feature=fresh')\n @pictures = JSON.parse(response.body)['photos']\n render :index\n end",
"title": ""
},
{
"docid": "dadc5023d8fa60ab0ea4b4c628b65c0b",
"score": "0.6616318",
"text": "def show\n @photo_gallery = PhotoGallery.find(params[:id])\n \n @photos = Array.new\n @photos_json = Array.new\n \n @photo_gallery.tags.each do |tag|\n tag.photos.each do |photo|\n photo[:path_small] = photo.image.url(:small)\n photo[:path_medium] = photo.image.url(:medium)\n photo[:path_large] = photo.image.url(:large)\n @photos.push(photo);\n end\n end\n \n @photos = @photos.flatten\n \n @gallery = {\n :id => @photo_gallery.id,\n :name => @photo_gallery.name,\n :photos => @photos\n }\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { @gallery }\n end\n end",
"title": ""
},
{
"docid": "ca37c90d63cfb018605ab14febe9519f",
"score": "0.66135263",
"text": "def index\n @v1_products = V1::Product.all\n if @v1_products.empty?\n render json: @v1_products, message: 'Resource not found', status: 404\n else\n render json: @v1_products, message: 'OK', status: 200\n end\n end",
"title": ""
},
{
"docid": "2b8838d886fa8cf68d463c45ad96392b",
"score": "0.65963084",
"text": "def index\n\n\t\t# do we have parameters\n\t\tpermitted = params.permit([:length,:width,:height,:weight]).keys\n\t\tif permitted.length>0\n\t\t\tparams.require([:length,:width,:height,:weight])\n\t\tend\n\t\t#&& permitted.length<4\n\t\t#\trender json: {error: \"Missing Parameters\"}, status: :unproccessable_entity\n\t\t#\treturn\n\t\t#end\n\n\t\tproducts = []\n\t\tif(permitted.length == 0)\n \t dbproducts = Product.all\n \tif !dbproducts.nil?\n\t\t\t# send back a clean object without dependencies on the \n\t\t\t# mongodb ObjectId format.\n \t dbproducts.each do |dbproduct|\n\t\t\t\t\tproducts.push(dbproduct)\n\t\t\t\tend\t\t\t\t\n \t end\n\t\telse\n\t\t\tdbproduct = Product.where(\n\t\t\t\t { \"$and\": \n\t\t\t\t\t[\n\t\t\t\t\t\t{ length: {\"$gte\": params[:length]}},\n\t\t\t { width: {\"$gte\": params[:width]}}, \n\t\t\t\t\t\t{ height: {\"$gte\": params[:height]}},\n\t\t\t\t\t\t{ weight: {\"$gte\": params[:weight]}}\n\t\t\t\t\t] \n\t\t\t\t })\n\t\t\t\t .sort({ weight:1 })\n\t\t\t\t .first\n\t\t\tif dbproduct.nil?\n\t\t\t\treturn render json: {error: 'Product Not Found'}, status: :not_found\n\t\t\telse\n\t\t\t\tproducts.push dbproduct\n\t\t\tend\n\t\tend\n\t\t\t\n render json: products, status: :ok \n\tend",
"title": ""
},
{
"docid": "e8a846cc175802331e9e71a283ca2e1a",
"score": "0.6586294",
"text": "def index\n products = Product.all\n render json: products\n end",
"title": ""
},
{
"docid": "62080019abd5d23fdbd975889abdf84a",
"score": "0.6582275",
"text": "def index\n\t\t@photos = Photo.all\n\t\trender :json => @photos\n\tend",
"title": ""
},
{
"docid": "96a3266dd4a4f236fe7ea8663cf0e592",
"score": "0.6581596",
"text": "def show\n @photoset = Photoset.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photoset }\n end\n end",
"title": ""
},
{
"docid": "4c948d8fbfd34ece8315e7650ae3a026",
"score": "0.6578787",
"text": "def index\n @products = Product.all\n render json: @products\n end",
"title": ""
},
{
"docid": "08597407f907feabb15bc276d6a62e2b",
"score": "0.65783834",
"text": "def index\n @route = Route.find(params[:route_id])\n @route_point = RoutePoint.find(params[:route_point_id])\n @route_point_photos = @route_point.route_point_photos.page(params[:page]).per(current_user.list_page_size)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @route_point_photos }\n end\n end",
"title": ""
},
{
"docid": "c94ac951ea74c2c2f12ae8ea06b2bbeb",
"score": "0.6575229",
"text": "def index\n @products = Product.all\n\n render json: @products\n end",
"title": ""
},
{
"docid": "b117539495a52f68d8e321e5a2f716c0",
"score": "0.6571844",
"text": "def index\n @products = Product.all\n render json: @products, status: 200\n end",
"title": ""
},
{
"docid": "1c3f0fdafef7cc55f7595ef3deacaf38",
"score": "0.6567379",
"text": "def get_photo\n @photo = Photo.find(params[:photo_id])\n end",
"title": ""
},
{
"docid": "780a9c2186e1c140d98dab4d2ca5ab5b",
"score": "0.6567301",
"text": "def pictures\n render json: @collection.pictures\n end",
"title": ""
},
{
"docid": "eeec201ad223c6a265c8baaaf4c33aeb",
"score": "0.65553254",
"text": "def new\n @images_product = ImagesProduct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @images_product }\n end\n end",
"title": ""
},
{
"docid": "6fb5632ac4814e977bfeb060864270f1",
"score": "0.6540206",
"text": "def index\n @post_photos = PostPhoto.all\n # render json:Post.all\n # render json:PostPhoto.all\n end",
"title": ""
}
] |
873991bd859cb1720586a0327b65d72e
|
Test voting. Now have Dick vote on Mary's name. Votes: rolf=2/3, mary=1/3, dick=1/3 Rolf prefers naming 3 (vote 2 vs 3). Mary prefers naming 9 (vote 1 vs 3). Dick now prefers naming 9 (vote 3). Summing, 3 gets 2+1/3=1, 9 gets 3+3+3/4=.75, so 3 gets it.
|
[
{
"docid": "d585de0a4bbd7b91de7946cbac51e56c",
"score": "0.6444669",
"text": "def test_cast_vote_dick\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login('dick')\n post(:cast_vote, :value => \"3\", :id => nam2.id)\n assert_equal(11, @dick.reload.contribution)\n\n # Check votes.\n assert_equal(3, nam1.reload.vote_sum)\n assert_equal(2, nam1.votes.length)\n assert_equal(3, nam2.reload.vote_sum)\n assert_equal(3, nam2.votes.length)\n\n # Make sure observation was updated right.\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n\n # If Dick votes on the other as well, then his first vote should\n # get demoted and his preference should change.\n # Summing, 3 gets 2+1+3/4=1.5, 9 gets -3+3+2/4=.5, so 3 keeps it.\n obs.change_vote(nam1, 3, @dick)\n assert_equal(12, @dick.reload.contribution)\n assert_equal(3, nam1.reload.users_vote(@dick).value)\n assert_equal(6, nam1.vote_sum)\n assert_equal(3, nam1.votes.length)\n assert_equal(2, nam2.reload.users_vote(@dick).value)\n assert_equal(2, nam2.vote_sum)\n assert_equal(3, nam2.votes.length)\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n end",
"title": ""
}
] |
[
{
"docid": "a2724cf9c9f80945715eaf8df11d9cc8",
"score": "0.6772115",
"text": "def required_votes\n possible_votes / 2 + 1\n end",
"title": ""
},
{
"docid": "844fff0de210a3427e22c65ed23ae748",
"score": "0.63888025",
"text": "def vote_up\n 15\n end",
"title": ""
},
{
"docid": "faaa5b8f00dcf1b7c568f7c1552ae729",
"score": "0.6387608",
"text": "def voted_by(name)\n get_data(\"user/#{name}/voted\")\n end",
"title": ""
},
{
"docid": "5ca269d505b54bdd9291bf00a8fcc6e0",
"score": "0.6337649",
"text": "def users_vote(naming, user)\n lookup_naming(naming).users_vote(user)\n end",
"title": ""
},
{
"docid": "8d8dbf217368f86982d762182b9f34de",
"score": "0.633641",
"text": "def percent_against\n (votes_against.to_f * 100 / (self.votes.size + 0.0001)).round\n end",
"title": ""
},
{
"docid": "44b42a4dcda81f5ec8d7eae379db12b4",
"score": "0.6332426",
"text": "def percentage_for(choice)\n vote_choice = self.send(\"total_#{choice}\")\n vote_choice > 0 ? (vote_choice.to_f / total_votes * 100) : 0 \n end",
"title": ""
},
{
"docid": "ddf646ab170b59cebf1a21537072fef3",
"score": "0.63293445",
"text": "def percentage_for(choice)\n vote_choice = self.send(choice)\n vote_choice > 0 ? (vote_choice.to_f / votes.count * 100) : 0 \n end",
"title": ""
},
{
"docid": "44d6670f4edaf584c0643df05574e7f6",
"score": "0.63291246",
"text": "def determine_upvotes(story, upvotes)\n if story.include?(\"cats\") || story.include?(\"Cats\")\n upvotes = upvotes * 5\n elsif story.include?(\"bacon\") || story.include?(\"Bacon\")\n upvotes = upvotes * 8\n elsif story.include?(\"food\") || story.include?(\"Food\")\n upvotes = upvotes * 3\n end\n puts upvotes\nend",
"title": ""
},
{
"docid": "b96d3a81b2590e63be9e43ee543c3cb4",
"score": "0.62601453",
"text": "def humanify_vote(vote)\n return \"for\" if vote == \"aye\"\n \"against\"\nend",
"title": ""
},
{
"docid": "47950a8b05e1bd1d6b978a5df343c59c",
"score": "0.6257739",
"text": "def rate\n votes = answers.inject(0) do |sum, a| \n sum + a.votes.count \n end\n \n # Return a count of votes and answers\n answers.count + votes\n end",
"title": ""
},
{
"docid": "e43cad00648cb10d9b79ddf82101315d",
"score": "0.6228867",
"text": "def rating\n (get_upvotes.size + 2)/(get_downvotes.size + 2)\n end",
"title": ""
},
{
"docid": "c3938221a9824d50d71e926e46b597df",
"score": "0.6195053",
"text": "def vote\n\tend",
"title": ""
},
{
"docid": "f30b63da70001b2824a3d17b042aa2c0",
"score": "0.6185652",
"text": "def runoff(voters)\n\n def find_winner(voters, tallies=nil)\n if tallies\n min = tallies.values.min\n tallies.keep_if { |candidate, v| v == min }\n voters.each { |voter| voter.reject! {|vote| tallies.include? vote }}\n return nil if voters.length == 0\n end\n new_tallies = Hash.new(0)\n voters[0].each {|candidate| new_tallies[candidate] = 0 }\n voters.each_with_object(new_tallies) { |voter, nt| nt[voter[0]] += 1 }\n total_votes = new_tallies.values.reduce(:+);\n new_tallies.each { |candidate, v|\n return candidate if v / total_votes.to_f > 0.5\n }\n return find_winner(voters, new_tallies)\n end\n\n find_winner(voters)\n\nend",
"title": ""
},
{
"docid": "72981c4be169cfde8a7045cd0b6d0f96",
"score": "0.61720926",
"text": "def report_votes(input_votes)\n\t\tinput_votes.each { |each_name,each_vote | puts \"#{each_name.yellow}\" + \" => votes: #{each_vote}\".rjust(25-each_name.length)}\n\tend",
"title": ""
},
{
"docid": "caab4c5707a4acd433337ac7b0b3092a",
"score": "0.61663795",
"text": "def tally\n up_votes - down_votes\n end",
"title": ""
},
{
"docid": "636aa2870b1e4b9356a8b4e8c995f0f9",
"score": "0.614979",
"text": "def vote(candidates) sleep(1) end",
"title": ""
},
{
"docid": "b7f6f4b2a3921ef31ce8c71c23b5d315",
"score": "0.61356336",
"text": "def get_percent_of_vote\n\t\t(@votes.count(@winner).to_f / @votes.count.to_f * 100).round\n\tend",
"title": ""
},
{
"docid": "29b434321ba2d06a8b75c40613145259",
"score": "0.6119161",
"text": "def votes\n up_votes - down_votes\n end",
"title": ""
},
{
"docid": "98c17212f34aa3b32254258e49cdcbe0",
"score": "0.61179805",
"text": "def votes_count\n upvotes + downvotes\n end",
"title": ""
},
{
"docid": "ab9511375a28b68b3b13eb8448e15156",
"score": "0.61176497",
"text": "def vote_score\n votes.sum(:value)\n end",
"title": ""
},
{
"docid": "4608986bfb3dedb077f205206e3e9ef6",
"score": "0.6117203",
"text": "def test_cast_vote_mary\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login('dick')\n obs.change_vote(nam2, 3, @dick)\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n assert_equal(11, @dick.reload.contribution)\n\n login('mary')\n post(:cast_vote, :value => Vote.delete_vote, :id => nam1.id)\n assert_equal(9, @mary.reload.contribution)\n\n # Check votes.\n assert_equal(2, nam1.reload.vote_sum)\n assert_equal(1, nam1.votes.length)\n assert_equal(3, nam2.reload.vote_sum)\n assert_equal(3, nam2.votes.length)\n\n # Make sure observation is changed correctly.\n assert_equal(names(:coprinus_comatus).search_name, obs.reload.name.search_name,\n \"Cache for 3: #{nam1.vote_cache}, 9: #{nam2.vote_cache}\")\n end",
"title": ""
},
{
"docid": "4608986bfb3dedb077f205206e3e9ef6",
"score": "0.6117203",
"text": "def test_cast_vote_mary\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login('dick')\n obs.change_vote(nam2, 3, @dick)\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n assert_equal(11, @dick.reload.contribution)\n\n login('mary')\n post(:cast_vote, :value => Vote.delete_vote, :id => nam1.id)\n assert_equal(9, @mary.reload.contribution)\n\n # Check votes.\n assert_equal(2, nam1.reload.vote_sum)\n assert_equal(1, nam1.votes.length)\n assert_equal(3, nam2.reload.vote_sum)\n assert_equal(3, nam2.votes.length)\n\n # Make sure observation is changed correctly.\n assert_equal(names(:coprinus_comatus).search_name, obs.reload.name.search_name,\n \"Cache for 3: #{nam1.vote_cache}, 9: #{nam2.vote_cache}\")\n end",
"title": ""
},
{
"docid": "cf4af5e62acbc68c67247abc401d444e",
"score": "0.6096672",
"text": "def rating\n return 0 if total_votes == 0\n (100 * self.yeses) / total_votes\n end",
"title": ""
},
{
"docid": "f1d35701ca951e6beb6d4d2f2299e02b",
"score": "0.60963076",
"text": "def vote \n \t\n voters = Voter.voters_created\n \n politicians = Voter.voters_created.select {|voter| voter if voter.is_a? Politician}\n vote_count = Hash.new(0)\n who_voted_for_whom = Hash.new(0)\n #introduce an element of fairness by varying when candidates get to visit voters \n campaign_stops = politicians.product(voters).shuffle\n\n campaign_stops.each do |stump_speech|\n campaigner = stump_speech[0]\n campaignee = stump_speech[1]\n\n campaigner.stump(campaignee)\n \n #need way to cancel out votes \n\n if campaignee.cast_vote(campaigner)\n puts \"\\tYou bet!\"\n vote_count[campaigner.name] += 1\n who_voted_for_whom[campaignee.name] = campaigner.name\n puts\n elsif campaignee.voted == true \n puts \"\\tSorry, I've already voted\"\n puts\n elsif campaignee.cast_vote(campaigner) && (campaigner == campaignee)\n puts \"\\tI am #{campaigner.name}, and I am voting for myself!\"\n vote_count[campaigner.name] += 1 \n who_voted_for_whom[campaignee.name] = campaigner.name\n puts\n elsif ( !campaignee.cast_vote(campaigner) ) && ( !campaignee.is_a? Politician )\n puts \"\\tI am not persuded by your logic\"\n puts\n end \n end \n\n sorted_vote_count = vote_count.to_a.sort {|a,b| b[1] <=> a[1]}\n puts\n puts\n puts \"\\t\\tWINNER\"\n puts \"\\tAnd the winner is #{sorted_vote_count[0][0]}!\"\n puts \"\\t\\tWINNER\"\n puts\n puts \"\\tAnd because this is a transparent democracy, here's the vote totals:\"\n puts \n puts \"\\t#{vote_count}\"\n puts\n puts \"\\tAnd let's see who voted for whom so we can purge the disloyal.\"\n puts\n puts \"\\t#{who_voted_for_whom}\"\n\n Process.exit\n end",
"title": ""
},
{
"docid": "b432ce98c704a2abfd21db41eb6be42c",
"score": "0.60963076",
"text": "def vote \n \t\n voters = Voter.voters_created\n \n politicians = Voter.voters_created.select {|voter| voter if voter.is_a? Politician}\n vote_count = Hash.new(0)\n who_voted_for_whom = Hash.new(0)\n #introduce an element of fairness by varying when candidates get to visit voters \n campaign_stops = politicians.product(voters).shuffle\n\n campaign_stops.each do |stump_speech|\n campaigner = stump_speech[0]\n campaignee = stump_speech[1]\n\n campaigner.stump(campaignee)\n \n #need way to cancel out votes \n\n if campaignee.cast_vote(campaigner)\n puts \"\\tYou bet!\"\n vote_count[campaigner.name] += 1\n who_voted_for_whom[campaignee.name] = campaigner.name\n puts\n elsif campaignee.voted == true \n puts \"\\tSorry, I've already voted\"\n puts\n elsif campaignee.cast_vote(campaigner) && (campaigner == campaignee)\n puts \"\\tI am #{campaigner.name}, and I am voting for myself!\"\n vote_count[campaigner.name] += 1 \n who_voted_for_whom[campaignee.name] = campaigner.name\n puts\n elsif ( !campaignee.cast_vote(campaigner) ) && ( !campaignee.is_a? Politician )\n puts \"\\tI am not persuded by your logic\"\n puts\n end \n end \n\n sorted_vote_count = vote_count.to_a.sort {|a,b| b[1] <=> a[1]}\n puts\n puts\n puts \"\\t\\tWINNER\"\n puts \"\\tAnd the winner is #{sorted_vote_count[0][0]}!\"\n puts \"\\t\\tWINNER\"\n puts\n puts \"\\tAnd because this is a transparent democracy, here's the vote totals:\"\n puts \n puts \"\\t#{vote_count}\"\n puts\n puts \"\\tAnd let's see who voted for whom so we can purge the disloyal.\"\n puts\n puts \"\\t#{who_voted_for_whom}\"\n\n voted_reset\n main_menu\n end",
"title": ""
},
{
"docid": "54e6f68d172604c0c6d7f280cfcdd760",
"score": "0.6095817",
"text": "def test_users_can_upvote_and_downvote\n katie = User.create! name: \"Katie\", password: \"hunter2\", votes_left: 10\n test_song = Song.create! suggester_id: katie.id, artist: \"The Polly's\", title: \"Fake Song\"\n\n sign_in katie, \"hunter2\"\n\n 5.times do\n post \"/vote\", song_title: test_song.title, value: 1\n end\n\n assert_equal 302, last_response.status\n assert_equal 5, test_song.total_votes\n assert_equal 5, Vote.count\n assert_equal 5, User.find_by_name(katie.name).votes_left\n\n 3.times do\n post \"/vote\", song_title: test_song.title, value: -1\n end\n\n assert_equal 302, last_response.status\n assert_equal 2, test_song.total_votes\n assert_equal 8, Vote.count\n assert_equal 2, User.find_by_name(katie.name).votes_left\n end",
"title": ""
},
{
"docid": "f60e323c29acaa33735b5b6baa01b4d4",
"score": "0.60835105",
"text": "def vote_percentage \n if self.filed? || self.finished? # Makes sure the threshold hasn't already been hit. \n return 100 # Return 100, meaning 100% goal. \n elsif self.pending? # PEtition is pending still \n petition_votes = self.votes_for.count\n petition_votes.to_f\n percentage = petition_votes / 500.00 # Finds percentage of the vote goal \n percentage *= 100 # Turns the float percentage into a whole number percentage.\n return percentage.round(1) \n else \n puts \"Something is wrong with this petition.\"\n end \n end",
"title": ""
},
{
"docid": "6174ccb6269d2ff2458320e9dce00d7d",
"score": "0.6073871",
"text": "def vote\n\t\trandomPlayer\n\tend",
"title": ""
},
{
"docid": "4b953cb9f48f0289fa20a5f263d40ba8",
"score": "0.6046061",
"text": "def percentage_of_votes\n if total_votes > 0\n 100 * (number_of_votes.to_f / total_votes.to_f)\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "91f97afca5cde167ef405caf1eb59dd0",
"score": "0.6025566",
"text": "def votes\n scenario_answers.count\n end",
"title": ""
},
{
"docid": "24e3c4ac98a8f341a0e8ebe640f3d529",
"score": "0.60144496",
"text": "def get_votes\n\t\t@voters.each{ |voter| @votes << voter.vote(@candidates) }\n\tend",
"title": ""
},
{
"docid": "0523021b28203387b4e767c73eb83ab9",
"score": "0.6001736",
"text": "def votes_needed \n if self.filed? || self.finished? # If the petition is not pending, then 0 votes are needed.\n return 0\n elsif self.pending? # Petition has not been filed yet and is pending.\n petition_votes = self.votes_for.count # Assigns number of votes for the petition.\n votes_needed = 500 - petition_votes # Calculates remining number of votes needed.\n return votes_needed # Returns number of votes neeeded.\n else \n puts \"Something is wrong with this petition.\"\n end\n end",
"title": ""
},
{
"docid": "67679aa1111fb7c1ca70b0c227f933d1",
"score": "0.59958905",
"text": "def voted\n new_total = self.votes + 1\n return self.update(votes: new_total)\n end",
"title": ""
},
{
"docid": "0679e495398f1b8a6c993b7eb24544b3",
"score": "0.59952694",
"text": "def score\n \tself.get_upvotes.size - self.get_downvotes.size\n end",
"title": ""
},
{
"docid": "70121ad3bb33e5acb1ebc9aee638a78c",
"score": "0.5993808",
"text": "def score\n self.up_votes - self.down_votes\n end",
"title": ""
},
{
"docid": "0a45dd3ae030f411af80c4d6decdb04b",
"score": "0.59809864",
"text": "def set_vote_tally!\n self.vote_tally = self.get_upvotes.size - self.get_downvotes.size\n end",
"title": ""
},
{
"docid": "bb8eed88c2579bb651ffbe3b050cf5aa",
"score": "0.597445",
"text": "def owners_vote(naming)\n lookup_naming(naming).users_vote(user)\n end",
"title": ""
},
{
"docid": "046d88576bd1e6d6736363144265090c",
"score": "0.5971418",
"text": "def score\n votes.sum(:vote)\n end",
"title": ""
},
{
"docid": "77f4fa8e4eb3ad84edf6e1ae83047f14",
"score": "0.5969727",
"text": "def total_votes\n self.up - self.down\n end",
"title": ""
},
{
"docid": "66cf58c60d6a306619aabbde9d397cda",
"score": "0.5959704",
"text": "def vote\n puts \"-----------------------------------------------\nSorry, voting system is currently not working\"\n \nend",
"title": ""
},
{
"docid": "de6dee6cc57f440206cb276e77e95173",
"score": "0.59562826",
"text": "def test_cast_vote_rolf_second_greater\n obs = observations(:coprinus_comatus_obs)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login(\"rolf\")\n put(:update, params: { vote: { value: \"3\" }, naming_id: nam2.id })\n assert_equal(10, rolf.reload.contribution)\n\n # Make sure observation was updated right.\n assert_equal(names(:agaricus_campestris).id, obs.reload.name_id)\n\n # Check vote.\n assert_equal(6, nam2.reload.vote_sum)\n assert_equal(2, nam2.votes.length)\n end",
"title": ""
},
{
"docid": "b5d65929911c2c9ee4e7c41d96af80e0",
"score": "0.5955993",
"text": "def test_cast_vote_rolf_second_greater\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login('rolf')\n post(:cast_vote, :value => \"3\", :id => nam2.id)\n assert_equal(10, @rolf.reload.contribution)\n\n # Make sure observation was updated right.\n assert_equal(names(:agaricus_campestris).id, obs.reload.name_id)\n\n # Check vote.\n assert_equal(6, nam2.reload.vote_sum)\n assert_equal(2, nam2.votes.length)\n end",
"title": ""
},
{
"docid": "b5d65929911c2c9ee4e7c41d96af80e0",
"score": "0.5955993",
"text": "def test_cast_vote_rolf_second_greater\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login('rolf')\n post(:cast_vote, :value => \"3\", :id => nam2.id)\n assert_equal(10, @rolf.reload.contribution)\n\n # Make sure observation was updated right.\n assert_equal(names(:agaricus_campestris).id, obs.reload.name_id)\n\n # Check vote.\n assert_equal(6, nam2.reload.vote_sum)\n assert_equal(2, nam2.votes.length)\n end",
"title": ""
},
{
"docid": "7c533f3f4f79228f1e1667cc9acf88df",
"score": "0.5954634",
"text": "def total_votes\n up_votes + down_votes\n end",
"title": ""
},
{
"docid": "07c405bd4b8969be1441b5aababb8eb2",
"score": "0.59468216",
"text": "def report_votes(final_votes)\n final_votes.each do |final_vote|\n puts \"#{final_vote[0].name.pink} earned #{final_vote[1]} vote(s).\"\n end\n end",
"title": ""
},
{
"docid": "63bfe165c51deca88160d66a8d0ddd6b",
"score": "0.59412557",
"text": "def vote\n\t\t@review = Review.find(params[:id])\n\n\t\tif params[:type] == 'up'\n\t\t\t@review.add_or_update_evaluation(:up_votes, 1, current_user)\n\t\tend\n\n\t\t# Both up and down votes affect total votes\n\t\t@review.add_or_update_evaluation(:total_votes, 1, current_user)\n\t\t\n\t\tflash[:success] = \"Thanks for voting!\"\n\t\tredirect_to :back\n\tend",
"title": ""
},
{
"docid": "8aa980ae6a7060a4fef34dafb58d0f1f",
"score": "0.591558",
"text": "def calculate_tallied_votes\n self.tallied_votes = upvotes - downvotes\n self.save\n end",
"title": ""
},
{
"docid": "fe74e43f1c0e1c1ade0aca4d8651f5be",
"score": "0.5914504",
"text": "def vote_sum\n sum = 0.0\n votes.each do |v|\n sum += v.value\n end\n sum\n end",
"title": ""
},
{
"docid": "c7cce6d07a22bb5b8169895e29618f7f",
"score": "0.59098977",
"text": "def vote\n vote = 0\n self.children.each { |c|\n vote = vote + c.vote\n }\n if self.children.size > 0\n (vote / self.children.size)\n else\n vote\n end\n end",
"title": ""
},
{
"docid": "9454c413138ad1bf160ad47ebc5799ff",
"score": "0.59012014",
"text": "def vote(poll_id, poll_name, votes)\n users = read_user_data\n\n users[@id][:votes][poll_id] = {\n name: poll_name,\n timestamp: Time.new,\n votes: {}\n }\n\n final_polls, final_users = prepare_votes_data(users, votes, poll_id)\n\n save_polls_data(final_polls)\n save_user_data(final_users)\n end",
"title": ""
},
{
"docid": "c31fcf241c0376798122a95328dadbb4",
"score": "0.5899301",
"text": "def simulate(preferences, vote_order, debug = false)\n\t#winner is an array where the index indicates the round of voting, and the value \n\t#indicates the candidate that will win given that they've made it to this round\n\twinner = []\n\tnum_rounds = vote_order.length - 1\n\tnum_candidates = preferences.length\n\n\t#start with the final round of voting and build backwards\n\tnum_rounds.downto(1).each do |i|\n\t\tmatchup_a = vote_order[i - 1]\n\t\t#a vote for matchup_b is a vote for b OR whoever is going to win in the next round\n\t\tmatchup_b = vote_order[i]\n\n\t\t#vote is an array where the index indicates the candidate, and the value indicates which of the \n\t\t#two current candidates they are voting for (0 = a, 1 = b)\n\t\tvote = []\n\n\t\tif winner.length == 0\n\t\t\t#if this is the last round, next winner is matchup_b\n\t\t\tnext_winner = matchup_b\n\t\telse\n\t\t\t#if this is not the last round, next winner is the winner in the next round\n\t\t\tnext_winner = winner[0]\n\t\tend \n\n\t\t0.upto(num_candidates - 1).each do |j|\n\t\t\t#if candidate j prefers next_winner to a, they vote for b. Otherwise they vote for a.\n\t\t\t#note there can never be a tie in this formulation.\n\t\t\tif debug\n\t\t\t\tputs \"Candidate \" + j.to_s + \" voting between \" + matchup_a.to_s + \" and \" + next_winner.to_s + \"...\"\n\t\t\tend\n\t\t\tif preferences[j].index(matchup_a) < preferences[j].index(next_winner)\n\t\t\t\tif debug\n\t\t\t\t\tputs matchup_a\n\t\t\t\tend\n\t\t\t\tvote[j] = 0\n\t\t\telse\n\t\t\t\tif debug\n\t\t\t\t\tputs next_winner\n\t\t\t\tend\n\t\t\t\tvote[j] = 1\n\t\t\tend\n\t\tend\n\t\t#if vote.inject(:+) < num_candidates.to_f / 2.0\n\t\tif vote.inject(:+) <= num_candidates.to_f / 2.0\n\t\t\t#a has it, a is this round's winner\n\t\t\tif debug\n\t\t\t\tputs \"**** \" + matchup_a.to_s + \" wins!\"\n\t\t\tend\n\t\t\twinner.unshift(matchup_a)\n\t\telse\n\t\t\t#b has it, this round's winner is whoever wins the next round\n\t\t\tif debug\n\t\t\t\tputs \"**** \" + next_winner.to_s + \" wins!\"\n\t\t\tend\n\t\t\twinner.unshift(next_winner)\n\t\tend\n\tend\n\treturn winner\nend",
"title": ""
},
{
"docid": "59b4e58b59e8c13816505028f6a55e4c",
"score": "0.5898578",
"text": "def vote\r\n while @v < 20 do\r\n puts \"\\n\"*2+'Type the name of the candidate you want to vote for:'+\"\\n\"*2\r\n @vote = gets.chomp.strip\r\n case @vote.downcase\r\n when 'mika'\r\n @votes[0]+=1\r\n @v+=1\r\n puts \"\\n\"+'You voted for Mika.'.center(93)+\"\\n\"*2+'Thank you for voting.'.center(93)\r\n gets\r\n header\r\n hi\r\n break #so it won't go through the rest of the loop\r\n when 'reggie'\r\n @votes[1]+=1\r\n @v+=1\r\n puts \"\\n\"+'You voted for Reggie.'.center(93)+\"\\n\"*2+'Thank you for voting.'.center(93)\r\n gets\r\n header\r\n hi\r\n break\r\n when 'kenneth'\r\n @votes[2]+=1\r\n @v+=1\r\n puts \"\\n\"+'You voted for Kenneth.'.center(93)+\"\\n\"*2+'Thank you for voting.'.center(93)\r\n gets\r\n header\r\n hi\r\n break\r\n when 'trevor'\r\n @votes[3]+=1\r\n @v+=1\r\n puts \"\\n\"+'You voted for Trevor.'.center(93)+\"\\n\"*2+'Thank you for voting.'.center(93)\r\n gets\r\n header\r\n hi\r\n break\r\n when 'end'\r\n votetally\r\n break\r\n else\r\n puts \"\\n\"+'That is not one of the candidates. Pls try again.'.center(93)\r\n gets\r\n header\r\n hi\r\n end\r\n end\nvotetally\r\nend",
"title": ""
},
{
"docid": "c180ba1972e0ec68af807cd1d8848d71",
"score": "0.5895449",
"text": "def test_propose_dicks_naming\n o_count = Observation.count\n g_count = Naming.count\n n_count = Name.count\n v_count = Vote.count\n\n # Dick proposes \"Conocybe filaris\" out of the blue.\n params = {\n :id => observations(:coprinus_comatus_obs).id,\n :name => { :name => \"Conocybe filaris\" },\n :vote => { :value => \"3\" },\n }\n login(\"dick\")\n post(:create_naming, params)\n assert_response(:redirect)\n assert_equal(12, @dick.reload.contribution)\n naming = Naming.last\n\n # Make sure the right number of objects were created.\n assert_equal(o_count + 0, Observation.count)\n assert_equal(g_count + 1, Naming.count)\n assert_equal(n_count + 0, Name.count)\n assert_equal(v_count + 1, Vote.count)\n\n # Make sure everything I need is reloaded.\n observations(:coprinus_comatus_obs).reload\n namings(:coprinus_comatus_naming).reload\n namings(:coprinus_comatus_other_naming).reload\n\n # Check votes.\n assert_equal(3, namings(:coprinus_comatus_naming).vote_sum)\n assert_equal(0, namings(:coprinus_comatus_other_naming).vote_sum)\n assert_equal(3, naming.vote_sum)\n assert_equal(2, namings(:coprinus_comatus_naming).votes.length)\n assert_equal(2, namings(:coprinus_comatus_other_naming).votes.length)\n assert_equal(1, naming.votes.length)\n\n # Make sure observation was updated right.\n assert_equal(names(:conocybe_filaris).id, observations(:coprinus_comatus_obs).name_id)\n end",
"title": ""
},
{
"docid": "c180ba1972e0ec68af807cd1d8848d71",
"score": "0.5895449",
"text": "def test_propose_dicks_naming\n o_count = Observation.count\n g_count = Naming.count\n n_count = Name.count\n v_count = Vote.count\n\n # Dick proposes \"Conocybe filaris\" out of the blue.\n params = {\n :id => observations(:coprinus_comatus_obs).id,\n :name => { :name => \"Conocybe filaris\" },\n :vote => { :value => \"3\" },\n }\n login(\"dick\")\n post(:create_naming, params)\n assert_response(:redirect)\n assert_equal(12, @dick.reload.contribution)\n naming = Naming.last\n\n # Make sure the right number of objects were created.\n assert_equal(o_count + 0, Observation.count)\n assert_equal(g_count + 1, Naming.count)\n assert_equal(n_count + 0, Name.count)\n assert_equal(v_count + 1, Vote.count)\n\n # Make sure everything I need is reloaded.\n observations(:coprinus_comatus_obs).reload\n namings(:coprinus_comatus_naming).reload\n namings(:coprinus_comatus_other_naming).reload\n\n # Check votes.\n assert_equal(3, namings(:coprinus_comatus_naming).vote_sum)\n assert_equal(0, namings(:coprinus_comatus_other_naming).vote_sum)\n assert_equal(3, naming.vote_sum)\n assert_equal(2, namings(:coprinus_comatus_naming).votes.length)\n assert_equal(2, namings(:coprinus_comatus_other_naming).votes.length)\n assert_equal(1, naming.votes.length)\n\n # Make sure observation was updated right.\n assert_equal(names(:conocybe_filaris).id, observations(:coprinus_comatus_obs).name_id)\n end",
"title": ""
},
{
"docid": "f0353a7a408d57e5c28cdc174a6d22aa",
"score": "0.5893479",
"text": "def score\n \tself.get_upvotes.size - self.get_downvotes.size\n\tend",
"title": ""
},
{
"docid": "113cb928c070622b2d804ea9e21009ea",
"score": "0.58881307",
"text": "def get_votes\n\t$votes_table.each do |voter|\n\t\tvoter.each do |vote|\n\t\t\tputs \"Give me your vote\"\n\t\t\tvote = gets.chomp\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "6ead105a9b7fb1ff778a90e225fca310",
"score": "0.5887099",
"text": "def test_cast_vote_mary\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login(\"dick\")\n obs.change_vote(nam2, 3, dick)\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n assert_equal(11, dick.reload.contribution)\n\n login(\"mary\")\n put(:update, params: { vote: { value: Vote.delete_vote },\n naming_id: nam1.id })\n assert_equal(9, mary.reload.contribution)\n\n # Check votes.\n assert_equal(2, nam1.reload.vote_sum)\n assert_equal(1, nam1.votes.length)\n assert_equal(3, nam2.reload.vote_sum)\n assert_equal(3, nam2.votes.length)\n\n # Make sure observation is changed correctly.\n assert_equal(names(:coprinus_comatus).search_name,\n obs.reload.name.search_name,\n \"Cache for 3: #{nam1.vote_cache}, 9: #{nam2.vote_cache}\")\n end",
"title": ""
},
{
"docid": "f1038e7c14bc310a6d2cee2f440837cd",
"score": "0.587029",
"text": "def score\n\t\tupvotes.count\n\tend",
"title": ""
},
{
"docid": "e4cfa7a8c6e2abba486adabe59e51949",
"score": "0.5861451",
"text": "def vote up\n end",
"title": ""
},
{
"docid": "b5e5ebed36a38db313833ca3d63e1ef3",
"score": "0.58599275",
"text": "def user_votes(user)\n namings.each_with_object([]) do |n, votes|\n v = n.users_vote(user)\n votes << v if v\n end\n end",
"title": ""
},
{
"docid": "dab252befaf9fc55ea05bfd4b11a584b",
"score": "0.584357",
"text": "def hi\r\n puts \"\\n\"*2+'Welcome to Vivixx Elections 2017. '+ \"\\n\"*2\r\n puts \"\\n\"+'Here are the candidates ' + \"[Votes in: #{@v}]:\"+\"\\n\"*2\r\n ctr=0\r\n @candidates.each do\r\n ctr +=1\r\n puts \"#{ctr}. #{@candidates[ctr-1]}\"\r\n end\r\n vote\r\nend",
"title": ""
},
{
"docid": "1ffcd1e5c76af335e845a133d015b9b1",
"score": "0.58033764",
"text": "def percent_for\n (votes_for.to_f * 100 / (self.votes.size + 0.0001)).round\n end",
"title": ""
},
{
"docid": "361aa28494d8cea9d1c0d9e10787952b",
"score": "0.5798319",
"text": "def score\n # add score caching\n total = 0\n self.votes.each do |vote|\n total += vote.value\n end\n total\n end",
"title": ""
},
{
"docid": "7d39953b7cb5349ce4dcd079c8783d06",
"score": "0.5795352",
"text": "def add_vote(vote)\n self.score = self.score + vote.value\n self.votes_count = self.votes_count + 1\n end",
"title": ""
},
{
"docid": "d2cb5c9f66b5b6b8092b5ad0e6ecdee3",
"score": "0.578165",
"text": "def night_vote\n puts \"Its night time\"\n @players.each do |player|\n unless player.dead?\n if player.role == \"werewolf\"\n player.make_vote\n unless @player_names.include?(player.vote)\n puts \"You must kill someone in the game!\"\n player.make_vote\n end\n end\n end\n end\n vote_count = Hash.new(0)\n @players.each do |player|\n if player.role == \"werewolf\"\n vote_count[player.vote] += 1\n end\n end\n highest_vote = vote_count.max_by{ |k,v| v }\n highest_vote = highest_vote.delete_if {|item| item.is_a?(Integer)}\n if highest_vote.length == 1\n \t@players.each do |player|\n if player.name == highest_vote[0]\n player.kill\n @dead_players << player.name\n puts \"#{player.name} has been killed!\"\n end\n end\n else\n @players.each do |player|\n if player.name == highest_vote[rand(0..highest_vote.length)]\n player.kill\n @dead_players << player.name\n puts \"#{player.name} has been killed!\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ebc0d16a6825fcfc5afa66d888ed979a",
"score": "0.5769409",
"text": "def give_right_to_vote( to_voter )\r\n assert msg.sender == @chairperson && @voters[to_voter].voted? == false\r\n @voters[to_voter].weight = 1\r\nend",
"title": ""
},
{
"docid": "5466c3c4a5ad73967e9b6014bae63397",
"score": "0.57670015",
"text": "def vote(value)\n args = self.state_properties\n args[:vote] += value[0]\n self.state_properties=args\n end",
"title": ""
},
{
"docid": "9dcb87a2da92f765ed7e4aa07361919f",
"score": "0.57649964",
"text": "def vote\n @user = User.find(cookies[:user_id])\n suggestion = Suggestion.find_by(name: params[:suggestion_name])\n \n if suggestion.nil?\n flash[:error] = \"Invalid vote\"\n respond_to do |format|\n format.json{ render :json => { :error => \"Invalid vote\" }, :status => 400}\n end\n return\n elsif !@user.can_vote?\n flash[:error] = \"Out of votes\"\n respond_to do |format|\n format.json{ render :json => { :error => \"You may not vote again until next month\" }, :status => 409}\n end\n return\n elsif Vote.has_voted?(@user.id, suggestion.id)\n flash[:error] = \"Already voted for this\"\n respond_to do |format|\n format.json{ render :json => { :error => \"You already voted for this\" }, :status => 409}\n end\n return\n end\n \n suggestion.voted\n @user.vote\n Vote.create(user_id: @user.id, suggestion_id: suggestion.id)\n \n # Needed to track votes in rspec:\n @user_votes = @user.remaining_votes\n @suggestion_votes = suggestion.votes\n \n respond_to do |format|\n format.json{ head :ok }\n return\n end\n end",
"title": ""
},
{
"docid": "223fb3ea37053dc4add094c51a8dd1f3",
"score": "0.5749914",
"text": "def seconds_for_expedition\n possible_votes / 3 + 1\n end",
"title": ""
},
{
"docid": "43cf701db263820669c35786de05b187",
"score": "0.5736433",
"text": "def runoff(voters)\n ballot= Hash.new\n # populate the hash with 0's\n voters.each do |votes|\n votes.each do |v|\n ballot[v] = 0;\n end\n end\n while voters.size/2 >= ballot.values.max && ballot.size > 1\n # reset ballot totals to zero at beginning of each round\n ballot.each { |k,v| ballot[k] = 0 }\n # tally votes for this round\n voters.each do |vote|\n votee = vote.select { |x| ballot.include?(x)}.first\n ballot[votee] += 1\n end\n ballot = ballot.select { |k,v| v > ballot.values.min }\n return nil if ballot.empty?\n end\n ballot.select { |k,v| v == ballot.values.max }.keys[0]\nend",
"title": ""
},
{
"docid": "b0881f5a0a1a859f4683c5ec50342e7f",
"score": "0.57357585",
"text": "def change_vote(naming, value, user = User.current)\n result = false\n naming = lookup_naming(naming)\n vote = naming.users_vote(user)\n value = value.to_f\n\n if value == Vote.delete_vote\n result = delete_vote(naming, vote, user)\n\n # If no existing vote, or if changing value.\n elsif !vote || (vote.value != value)\n result = true\n process_real_vote(naming, vote, value, user)\n end\n\n # Update consensus if anything changed.\n calc_consensus if result\n\n result\n end",
"title": ""
},
{
"docid": "9ecdb21e1bc9c7d51e4bd22e058e514f",
"score": "0.5728176",
"text": "def vote( choice )\n assert @ponzico.invested[msg.sender] >= 100.finney && @voted[msg.sender] == false\n\n color = Color( choice )\n # 0.1 ETH (100 finney) invested in PonzICO per vote, truncated\n num = @ponzico.invested[msg.sender] / 100.finney\n @votes[color] += num\n @voted[msg.sender] = true\n log Votes.new( color, num )\nend",
"title": ""
},
{
"docid": "22d658bbd2c726e6c2a5d8359b1a32f8",
"score": "0.5724971",
"text": "def cast_vote(politician)\n \tif ((self.is_a? Voter) && !(self.is_a? Politician) && (self.voted == false))\n \t\tif politician.party == \"Democrat\"\n \t if ((self.politics == \"Socialist\") && ((1..90).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Liberal\") && ((1..75).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Neutral\") && ((1..50).include? rand(100) + 1)) \t\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Conservative\") && ((1..25).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Tea Party\") && ((1..10).include? rand(100)+ 1))\n self.voted = true\n return true\n \t\t\tend\n \t\telsif politician.party == \"Republican\"\n \t\t\tif ((self.politics == \"Tea Party\") && ((1..90).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Conservative\") && ((1..75).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Neutral\") && ((1..50).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Liberal\") && ((1..25).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Socialist\") && ((1..10).include? rand(100)+ 1))\n self.voted = true\n return true\n \t\t\tend\n \t\tend \n \telsif ((self.is_a? Voter) && (self.is_a? Politician))\n \t\tif self == politician\n self.voted = true\n \t\t\treturn true \n \t\tend \n else \n return false\n end\n end",
"title": ""
},
{
"docid": "22d658bbd2c726e6c2a5d8359b1a32f8",
"score": "0.5724971",
"text": "def cast_vote(politician)\n \tif ((self.is_a? Voter) && !(self.is_a? Politician) && (self.voted == false))\n \t\tif politician.party == \"Democrat\"\n \t if ((self.politics == \"Socialist\") && ((1..90).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Liberal\") && ((1..75).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Neutral\") && ((1..50).include? rand(100) + 1)) \t\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Conservative\") && ((1..25).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Tea Party\") && ((1..10).include? rand(100)+ 1))\n self.voted = true\n return true\n \t\t\tend\n \t\telsif politician.party == \"Republican\"\n \t\t\tif ((self.politics == \"Tea Party\") && ((1..90).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Conservative\") && ((1..75).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Neutral\") && ((1..50).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Liberal\") && ((1..25).include? rand(100) + 1))\n self.voted = true\n return true\n \t\t\tend\n \t\t\tif ((self.politics == \"Socialist\") && ((1..10).include? rand(100)+ 1))\n self.voted = true\n return true\n \t\t\tend\n \t\tend \n \telsif ((self.is_a? Voter) && (self.is_a? Politician))\n \t\tif self == politician\n self.voted = true\n \t\t\treturn true \n \t\tend \n else \n return false\n end\n end",
"title": ""
},
{
"docid": "665bf4ac79b6ef7bf800cefcca1db2d3",
"score": "0.57107574",
"text": "def vote_percent\n Vote.percent(vote_cache)\n end",
"title": ""
},
{
"docid": "bd55f197eb4c65df46835173779bf696",
"score": "0.5688765",
"text": "def vote_up\n update_votes(1)\n end",
"title": ""
},
{
"docid": "c550dcd5f73c676cb20c0207ca4464bc",
"score": "0.5687471",
"text": "def test_cast_vote_rolf_second_lesser\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login(\"rolf\")\n put(:update, params: { vote: { value: \"-1\" }, naming_id: nam2.id })\n assert_equal(10, rolf.reload.contribution)\n\n # Make sure observation was updated right.\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n\n # Check vote.\n assert_equal(3, nam1.reload.vote_sum)\n assert_equal(2, nam2.reload.vote_sum)\n assert_equal(2, nam2.votes.length)\n end",
"title": ""
},
{
"docid": "9c3c802f77d6ebe8ee2909e534895cbb",
"score": "0.56870514",
"text": "def user_voted?(naming, user)\n !lookup_naming(naming).users_vote(user).nil?\n end",
"title": ""
},
{
"docid": "22c86b28c470b7a701ec31724d38717d",
"score": "0.5683221",
"text": "def vote\n elected = 0\n @output.each_index do |o|\n elected = @output[o] > @output[elected] ? o : elected\n end\n elected\n end",
"title": ""
},
{
"docid": "cf321cf3af53b8a546d292bc0e667a33",
"score": "0.5680848",
"text": "def votes_left\n vote_total = 10\n # @submissions = Submission.find_all_by_story_id(params[:id])\n @submissions.each do |submission|\n vote_total -= submission.vote\n end\n vote_total\nend",
"title": ""
},
{
"docid": "0e2452b3ca602c34a88b979b59dd7f3b",
"score": "0.5675655",
"text": "def total_votes\n self.get_upvotes.size - self.get_downvotes.size\n end",
"title": ""
},
{
"docid": "30fbe89187c57470feb951a47d4b961d",
"score": "0.567128",
"text": "def votes_in_scenarios(scenarios)\n scenario_answers.for_scenarios(scenarios).count\n end",
"title": ""
},
{
"docid": "1e0abee3d82b12e5c41a387a6d795048",
"score": "0.5669607",
"text": "def report_votes(total_votes)\n total_votes.each do |finalist, vote_count|\n puts \"#{finalist.to_s.capitalize.light_blue} received #{vote_count.to_s.yellow} votes.\"\n end\n end",
"title": ""
},
{
"docid": "439a953edfae1f8a0640dbd47f31902d",
"score": "0.56648237",
"text": "def checkvote(vote,account)\n @deal = Deal.find_by_id(vote)\n @vs = 0 \n @current = account\n \n if @current.voted_for? @deal, :vote_scope => 'popularity'\n if @current.voted_up_on? @deal, vote_scope: 'popularity'\n @vs = 1\n else\n @vs = -1\n end\n end\n return @vs\n end",
"title": ""
},
{
"docid": "5f83d4a436817bf6754bc67946791ae3",
"score": "0.5660296",
"text": "def score(alpha, votes, views) #:doc:\n n = 2 * votes - views\n n != 0 ? (n / n.abs) * (n.abs) ** alpha : 0\n end",
"title": ""
},
{
"docid": "2526000ba53b4cc84563069546a46f90",
"score": "0.56551284",
"text": "def new_vote(vote, votable, voter)\n vote == 'up' ? votable.upvote_by(voter) : votable.downvote_by(voter)\n change_carma(vote, votable, voter,\n ex_up: 2, ex_down: -1, ph_up: 4, ph_down: -2, usr: 1)\n flash[:notice] = 'Thank you for your vote.'\n end",
"title": ""
},
{
"docid": "73258bb7afd0c4f7dca6c310afca3cbb",
"score": "0.5653907",
"text": "def test_cast_vote_rolf_second_lesser\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login('rolf')\n post(:cast_vote,\n :value => \"-1\",\n :id => nam2.id\n )\n assert_equal(10, @rolf.reload.contribution)\n\n # Make sure observation was updated right.\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n\n # Check vote.\n assert_equal(3, nam1.reload.vote_sum)\n assert_equal(2, nam2.reload.vote_sum)\n assert_equal(2, nam2.votes.length)\n end",
"title": ""
},
{
"docid": "73258bb7afd0c4f7dca6c310afca3cbb",
"score": "0.5653907",
"text": "def test_cast_vote_rolf_second_lesser\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login('rolf')\n post(:cast_vote,\n :value => \"-1\",\n :id => nam2.id\n )\n assert_equal(10, @rolf.reload.contribution)\n\n # Make sure observation was updated right.\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n\n # Check vote.\n assert_equal(3, nam1.reload.vote_sum)\n assert_equal(2, nam2.reload.vote_sum)\n assert_equal(2, nam2.votes.length)\n end",
"title": ""
},
{
"docid": "67d32c00a0c81ee2ec482d15ebb96ea1",
"score": "0.56486374",
"text": "def pct_html(naming)\n percent = \"#{naming.vote_percent.round}%\"\n\n link_with_query(h(percent),\n naming_vote_path(naming_id: naming.id),\n class: \"vote-percent btn btn-link px-0\",\n onclick: \"MOEvents.whirly();\",\n remote: true)\n end",
"title": ""
},
{
"docid": "3129245d1d596cceaac7f211c4ad3ef0",
"score": "0.5631663",
"text": "def bayesian_rank\n\n #this is an ad hoc value, which basically represents the minimum number of \n #votes we think an Idea should have before it's even considered relevant. \n #eventually this value will come from the admin screen\n @magic_number_of_votes = 0.5\n\n @return_value = ((@magic_number_of_votes*Idea.average_rank_of_all_ideas.to_f)+(self.count_of_users_ranked*self.average_rank.to_f))/(@magic_number_of_votes+self.count_of_users_ranked)\n\n if @return_value == 0\n return 10\n else\n return @return_value.round(2)\n end\n\nend",
"title": ""
},
{
"docid": "5772e9904b858191621f6e2ea5cc3fa0",
"score": "0.56142646",
"text": "def check_vote_age(age)\n if age >= 18\n puts \"You are eligible to vote\"\n else\n puts \"You are not eligible to vote.\"\n end\nend",
"title": ""
},
{
"docid": "e5bfc062604f4d5c75d4fa563e938b8a",
"score": "0.5610344",
"text": "def votes\n total_votes = 0\n self.options.each do |vote_val|\n #todo: this is probably wrong\n total_votes += vote_val.to_i\n end\n total_votes += (REDIS_VOTES.get('YES:' + self.id).to_i + REDIS_VOTES.get('NO:' + self.id).to_i)\n end",
"title": ""
},
{
"docid": "172cc06167d18477e627b8ef191d5806",
"score": "0.5609775",
"text": "def vote_down\n 100\n end",
"title": ""
},
{
"docid": "16f20170377aac0d1e6697a4051b44b4",
"score": "0.56016725",
"text": "def vote(vtr, value)\n\n original_points = self.point #Record original points to update user \n\n #Check that voter is not self's voter \n return nil if vtr == self.voter\n\n vt = Vote.where(voter_id:vtr.id, voteable_id:self.id).first\n if vt && vt.vote == value\n unvote(vtr,vt)\n return nil\n elsif vt\n self.point -= self.class.options(vt.vote) #Remove old vote points\n vtr.reputation -= self.class.vtback(vt.vote)\n else\n self.count += 1\n vt = Vote.new(voter_id:vtr.id, voteable_id:self.id)\n votes << vt\n end\n\n case value\n when :up ; self.up += 1\n when :down ; self.down += 1\n end\n\n self.point += self.class.options(value) #Add new vote points\n vtr.reputation += self.class.vtback(value)\n self.save\n vtr.save\n\n #Update votee reputation\n self.voter.reputation += self.point - original_points\n self.voter.save\n\n # Set vote to up or down\n vt.vote= value\n vt.save\n return vt\n end",
"title": ""
},
{
"docid": "86a6e8cfae14e89c1aebb2c777edf4e5",
"score": "0.5596355",
"text": "def new_vote(new_vote,voter_name)\n # puts \"iNSERT NEW VOTES WITH VOTES #{new_vote.inspect}\"\n\n self.votes = Array.new\n hash = Hash.new\n hash[new_vote] = voter_name\n self.votes << hash\n new_pg_vote(self.votes,self)\n\n end",
"title": ""
},
{
"docid": "150355326c4084208e795b6f01851281",
"score": "0.5581089",
"text": "def get_vote_tally\n return self.get_upvotes.size - self.get_downvotes.size\n end",
"title": ""
},
{
"docid": "2f72b3049da5d3fea7087096c3819b55",
"score": "0.55679405",
"text": "def upvote\n self.votes += 1\n save\n end",
"title": ""
},
{
"docid": "bf7437c02ce1228593c1ca07edf6ed3b",
"score": "0.55660856",
"text": "def repute_vote_up(voter)\n Reputation.handle(self, :vote_up, self.person, :sender => voter, :tier => self.tier)\n end",
"title": ""
},
{
"docid": "ffdec08d0ea33692a533506763bed396",
"score": "0.55467844",
"text": "def vote\n value = params[:type] == \"up\" ? 1 : -1\n @post.add_or_update_evaluation(:votes, value, current_user)\n redirect_to :back\n end",
"title": ""
}
] |
641f310c470f21e22de1af50aa35ce37
|
Returns if the given message is from a device
|
[
{
"docid": "4f2fcbedc77a0348756884857aeba031",
"score": "0.6021219",
"text": "def device?\n !user?\n end",
"title": ""
}
] |
[
{
"docid": "2317faa8056dbe0762f8518e4fb3d216",
"score": "0.68273544",
"text": "def incomming?\n device?\n end",
"title": ""
},
{
"docid": "7159a9fd0423531a798205ab551cf3c5",
"score": "0.6611933",
"text": "def has_device?(device)\n @devices.include?(device.to_s)\n end",
"title": ""
},
{
"docid": "86d1f0db91f69dae01f452bba2572c4e",
"score": "0.6599573",
"text": "def sender?(message)\n if message.sender == id\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "a7e90932ff723adf3de5571573f630fa",
"score": "0.65150017",
"text": "def device?\n @device\n end",
"title": ""
},
{
"docid": "1104102d3b2de0e5945c988a5df07265",
"score": "0.65124685",
"text": "def is_device?(device)\n request.user_agent.to_s.downcase.include?(device.to_s.downcase)\n end",
"title": ""
},
{
"docid": "f888386cfb6610839f4eabf0c884de6a",
"score": "0.64187765",
"text": "def is_message(message)\n case message\n\twhen Telegram::Bot::Types::Message\n\t return true\n\telse\n\t return false\n\tend\nend",
"title": ""
},
{
"docid": "9401512f0c4c703099a2ced352833cec",
"score": "0.63461345",
"text": "def message_to_bot?\n @message.scan(/^\\<\\@#{@client.self.id}\\>/).count.positive? || @channel[0] == \"D\"\n end",
"title": ""
},
{
"docid": "4b08145c7b287237e129edcd033e3f2d",
"score": "0.6331092",
"text": "def from_me?(message,connection)\n this_user = self.user_from_connection(connection)\n return true if this_user == message['from'] \n return false\n end",
"title": ""
},
{
"docid": "7e7bfc45272865c98394191154322975",
"score": "0.61709195",
"text": "def in_dm?\n event[:channel].starts_with? 'D'\n end",
"title": ""
},
{
"docid": "616c213d31d2aa886b087a57adf60861",
"score": "0.6155698",
"text": "def recognize?(message)\n return false if @options[:pattern] && message.text !~ @options[:pattern] # Pattern check\n\n users = @options[:from] ? @options[:from] : nil\n sender = message.respond_to?(:sender) ? message.sender : message.user\n return false if users && !users.include?(sender.screen_name.downcase) # Check allowed senders\n true\n end",
"title": ""
},
{
"docid": "956ef71bbd6e7e8217f0ce9cde675477",
"score": "0.6108071",
"text": "def physical_device?\n not udid[DEVICE_UDID_REGEX, 0].nil?\n end",
"title": ""
},
{
"docid": "30f2ab24a23b0672e94b4799a64face6",
"score": "0.6105686",
"text": "def uses?(input)\n @device == input\n end",
"title": ""
},
{
"docid": "7ee6ad6f87b57de930c780d9fa9f8ff5",
"score": "0.60832447",
"text": "def message?\n true\n end",
"title": ""
},
{
"docid": "fa5426d615eb98710d11df5d3b8ab9ae",
"score": "0.6082806",
"text": "def is_message?(data)\n data.type == TYPE_MESSAGE\n end",
"title": ""
},
{
"docid": "a94739ac67e0bc8a83fe8a563bfc8923",
"score": "0.60518056",
"text": "def command?(message)\n return false unless message.text\n return false unless message.text[0] == '/'\n return false unless message.text =~ %r[^(?:/\\w+@#{@config.telegram.username}|/\\w+(?!@))(?: |$)]\n return true\n end",
"title": ""
},
{
"docid": "73a85532a2b9f176a27d4a9c65643546",
"score": "0.5997165",
"text": "def is_me(message)\n message.from.username == 'TuorTurambar'\nend",
"title": ""
},
{
"docid": "4b0bfe15e266c87fc24900f8d48bd74e",
"score": "0.5974581",
"text": "def to_me?(message,connection)\n if(!message.has_key?('user') or message['user'].nil? or message['user'] == 'all')\n return true\n else \n # Unicast\n this_user = self.user_from_connection(connection)\n return true if this_user == message['user'] \n return false\n end\n end",
"title": ""
},
{
"docid": "536a1c7ddcc5f3a019a742a42a586ff9",
"score": "0.5971722",
"text": "def device_responds?\n begin\n # send plain AT command\n meta(nil,:at)\n rescue DeviceNotFoundException\n false\n end\n end",
"title": ""
},
{
"docid": "6a8d83ef111e9d5850eb36946a67596e",
"score": "0.5968341",
"text": "def message?\n !message.nil?\n end",
"title": ""
},
{
"docid": "92fd7f4fc35196f2d674e7ff7aadb858",
"score": "0.5958065",
"text": "def recognize?(message)\n return false if @pattern && message.text !~ @pattern\n\n users = @options[:from] ? @options[:from] : nil\n return false if users && !users.include?(message.user) # Check allowed senders\n true\n end",
"title": ""
},
{
"docid": "3a5fc8f503c1b645de19dc27a5c36779",
"score": "0.5930122",
"text": "def is_device? type\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"title": ""
},
{
"docid": "c89e671818ac380f214447892ac464c5",
"score": "0.59209424",
"text": "def channel_message?(msg) \n msg.include?(@greeting_prefix)\nend",
"title": ""
},
{
"docid": "0d1524b4c7321721516f91f6c0c0556a",
"score": "0.5901247",
"text": "def is_device?(type)\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"title": ""
},
{
"docid": "0d1524b4c7321721516f91f6c0c0556a",
"score": "0.5901247",
"text": "def is_device?(type)\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"title": ""
},
{
"docid": "0d1524b4c7321721516f91f6c0c0556a",
"score": "0.5901247",
"text": "def is_device?(type)\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"title": ""
},
{
"docid": "a55374159539f79e963c784bd7890c75",
"score": "0.58917445",
"text": "def is_device?(type)\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"title": ""
},
{
"docid": "6a49140310e15bf4897e4e7d8875e372",
"score": "0.5891734",
"text": "def message?\n return true if @message\n\n false\n end",
"title": ""
},
{
"docid": "602733cdc2bf1358fcaa713ec9932bb9",
"score": "0.58906704",
"text": "def from_channel?\n self.target && [?#, ?&].include?(self.target[0])\n end",
"title": ""
},
{
"docid": "ec270a0f2598dd70c6196c14a113bd0d",
"score": "0.588344",
"text": "def include?(device)\n devices.include?(device)\n end",
"title": ""
},
{
"docid": "0adb2591a8cdce1477d8654ab661dacf",
"score": "0.5876471",
"text": "def check_for_automated_sender\n raise_decoding_error(\"automated_sender\") if @msg.from_shortcode?\n end",
"title": ""
},
{
"docid": "45423fa2e420d36972bf547ba62c425c",
"score": "0.58686715",
"text": "def from_user?\n self.target && !from_channel?\n end",
"title": ""
},
{
"docid": "f8629b983dcff51a86938ceeef8a12d1",
"score": "0.5868609",
"text": "def can_receive_notifications? \n device_id != nil && device_id != \"\"\n end",
"title": ""
},
{
"docid": "7cb51d3e0d64d1b8b5e2c6174f37fbbd",
"score": "0.5838245",
"text": "def handles?(device)\n device = Pling._convert(device, :device)\n self.class.handled_types.include?(device.type)\n end",
"title": ""
},
{
"docid": "754e62014c0d051886dd52cdce7c4a36",
"score": "0.58353746",
"text": "def check_for_automated_sender\n raise_decoding_error(\"automated_sender\") if @msg.from_shortcode?\n end",
"title": ""
},
{
"docid": "439c9fa1499d146ca7480c712735046d",
"score": "0.583028",
"text": "def is_message?\n return !type.nil? && type == :message\n end",
"title": ""
},
{
"docid": "f69b3755b636940b7aeac0e71ab0f454",
"score": "0.58220553",
"text": "def sends_message?(string)\n end",
"title": ""
},
{
"docid": "417c1c67e2abc843b86405b251aaeef9",
"score": "0.58213615",
"text": "def server_device?\n self.name =~ /mor_server_\\d+/ ? true : false\n end",
"title": ""
},
{
"docid": "417c1c67e2abc843b86405b251aaeef9",
"score": "0.58213615",
"text": "def server_device?\n self.name =~ /mor_server_\\d+/ ? true : false\n end",
"title": ""
},
{
"docid": "8bbf14e9f0dbe98a47a252a3f356ea4e",
"score": "0.5814514",
"text": "def send_by_mobile?(resource)\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "89bb05548683251f175d01edc48e9841",
"score": "0.5814446",
"text": "def used?(device)\n dev = devices.detect { |v| v == device }\n return false unless dev\n !dev.inherited?\n end",
"title": ""
},
{
"docid": "3ce9f48681cfd2d6710f51d5698faf37",
"score": "0.580903",
"text": "def input?(device)\n device.respond_to?(:type) && device.type == :input && device.respond_to?(:gets)\n end",
"title": ""
},
{
"docid": "f5382885c4ddda20d2eba12e246f7b70",
"score": "0.57878244",
"text": "def wechat?\n ua =~ /MicroMessenger/\n end",
"title": ""
},
{
"docid": "10fd731d77e166a2fc849e9ee685b44c",
"score": "0.5787351",
"text": "def process_message?(_payload)\n true\n end",
"title": ""
},
{
"docid": "401900a315601844ae452e3ded630ea3",
"score": "0.57663924",
"text": "def valid_client?(client, message)\n if message['receivers'].is_a?(Hash) && message['receivers']['sockets'].is_a?(Array)\n return true if message['receivers']['sockets'].any?{|r| r == '*'}\n return true if message['receivers']['sockets'].any?{|r| r == client.socket_id}\n end\n if message['receivers'].is_a?(Hash) && message['receivers']['tags'].is_a?(Array)\n return true if message['receivers']['tags'].any?{|tag| client.tags.include?(tag)}\n end\n\n false\n end",
"title": ""
},
{
"docid": "5335d77b148f5ebc4891cc64f6781f93",
"score": "0.5764125",
"text": "def is_self_message?(data)\n if data[:type] == 'message' && data[:user] == Affiliation::Self.get[:id]\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "412a35673ae6e4a6c28af264b3ceec86",
"score": "0.5762111",
"text": "def accept? message\n return false if message.direction == :in && @ingoing == false\n return false if message.direction == :out && @outgoing == false\n if @type\n if @type.is_a? Array\n return false unless @type.include? message.type\n else\n return false unless message.type == @type\n end\n end\n if @component\n return false if message.attributes['cId'] && message.attributes['cId'] != @component\n end\n true\n end",
"title": ""
},
{
"docid": "6f303375e73f8364dcf9f61e40219f38",
"score": "0.57620597",
"text": "def has_message? ; !!@message ; end",
"title": ""
},
{
"docid": "ae23758cdf4a3a2b64231718cb1066dd",
"score": "0.5756361",
"text": "def device?\n !!(@device ||= false)\n end",
"title": ""
},
{
"docid": "ae23758cdf4a3a2b64231718cb1066dd",
"score": "0.5756361",
"text": "def device?\n !!(@device ||= false)\n end",
"title": ""
},
{
"docid": "baddf216fd29d9b480944196ca76d4e1",
"score": "0.5751652",
"text": "def contains_message?(message_id)\n\t\t!! uid_for_message_id(message_id)\n\tend",
"title": ""
},
{
"docid": "b881fee1b02038f7697cae412ba74c92",
"score": "0.57247674",
"text": "def system_msg?\r\n %w(approve deny system repost).detect {|x| msg_type == x}\r\n end",
"title": ""
},
{
"docid": "8cbd3017d0f16158c8fc8c36556292d2",
"score": "0.57241344",
"text": "def send_by_sms?(resource)\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "394e2580535655d9f0b5ee2e7c52e248",
"score": "0.57068914",
"text": "def used?(device)\n sync do\n dev = devices.detect { |v| v == device }\n next(false) unless dev\n !dev.inherited?\n end\n end",
"title": ""
},
{
"docid": "a27aaa667dbb341604c534fc3c42b6bf",
"score": "0.5703185",
"text": "def want_msg?\r\n msg_type == 'want'\r\n end",
"title": ""
},
{
"docid": "c6d010264108444e4a2180c03a626138",
"score": "0.5693663",
"text": "def addressed_to_me?(message)\n m = message.body.match(/^#{name}(?:[,:]\\s*|\\s+)(.*)/i)\n m ||= message.body.match(/^\\s*(.*?)(?:,\\s+)?\\b#{name}[.!?\\s]*$/i)\n message.command = m[1] if m\n end",
"title": ""
},
{
"docid": "eec2f3037f74fb9fa2fc9219e256f7a9",
"score": "0.5693563",
"text": "def is_mobile_device?\n request.user_agent.to_s.downcase =~ Regexp.new(Simplicity::Helpers::MOBILE_USER_AGENTS)\n end",
"title": ""
},
{
"docid": "07d0db67c0dac629189f0a29152b8b48",
"score": "0.56871235",
"text": "def message_in_session?(message)\n session_message_ids.include?(message.id)\n end",
"title": ""
},
{
"docid": "3d564c462226550a59b54d31571196a6",
"score": "0.56752735",
"text": "def network_device?(device)\n device_name = (device[\"productName\"] ? device[\"productName\"] : device[\"name\"]).try(:downcase)\n device[\"class\"] == \"Network controller\" || device_name =~ /nic/ || device_name =~ /ethernet/\n end",
"title": ""
},
{
"docid": "27bd0444240cee81cec6bc381d43e5ff",
"score": "0.56703264",
"text": "def network_device?(device)\n device_name = (device['productName'] ? device['productName'] : device['name']).try(:downcase)\n device['class'] == 'Network controller' || device_name =~ /nic/ || device_name =~ /ethernet/\n end",
"title": ""
},
{
"docid": "77c03291046a0fbe978dd6eb9d4f38f9",
"score": "0.566435",
"text": "def received?\n (status == RECEIVED)\n end",
"title": ""
},
{
"docid": "dadb148becf53af0d9836a5edfbabd3a",
"score": "0.5656075",
"text": "def mobile?\n @device == :mobile\n end",
"title": ""
},
{
"docid": "a0487794e18e134e136e381bc7eee7dc",
"score": "0.5655239",
"text": "def from_self?(message, robot)\n message.user.name == robot.name\n end",
"title": ""
},
{
"docid": "8481f047de3b6c6133682f5c311f80d3",
"score": "0.56478345",
"text": "def is_device?(app_type)\n (device_type ? :gcm : :apns) == app_type \n end",
"title": ""
},
{
"docid": "b12289347fa79ce4981e49f5c10cafba",
"score": "0.5635813",
"text": "def network_device?(device)\n device_name = (device['productName'] ? device['productName'] : device['name']).try(:downcase)\n device['class'] == 'Network controller' || device_name =~ /nic/ || device_name =~ /ethernet/\n end",
"title": ""
},
{
"docid": "c790e49e185b1d762fb93508a77b9c91",
"score": "0.56316954",
"text": "def is_mobile_device?\n request.user_agent.to_s.downcase =~ Regexp.new(ActionController::MobileFu::MOBILE_USER_AGENTS)\n end",
"title": ""
},
{
"docid": "c790e49e185b1d762fb93508a77b9c91",
"score": "0.56316954",
"text": "def is_mobile_device?\n request.user_agent.to_s.downcase =~ Regexp.new(ActionController::MobileFu::MOBILE_USER_AGENTS)\n end",
"title": ""
},
{
"docid": "281e79d779aa2aa406d1743ebaeb51dd",
"score": "0.5615127",
"text": "def reply?\n self.message_kind.to_s == REPLY\n end",
"title": ""
},
{
"docid": "e09d075ab8a141d8839a327357f8e472",
"score": "0.55911034",
"text": "def is_mobile_device?\n request.user_agent.to_s.downcase =~ Regexp.new(MOBILE_USER_AGENTS)\n end",
"title": ""
},
{
"docid": "b0115b755a66663f954569bc24be4e53",
"score": "0.5578615",
"text": "def has_read(message)\n read_message_id == message.id\t\n end",
"title": ""
},
{
"docid": "b53707e86b5b316d536e0dd1fc0fbd9c",
"score": "0.5561059",
"text": "def has_message?\n !message.blank?\n end",
"title": ""
},
{
"docid": "3b933b593afec75e525b0e1ae6dfe8f2",
"score": "0.5555666",
"text": "def is_command?(message)\n if message[0,1] == \"!\"\n true\n end\n end",
"title": ""
},
{
"docid": "a80936fe9813123534a1152d654423ab",
"score": "0.5554612",
"text": "def include?(device)\n sync { devices.include?(device) }\n end",
"title": ""
},
{
"docid": "6ef79810ac243b75e942f5c461c2eda2",
"score": "0.5525458",
"text": "def is_simplemessage?\n is_message? && subtype.nil?\n end",
"title": ""
},
{
"docid": "c28046670ab5396484a460d819d15dbf",
"score": "0.5510738",
"text": "def device?\n\n\t\t\treturn false if @file_stat.nil?\n\n\t\t\t@file_stat.device?\n\t\tend",
"title": ""
},
{
"docid": "b2ed855891c5afd8583f03eb0016f511",
"score": "0.55089474",
"text": "def sender? usr\r\n usr.id == user_id\r\n end",
"title": ""
},
{
"docid": "4b69da3ed75c2a27f0cdbe1c03603cdf",
"score": "0.55065125",
"text": "def relevant?(msg)\n return false unless msg.match(@@botname)\n true\n end",
"title": ""
},
{
"docid": "a19b2f4650cedcfefc74f20a3e2164bb",
"score": "0.55062217",
"text": "def is_mobile_device?\n ActiveDevice::Handset.is_mobile? request.user_agent\n end",
"title": ""
},
{
"docid": "6977f31ee1c9f41f188884228092c39e",
"score": "0.5504973",
"text": "def from_user?\n !from_channel?\n end",
"title": ""
},
{
"docid": "93c7c195e7a9d0ab59f2efa8e9d46184",
"score": "0.5504001",
"text": "def match(msg)\n if @type\n if {Message::SIGNAL => \"signal\", Message::METHOD_CALL => \"method_call\",\n Message::METHOD_RETURN => \"method_return\",\n Message::ERROR => \"error\"}[msg.message_type] != @type\n return false\n end\n end\n return false if @interface and @interface != msg.interface\n return false if @member and @member != msg.member\n return false if @path and @path != msg.path\n true\n end",
"title": ""
},
{
"docid": "846e178ce1376b84f3489b8acb769043",
"score": "0.55030805",
"text": "def is_mobile_device?\n request.user_agent.to_s.downcase =~ Regexp.new(ActionController::RespondToMobile::MOBILE_USER_AGENTS)\n end",
"title": ""
},
{
"docid": "3fb088af37868bac5fc2759d268c4575",
"score": "0.54979575",
"text": "def RESPOND?(message)\n respond_to? message\n end",
"title": ""
},
{
"docid": "77a020c41acf73b840f8780303deefc1",
"score": "0.5494546",
"text": "def sender?(user_id)\n (sender_id == user_id)? true : false\n end",
"title": ""
},
{
"docid": "6348d57f00bef581a72f3cf76bebe257",
"score": "0.5474172",
"text": "def exists?\n start = Time.now\n debug \"Checking for device: \\\"#{resource[:hostname]}\\\"\"\n connection = self.class.get_connection(resource[:account])\n device = get_device_by_display_name(connection, resource[:display_name], 'id') ||\n get_device_by_hostname(connection, resource[:hostname], resource[:collector])\n if nil_or_empty?(device)\n debug \"Finished in #{(Time.now-start)*1000.0} ms\"\n return false\n end\n debug \"Finished in #{(Time.now-start)*1000.0} ms\"\n true\n end",
"title": ""
},
{
"docid": "410e04ae9b0331e1bd811c3ece4d7d58",
"score": "0.5466591",
"text": "def shout? (msg)\n msg.upcase == msg\n end",
"title": ""
},
{
"docid": "01b2fd2a91c9052175bdecd73994f438",
"score": "0.5461007",
"text": "def isSendAble?\n self.connected? && self.isActive?\n end",
"title": ""
},
{
"docid": "6943c36a4032ee7da53c0d9149979a90",
"score": "0.5460972",
"text": "def smsable?\n properties.include?(\"smsable\")\n end",
"title": ""
},
{
"docid": "787c3ed588685d00192cf767d4328d9a",
"score": "0.5459323",
"text": "def device_owned_by?(owner)\n owners.include?(owner)\n end",
"title": ""
},
{
"docid": "f017d009681472e6ecfa3f1e87e24661",
"score": "0.5457642",
"text": "def is_direct_message?(hash)\n return hash[:sender] && hash[:recipient]\n end",
"title": ""
},
{
"docid": "40e53002163a9dc601af97d4038458c4",
"score": "0.5457392",
"text": "def echo?\n @messaging['message']['is_echo']\n end",
"title": ""
},
{
"docid": "7aef1feedcdb1a671052d63517d73d28",
"score": "0.54564816",
"text": "def check_message_direction(message)\n @telerivetPhone = @user.coordinator_api_setting.telerivet_phone_number\n coordinatorPhone = remove_state_code_from_message_number(@telerivetPhone)\n if message.direction.downcase == \"incoming\"\n @to_number = message.from_number\n else\n @to_number = message.to_number\n end\n @client_number = remove_state_code_from_message_number(@to_number)\n @conversation = Conversation.where(\"phone_number LIKE ? AND final_from_number LIKE ?\", \"%#{@client_number}\", \"%#{coordinatorPhone}\").order(\"msg_time DESC\")\n end",
"title": ""
},
{
"docid": "dccedb39c35a54961c754ca83ecf8dc2",
"score": "0.5455743",
"text": "def sms?\n sms ? (sms == \"enabled\") : false\n end",
"title": ""
},
{
"docid": "4e173a6330ca1b05ddcbcb8aceb434b5",
"score": "0.5441503",
"text": "def mobile_device?\n !!(request.user_agent =~ /Mobile|webOS/i)\n end",
"title": ""
},
{
"docid": "9175ebefda32a5ca1bc7798746a42556",
"score": "0.5434974",
"text": "def is_bot?\n ActiveDevice::Bot.is_bot? request.user_agent\n end",
"title": ""
},
{
"docid": "c15d2be5b200c2682f4c82518fea4fb9",
"score": "0.54229033",
"text": "def is_android_phone\n self.device.eql? ANDROID_PHONE\n end",
"title": ""
},
{
"docid": "9416eee20c727009d5d5b1c597edbb18",
"score": "0.5412312",
"text": "def supported?(device)\n port_count(device).nonzero?\n end",
"title": ""
},
{
"docid": "5c1345271b89fdf70e93ba62064bf307",
"score": "0.5404916",
"text": "def udp?\n @name == 'udp'\n end",
"title": ""
},
{
"docid": "953e99cf38d2d5e13e2058a371209618",
"score": "0.5398815",
"text": "def directly_addressed?\n return false unless @msg\n return true if @msg.match(/^\\@?#{bot.nickname}/i)\n return false\n end",
"title": ""
},
{
"docid": "d28af25cbb7bcdf428791a006a4d8127",
"score": "0.53959787",
"text": "def responds_to?(message)\n return true unless event_regex\n @match_data = event_regex.match(message)\n return @match_data\n end",
"title": ""
},
{
"docid": "e3756936a52a0cc90f5d6e3752d246ac",
"score": "0.5389263",
"text": "def sender_not_supported\n sms.to[0] == \"1\" || # USA\n sms.to[0..2] == \"962\" || # Jordan\n sms.to[0..2] == \"971\" # UAE\n end",
"title": ""
},
{
"docid": "55dc27c1a9aa59044f1ed0ecddfbef48",
"score": "0.53832346",
"text": "def subscribed?\n !!@on_msg\n end",
"title": ""
}
] |
add9ca28828d03053f6fe2d2f1829d20
|
Split shorthand border declarations (e.g. border: 1px red;) Additional splitting happens in expand_dimensions_shorthand!
|
[
{
"docid": "dd8ffa496ae2734456e7fd1ab9ac6f5e",
"score": "0.7921527",
"text": "def expand_border_shorthand! # :nodoc:\n BORDER_PROPERTIES.each do |k|\n next unless (declaration = declarations[k])\n\n value = declaration.value.dup\n\n replacement = {\n \"#{k}-width\" => value.slice!(CssParser::RE_BORDER_UNITS),\n \"#{k}-color\" => value.slice!(CssParser::RE_COLOUR),\n \"#{k}-style\" => value.slice!(CssParser::RE_BORDER_STYLE)\n }\n\n declarations.replace_declaration!(k, replacement, preserve_importance: true)\n end\n end",
"title": ""
}
] |
[
{
"docid": "ee276805abfce6551dae4f13c50e24c5",
"score": "0.85924184",
"text": "def expand_border_shorthand! # :nodoc:\n ['border', 'border-left', 'border-right', 'border-top', 'border-bottom'].each do |k|\n next unless @declarations.has_key?(k)\n\n value = @declarations[k][:value]\n\n split_declaration(k, \"#{k}-width\", value.slice!(CssParser::RE_BORDER_UNITS))\n split_declaration(k, \"#{k}-color\", value.slice!(CssParser::RE_COLOUR))\n split_declaration(k, \"#{k}-style\", value.slice!(CssParser::RE_BORDER_STYLE))\n\n @declarations.delete(k) \n end\n end",
"title": ""
},
{
"docid": "3f61b8bd3284867bb247614f4756f241",
"score": "0.7687793",
"text": "def expand_dimensions_shorthand! # :nodoc:\n {'margin' => 'margin-%s',\n 'padding' => 'padding-%s',\n 'border-color' => 'border-%s-color', \n 'border-style' => 'border-%s-style', \n 'border-width' => 'border-%s-width'}.each do |property, expanded|\n\n next unless @declarations.has_key?(property)\n \n value = @declarations[property][:value]\n\n # RGB and HSL values in borders are the only units that can have spaces (within params).\n # We cheat a bit here by stripping spaces after commas in RGB and HSL values so that we \n # can split easily on spaces.\n #\n # TODO: rgba, hsl, hsla\n value.gsub!(RE_COLOUR) { |c| c.gsub(/[\\s]+/, '') }\n\n matches = value.strip.split(/[\\s]+/)\n\n t, r, b, l = nil\n\n case matches.length\n when 1\n t, r, b, l = matches[0], matches[0], matches[0], matches[0]\n when 2\n t, b = matches[0], matches[0]\n r, l = matches[1], matches[1]\n when 3\n t = matches[0]\n r, l = matches[1], matches[1]\n b = matches[2]\n when 4\n t = matches[0]\n r = matches[1]\n b = matches[2]\n l = matches[3]\n end\n\n split_declaration(property, expanded % 'top', t)\n split_declaration(property, expanded % 'right', r)\n split_declaration(property, expanded % 'bottom', b)\n split_declaration(property, expanded % 'left', l)\n\n @declarations.delete(property)\n end\n end",
"title": ""
},
{
"docid": "1cc0e25d380ab010e241c472d5c9c2fe",
"score": "0.74254036",
"text": "def create_border_shorthand! # :nodoc:\n values = []\n \n ['border-width', 'border-style', 'border-color'].each do |property|\n if @declarations.has_key?(property) and not @declarations[property][:is_important]\n # can't merge if any value contains a space (i.e. has multiple values)\n # we temporarily remove any spaces after commas for the check (inside rgba, etc...)\n return if @declarations[property][:value].gsub(/\\,[\\s]/, ',').strip =~ /[\\s]/\n values << @declarations[property][:value]\n end\n end\n\n @declarations.delete('border-width')\n @declarations.delete('border-style')\n @declarations.delete('border-color')\n\n unless values.empty?\n @declarations['border'] = {:value => values.join(' ')}\n end\n end",
"title": ""
},
{
"docid": "f31742969162f6b45f6540fd6a00d8ab",
"score": "0.7188525",
"text": "def create_border_shorthand! # :nodoc:\n values = BORDER_STYLE_PROPERTIES.map do |property|\n next unless (declaration = declarations[property])\n next if declaration.important\n # can't merge if any value contains a space (i.e. has multiple values)\n # we temporarily remove any spaces after commas for the check (inside rgba, etc...)\n next if declaration.value.gsub(/,\\s/, ',').strip =~ /\\s/\n\n declaration.value\n end.compact\n\n return if values.size != BORDER_STYLE_PROPERTIES.size\n\n BORDER_STYLE_PROPERTIES.each do |property|\n declarations.delete(property)\n end\n\n declarations['border'] = values.join(' ')\n end",
"title": ""
},
{
"docid": "3521ba90e4372d57a37a12ae61e0e9b8",
"score": "0.71545017",
"text": "def expand_shorthand!\n # border must be expanded before dimensions\n expand_border_shorthand!\n expand_dimensions_shorthand!\n expand_font_shorthand!\n expand_background_shorthand!\n expand_list_style_shorthand!\n end",
"title": ""
},
{
"docid": "3521ba90e4372d57a37a12ae61e0e9b8",
"score": "0.71545017",
"text": "def expand_shorthand!\n # border must be expanded before dimensions\n expand_border_shorthand!\n expand_dimensions_shorthand!\n expand_font_shorthand!\n expand_background_shorthand!\n expand_list_style_shorthand!\n end",
"title": ""
},
{
"docid": "3b885a7168b8d3b04ce9979c025e7189",
"score": "0.6848949",
"text": "def expand_dimensions_shorthand! # :nodoc:\n DIMENSIONS.each do |property, (top, right, bottom, left)|\n next unless (declaration = declarations[property])\n\n value = declaration.value.dup\n\n # RGB and HSL values in borders are the only units that can have spaces (within params).\n # We cheat a bit here by stripping spaces after commas in RGB and HSL values so that we\n # can split easily on spaces.\n #\n # TODO: rgba, hsl, hsla\n value.gsub!(RE_COLOUR) { |c| c.gsub(/(\\s*,\\s*)/, ',') }\n\n matches = split_value_preserving_function_whitespace(value)\n\n case matches.length\n when 1\n values = matches.to_a * 4\n when 2\n values = matches.to_a * 2\n when 3\n values = matches.to_a\n values << matches[1] # left = right\n when 4\n values = matches.to_a\n else\n raise ArgumentError, \"Cannot parse #{value}\"\n end\n\n replacement = [top, right, bottom, left].zip(values).to_h\n\n declarations.replace_declaration!(property, replacement, preserve_importance: true)\n end\n end",
"title": ""
},
{
"docid": "8639686c10545d83f9d02dcd05e6c819",
"score": "0.67170084",
"text": "def create_dimensions_shorthand! # :nodoc:\n directions = ['top', 'right', 'bottom', 'left']\n\n {'margin' => 'margin-%s',\n 'padding' => 'padding-%s',\n 'border-color' => 'border-%s-color', \n 'border-style' => 'border-%s-style', \n 'border-width' => 'border-%s-width'}.each do |property, expanded|\n\n top, right, bottom, left = ['top', 'right', 'bottom', 'left'].map { |side| expanded % side }\n foldable = @declarations.select do |dim, val|\n dim == top or dim == right or dim == bottom or dim == left\n end\n # All four dimensions must be present\n if foldable.length == 4\n values = {}\n\n directions.each { |d| values[d.to_sym] = @declarations[expanded % d][:value].downcase.strip }\n\n if values[:left] == values[:right]\n if values[:top] == values[:bottom] \n if values[:top] == values[:left] # All four sides are equal\n new_value = values[:top]\n else # Top and bottom are equal, left and right are equal\n new_value = values[:top] + ' ' + values[:left]\n end\n else # Only left and right are equal\n new_value = values[:top] + ' ' + values[:left] + ' ' + values[:bottom]\n end\n else # No sides are equal\n new_value = values[:top] + ' ' + values[:right] + ' ' + values[:bottom] + ' ' + values[:left]\n end\n\n new_value.strip!\n @declarations[property] = {:value => new_value.strip} unless new_value.empty?\n\n # Delete the longhand values\n directions.each { |d| @declarations.delete(expanded % d) }\n end\n end\n end",
"title": ""
},
{
"docid": "4ba862d95382e7845103fed105e7705b",
"score": "0.61921924",
"text": "def borders; end",
"title": ""
},
{
"docid": "469eed7d472afe16071fff888079e1e8",
"score": "0.61481756",
"text": "def create_shorthand!\n create_background_shorthand!\n create_dimensions_shorthand!\n # border must be shortened after dimensions\n create_border_shorthand!\n create_font_shorthand!\n create_list_style_shorthand!\n end",
"title": ""
},
{
"docid": "469eed7d472afe16071fff888079e1e8",
"score": "0.61481756",
"text": "def create_shorthand!\n create_background_shorthand!\n create_dimensions_shorthand!\n # border must be shortened after dimensions\n create_border_shorthand!\n create_font_shorthand!\n create_list_style_shorthand!\n end",
"title": ""
},
{
"docid": "6cc96edaed8e936025ae3cb31209075e",
"score": "0.5991912",
"text": "def create_dimensions_shorthand! # :nodoc:\n return if declarations.size < NUMBER_OF_DIMENSIONS\n\n DIMENSIONS.each do |property, dimensions|\n values = [:top, :right, :bottom, :left].each_with_index.with_object({}) do |(side, index), result|\n next unless (declaration = declarations[dimensions[index]])\n\n result[side] = declaration.value\n end\n\n # All four dimensions must be present\n next if values.size != dimensions.size\n\n new_value = values.values_at(*compute_dimensions_shorthand(values)).join(' ').strip\n declarations[property] = new_value unless new_value.empty?\n\n # Delete the longhand values\n dimensions.each { |d| declarations.delete(d) }\n end\n end",
"title": ""
},
{
"docid": "4e9fd3ae4d9b6e5e8c3e7e613f41ec68",
"score": "0.59365416",
"text": "def test_combining_dimensions_into_shorthand_with_auto\n rs = RuleSet.new('#page', \"margin: 0; margin-left: auto; margin-right: auto;\")\n rs.expand_shorthand!\n assert_equal('auto;', rs['margin-left'])\n rs.create_shorthand!\n assert_equal('0 auto;', rs['margin'])\n end",
"title": ""
},
{
"docid": "b71f1c0bfaecd77dfea44d3d33cbac91",
"score": "0.58248705",
"text": "def border\n [bottom, top, right, left]\n end",
"title": ""
},
{
"docid": "9b02dccaf2b2371cc4cee6398ab68773",
"score": "0.58072597",
"text": "def border; end",
"title": ""
},
{
"docid": "a28686cd87166a3dd747bc23c7d3ba52",
"score": "0.5727074",
"text": "def applyBorder; end",
"title": ""
},
{
"docid": "ccb72664e28b4abbe7774db59e98b2d6",
"score": "0.5723005",
"text": "def border_style\n s = final_style\n if border\n s = s.assign(border)\n s.assign(style.focus&.border) if get_attribute('focused')\n s.assign(style.enter&.border) if get_attribute('entered')\n s.assign(style.action&.border) if get_attribute('actioned')\n end\n s\n end",
"title": ""
},
{
"docid": "ae994e316303a11eb25722af872b87f3",
"score": "0.554991",
"text": "def border_classes(sides, class_prefix = 'border')\n if sides.is_a?(String)\n return '' if sides == 'none'\n return class_prefix if sides == 'all'\n \"#{class_prefix}-#{sides}\"\n else\n sides.collect do |side|\n \"#{class_prefix}-#{side}\"\n end.join(' ').rstrip\n end\n end",
"title": ""
},
{
"docid": "4e7e58a6b5882bf12278485d7756adf7",
"score": "0.5517226",
"text": "def border_width=(width)\n @border_widths = case\n when width.nil?\n [\"000000\"] * 4\n when Numeric === width # all widths\n [width, width, width, width]\n when width.length == 2 # vert, horiz\n [width[0], width[1], width[0], width[1]]\n when width.length == 3 # top, horiz, bottom\n [width[0], width[1], width[2], width[1]]\n when width.length == 4 # top, right, bottom, left\n [width[0], width[1], width[2], width[3]]\n else\n raise ArgumentError, \":border_width must be a string \" +\n \"or an array [v,h] or [t,r,b,l]\"\n end\n end",
"title": ""
},
{
"docid": "1660641a9e603d4b8bc9c81e30fef77e",
"score": "0.5503223",
"text": "def borderId; end",
"title": ""
},
{
"docid": "a6669fd5fa5f863ee7a444141a5cca99",
"score": "0.54717267",
"text": "def multicell_border(border,first_cell,remainder,w,h)\n if border == 0 then return end\n last_cell = (remainder == nil) || (remainder.length == 0)\n # puts \"multicell_border border #{border} first_cell #{first_cell} last_cell #{last_cell}\"\n border_internal(\n first_cell ? (last_cell ? border : pborder_and(border,'LTR')) :\n (last_cell ? pborder_and(border,'LRB') : pborder_and(border,'LR') ),\n @cur_x,@cur_y+h,@cur_x+w,@cur_y)\n end",
"title": ""
},
{
"docid": "a04085c3b6900ac3d6470fad562e82d1",
"score": "0.5462308",
"text": "def tag_border=(_arg0); end",
"title": ""
},
{
"docid": "0298f04c7ce7fbba7d71b19a2a7cde36",
"score": "0.54470354",
"text": "def border\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n return_value = BorderReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __WS295__ = nil\n __BORDER296__ = nil\n attr_svalue297 = nil\n\n tree_for_WS295 = nil\n tree_for_BORDER296 = nil\n stream_WS = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token WS\" )\n stream_BORDER = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token BORDER\" )\n stream_attr_svalue = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule attr_svalue\" )\n begin\n # at line 307:9: WS BORDER attr_svalue\n __WS295__ = match( WS, TOKENS_FOLLOWING_WS_IN_border_1941 )\n stream_WS.add( __WS295__ )\n __BORDER296__ = match( BORDER, TOKENS_FOLLOWING_BORDER_IN_border_1943 )\n stream_BORDER.add( __BORDER296__ )\n @state.following.push( TOKENS_FOLLOWING_attr_svalue_IN_border_1945 )\n attr_svalue297 = attr_svalue\n @state.following.pop\n stream_attr_svalue.add( attr_svalue297.tree )\n # AST Rewrite\n # elements: BORDER, attr_svalue\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 307:31: -> ^( BORDER attr_svalue )\n # at line 307:34: ^( BORDER attr_svalue )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_BORDER.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_attr_svalue.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 47 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "9a84890d66e004db72e67608767958e0",
"score": "0.5432713",
"text": "def border_classes(sides, class_prefix = 'border')\n if sides.is_a?(String)\n return '' if sides == 'none'\n\n return class_prefix if sides == 'all'\n\n return \"#{class_prefix}-#{sides}\"\n end\n\n sides.collect do |side|\n \"#{class_prefix}-#{side}\"\n end.join(' ').rstrip\n end",
"title": ""
},
{
"docid": "84831f540ba442bf2b05de4b868a47b9",
"score": "0.5405083",
"text": "def border(width = 20, color = '#cbfe00')\n convert \"#{result.path} -bordercolor #{color} -border #{width}x#{width} #{result.path}\"\n end",
"title": ""
},
{
"docid": "6353be47bc006149a6921eebf5ed7223",
"score": "0.53930795",
"text": "def border!(size, color = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5efceb08e85082d1e0be50d26b30c25b",
"score": "0.53262514",
"text": "def test_mixed_borders\n filename = 'mixed_borders_2'\n @workbook.add_worksheet do |sheet|\n sheet.add_row\n sheet.add_row ['', '1', '2', '3']\n sheet.add_row ['', '4', '5', '6']\n sheet.add_row ['', '7', '8', '9']\n sheet.add_border 'B2:D4', style: :medium\n sheet.add_style 'D2:D4', border: { style: :thin, color: '000000' }\n end\n @workbook.apply_styles\n assert_equal 8, @workbook.styled_cells.count\n assert_equal 6, @workbook.styles.style_index.count\n serialize(filename)\n end",
"title": ""
},
{
"docid": "3720d5179664269dab175230248a535b",
"score": "0.5315629",
"text": "def test_set_border\n end",
"title": ""
},
{
"docid": "ae2303e23629b6aae74447c9421a6a16",
"score": "0.529976",
"text": "def border_widths\n widths = []\n @borders.each {|entry| widths.push(entry.nil? ? 0 : entry)}\n widths\n end",
"title": ""
},
{
"docid": "adc88700982efc6dc6e24ba6e4813478",
"score": "0.5289389",
"text": "def pborder_and(border1,border2)\n if (border1 == 0) || (border2 == 0)\n 0\n elsif border1 == 1\n border2\n elsif border2 == 1\n border1\n else\n # Both are strings\n rv = '' \n [\"L\",\"T\",\"R\",\"B\"].each do |c|\n if (border1.include? c) and (border2.include? c)\n rv += c\n end\n end\n rv\n end\n end",
"title": ""
},
{
"docid": "9ddb7c448dc1696e5fb9a6b85ec89d18",
"score": "0.5278877",
"text": "def prepare_borders #:nodoc:\n borders = {}\n\n @xf_formats.each { |format| format.set_border_info(borders) }\n\n @border_count = borders.size\n\n # For the DXF formats we only need to check if the properties have changed.\n @dxf_formats.each do |format|\n key = format.get_border_key\n format.has_dxf_border(true) if key =~ /[^0:]/\n end\n end",
"title": ""
},
{
"docid": "f072dfefe63ff746a9581cfb90fcd9e1",
"score": "0.52775",
"text": "def prepare_borders #:nodoc:\n borders = {}\n index = 0\n\n @xf_formats.each do |format|\n key = format.get_border_key\n\n if borders[key]\n # Border has already been used.\n format.border_index = borders[key]\n format.has_border = 0\n else\n # This is a new border.\n borders[key] = index\n format.border_index = index\n format.has_border = 1\n index += 1\n end\n end\n\n @border_count = index\n\n # For the DXF formats we only need to check if the properties have changed.\n @dxf_formats.each do |format|\n key = format.get_border_key\n format.has_dxf_border = 1 if key =~ /[^0:]/\n end\n end",
"title": ""
},
{
"docid": "aa0f0bc2cfd3e1cf82162caa203bf92c",
"score": "0.52682596",
"text": "def expand_shorthand(s)\n puts 'inside expand'\n a = s.scan(/\\d+(?:\\.\\d+)?\\s*(?:em|px)?/)\n\n case a.length\n when 1 then [a[0]] * 4\n when 2 then [a[0],a[-1],a[0],a[-1]]\n when 4 then a\n else\n (a + [0,0,0,0]).take 4\n end\n \n end",
"title": ""
},
{
"docid": "43f2e21099dc7049018d4ac03334d4b6",
"score": "0.525712",
"text": "def border(border_opts = (not_set = true), &block)\n return @border if not_set && !block_given?\n\n border_opts = {} if not_set\n @border = BorderDSL.new(border_opts, &block).options\n end",
"title": ""
},
{
"docid": "5ed38e46f1e6d38bee3d67b0dd9c0b99",
"score": "0.52293164",
"text": "def test_mixed_borders_1\n filename = 'mixed_borders_1'\n @workbook.add_worksheet do |sheet|\n sheet.add_row\n sheet.add_row ['', '1', '2', '3']\n sheet.add_row ['', '4', '5', '6']\n sheet.add_row ['', '7', '8', '9']\n sheet.add_style 'B2:D4', border: { style: :thin, color: '000000' }\n sheet.add_border 'C3:D4', style: :medium\n end\n @workbook.apply_styles\n assert_equal 9, @workbook.styled_cells.count\n assert_equal 2, @workbook.styles.style_index.count\n serialize(filename)\n end",
"title": ""
},
{
"docid": "3aaf0ebae7e94014101032e33991c2a7",
"score": "0.52275336",
"text": "def recolor_border border, r, g, b\n border[4] = r\n border[5] = g\n border[6] = b\n border\n end",
"title": ""
},
{
"docid": "258f2754385f926a0fd5b3e8cf50155c",
"score": "0.52239656",
"text": "def borders(tile)\n [\n tile.first,\n tile.transpose.last,\n tile.last,\n tile.transpose.first\n ]\nend",
"title": ""
},
{
"docid": "0037d1350fd4ca1d8a55b9e3d47154cc",
"score": "0.52118343",
"text": "def border_widths\n widths = []\n @borders.each {|entry| widths.push(entry.nil? ? 0 : entry)}\n widths\n end",
"title": ""
},
{
"docid": "5a74886f883af918a006d3a014b40144",
"score": "0.520338",
"text": "def pborder(border)\n if border.class == String\n Margins.new(*(['L','T','R','B'].map { |c| border.include?(c) ? 1 : 0 }))\n elsif border == 0\n return Margins.new(0,0,0,0)\n elsif border == 1\n return Margins.new(1,1,1,1)\n else\n raise StandardError, \"border parameter #{border} illegal\"\n end\n end",
"title": ""
},
{
"docid": "e2935bd5e781926b78dc6c658dbaa72e",
"score": "0.51897144",
"text": "def border!\n border do\n # adds default border\n end\n end",
"title": ""
},
{
"docid": "e2935bd5e781926b78dc6c658dbaa72e",
"score": "0.51897144",
"text": "def border!\n border do\n # adds default border\n end\n end",
"title": ""
},
{
"docid": "0f1638189e45847320d6240df50c7f29",
"score": "0.51745874",
"text": "def horizontal(type)\n raise ArgumentError, \"Border type is #{type.inspect}, must be one of #{ALLOWED_SEPARATOR_BORDER_STYLES.inspect}\" unless ALLOWED_SEPARATOR_BORDER_STYLES.include?(type)\n lookup = case type\n when :top\n [:nw, :nx, :n, :ne, :n, nil]\n when :bot\n [:sw, :sx, :s, :se, nil, :s]\n when :double\n # typically used for the separator below the heading row or above a footer row)\n [:aw, :ax, :ai, :ae, :ad, :au]\n when :thick, :thick_dash, :thick_dot3, :thick_dot4,\n :heavy, :heavy_dash, :heavy_dot3, :heavy_dot4,\n :bold, :bold_dash, :bold_dot3, :bold_dot4\n # alternate thick/bold border\n xref = type.to_s.sub(/^(thick|heavy|bold)/,'bx').to_sym\n [:bw, xref, :bi, :be, :bd, :bu]\n when :dash, :dot3, :dot4\n # alternate thin dividers\n xref = \"x_#{type}\".to_sym\n [:w, xref, :i, :e, :dn, :up]\n else # :div (center, non-emphasized)\n [:w, :x, :i, :e, :dn, :up]\n end\n rval = lookup.map { |key| @data.fetch(key) }\n rval[0] = '' unless @left\n rval[3] = '' unless @right\n rval\n end",
"title": ""
},
{
"docid": "292a5076935ddf4309fb8fe941b419a6",
"score": "0.515168",
"text": "def split_definition(raw_def)\n # TODO: your implementation here\n n_array = raw_def.split(/\\s;\\s*\\n+/)\n f_array = n_array[0].split(/(?<=>)\\s*/,2)\n l_array = f_array + n_array[1..-1]\n l_array.map!{|x| x.gsub(/\\s\\s+|\\t|;|\\n/, ' ').strip}\nend",
"title": ""
},
{
"docid": "d7fda9cfd33a1e3908b16197b2add2ba",
"score": "0.51484984",
"text": "def border borders\n borders = [borders] unless borders.is_a?(Array)\n borders.sort!\n unless i = @borders[borders]\n i = @borders.length\n @borders[borders] = i\n end\n i\n end",
"title": ""
},
{
"docid": "30082a5fbea6e7a235cf6e1100fc2ab7",
"score": "0.51464635",
"text": "def fix_borders\n self.width.times do |i|\n self[i, 0] = AsciiLocation.new(i, 0, '#')\n self[i, self.height - 1] = AsciiLocation.new(i, self.height - 1, '#')\n end\n \n self.height.times do |j|\n self[0, j] = AsciiLocation.new(0, j, '#')\n self[self.width - 1, j] = AsciiLocation.new(self.width - 1, j, '#')\n end\n end",
"title": ""
},
{
"docid": "3937fed3b9929670cc45061f461f2360",
"score": "0.51430345",
"text": "def border_width=(width)\n size = width.nil? ? 0 : width\n if size > 0\n @borders[TOP] = @borders[RIGHT] = @borders[BOTTOM] = @borders[LEFT] = size.to_i\n else\n @borders = [nil, nil, nil, nil]\n end\n end",
"title": ""
},
{
"docid": "3775807694cd1e4003e9637c856ad951",
"score": "0.51418626",
"text": "def bordered_width\n return width unless border && enabled?\n\n if left? && right?\n width - 2\n\n elsif left? || right?\n width - 1\n\n else\n width\n\n end\n end",
"title": ""
},
{
"docid": "3e76fa5dae34886f250ed3fee6ba531f",
"score": "0.51225424",
"text": "def clean_tag_borders(string)\n result = string.gsub(/\\s?\\*{2,}.*?\\*{2,}\\s?/) do |match|\n preserve_border_whitespaces(match, default_border: ReverseMarkdown.config.tag_border) do\n match.strip.sub('** ', '**').sub(' **', '**')\n end\n end\n\n result = result.gsub(/\\s?\\_{2,}.*?\\_{2,}\\s?/) do |match|\n preserve_border_whitespaces(match, default_border: ReverseMarkdown.config.tag_border) do\n match.strip.sub('__ ', '__').sub(' __', '__')\n end\n end\n\n result = result.gsub(/\\s?~{2,}.*?~{2,}\\s?/) do |match|\n preserve_border_whitespaces(match, default_border: ReverseMarkdown.config.tag_border) do\n match.strip.sub('~~ ', '~~').sub(' ~~', '~~')\n end\n end\n\n result.gsub(/\\s?\\[.*?\\]\\s?/) do |match|\n preserve_border_whitespaces(match) do\n match.strip.sub('[ ', '[').sub(' ]', ']')\n end\n end\n end",
"title": ""
},
{
"docid": "a9e0e2cf70eb5f79f70e90ee91498552",
"score": "0.5121017",
"text": "def border_options\n @dsl.options\n end",
"title": ""
},
{
"docid": "6eb068cee7f93bb2b16ac63be4777479",
"score": "0.5099646",
"text": "def border(object)\n if object.is_a? Hash\n [\"border : #{object[:width]} solid #{object[:color]}\"]\n else\n [\"border : #{object}\"]\n end\n end",
"title": ""
},
{
"docid": "3772722479d132ce86bdc530e9c40aa8",
"score": "0.50957996",
"text": "def border_width=(width)\n size = width.nil? ? 0 : width\n if size > 0\n @borders[TOP] = @borders[RIGHT] = @borders[BOTTOM] = @borders[LEFT] = size.to_i\n else\n @borders = [nil, nil, nil, nil]\n end\n end",
"title": ""
},
{
"docid": "1bffa39b4117fed8d27f0065d5c462e0",
"score": "0.5035819",
"text": "def border(text, opts={})\n # returns Shoes::Border\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "85d32e85fbed41fd9d037b3e65c81e52",
"score": "0.5030531",
"text": "def border?\n @type == :border\n end",
"title": ""
},
{
"docid": "d7264a94e38349bd3f789ed30456d510",
"score": "0.5028041",
"text": "def border\n return '' unless block_given?\n\n \"#{border_on}#{yield}#{border_off}\"\n end",
"title": ""
},
{
"docid": "0a2d18724541c373dc05a116e2550ead",
"score": "0.5026486",
"text": "def set_border(style)\n set_bottom(style)\n set_top(style)\n set_left(style)\n set_right(style)\n end",
"title": ""
},
{
"docid": "70d1703fa044358d10caac64e727dfe0",
"score": "0.50007457",
"text": "def addBorder(picture)\n picture.map! { |el| el = '*' + el + '*' }.unshift( '*' * ( picture[0].length) ).push( '*' * ( picture[0].length) )\nend",
"title": ""
},
{
"docid": "13d47c36712b40ada176289624ec9431",
"score": "0.49998677",
"text": "def test_set_border_color\n end",
"title": ""
},
{
"docid": "05358bd29d253b9e8e7ef079b7ba4d59",
"score": "0.49725193",
"text": "def find_border\n {\n top: pixels.first.join,\n left: pixels.map(&:first).join,\n bottom: pixels.last.join,\n right: pixels.map(&:last).join\n }\n end",
"title": ""
},
{
"docid": "10090f983f21ecb92b3c21eacbf59c07",
"score": "0.4946528",
"text": "def border size, color = nil\n color ||= @fg || @bg\n @borders << Border.new( size.is_a?(Hash) ? size : {:size => size, :color => color} )\n end",
"title": ""
},
{
"docid": "6dca32bf3c6430e44aaa86247530ff5c",
"score": "0.49454993",
"text": "def border!\n @win.box(@vborder, @hborder)\n end",
"title": ""
},
{
"docid": "7b075741a4f37cc978914cd7cb5c54a3",
"score": "0.49447402",
"text": "def get_border_key\n [\n @bottom,\n @bottom_color,\n @diag_border,\n @diag_color,\n @diag_type,\n @left,\n @left_color,\n @right,\n @right_color,\n @top,\n @top_color\n ].join(':')\n end",
"title": ""
},
{
"docid": "7b075741a4f37cc978914cd7cb5c54a3",
"score": "0.49447402",
"text": "def get_border_key\n [\n @bottom,\n @bottom_color,\n @diag_border,\n @diag_color,\n @diag_type,\n @left,\n @left_color,\n @right,\n @right_color,\n @top,\n @top_color\n ].join(':')\n end",
"title": ""
},
{
"docid": "f9c27fc8b9c931bf5a3798ed11b23314",
"score": "0.49270564",
"text": "def create_background_shorthand! # :nodoc:\n # When we have a background-size property we must separate it and distinguish it from\n # background-position by preceeding it with a backslash. In this case we also need to\n # have a background-position property, so we set it if it's missing.\n # http://www.w3schools.com/cssref/css3_pr_background.asp\n if @declarations.has_key?('background-size') and not @declarations['background-size'][:is_important]\n unless @declarations.has_key?('background-position')\n @declarations['background-position'] = {:value => 'initial'}\n end\n\n @declarations['background-size'][:value] = \"/ #{@declarations['background-size'][:value]}\"\n end\n\n create_shorthand_properties! BACKGROUND_PROPERTIES, 'background'\n end",
"title": ""
},
{
"docid": "a75398d5a89ea5167e3cd63b3d8771aa",
"score": "0.49070087",
"text": "def create_background_shorthand! # :nodoc:\n # When we have a background-size property we must separate it and distinguish it from\n # background-position by preceding it with a backslash. In this case we also need to\n # have a background-position property, so we set it if it's missing.\n # http://www.w3schools.com/cssref/css3_pr_background.asp\n if (declaration = declarations['background-size']) && !declaration.important\n declarations['background-position'] ||= '0% 0%'\n declaration.value = \"/ #{declaration.value}\"\n end\n\n create_shorthand_properties! BACKGROUND_PROPERTIES, 'background'\n end",
"title": ""
},
{
"docid": "7bdb1b569d3674651316b7f79eb22a90",
"score": "0.48871583",
"text": "def border(width)\n print '+'\n width.times { print '-' }\n puts \"+\"\nend",
"title": ""
},
{
"docid": "b096c4e36b368e9e81f13583f972b6a2",
"score": "0.4884088",
"text": "def border_width()\n @border ||= img_size() / 10\n end",
"title": ""
},
{
"docid": "29405266e75936a7e9604a0107e71362",
"score": "0.4869345",
"text": "def border_calculations\n border_height = (space_invaders.max_by(&:height).height / 2.0).round\n border_width = (space_invaders.max_by(&:width).width / 2.0).round\n\n return border_height, border_width\n end",
"title": ""
},
{
"docid": "918d0f100a19f0c85db3432a305bfa3b",
"score": "0.48496622",
"text": "def border\n @border ||= Vedeu.borders.by_name(name)\n end",
"title": ""
},
{
"docid": "69d90417e5007698ffae424de2a737e9",
"score": "0.48383486",
"text": "def bordercolor\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 45 )\n return_value = BordercolorReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __WS289__ = nil\n __BORDERCOLOR290__ = nil\n attr_svalue291 = nil\n\n tree_for_WS289 = nil\n tree_for_BORDERCOLOR290 = nil\n stream_WS = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token WS\" )\n stream_BORDERCOLOR = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token BORDERCOLOR\" )\n stream_attr_svalue = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule attr_svalue\" )\n begin\n # at line 303:14: WS BORDERCOLOR attr_svalue\n __WS289__ = match( WS, TOKENS_FOLLOWING_WS_IN_bordercolor_1903 )\n stream_WS.add( __WS289__ )\n __BORDERCOLOR290__ = match( BORDERCOLOR, TOKENS_FOLLOWING_BORDERCOLOR_IN_bordercolor_1905 )\n stream_BORDERCOLOR.add( __BORDERCOLOR290__ )\n @state.following.push( TOKENS_FOLLOWING_attr_svalue_IN_bordercolor_1907 )\n attr_svalue291 = attr_svalue\n @state.following.pop\n stream_attr_svalue.add( attr_svalue291.tree )\n # AST Rewrite\n # elements: attr_svalue, BORDERCOLOR\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 303:41: -> ^( BORDERCOLOR attr_svalue )\n # at line 303:44: ^( BORDERCOLOR attr_svalue )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_BORDERCOLOR.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_attr_svalue.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 45 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "bdf7c8afcf34fde6a28cf4e13013a161",
"score": "0.48306736",
"text": "def grab_borders(grid)\n length = grid.length\n edge1 = []\n edge2 = []\n length.times do |i|\n edge1.push(grid[i][length - 1])\n edge2.push(grid[i][0])\n end\n # borders are N, E, S, W\n [grid[0], edge1, grid[length - 1], edge2]\n end",
"title": ""
},
{
"docid": "84a910b0686272a551c050999ac62480",
"score": "0.48173314",
"text": "def split_definition(raw_def)\r\n split_arr = raw_def.map{|x| x.sub(/>/, '>;')} # substitute > for >; for easy split\r\n split_arr = split_arr.map{|x| x.strip} # strip excess whitespace\r\n split_arr = split_arr.map{|x| x.split(/;/)} # split based on semicolon\r\n split_arr = split_arr.map{|x| x.map{|x| x.strip}}\r\nend",
"title": ""
},
{
"docid": "1c30a5b5d3ad58ab0f63f1c39352c522",
"score": "0.4816936",
"text": "def bottom_border\n \"==========\"\n end",
"title": ""
},
{
"docid": "671e860eb53ed6d6e386b079f1812dea",
"score": "0.48162806",
"text": "def border_internal(fborder,l,t,r,b)\n # puts \"In border_internal with (#{l},#{t},#{r},#{b}) and border #{fborder}\"\n border = pborder(fborder)\n if border.any?\n old_cap_style = @pdoc.cap_style\n @pdoc.cap_style :projecting_square\n mt = @pdoc.method(:move_to)\n lt = @pdoc.method(:line_to)\n @pdoc.stroke do\n @pdoc.move_to l, b\n (border.left != 0 ? lt : mt).call(l,t)\n (border.top != 0 ? lt : mt).call(r,t)\n (border.right != 0 ? lt : mt).call(r,b)\n (border.bottom != 0 ? lt : mt).call(l,b)\n end\n @pdoc.cap_style old_cap_style\n end\n end",
"title": ""
},
{
"docid": "1f948f6c35ce89a63967e3f96d3caad6",
"score": "0.4815382",
"text": "def test_multiple_custom_multichar_delimiters\n assert_equal(20, @@calc.add(\"//[caca][pedo]\\n8caca3pedo8\\n1\"))\n assert_equal(17, @@calc.add(\"//[caca][pedo]\\n8caca1003caca8\\n1\"))\n assert_equal(19, @@calc.add(\"//[caca][pedo][%%][;]\\n8\\n1003%%1;pedo8\\n2\"))\n end",
"title": ""
},
{
"docid": "6691c48b33904a4ddeec3310183dd19a",
"score": "0.48103535",
"text": "def setBorders(x,y,flags)\n @borders[y][x] = flags\n end",
"title": ""
},
{
"docid": "a638224f246e6179d309906357d4c8c8",
"score": "0.48065743",
"text": "def lines_for_part\n <<-CMD\n-background transparent\n-stroke #{DARKERS[:part]}\n-fill white\n-strokewidth #{BORDERS[:part]}\n-draw \"rectangle #{left},#{top} #{right},#{box_bottom}\"\n CMD\nend",
"title": ""
},
{
"docid": "f0f41114eab786cf04963d2e2e056877",
"score": "0.47982174",
"text": "def trim(border = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "d69ee740ca31a52f3fb94231c20bb642",
"score": "0.47886032",
"text": "def set_border(style)\n set_bottom(style)\n set_top(style)\n set_left(style)\n set_right(style)\n end",
"title": ""
},
{
"docid": "d69ee740ca31a52f3fb94231c20bb642",
"score": "0.47886032",
"text": "def set_border(style)\n set_bottom(style)\n set_top(style)\n set_left(style)\n set_right(style)\n end",
"title": ""
},
{
"docid": "f8ac429b4f555dff44cd39bdae62dfc8",
"score": "0.476467",
"text": "def padding size, color = @bg\n border size, color\n end",
"title": ""
},
{
"docid": "03537a15d5f61b1e9276a50e7f9fd010",
"score": "0.47633195",
"text": "def border=(style)\n [:bottom=, :top=, :right=, :left=].each do |writer| send writer, style end\n end",
"title": ""
},
{
"docid": "cdc625e91ddedc157effb2438b4f27cc",
"score": "0.47625223",
"text": "def initialize(definition)\n if definition.instance_of? String\n @top, @right, @bottom, @left = expand_shorthand(\n definition.split(/\\s+/).map!(&:to_f))\n elsif definition.is_a? Numeric\n @top, @right, @bottom, @left = expand_shorthand [definition]\n elsif definition.instance_of? Array\n @top, @right, @bottom, @left = expand_shorthand definition\n else\n raise ArgumentError, 'Invalid value, must be either string or array'\n end\n end",
"title": ""
},
{
"docid": "f1404a20292aa404bc51618ac7522661",
"score": "0.47582632",
"text": "def split_css\n\t\tlines = @formatted_css\n\t\tpos = 0\n\t\twhile pos < lines.length do\n\t\t\tcss_selectors = {}\n\t\t\tcss = lines[pos].split( /;|{/ ).map(&:strip)\n\n\t\t\trule_type = get_rule_type(css[0])\n\n\t\t\t#hashing for different rule types\n\t\t\tif rule_type == \"nested\"\n\t\t\t\tmedia_array = []\n\t\t\t\tmedia_length = query_length(lines[pos..-1])\n\t\t\t\trule = css[0].split(\" \", 2)\n\t\t\t\tcss_selectors = {'nested' => rule[0].strip, 'command' => rule[1].strip}\n\t\t\t\tfor i in 0..media_length\n\t\t\t\t\tcss = lines[pos+i].split( /;|{/)\n\t\t\t\t\tif i == 0 \n\t\t\t\t\t\tcss.shift\n\t\t\t\t\tend\n\t\t\t\t\tmedia_array << hash_css(css)\n\t\t\t\tend\n\t\t\t\tcss_selectors['contents'] = media_array\n\t\t\t\tpos+=media_length\n\t\t\t\n\t\t\t#single at rules\t\n\t\t\telsif rule_type == \"single\"\n\t\t\t\trule = css.shift.split(\" \", 2).map(&:strip)\n\t\t\t\tcss_selectors = {'at-rule' => rule[0], 'command' => rule[1]}\n\n\t\t\t#standard css rule\n\t\t\telsif rule_type == \"selector\"\n\t\t\t\tcss_selectors = hash_css(css)\n\t\t\tend\n\t\t\t@css_hashes << css_selectors\n\t\t\tpos+=1\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "f27ecb194258df0f10cc4734ecf745da",
"score": "0.4756586",
"text": "def wrap(*args)\n px, sx = args if args.length == 2\n px, sx = args.first.split(//) if args.length == 1 && args.first.length == 2\n\n raise ArgumentError unless px && sx\n\n self.prefix(px).suffix(sx)\n end",
"title": ""
},
{
"docid": "7f0d488a04a0db102e7a223161ac5f87",
"score": "0.47516286",
"text": "def all_borders\n borders = []\n @squares.values.each do |value|\n value['borders'].each do |border|\n borders.push(border)\n borders.push(border.reverse)\n end\n end\n borders\n end",
"title": ""
},
{
"docid": "55773d4720b1fc2eaa90f3ead1a2c427",
"score": "0.47492388",
"text": "def resize_dimensions(original_dimensions, style)\n dimensions = super\n dimensions.map!{|i| i &= -2}\n end",
"title": ""
},
{
"docid": "33362fea0e42071da03737a7f3cde259",
"score": "0.47458223",
"text": "def format_border(cell_size)\n \"+\" + (['-' * cell_size] * @board.size).join('+') + \"+\"\n end",
"title": ""
},
{
"docid": "ab7cc5423206696e44f89c374ae9ae8b",
"score": "0.47407633",
"text": "def expand_background_shorthand! # :nodoc:\n return unless @declarations.has_key?('background')\n\n value = @declarations['background'][:value]\n\n if value =~ CssParser::RE_INHERIT\n BACKGROUND_PROPERTIES.each do |prop|\n split_declaration('background', prop, 'inherit')\n end\n end\n\n split_declaration('background', 'background-image', value.slice!(Regexp.union(CssParser::URI_RX, CssParser::RE_GRADIENT, /none/i)))\n split_declaration('background', 'background-attachment', value.slice!(CssParser::RE_SCROLL_FIXED))\n split_declaration('background', 'background-repeat', value.slice!(CssParser::RE_REPEAT))\n split_declaration('background', 'background-color', value.slice!(CssParser::RE_COLOUR))\n split_declaration('background', 'background-size', extract_background_size_from(value))\n split_declaration('background', 'background-position', value.slice(CssParser::RE_BACKGROUND_POSITION))\n\n @declarations.delete('background')\n end",
"title": ""
},
{
"docid": "43e6beda4d7c807bbc1879d2b60adccd",
"score": "0.4736647",
"text": "def border_cells\r\n\t\tborder_cells = [-1, 0, 1].repeated_permutation(2).to_a\r\n\t\tborder_cells.delete([0, 0])\r\n\t\tborder_cells.map do |bx, by|\r\n\t\t\t@field.get_cell(x + bx, y + by)\r\n\t\tend.compact\r\n\tend",
"title": ""
},
{
"docid": "6d95b77730e4347ce1fdf55c61e38222",
"score": "0.4725059",
"text": "def border_radius_decl(size = '4px')\n \"border-radius: #{size}; -moz-border-radius: #{size}; -webkit-border-radius: #{size};\"\n end",
"title": ""
},
{
"docid": "8bdb6ee4a2657f7096cc976c0ed4d4ab",
"score": "0.4723454",
"text": "def color_border(char)\n @border_bg.(@border_fg.(char))\n end",
"title": ""
},
{
"docid": "7d954bd4a48902fcf4713f69df4a53fc",
"score": "0.4722016",
"text": "def split_definition(raw_def)\n newArray = []\n\n raw_def.each do |a|\n new = a.split(/[\\n]/)\n new = new.reject(&:empty?)\n newArray.append(new)\n end\n\n newArray.each do |b|\n b.each do |c|\n c.gsub!(/\\t/, \"\")\n c.gsub!(/;/, \"\")\n c.gsub!(/\\s+$/, \"\")\n c.gsub!(/\\s+/, ' ')\n end\n end\n newArray\nend",
"title": ""
},
{
"docid": "fb2d6b737189f4c71eac6253016967cf",
"score": "0.4720678",
"text": "def border_color\n [@bottom_color,@top_color,@right_color,@left_color]\n end",
"title": ""
},
{
"docid": "54f46182fc3e7d2d97ff1e2b56a95249",
"score": "0.47163683",
"text": "def border(image, color = 'black', width = 20)\n %x{ convert #{image} \\\n -bordercolor '#{color}' -border #{width}x#{width} \\\n #{image} }\n image\n end",
"title": ""
},
{
"docid": "0ad05085665bdfa6a495d98b37ced08f",
"score": "0.47106516",
"text": "def borders(workbook, center, heading, _colors)\n worksheet = workbook.add_worksheet('Borders')\n\n worksheet.set_column(0, 4, 10)\n worksheet.set_column(5, 5, 40)\n\n worksheet.write(0, 0, \"Index\", heading)\n worksheet.write(0, 1, \"Index\", heading)\n worksheet.write(0, 3, \"Style\", heading)\n worksheet.write(0, 5, \"The style is highlighted in red for \", heading)\n worksheet.write(1, 5, \"emphasis, the default color is black.\",\n heading)\n\n 14.times do |i|\n format = workbook.add_format\n format.set_border(i)\n format.set_border_color('red')\n format.set_align('center')\n\n worksheet.write((2 * (i + 1)), 0, i, center)\n worksheet.write((2 * (i + 1)),\n 1, sprintf(\"0x%02X\", i), center)\n\n worksheet.write((2 * (i + 1)), 3, \"Border\", format)\n end\n\n worksheet.write(30, 0, \"Diag type\", heading)\n worksheet.write(30, 1, \"Index\", heading)\n worksheet.write(30, 3, \"Style\", heading)\n worksheet.write(30, 5, \"Diagonal Boder styles\", heading)\n\n (1..3).each do |i|\n format = workbook.add_format\n format.set_diag_type(i)\n format.set_diag_border(1)\n format.set_diag_color('red')\n format.set_align('center')\n\n worksheet.write((2 * (i + 15)), 0, i, center)\n worksheet.write((2 * (i + 15)),\n 1, sprintf(\"0x%02X\", i), center)\n\n worksheet.write((2 * (i + 15)), 3, \"Border\", format)\n end\nend",
"title": ""
},
{
"docid": "a9a17272366f6dc2800fea38ffe4d963",
"score": "0.47039822",
"text": "def border\n @border ||= Vedeu.borders.by_name(name)\n end",
"title": ""
},
{
"docid": "a9a17272366f6dc2800fea38ffe4d963",
"score": "0.47039822",
"text": "def border\n @border ||= Vedeu.borders.by_name(name)\n end",
"title": ""
},
{
"docid": "a9a17272366f6dc2800fea38ffe4d963",
"score": "0.47039822",
"text": "def border\n @border ||= Vedeu.borders.by_name(name)\n end",
"title": ""
},
{
"docid": "a9a17272366f6dc2800fea38ffe4d963",
"score": "0.47039822",
"text": "def border\n @border ||= Vedeu.borders.by_name(name)\n end",
"title": ""
},
{
"docid": "a9a17272366f6dc2800fea38ffe4d963",
"score": "0.47039822",
"text": "def border\n @border ||= Vedeu.borders.by_name(name)\n end",
"title": ""
}
] |
dc8b3746d2e6cebbac40880664018c39
|
require_role "admin", :except => [:index]
|
[
{
"docid": "cef45b6cee1eae0d65d713ee34b146fc",
"score": "0.0",
"text": "def index\n today = Date.today\n b = today << 1\n today_topics = ActiveRecord::Base.connection.select_all(<<sql).collect{|c| c[\"count(*)\"].to_i}\nselect date(created_at),count(*) from topics\nwhere created_at < '#{today}' and created_at > '#{b}'\ngroup by date(created_at)\nsql\n today_users = ActiveRecord::Base.connection.select_all(<<sql).collect{|c| c[\"count(*)\"].to_i}\nselect date(created_at),count(*) from users\nwhere created_at < '#{today}' and created_at > '#{b}'\ngroup by date(created_at)\nsql\n date=ActiveRecord::Base.connection.select_all( <<sql ).collect{|c| c[\"date(created_at)\"].to_date.day.to_s}\nselect date(created_at),count(*) from topics\nwhere created_at < '#{today}' and created_at > '#{b}'\ngroup by date(created_at)\nsql\n\n @chart = LazyHighCharts.new(\"topics and users statistics\" ) do |f|\n f.xAxis categories: date\n f.series name: 'topics', data: today_topics\n f.series name: 'new users', data: today_topics\n end\n end",
"title": ""
}
] |
[
{
"docid": "b5034bd2a76ebad2c699dbed91db3515",
"score": "0.7805163",
"text": "def set_admin_only\n redirect_to(\"/\") unless current_user.roles.include?(\"admin\")\n end",
"title": ""
},
{
"docid": "4dc7ce5c4ebbadae3705ecfe33cff068",
"score": "0.77533406",
"text": "def require_admin!\n raise User::NotAuthorised unless current_user.admin?\n end",
"title": ""
},
{
"docid": "d589784ff97efd71f864cbda9981189e",
"score": "0.7734268",
"text": "def require_admin\n require_login unless current_user\n restrict_access unless current_user.is_admin\n end",
"title": ""
},
{
"docid": "2c053ffdffb50041db0d0468a5bac6f2",
"score": "0.7644172",
"text": "def require_admin\n authorize :application, :admin?\n end",
"title": ""
},
{
"docid": "ad42e79f051ecc024498e6b78f89b2c2",
"score": "0.7580271",
"text": "def admin_only\n self.has_role?(:admin)\n end",
"title": ""
},
{
"docid": "dc4af6d8f62044032094a1c0bbd6398e",
"score": "0.75762653",
"text": "def require_admin\n unless current_user && current_user.role == 'admin'\n flash[:error] = \"Usted no es un administrador\"\n redirect_to(current_user ? home_path_for(current_user) : root_path)\n end\n end",
"title": ""
},
{
"docid": "8017124dbe63f83f15afe6ac46c4650e",
"score": "0.75702953",
"text": "def role_require\n admin_or_moderator = current_user.has_role?(:system, :administrator) || current_user.has_role?(:moderator, controller_name)\n access_denied unless current_user.has_role?(controller_name, action_name) || admin_or_moderator\n end",
"title": ""
},
{
"docid": "30a51f5208f32d362fdc0d9fa3212231",
"score": "0.7556798",
"text": "def only_admin\n @role = current_user_role\n unless @role == \"admin\"\n # redirect_to(root_url) \n respond_to do |format|\n format.html { redirect_to root_url, notice: 'You are not authorised to do that' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "fe516d4b9f5b6311907b6d2a09a9e79c",
"score": "0.7528594",
"text": "def require_admin\n if !is_admin?\n not_authorized\n end\n end",
"title": ""
},
{
"docid": "6303de9b7a7da5b57a6c7ab1fba6d7e3",
"score": "0.74975365",
"text": "def user_admin\n require_admin\n end",
"title": ""
},
{
"docid": "48f8f0e46a94e142a1e9edca470347b1",
"score": "0.7496966",
"text": "def require_admin\n not_found unless current_user.admin?\n end",
"title": ""
},
{
"docid": "c1627e6c278eca5decfa93dd88cc8442",
"score": "0.7491289",
"text": "def admin_only\n redirect_to(root_url) unless role?(current_user, \"admin\")\n end",
"title": ""
},
{
"docid": "cd17fc9161ac628adf233a65007c1543",
"score": "0.74445975",
"text": "def admin_only(&block)\n role_only(\"admin\", &block)\n end",
"title": ""
},
{
"docid": "071311584a21e87881b7c3ef5ac630d4",
"score": "0.7420668",
"text": "def admin_required\n unless current_user.has_role? :admin\n flash[:notice] = \"You don't have sufficient permissions to access this page\"\n redirect_to dashboard_url\n end\n end",
"title": ""
},
{
"docid": "789fde142204038230c237604e048edf",
"score": "0.739553",
"text": "def require_admin\n unless current_user.admin?\n redirect_to tasks_index_path, notice: \"You do not have the needed permission to access.\"\n end\n end",
"title": ""
},
{
"docid": "03ae0793ff49ed1a16eed31b4800192a",
"score": "0.7394324",
"text": "def admin? ; role == 0 ; end",
"title": ""
},
{
"docid": "e4542ea3df59610945fab12b909c643e",
"score": "0.7355271",
"text": "def require_admin\n unless admin?\n redirect_to_login 'The requested resource requires administrator privileges'\n end\n end",
"title": ""
},
{
"docid": "3d9e39c8ed022cfbc197caa8a0c87b0b",
"score": "0.72961724",
"text": "def require_admin\n if @current_user.administrator?\n return\n else\n flash[:neg_notice] = 'Sorry, permission denied.'\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "58cbcd4e1065e88511e548eafe5c0212",
"score": "0.72940797",
"text": "def check_admin\n redirect_to user_root_path unless current_user[:role] == 'admin'\n end",
"title": ""
},
{
"docid": "25f717243ae7597c525ff6f06a706c52",
"score": "0.7293491",
"text": "def check_user_role\n \tredirect_to root_path unless current_user.roles.first.name == \"admin\"\n end",
"title": ""
},
{
"docid": "c39168d4177d6333fd92b3aa3a1e2020",
"score": "0.72777265",
"text": "def admin\n role.eql?(\"admin\")\n end",
"title": ""
},
{
"docid": "9328d8441918a0f58cad6841a289b910",
"score": "0.7273312",
"text": "def verify_admin\n redirect_to root_url unless current_user.role_id == 1 \n end",
"title": ""
},
{
"docid": "d5338b508093de377761a2595c3776a8",
"score": "0.7249168",
"text": "def ensure_admin!\n unless current_user.user_role == 1\n flash[:notice] = \"Not sufficient permission!\"\n redirect_to root_path\n\n return false\n end\n end",
"title": ""
},
{
"docid": "acbfec63a2bffa7450f75dcfce5d508a",
"score": "0.7246805",
"text": "def require_admin\n redirect_to '/' unless current_user.admin? \n end",
"title": ""
},
{
"docid": "b60e4ec0a01b07f139b1b73b847df6e8",
"score": "0.72463346",
"text": "def require_admin \n redirect_to(root_url) unless current_user.admin?\n end",
"title": ""
},
{
"docid": "b386594ca7690a167823728a82570256",
"score": "0.7225596",
"text": "def admin_required\n return head(:forbidden) unless current_user.admin\n end",
"title": ""
},
{
"docid": "2f880037808202492d4c196801191ee6",
"score": "0.7218778",
"text": "def require_admin\n redirect_to '/' unless current_user && current_user.admin? \n end",
"title": ""
},
{
"docid": "238c9b7d6dfe3b9133e2ae7848f20c74",
"score": "0.7217294",
"text": "def require_admin\n unless is_admin?\n flash[:error] = t(:admin_required)\n redirect_to login_path\n end\n end",
"title": ""
},
{
"docid": "d4fe54af47fe4758cce7473caee34852",
"score": "0.71986854",
"text": "def require_moderator\n require_role('ROLE_MODERATOR')\n end",
"title": ""
},
{
"docid": "d57014aec1e36fa74f20c908bccdb57e",
"score": "0.7189402",
"text": "def require_admin\n\t\tredirect_to :root unless current_user.admin?\n\tend",
"title": ""
},
{
"docid": "d57014aec1e36fa74f20c908bccdb57e",
"score": "0.7189402",
"text": "def require_admin\n\t\tredirect_to :root unless current_user.admin?\n\tend",
"title": ""
},
{
"docid": "4de1f4dc7b9ccf24dc51ebd2edb2aba5",
"score": "0.7167632",
"text": "def require_admin\n unless current_user.is_admin\n redirect_to courses_url\n end\n end",
"title": ""
},
{
"docid": "736b0d25402114b88b50f06829bcad1f",
"score": "0.71649665",
"text": "def make_admin\n self.role = 2\n end",
"title": ""
},
{
"docid": "3445be650e460b47cc693ca8717944af",
"score": "0.71632856",
"text": "def admin\n if !current_user.role.user_role.eql? \"admin\"\n flash[:notice] = \"You Are Not Authorized To Do This\"\n redirect_to \"/notices\"\n end\n end",
"title": ""
},
{
"docid": "18dcf3e718edc4e6f8de2403a8a89197",
"score": "0.7156051",
"text": "def admin_required\r\n if !current_user.is_admin?\r\n raise AccessDenied\r\n end\r\n end",
"title": ""
},
{
"docid": "fb62b190adfacdfaae30e97f2c5a09a0",
"score": "0.71523523",
"text": "def require_admin\n unless admin?\n logger.warn(\"Disallowing as user is not an admin\")\n respond_unauthorized\n end\n end",
"title": ""
},
{
"docid": "7f4f7e8e0c45db6fb1e3bb164a1ce971",
"score": "0.7141877",
"text": "def require_admin\n unless admin?\n flash[:info] = \"You have insufficient rights to access this page!\"\n redirect_to \"/\"\n end\n end",
"title": ""
},
{
"docid": "3368cdb06a6e356b42ff4afeec71803e",
"score": "0.7140265",
"text": "def ensure_administrator_only\n # TODO\n end",
"title": ""
},
{
"docid": "b4a2281c70d240e62da2ec7cdacac37a",
"score": "0.7135839",
"text": "def admin_only\n unless current_user.role == 'admin'\n redirect_to wall_path, :flash => { :error => \"Access Denied - you do not have permission to access that resource.\" }\n end\n end",
"title": ""
},
{
"docid": "d53fd64da1f342f4c13b54c3e016305b",
"score": "0.71284145",
"text": "def require_admin\n unless current_user_admin\n redirect_to \"/access_denied.html\"\n return false\n end\n end",
"title": ""
},
{
"docid": "048d300eebfa3c0cea702508ab243500",
"score": "0.7126613",
"text": "def requires_administrator_role\n reject_request unless logged_in? && current_user.administrator?\n end",
"title": ""
},
{
"docid": "6ed1c29affa731e2a6c1c92afd2b0bde",
"score": "0.7126357",
"text": "def admin_access_required\n access_denied unless admin?\n end",
"title": ""
},
{
"docid": "6ed1c29affa731e2a6c1c92afd2b0bde",
"score": "0.7126357",
"text": "def admin_access_required\n access_denied unless admin?\n end",
"title": ""
},
{
"docid": "6ed1c29affa731e2a6c1c92afd2b0bde",
"score": "0.7126357",
"text": "def admin_access_required\n access_denied unless admin?\n end",
"title": ""
},
{
"docid": "e0a522cb1340b4783b5108873f79f27e",
"score": "0.71241564",
"text": "def verify_admin\n redirect_to root_url unless current_user.role_id == 1\n end",
"title": ""
},
{
"docid": "97d9de7a12f8b81a539bfd0c1bcba329",
"score": "0.71202636",
"text": "def check_role\n redirect_to(root_url) unless check_role?(\"Site Admin\")\n end",
"title": ""
},
{
"docid": "fdb9656c3fd471e5dcf6b6f9fc919b12",
"score": "0.71188766",
"text": "def require_admin\n unless is_admin?\n redirect_to root_path, alert: 'Доступ только для администрации'\n end\n end",
"title": ""
},
{
"docid": "8bb489e9c7087a8b0d14eed30bc26ef0",
"score": "0.7118856",
"text": "def require_admin\n return unless !admin?\n flash[:danger] = 'Only admin users can perform that action!'\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "881fbec6de3513627f024f89c7686d87",
"score": "0.7113362",
"text": "def require_admin\n @admin = @current_user.administrator? or redirect_to root_path\n end",
"title": ""
},
{
"docid": "a3ba8c0c14724be3a93965a20e4e2484",
"score": "0.7106326",
"text": "def require_admin!\n authenticate_user!\n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "a3ba8c0c14724be3a93965a20e4e2484",
"score": "0.7106326",
"text": "def require_admin!\n authenticate_user!\n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "994262823de1b2d0fe259936da46dd6a",
"score": "0.710108",
"text": "def require_admin\n redirect_to root_path unless is_admin?\n end",
"title": ""
},
{
"docid": "21634846d7566c1952b834c5b13ada17",
"score": "0.70987475",
"text": "def admin_required\n (logged_in? && current_user.role == Role.find_by_name('Admin')) || admin_denied\n end",
"title": ""
},
{
"docid": "54500220f02d39b65e7ca4d182b382c1",
"score": "0.7092088",
"text": "def ensure_admin\n redirect_to unauthorized_url unless current_user.is?(:admin)\n end",
"title": ""
},
{
"docid": "4e9d22085636abbcb58f1bbff0019637",
"score": "0.7089597",
"text": "def check_role\n redirect_to(root_url) unless check_role?(\"Site Admin\")\n end",
"title": ""
},
{
"docid": "e9ff0345995ebfc11676ec6b24d21c46",
"score": "0.708892",
"text": "def require_admin\n if !current_user.admin?\n flash[:alert] = \"Not authorised\"\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "7ed333ecf9c78fdbeac3af0eabeb2d8f",
"score": "0.7086111",
"text": "def check_role\n redirect_to(root_url) unless check_role?(\"Document Editor\") or check_role?(\"Site Admin\")\n end",
"title": ""
},
{
"docid": "57737120407a02470806fafde83da56f",
"score": "0.70799583",
"text": "def require_admin!\n authenticate_user!\n\n if current_user && !current_user.admin?\n redirect_to home_path\n end\n end",
"title": ""
},
{
"docid": "4c5423a20d2e415c3bf59978b4172e7d",
"score": "0.70786935",
"text": "def ensure_admin_role\n role = :admin\n\n if !!current_user && current_user.has_role?( role )\n return true\n else\n flash.alert = \"Unauthorized action attempted.\"\n redirect_to root_url and return\n end\n end",
"title": ""
},
{
"docid": "7c271bd9b68de6b48c87e70de7f7ec1b",
"score": "0.70744425",
"text": "def require_admin!\n authenticate_user!\n\n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "7c271bd9b68de6b48c87e70de7f7ec1b",
"score": "0.70744425",
"text": "def require_admin!\n authenticate_user!\n\n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "dabb1e5b4e162fef7e0e04d4a27f7aed",
"score": "0.7061796",
"text": "def require_admin!\n if !current_user_admin?\n redirect_back_or home_path, alert: \"Sorry, you don't have access to that.\"\n end\n end",
"title": ""
},
{
"docid": "576f758a470f5ebcc4e590ad782ad034",
"score": "0.7061207",
"text": "def block_access_for_non_admins\n# if current_user.role != \"admin\"\n# changed to super admins only\n if (current_user.role != \"admin\" )\n flash[:error] = \"You have no access rights for this section.\"\n redirect_to :controller => \"streams\", :action => \"index\"\n end\n end",
"title": ""
},
{
"docid": "5223a5c9e9d332cafa9de97c97ff9441",
"score": "0.70577985",
"text": "def require_admin\n render file: 'public/401.html', status: :unauthorized unless @current_user.admin?\n end",
"title": ""
},
{
"docid": "1abbeed906fdffd3b0270abda31eac05",
"score": "0.7056514",
"text": "def require_admin\n unless logged_in_admin?\n flash[:error] = \"You must be admin for this resource!\"\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "6c90316ee0c04ba64583dee3c3da1158",
"score": "0.7054841",
"text": "def require_admin\n admin? || access_denied(:message => \"You must have administrator privileges to access the requested page.\")\n end",
"title": ""
},
{
"docid": "d942eabce8fc8e11d474c957b100f87c",
"score": "0.7051728",
"text": "def should_require_role(*roles)\n \n klass = self.name.gsub(/Test$/, '').underscore.to_sym\n \n context \"when not logged in\" do\n setup { }\n context \"on GET of :index on #{klass}\" do\n setup { get :index }\n should redirect_to \"/admin/login\" \n end\n end\n\n context \"when logged in as a user with no roles\" do\n setup do\n @user = Factory(:user)\n login_as @user\n end\n context \"on GET of :index on #{klass}\" do\n setup { get :index }\n should redirect_to \"/admin/403\"\n end\n end\n\n Grundlebox::Config::AdminRoles.each do |role|\n context \"when logged in as an user with the #{role} role\" do\n setup do\n @user = Factory(:user, :role => role)\n login_as @user\n end\n context \"on GET of :index on #{klass}\" do\n setup { get :index }\n if roles.include?(role.downcase.to_sym)\n should respond_with :success \n should render_template :index \n should_not set_the_flash\n else\n should redirect_to \"/admin/403\"\n end\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "cc7b7d5bbb02bb8056f1d9bf539ac8f0",
"score": "0.70508325",
"text": "def admin_user\n if current_role != \"admin\"\n redirect_to recipes_path, alert: \"You don't have access!\"\n end\n end",
"title": ""
},
{
"docid": "f5e5f9547137124263a1775148fbcb5f",
"score": "0.70497864",
"text": "def authorize_admin\n redirect_to '/login_admin' unless current_admin\n end",
"title": ""
},
{
"docid": "89eff2ffd50bf215cce2e9b4a58c3561",
"score": "0.70461947",
"text": "def confirm_admin_role\n unless session[:role] == 2\n flash[:notice] = \"You are not permitted to access the requested page.\"\n redirect_to(:controller => 'public', :action => 'index')\n return false # halts the before filter\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "a602b68f707109c2233a2e74950e22a4",
"score": "0.70461833",
"text": "def admin\n can :manage, :all \n end",
"title": ""
},
{
"docid": "991e27aac7b81b2109f2ef2e28e0776e",
"score": "0.70428777",
"text": "def require_admin!\n authenticate_user!\n \n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "991e27aac7b81b2109f2ef2e28e0776e",
"score": "0.70428777",
"text": "def require_admin!\n authenticate_user!\n \n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "991e27aac7b81b2109f2ef2e28e0776e",
"score": "0.70428777",
"text": "def require_admin!\n authenticate_user!\n \n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "fd7a8e7a2b5383f641a51e18237941f6",
"score": "0.7039178",
"text": "def authenticate\n unless current_user.role == \"super_admin\" || \"admin\"\n redirect_to root_path, :notice => \"Access Denied\"\n end\n end",
"title": ""
},
{
"docid": "b256904de880fef5b35df8160b0e3e93",
"score": "0.7038957",
"text": "def authorize_admin\n redirect_to restricted_path unless current_user.admin\n end",
"title": ""
},
{
"docid": "17a8a260c7930f602f8381438abf82c7",
"score": "0.70333713",
"text": "def authenticate_admin\n unless current_user.role == \"admin\"\n redirect_to root_path, :notice => \"Authenticated admin needed here!\"\n end\n end",
"title": ""
},
{
"docid": "a0962db627cf34c62cb8e62aef4fac61",
"score": "0.70258635",
"text": "def authenticate_admin\n if !current_user.role_admin?\n redirect_to_back(root_path) \n else\n # nothing to do\n end\n end",
"title": ""
},
{
"docid": "92054f10c9f2ca510690129b6844233d",
"score": "0.70258075",
"text": "def authorize_admin\n return if current_user.role == 'admin'\n\n render json: { error: 'must be admin' }\n end",
"title": ""
},
{
"docid": "a8cbcdd35353dd64dbc230db61cda994",
"score": "0.702291",
"text": "def authenticate_admin\n unless current_user.role == \"admin\"\n flash[:alert] = \"權限不足!\"\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "ab832ea1ac35800bec099f95c835572d",
"score": "0.70221764",
"text": "def require_admin\n unless current_user && current_user.admin?\n flash[:alert] = \"You must have admin permissions to access that page.\"\n redirect_to current_user # TODO: Request permissions page?\n end\n end",
"title": ""
},
{
"docid": "411752e3ebbe3ccdfe8a8fd891da2683",
"score": "0.7022103",
"text": "def require_admin\n unless current_user != nil && current_user.is_admin?\n render :file => \"public/401.html\", :status => :unauthorized\n end\n end",
"title": ""
},
{
"docid": "628d2e02e00687933d126b6f9a88da73",
"score": "0.7022102",
"text": "def admin_required\n\t # redirect_to root_path if !current_user.role?(:admin)\n # redirect_to root_path unless current_user.is_seller_or_admin?\n redirect_to root_path unless current_user.is_admin?\n end",
"title": ""
},
{
"docid": "da417a9c255d06af4c02c956e874bed5",
"score": "0.701712",
"text": "def require_admin\n\t if logged_in? & !current_chef.admin?\n\t flash[:danger] = \"Only admin users can perform that action\"\n\t redirect_to root_path\n\t end\n\tend",
"title": ""
},
{
"docid": "158d18234f20ab649934e3b1d6a66482",
"score": "0.70036435",
"text": "def require_role(role_name)\n unless current_user.role.name == role_name\n flash[:error] = 'Access denied'\n redirect_to '/'\n return false\n end\n true\n end",
"title": ""
},
{
"docid": "e76339e68e1fa90da585815da28c8eb8",
"score": "0.6999392",
"text": "def ensure_admin\n unless current_user && current_user.admin?\n render :text => \"Access Error Message\", :status => :unauthorized\n end\nend",
"title": ""
},
{
"docid": "e76339e68e1fa90da585815da28c8eb8",
"score": "0.6999392",
"text": "def ensure_admin\n unless current_user && current_user.admin?\n render :text => \"Access Error Message\", :status => :unauthorized\n end\nend",
"title": ""
},
{
"docid": "cfe3eaffa17c007529605b28c6d558df",
"score": "0.6999089",
"text": "def require_admin\r\n if logged_in? && !current_chef.admin?\r\n flash[:danger] = \"Only admin users can perform that action!\"\r\n redirect_to root_path\r\n end \r\n end",
"title": ""
},
{
"docid": "1833b719569a50962bc5072cd61bcfad",
"score": "0.699576",
"text": "def require_admin\n redirect_to(root_url, \n :alert => \"Sorry, you don't have authorization to do that.\") unless\n is_admin?\n end",
"title": ""
},
{
"docid": "3a1451e22d8a3d37d3ab4d9618a29303",
"score": "0.6992614",
"text": "def authorize\n if !current_user.has_role? :admin\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "3cfc95e6773868ebdcd22153a3cdec89",
"score": "0.69904053",
"text": "def admin?\n role == 0\n end",
"title": ""
},
{
"docid": "6a02048da035892d3792c2b0ab1452ea",
"score": "0.6989913",
"text": "def require_admin\n unless current_user.try(:admin?)\n redirect_to root_path, notice: \"are you admin?please login\"\n end\n end",
"title": ""
},
{
"docid": "c3af250af9ffdf1356cca60dc16d877c",
"score": "0.69894904",
"text": "def index\n authorize! :read, Role\n @roles = Role.all\n end",
"title": ""
},
{
"docid": "5210704a65ee289615ebda46c1213e62",
"score": "0.6989325",
"text": "def authorize_as_admin\n unless session[:administrator]\n redirect_to(:controller => \"home\", :action => \"index\")\n end\n end",
"title": ""
},
{
"docid": "ff599bf3fbf2f609624eba17eec5c63f",
"score": "0.69883615",
"text": "def admin_required \n\tunless current_user && (current_user.id < 1 || current_user.permission_level == 1) \n redirect_to '/' \n end \n end",
"title": ""
},
{
"docid": "afa6339c51f019435d240c5be23eeb5e",
"score": "0.6983123",
"text": "def require_admin\n redirect_to restrooms_path, flash: {message: \"Please log in as an admin to access that page.\"} unless logged_in? && current_user.admin?\n end",
"title": ""
},
{
"docid": "9d1065344770e484614c7b96d66c67ce",
"score": "0.69830096",
"text": "def check_for_admin\n check_for_role(:admin)\n end",
"title": ""
},
{
"docid": "2425c3024646ed35d554cf772403655e",
"score": "0.6981582",
"text": "def authorize_as_admin\n return_unauthorized unless !current_user.nil? && current_user.is_admin?\n end",
"title": ""
},
{
"docid": "1c576c1a8f903286257c522f1d1123d4",
"score": "0.6976698",
"text": "def verify_admin\n redirect_to admin_dashboard_path,:flash => { :error => \"Only admin access\" } unless current_admin_user.role=='admin'\n end",
"title": ""
},
{
"docid": "2b46c90a1336d23cc76b4e4a45909162",
"score": "0.6972424",
"text": "def ensure_admin_user\n head :unauthorized unless current_user.is? :admin\n end",
"title": ""
},
{
"docid": "2ae993e533acd4e8078a5226c4ce0e33",
"score": "0.6970694",
"text": "def check_access_level(role)\n redirect_to root_path unless (current_user && current_user.role?(role))\n end",
"title": ""
}
] |
aa00d7c86fe99c105a401e7b3c3e9a90
|
Returns normalized attributes for that particular blueprint.
|
[
{
"docid": "344b9c39c5ee4f7b5c652514fb64065f",
"score": "0.62929034",
"text": "def normalized_attributes\n Buildable.normalize_attributes(@attributes ||= {})\n end",
"title": ""
}
] |
[
{
"docid": "1cb9810a4d2750a224bf571aacbbe0c9",
"score": "0.6004801",
"text": "def attributes\n attrs = filter_partials(self.class._attributes.dup)\n filter(attrs).each_with_object({}) do |attr, hash|\n hash[camelize_value(attr)] = send(attr)\n end\n end",
"title": ""
},
{
"docid": "a5dbc3825f3cada8f0215928c2a7a80f",
"score": "0.58729327",
"text": "def attributes\n @attributes ||= descriptors_fields.select{|field| field.scope == ATTRIBUTE_FIELDS }\n end",
"title": ""
},
{
"docid": "4b9e57ca7ba8dadaf6ae21febbb6eb79",
"score": "0.57612187",
"text": "def attribute_names(normalize=false)\n ensure_apply_object_class\n names = @attr_methods.keys\n if normalize\n names.collect do |name|\n to_real_attribute_name(name)\n end.uniq\n else\n names\n end\n end",
"title": ""
},
{
"docid": "eeffccc85a82bfcbd8b98f0b2cddf06d",
"score": "0.5696441",
"text": "def attributes\n @attributes ||= get_field_by_type(ATTRIBUTE_FIELDS)\n end",
"title": ""
},
{
"docid": "fadfc712674b16161e1c28b5c2aec0a1",
"score": "0.5693996",
"text": "def all_attributes\n the_attrs = Hash[accessors.collect {|v| [v, send(v.to_s)] if respond_to? \"#{v}\".to_sym}]\n (respond_to?(:attributes) && attributes.merge(the_attrs)) || the_attrs\n end",
"title": ""
},
{
"docid": "79690a0ff3a12aab2dc841047df869a7",
"score": "0.5691247",
"text": "def attributes\n load_attributes! unless attributes_loaded?\n @attributes.values\n end",
"title": ""
},
{
"docid": "5bc28a795d2c930be7bd397b9fbc9a2c",
"score": "0.5675623",
"text": "def attrs\r\n @attrs ||= Utils.deep_merge(@attributes, _package_.env)\r\n end",
"title": ""
},
{
"docid": "3d4f1881745a448bd3e6eddde2cb4b83",
"score": "0.5650503",
"text": "def factorygirl_attributes\n symbolize_attributes!\n @attributes.each do |key, value|\n next unless respond_to?(method = method_name(key))\n if (result = send method, value) || value.nil?\n @attributes[key] = result if @attributes.key? key\n else\n @attributes.delete key\n end\n end\n end",
"title": ""
},
{
"docid": "f9b87cd85640fe39170d7f3b9a529ef3",
"score": "0.5623837",
"text": "def api_attributes\n record.class.column_names.map(&:to_sym)\n end",
"title": ""
},
{
"docid": "c4a85b0a34a8632c6546f4901596da74",
"score": "0.561888",
"text": "def normalize_attributes_collection(attributes)\n if attributes.is_a?(Hash)\n attributes.map { |_, attrs| attrs }\n else\n attributes\n end\n end",
"title": ""
},
{
"docid": "32f86b150e0d6dcee5374a837b1739b4",
"score": "0.5606092",
"text": "def get_attributes\n\t\t\t@@attributes\n\t\tend",
"title": ""
},
{
"docid": "d051df3b7a11f92143c182b3b301247e",
"score": "0.5591932",
"text": "def normalize object\n return {} if object.nil?\n\n hsh = {}\n\n attribute_names.each do |attr_name|\n hsh[attr_name] = object.send(attr_name)\n end # each\n\n hsh\n end",
"title": ""
},
{
"docid": "3c8e01615152a20fcc14701e39ab5863",
"score": "0.55430883",
"text": "def base_attributes\n kind.attributes\n end",
"title": ""
},
{
"docid": "0a85840dda734f1013cb2597c1592a6f",
"score": "0.55273783",
"text": "def attributes\n @attributes = Hash[attrs.map { |a| [a.to_sym, send(\"#{a}\")] }]\n end",
"title": ""
},
{
"docid": "522b1514da35b29b135d71b979df5d93",
"score": "0.5519873",
"text": "def attributes\n ATTRIBUTE_NAMES\n end",
"title": ""
},
{
"docid": "18496e32259465032811a294866c5037",
"score": "0.5513187",
"text": "def raw_attributes\n @ldap_entry.attribute_names.each_with_object({}) do |key, hsh|\n hsh[key] = @ldap_entry[key]\n end\n end",
"title": ""
},
{
"docid": "bc045d512459c9371cda0aa6737a5b41",
"score": "0.5502942",
"text": "def normal\n attributes.normal\n end",
"title": ""
},
{
"docid": "929e6acd83bd2badff3e47a1660cd7d8",
"score": "0.5502519",
"text": "def attrs\n @attrs\n end",
"title": ""
},
{
"docid": "5d56dcbb6827e53cdf935ec14adf24ea",
"score": "0.54846364",
"text": "def attributes\n self._attributes.inject({}) do |hash, attr|\n hash[attr.to_s] = send(attr)\n hash\n end\n end",
"title": ""
},
{
"docid": "9fa2c53f2990e4edcfe60d9969a85a7c",
"score": "0.5480104",
"text": "def get_table_attributes(table_name)\n get_schemas[table_name].columns.map(&:name)\n end",
"title": ""
},
{
"docid": "dded8ebd70038cc29622a238b431fe14",
"score": "0.547645",
"text": "def attributes\n @attrs.keys\n end",
"title": ""
},
{
"docid": "2d46b1963d327c307ef20c98e0eed860",
"score": "0.5464754",
"text": "def normalized(attribute)\n @normalized ||= csf\n (@normalized.respond_to?(attribute)) ? @normalized.send(attribute) : []\n end",
"title": ""
},
{
"docid": "097e0ec800195c0c806fb848befad485",
"score": "0.54604083",
"text": "def attributes\n self.class::ATTRIBUTES\n end",
"title": ""
},
{
"docid": "2e7762d51610c0d8c69ccdbbe6dca4f8",
"score": "0.54495186",
"text": "def strip_attributes\n attribute_names().each do |name|\n if self.send(name.to_sym).respond_to?(:strip)\n self.send(\"#{name}=\".to_sym, self.send(name).strip)\n end\n end\n end",
"title": ""
},
{
"docid": "0f5e10b22174a96003ef07eb2584bf53",
"score": "0.5445356",
"text": "def to_rest\n return attributes\n end",
"title": ""
},
{
"docid": "dafdb71ea2baa19d9b98bcf4b2a6af5b",
"score": "0.54439175",
"text": "def normalize(value)\n Array(attrs[:normalize]).each do |method|\n next unless method.is_a?(Symbol)\n\n value = value.send(method) if value.respond_to?(method)\n end\n\n value\n end",
"title": ""
},
{
"docid": "8d6116c9f6ada027ad6da378ef84cb32",
"score": "0.5440055",
"text": "def attrs\n self.class.attrs\n end",
"title": ""
},
{
"docid": "7fb06e81ef3e2a6f90d4231cda19a8d8",
"score": "0.5429726",
"text": "def attributes\n (@original_attributes||{}).merge(@attributes).keys.inject({}) do |hash, key|\n hash[key] = read_attribute(key)\n hash\n end\n end",
"title": ""
},
{
"docid": "80ae7b50e1f2cd59a592b94f6bbe4c1d",
"score": "0.5426686",
"text": "def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"title": ""
},
{
"docid": "80ae7b50e1f2cd59a592b94f6bbe4c1d",
"score": "0.5426686",
"text": "def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"title": ""
},
{
"docid": "48109664e7beadf3f3026b7b3163556d",
"score": "0.5426215",
"text": "def shop_bunny_json_attributes\n attributes\n end",
"title": ""
},
{
"docid": "e484cd8142b0418df71443f2152c2f6a",
"score": "0.54253626",
"text": "def attributes\n @attributes ||= []\n @attributes\n end",
"title": ""
},
{
"docid": "e42020cae1655aaae951e07382e021cc",
"score": "0.5421819",
"text": "def derived_attribute_names\n Module.nesting.first.public_instance_methods - [:derived_attribute_names]\n end",
"title": ""
},
{
"docid": "768d3d707d52eab8a26386dfac41ed90",
"score": "0.5419455",
"text": "def attrs\n @attrs\n end",
"title": ""
},
{
"docid": "57531393a2d97c9c191e3426a623d217",
"score": "0.5407094",
"text": "def attributes; @attributes ||= []; end",
"title": ""
},
{
"docid": "76e01185dff409355bc6dacdd6b7d91c",
"score": "0.5403001",
"text": "def attributes\n {}.tap do |attributes|\n attribute_names.each do |key|\n attributes[key] = send(key)\n end\n end\n end",
"title": ""
},
{
"docid": "3dbdfb4cd1d03f2ef39b398c5633f59b",
"score": "0.539739",
"text": "def attributes\n self\n .class\n .attribute_names\n .map { |attr| [attr, send(attr)] }\n .reject { |_, value| value.nil? }\n .map do |attr, value|\n [attr, value.respond_to?(:attributes) ? value.attributes : value]\n end\n .to_h\n end",
"title": ""
},
{
"docid": "f8c0f85d05ac55cd0745b7884b5e9852",
"score": "0.53759086",
"text": "def attribs\n\t\t@attributes\n\tend",
"title": ""
},
{
"docid": "9481227ef8fbaaea9cce4b878520b496",
"score": "0.53714657",
"text": "def attributes\n @attributes ||= sort.reverse.inject({}) do |final, (_, changeset)|\n changeset.merge(final)\n end\n end",
"title": ""
},
{
"docid": "b7ba30ceaffed80c542c773a7bfecf1c",
"score": "0.53669745",
"text": "def marshalized_attributes\n read_inheritable_attribute(:attr_marshalized) or write_inheritable_attribute(:attr_marshalized, {})\n end",
"title": ""
},
{
"docid": "a4046777a041758b6d1f767c0792d36e",
"score": "0.5366032",
"text": "def attributes\n @attributes ||= {}\n @attributes\n end",
"title": ""
},
{
"docid": "0c3216e52e785c3901839d34bad997ff",
"score": "0.53630364",
"text": "def attributes\n @attributes ||= []\n end",
"title": ""
},
{
"docid": "748f8a680e5f729cd4943e047091f42c",
"score": "0.5357163",
"text": "def loaded_attributes\n properties.map{|p| p.name if attribute_loaded?(p.name)}.compact\n end",
"title": ""
},
{
"docid": "81346cd291acc8628a8244d0ccfecda1",
"score": "0.5343516",
"text": "def attributes\n @attrs\n end",
"title": ""
},
{
"docid": "43170e8c376b0d9bcfd2010e5461b8d3",
"score": "0.534046",
"text": "def attribute_values\n attributes.values\n end",
"title": ""
},
{
"docid": "0eafc2c774fca572753b1c49930da0b8",
"score": "0.5335649",
"text": "def attr_columns\n @attr_columns\n end",
"title": ""
},
{
"docid": "a9a62854ba670512d58d1794ab765464",
"score": "0.53285027",
"text": "def _attributes\n @_attributes = superclass.try(:_attributes)&.dup || {} unless defined?(@_attributes)\n @_attributes\n end",
"title": ""
},
{
"docid": "d14f6bfb4045fb86b44b35f254c02e4b",
"score": "0.53257895",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "36ae1ae0500702fe522e227667e7e6cf",
"score": "0.53220826",
"text": "def attributes\n @ldap_entry.attribute_names.each_with_object({}) do |key, hsh|\n hsh[key] = get_value(key)\n end\n end",
"title": ""
},
{
"docid": "798b10e5f1d5a763ef397a80b6ead1e1",
"score": "0.5314598",
"text": "def attributes\n ATTRIBUTES\n end",
"title": ""
},
{
"docid": "373257bc7243d6f7566e46ead2def10f",
"score": "0.53079623",
"text": "def attributes\n self.class.attribute_names.map do |attr|\n type = self.class.attribute_types[attr.to_s]\n value = public_send(attr)\n [attr, type ? type.serialize(value) : value]\n end.to_h\n end",
"title": ""
},
{
"docid": "8cedc652f7baa4a95e7941fa7f686395",
"score": "0.53049505",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "8cedc652f7baa4a95e7941fa7f686395",
"score": "0.53049505",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "8cedc652f7baa4a95e7941fa7f686395",
"score": "0.53049505",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "2577be25106d2818f41dce8f5da0319d",
"score": "0.530015",
"text": "def attributes\n @attributes = @attributes || {}\n end",
"title": ""
},
{
"docid": "0fa1b75cbb48aa6a804c9c2b97a30f70",
"score": "0.5295998",
"text": "def all_attributes\n @@all_attributes ||= \n begin\n to_return = {}\n @fields.each do |key, field|\n to_return[key] = field.human_name\n end\n to_return\n end\n end",
"title": ""
},
{
"docid": "826c08ab4be137d8c693bfcc9e781664",
"score": "0.5290415",
"text": "def attributes\n data[:attributes]\n end",
"title": ""
},
{
"docid": "226d3bb8759377f0ebc48b0bd5a21a27",
"score": "0.528526",
"text": "def derived_attributes\n @derive_attribute ||= {}\n end",
"title": ""
},
{
"docid": "0d55d20dae2cdd9c4addec79dc51ddce",
"score": "0.5283191",
"text": "def attributes\n @attributes ||= @internal_struct[:attributes]\n end",
"title": ""
},
{
"docid": "c703b99644c006800260eafabc5df4cb",
"score": "0.5281534",
"text": "def full_attributes \n self.class.attributes\n end",
"title": ""
},
{
"docid": "270d01abd68618f563ddd24a87aef52b",
"score": "0.5280964",
"text": "def attributes\n attributes = resource_class.list_attributes\n attributes &= params[:attributes].split(',') if params[:attributes]\n\n associations = resource_class.reflect_on_all_associations\n\n attributes.map do |attribute|\n next if attribute.blank?\n association = associations.detect { |association| association.foreign_key == attribute }\n\n # If attribute is an association and is not polymorphic, use the association\n # name instead of the foreign key.\n if association\n association.name unless association.options.include? :polymorphic\n else\n attribute\n end\n end.compact\n end",
"title": ""
},
{
"docid": "912a53da9e0b11c55b4fda95beebe9c7",
"score": "0.5280523",
"text": "def attributes\n @_attributes\n end",
"title": ""
},
{
"docid": "c45d3a244cef748f1dd7787ec9214c4c",
"score": "0.52786213",
"text": "def to_rest\n return attributes\n end",
"title": ""
},
{
"docid": "406caf05179a10693177f89890cb25d4",
"score": "0.5268357",
"text": "def attributes\n @json_attributes.reject{|k,v| !schema.fields.include?(k)}\n end",
"title": ""
},
{
"docid": "7a4e278067ea0e8d86f0c4ac9137b3f1",
"score": "0.5267538",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "9eda5af017c9667f9e1e3b0da9fa872d",
"score": "0.5262606",
"text": "def attributes\n superclass_attrs = superclass.attributes if superclass.respond_to? :attributes\n @__attrs ||= AttributeCollection.new + superclass_attrs\n end",
"title": ""
},
{
"docid": "bf78502bc5fdda8c8b03e6a2f41273d3",
"score": "0.52521986",
"text": "def attribute_mappings\n return @attribute_mappings\n end",
"title": ""
},
{
"docid": "d6f70ac4498335a005ed978fe8c7a794",
"score": "0.524945",
"text": "def domain_attrs\n attributes.symbolize_keys.select {|_k, v| !v.nil? }\n end",
"title": ""
},
{
"docid": "4747a2ad3d5205dbcfbd387897b0f543",
"score": "0.52482545",
"text": "def values\n @attrs.values\n end",
"title": ""
},
{
"docid": "142f2214572e09cec6f1745fb097e130",
"score": "0.5242613",
"text": "def attributes\n []\n end",
"title": ""
},
{
"docid": "a383fea7a6cfabec14bb4e2583d86369",
"score": "0.52422076",
"text": "def attributes\n self.class._attributes.dup.each_with_object({}) do |name, hash|\n hash[name] = send(name)\n end\n end",
"title": ""
},
{
"docid": "bf56a782d14e9049166a0bde2195aa4a",
"score": "0.5239461",
"text": "def attribute_values\n @columns.map do |column|\n @attributes[column.to_sym]\n end\n end",
"title": ""
},
{
"docid": "bd48857f232ff451abb6850a10bd3468",
"score": "0.5237025",
"text": "def parse_attributes! #:nodoc:\n self.attributes = (attributes || []).map do |attr|\n Barbecue::Generators::GeneratedAttribute.parse(attr)\n end\n end",
"title": ""
},
{
"docid": "c538969e377ba82166c97e51c5c24f1c",
"score": "0.52356815",
"text": "def attributes\n if @attributes.empty?\n fetch_configuration()\n end\n return @attributes\n end",
"title": ""
},
{
"docid": "da8f951887275603f4c9637b416f1683",
"score": "0.5231547",
"text": "def populate_attributes\n theme_package.attributes.each{ |attribute_name| populate_attribute(attribute_name) }\n end",
"title": ""
},
{
"docid": "644d7d93bd170d8212a220ef9169ccd5",
"score": "0.5230073",
"text": "def attributes\n @attribute_ids.collect { |idx| BAttribute.store[idx] }\n end",
"title": ""
},
{
"docid": "f7e12b03db43df5802c7ffbb292992b2",
"score": "0.52236414",
"text": "def attributes\n ATTRIBUTES.each_with_object({}) do |name, buffer|\n buffer[name] = public_send(name)\n end\n end",
"title": ""
},
{
"docid": "725e1ee2b0eed551536de56e787d5128",
"score": "0.5221254",
"text": "def attributes\n self.class.attribute_names.map do |name|\n [name.to_s, self.send(name)]\n end.to_h\n end",
"title": ""
},
{
"docid": "eec96558e1cc0323dedcb00b592fd290",
"score": "0.5205268",
"text": "def table_attributes\n attributes\n end",
"title": ""
},
{
"docid": "5f4705be9fdc75a960f5f116a95cd9b0",
"score": "0.52041584",
"text": "def attribute_names\n @attribute_names ||= attribute_definitions.keys.collect {|a|a.to_s}\n end",
"title": ""
},
{
"docid": "a43c9a6c3b72d6f4e57ced20307ee37a",
"score": "0.52038866",
"text": "def attributes\n self.class.config.full_config.map { |attribute| [attribute, send(attribute)] }.to_h\n end",
"title": ""
},
{
"docid": "a24012c6b2f3d24b606a69c234616dbc",
"score": "0.52026856",
"text": "def resource_attributes\n resource_class.attribute_names\n end",
"title": ""
},
{
"docid": "0a8beccd61734cebf68e94f8e1acdfaf",
"score": "0.5202013",
"text": "def attributes\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "0a8beccd61734cebf68e94f8e1acdfaf",
"score": "0.5202013",
"text": "def attributes\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "0a8beccd61734cebf68e94f8e1acdfaf",
"score": "0.5202013",
"text": "def attributes\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "562ac8560aa47dd20f40fd1fdb4d9669",
"score": "0.51985943",
"text": "def attributes\n data.require(:attributes)\n end",
"title": ""
},
{
"docid": "0e5f09a2d31dffca3f86f045a8b87b29",
"score": "0.51957124",
"text": "def attributes\n @_attributes\n end",
"title": ""
},
{
"docid": "23f7fc3f0f31cbcfc4367c15785b86e9",
"score": "0.5194448",
"text": "def attributes\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "23f7fc3f0f31cbcfc4367c15785b86e9",
"score": "0.5194448",
"text": "def attributes\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "23f7fc3f0f31cbcfc4367c15785b86e9",
"score": "0.5194448",
"text": "def attributes\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "23f7fc3f0f31cbcfc4367c15785b86e9",
"score": "0.5194448",
"text": "def attributes\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "23f7fc3f0f31cbcfc4367c15785b86e9",
"score": "0.5194448",
"text": "def attributes\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "72bf2b735ce78de69ca18b154fc1dc05",
"score": "0.5180871",
"text": "def bmAttributes\n self[:bmAttributes]\n end",
"title": ""
},
{
"docid": "04da95b5ba0b24d9c85fdc5d83ff79c2",
"score": "0.5179031",
"text": "def inspect_attributes\n %i[uuid name type slug status email]\n end",
"title": ""
},
{
"docid": "96326d8aebfecae3c168cba7e8972cc0",
"score": "0.5165331",
"text": "def attribute_values\n self.class.attributes.map{ |attr| self.send(attr) }\n end",
"title": ""
},
{
"docid": "c0651ed90ddfc05763fe4621befc688b",
"score": "0.51634514",
"text": "def attributes\n @attributes ||= {}.freeze\n end",
"title": ""
},
{
"docid": "a31e296009c7d515f2e9d641fbf8c164",
"score": "0.5161696",
"text": "def attributes\n self.attribute_keys.inject({}) do |hash, key|\n hash[key] = self.__send__(key) if self.__send__(key)\n hash\n end\n end",
"title": ""
},
{
"docid": "92f679996ef2c792c2688819ab31e875",
"score": "0.5160987",
"text": "def merge_attributes\n %w( price area paragraph bullet file ).map(&:to_sym)\n end",
"title": ""
},
{
"docid": "02263c26790660dea9a5b3e81153ccb6",
"score": "0.51600957",
"text": "def attribute_values \n columns = self.class.columns\n columns.map { |col| self.send(col) } #=> ex. [:id, :name, :owner_id]\n end",
"title": ""
},
{
"docid": "c4a561ae0afd1bfb3e2ea24934963a36",
"score": "0.5159071",
"text": "def normalize_attrs(attrs)\n attrs.keys.find_all { |k, v| k != k.downcase }.each { |k, v|\n v = v.downcase if k == \"rel\" || k == \"type\"\n attrs.delete k\n attrs[k.downcase] = v\n }\n attrs\n end",
"title": ""
}
] |
c4ef51cac0fe0e5baf2c061e3de11384
|
PATCH/PUT /installations/1 PATCH/PUT /installations/1.json
|
[
{
"docid": "4cc6ecadee8161b7cfc247d6a4b23a98",
"score": "0.6849272",
"text": "def update\n respond_to do |format|\n if @installation.update(installation_params)\n format.html { redirect_to @installation, notice: 'Installation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @installation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "fd17b437e40b4211b8fcd1e2e428b454",
"score": "0.68078256",
"text": "def update\n @installation = Installation.find(params[:id])\n\n respond_to do |format|\n if @installation.update_attributes(params[:installation])\n format.html { redirect_to @installation, :notice => 'Installation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @installation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0b12e97a5ecc6b0f9b5cd173b0515c3",
"score": "0.6747204",
"text": "def update\n respond_to do |format|\n if @installation.update(installation_params)\n format.html { redirect_to @installation, notice: 'Installation was successfully updated.' }\n format.json { render :show, status: :ok, location: @installation }\n else\n format.html { render :edit }\n format.json { render json: @installation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f760cebe9af7a8bf9ffb7ca6532be1f2",
"score": "0.6596517",
"text": "def update\n respond_to do |format|\n if @installation.update(installation_params)\n format.html { redirect_to @installation, notice: 'Instalacja została pomyślnie zaktualizowana' }\n format.json { render :show, status: :ok, location: @installation }\n else\n format.html { render :edit }\n format.json { render json: @installation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f3aeb69f627d3f3a49c6433a85a20d3",
"score": "0.6564178",
"text": "def update\n respond_to do |format|\n if @rack_installation.update(rack_installation_params)\n format.html { redirect_to @rack_installation, notice: 'Rack installation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rack_installation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "877341fb0e5e5114994bac19c91c49e8",
"score": "0.6450272",
"text": "def update\n @silent_install = SilentInstall.find(params[:id])\n\n respond_to do |format|\n if @silent_install.update_attributes(params[:silent_install])\n format.html { redirect_to @silent_install, notice: 'Silent install was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @silent_install.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c27a03a65238a1bc1b8b70a7472c9c55",
"score": "0.6271056",
"text": "def update\n respond_to do |format|\n if @installment.update(installment_params)\n format.html { redirect_to @installment, notice: 'Installment was successfully updated.' }\n format.json { render :show, status: :ok, location: @installment }\n else\n format.html { render :edit }\n format.json { render json: @installment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "939213d9663059bf0d64fe1ce04983ed",
"score": "0.6111303",
"text": "def update\n recipe.update(recipe_params)\n render json: recipe\n end",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.586962",
"text": "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"title": ""
},
{
"docid": "576f27e4c99d0868b0454fedc7deba0c",
"score": "0.58637226",
"text": "def update # PATCH\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "1167cd27cd1fb43f4943b64e7be17837",
"score": "0.5817855",
"text": "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end",
"title": ""
},
{
"docid": "ddc3dabaac834d6e13990ac52c0f2aa9",
"score": "0.57918483",
"text": "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end",
"title": ""
},
{
"docid": "c6ad3d7b3f025ac43448a6b46852daba",
"score": "0.57679784",
"text": "def update *reqs\n fire :updating, :updated do\n @environments |= @sandbox.environments\n @options.merge! reqs.pop if Hash === reqs.last\n @requirement = Gem::Requirement.new reqs unless reqs.empty?\n end\n\n self\n end",
"title": ""
},
{
"docid": "6aa809630cc29fb9a8a453f9804b5bc1",
"score": "0.5765897",
"text": "def update\n respond_to do |format|\n if @recipe.update(recipe_params)\n params[:recipe][:ingredients].each do |ingredient_id|\n next if ingredient_id.to_i == 0\n ingredient = Ingredient.find(ingredient_id.to_i)\n @recipe.ingredients << ingredient\n end\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d365fce02f6dc2cc27891602aaa315f2",
"score": "0.5756518",
"text": "def update\n respond_to do |format|\n if @sports_installation.update(sports_installation_params)\n format.html { redirect_to @sports_installation, notice: 'Sports installation was successfully updated.' }\n format.json { render :show, status: :ok, location: @sports_installation }\n else\n format.html { render :edit }\n format.json { render json: @sports_installation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa2eeaa45445dd76141374dc13ffab6d",
"score": "0.573009",
"text": "def update\n begin\n @api_v1_product.update!(api_v1_product_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end",
"title": ""
},
{
"docid": "2ad2ae95a5936664c50c8e4b7d3a28ea",
"score": "0.56881976",
"text": "def update\n respond_to do |format|\n if @requirement.update_attributes(requirement_params)\n format.html { redirect_to action: :index, notice: 'Update Success.' }\n format.json { render action: :index, status: :accepted }\n else\n format.html { render action: :edit }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b9f565bc22e8cbe4fdde7bc14a4edc3",
"score": "0.5677302",
"text": "def update\n respond_to do |format|\n if @requirement.update(requirement_params)\n format.html { redirect_to requirements_path, notice: \"Requisito (#{@requirement.name}) atualizado com sucesso!\" }\n format.json { render :show, status: :ok, location: @requirement }\n else\n format.html { render :edit }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d6a61f3186174209e44862cb0ae05d7",
"score": "0.56676495",
"text": "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",
"title": ""
},
{
"docid": "fec2c140021e4d6199def07327a08e33",
"score": "0.5643367",
"text": "def update\n respond_to do |format|\n if @chef.update(chef_params)\n format.html { redirect_to [:admin, @chef], notice: t('messages.updated', model:Chef.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chef.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12cb928038a5460056341c9a327ca41a",
"score": "0.5634229",
"text": "def update\n respond_to do |format|\n if @deployment.update(deployment_params)\n services_params(@deployment).each do |service_name, version_name|\n version = Version.find_by(name: version_name)\n @deployment.versions << version if version\n end\n @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully updated.' }\n format.json { render :show, status: :ok, location: @deployment }\n else\n format.html { render :edit }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc30dad73497718dc5bc1f192ccbebe2",
"score": "0.5629309",
"text": "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end",
"title": ""
},
{
"docid": "17394723967eced6a5486f67c71d4516",
"score": "0.56285703",
"text": "def update\n @fabric = Fabric.find(params[:id])\n\n respond_to do |format|\n if @fabric.update_attributes(params[:fabric])\n format.html { redirect_to @fabric, notice: 'Fabric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fabric.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2ba819874d210db4a92658d75d11f6d",
"score": "0.5613985",
"text": "def update\n respond_to do |format|\n update_special_attributes\n if @package.update(package_params)\n format.html { redirect_to @package }\n flash[:success] = 'Package was successfully updated.'\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b081c749b9b27694cbd95bcc0130aea",
"score": "0.56039584",
"text": "def update!(**args)\n @has_dependencies = args[:has_dependencies] if args.key?(:has_dependencies)\n @is_installed = args[:is_installed] if args.key?(:is_installed)\n @version = args[:version] if args.key?(:version)\n end",
"title": ""
},
{
"docid": "b0e9e767a080f81dee06586cf512a9ba",
"score": "0.5603946",
"text": "def update\n install\n end",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.55954117",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "daecf6f61903e0cd5581d865988168e5",
"score": "0.5590875",
"text": "def update\n respond_to do |format|\n if @requirement.update(requirement_params)\n format.html { redirect_to @requirement, notice: 'Requirement was successfully updated.' }\n format.json { render :show, status: :ok, location: @requirement }\n else\n format.html { render :edit }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c42bde476d51212fa13cbbdb620fb4b8",
"score": "0.55867183",
"text": "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "c4ed8564772889642e0616884980724c",
"score": "0.5571144",
"text": "def update\n @rpm = Rpm.find(params[:id])\n @rpm.save\n respond_to do |format|\n if @rpm.update_attributes(params[:rpm])\n format.html { redirect_to imprimir_rpm_path(@rpm) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rpm.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f10cae4cd69e78e0a56e88c729c76f59",
"score": "0.5570427",
"text": "def update\n self.install\n end",
"title": ""
},
{
"docid": "f10cae4cd69e78e0a56e88c729c76f59",
"score": "0.55691653",
"text": "def update\n self.install\n end",
"title": ""
},
{
"docid": "f10cae4cd69e78e0a56e88c729c76f59",
"score": "0.55691653",
"text": "def update\n self.install\n end",
"title": ""
},
{
"docid": "f764f063931563f1b2ac845b58a575c5",
"score": "0.55659556",
"text": "def update!(**args)\n @resource_type = args[:resource_type] if args.key?(:resource_type)\n @service = args[:service] if args.key?(:service)\n @version = args[:version] if args.key?(:version)\n end",
"title": ""
},
{
"docid": "b97f9c37a7d5740631ab55d37671da0b",
"score": "0.5557812",
"text": "def update\n if @requirement.update(requirement_params)\n render :show, status: :ok, location: @requirement\n else\n render json: @requirement.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.5550251",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "dd2562dcce7d02f68335913edcc1145e",
"score": "0.5548681",
"text": "def update\n begin\n recipe = Recipe.find(params[:id])\n\n if recipe.update_attributes(recipe_params)\n render json: { status: 'SUCCESS', message: 'Recipe updated!', data: recipe }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Error updating recipe', data: recipe.errors }, status: :unprocessable_entity\n end\n rescue\n render json: { status: 'ERROR', message: 'Error finding recipe', data: {} }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "72851e8b717ed4aa56ab1ee3902e0579",
"score": "0.5547855",
"text": "def update\n respond_to do |format|\n if @concrete_package_version.update(concrete_package_version_params)\n format.html { redirect_to @concrete_package_version, success: 'Concrete package version was successfully updated.' }\n format.json { render :show, status: :ok, location: @concrete_package_version }\n else\n format.html { render :edit }\n format.json { render json: @concrete_package_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "11a3fd9e3ee9f3bd93b67f49a162bbdf",
"score": "0.5537396",
"text": "def update(args)\n builder.update_rest(type, ref, args, username, password)\n self.elements(true)\n end",
"title": ""
},
{
"docid": "d37b39a795a6e081d6480942ece1c538",
"score": "0.55349916",
"text": "def put!\n request! :put\n end",
"title": ""
},
{
"docid": "c22d573a52c3ed5ad72a61054580a07c",
"score": "0.5533442",
"text": "def update(name, attributes)\n\t\tput(\"/apps/#{name}\", :app => attributes)\n\tend",
"title": ""
},
{
"docid": "c22d573a52c3ed5ad72a61054580a07c",
"score": "0.5533442",
"text": "def update(name, attributes)\n\t\tput(\"/apps/#{name}\", :app => attributes)\n\tend",
"title": ""
},
{
"docid": "cebc77fe44cb6e30f8f8a2c50ac1c0ca",
"score": "0.55286545",
"text": "def update\n @systeminstallscript = Systeminstallscript.find(params[:id])\n\n respond_to do |format|\n if @systeminstallscript.update_attributes(params[:systeminstallscript])\n format.html {redirect_to systeminstallscripts_url, flash[:info]='Systeminstallscript was successfully updated.' }\n format.js { flash[:info]='Systeminstallscript was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @systeminstallscript.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b510f3891c232d05eaed2566f2a2335",
"score": "0.5525485",
"text": "def update\n respond_to do |format|\n if @req.update(req_params)\n flash[:notice] = \"Your requirement has been saved\"\n format.html { redirect_to @req }\n format.json { render :show, status: :ok, location: @req }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @req.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23642f887f9be4c02c58782afcd91e3e",
"score": "0.55250454",
"text": "def update\n self.uninstall if (@property_hash[:ensure] || info2hash()[:ensure]) != :absent\n self.install\n end",
"title": ""
},
{
"docid": "951e2d5f363e6a4b2acd28e437137a98",
"score": "0.5517864",
"text": "def update\n # @recipe = Recipe.find(params[:id])\n #\n update! do |success, failure|\n # success.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n # success.json { head :ok }\n # failure.html { render action: \"edit\" }\n # failure.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "f78d126c42ef4c9f2bb12dc6a4f0805e",
"score": "0.5515533",
"text": "def update\n respond_to do |format|\n add_items\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7663d0348b74542ff1d2f4fd96156fe",
"score": "0.55139977",
"text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"title": ""
},
{
"docid": "4d2960d7feab7fec0dfe064c0bfaedc0",
"score": "0.55010724",
"text": "def update!(**args)\n @index_status = args[:index_status] if args.key?(:index_status)\n @package_id_fingerprint = args[:package_id_fingerprint] if args.key?(:package_id_fingerprint)\n @per_app_info_encoded = args[:per_app_info_encoded] if args.key?(:per_app_info_encoded)\n end",
"title": ""
},
{
"docid": "c82cb493ed02fff395062dfa274eeb2c",
"score": "0.550017",
"text": "def update!(**args)\n @ray_spec = args[:ray_spec] if args.key?(:ray_spec)\n @service_account_spec = args[:service_account_spec] if args.key?(:service_account_spec)\n end",
"title": ""
},
{
"docid": "056b218f7e32e83bcc1bdd6c66162161",
"score": "0.5499711",
"text": "def update\n respond_to do |format|\n if @startup.update(startup_params)\n format.html { redirect_to startups_url, notice: 'listing was successfully updated.' }\n format.json { render :index, status: :ok, location: @startup }\n else\n format.html { render :edit }\n format.json { render json: @startup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e81f70bb75f96a961bc6b50519fd748e",
"score": "0.549774",
"text": "def update!(**args)\n @json_schemas = args[:json_schemas] if args.key?(:json_schemas)\n @schema = args[:schema] if args.key?(:schema)\n end",
"title": ""
},
{
"docid": "d30c0f57490fcd9ee9c0f8439f3cc233",
"score": "0.5493684",
"text": "def update\n respond_to do |format|\n if @package_version.update(package_version_params)\n format.html { redirect_to @package_version, success: 'Package version was successfully updated.' }\n format.json { render :show, status: :ok, location: @package_version }\n else\n format.html { render :edit }\n format.json { render json: @package_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98ffa158acbf02cbf2dc20af8c117e34",
"score": "0.54917574",
"text": "def update\n put :update\n end",
"title": ""
},
{
"docid": "6af7721ceb1db8fa02281dc9210f6861",
"score": "0.5483499",
"text": "def update!(**args)\n @deployed_model_id = args[:deployed_model_id] if args.key?(:deployed_model_id)\n @endpoint = args[:endpoint] if args.key?(:endpoint)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5483013",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5483013",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5483013",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5483013",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "2ac5b8126272fb3f105c7bfa017b8067",
"score": "0.5478831",
"text": "def update\n authorize! :manage, @packages , :message => \"Access denied.\"\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to [@package.product, @package], notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1fb062056f0d6079270d7238694d19d",
"score": "0.5475022",
"text": "def update\n respond_to do |format|\n if @product_spec.update(product_spec_params)\n format.html { redirect_to @product_spec, notice: 'Product spec was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_spec }\n else\n format.html { render :edit }\n format.json { render json: @product_spec.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "808234af09c7fb630a6cd9cf37af7427",
"score": "0.54744846",
"text": "def update\n @package = Package.find(params[:id])\n\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to @package, :notice => 'Package was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @package.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54f95a361000b6219275e377b8bf4555",
"score": "0.5474177",
"text": "def update options={}\n client.put(\"/#{id}\", options)\n end",
"title": ""
},
{
"docid": "4834b0d0369949dccb23e02eef7bb6e1",
"score": "0.5472813",
"text": "def update\n respond_to do |format|\n if @instaler.update(instaler_params)\n format.html { redirect_to @instaler, notice: '安装工人更新成功!' }\n format.json { render :show, status: :ok, location: @instaler }\n else\n format.html { render :edit }\n format.json { render json: @instaler.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "691bbc019c1e28ecb603a3b43974b6c1",
"score": "0.5464479",
"text": "def update!(**args)\n @client = args[:client] if args.key?(:client)\n @list_update_requests = args[:list_update_requests] if args.key?(:list_update_requests)\n end",
"title": ""
},
{
"docid": "ef88bcc235a3c2b2f45c36f47124afe9",
"score": "0.5461996",
"text": "def update!(**args)\n @api_signatures = args[:api_signatures] if args.key?(:api_signatures)\n @unique_apis = args[:unique_apis] if args.key?(:unique_apis)\n end",
"title": ""
},
{
"docid": "449f05da0e025824189fbafe4280c276",
"score": "0.5449685",
"text": "def update\n params[:recipe][:ingredient_ids] ||= []\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3adfbac26fa916d34e8b24abae8e48f9",
"score": "0.54479074",
"text": "def update!(**args)\n @versions = args[:versions] if args.key?(:versions)\n end",
"title": ""
},
{
"docid": "3adfbac26fa916d34e8b24abae8e48f9",
"score": "0.54479074",
"text": "def update!(**args)\n @versions = args[:versions] if args.key?(:versions)\n end",
"title": ""
},
{
"docid": "3adfbac26fa916d34e8b24abae8e48f9",
"score": "0.54479074",
"text": "def update!(**args)\n @versions = args[:versions] if args.key?(:versions)\n end",
"title": ""
},
{
"docid": "35b802e5d4a779aa35266853fcbb82e7",
"score": "0.54461706",
"text": "def update!(**args)\n @bundles = args[:bundles] if args.key?(:bundles)\n @platform_version = args[:platform_version] if args.key?(:platform_version)\n @required_platform_version = args[:required_platform_version] if args.key?(:required_platform_version)\n @status = args[:status] if args.key?(:status)\n end",
"title": ""
},
{
"docid": "22cf79997267ddc9a0540f363f61e403",
"score": "0.54390484",
"text": "def update!(**args)\n @attributes = args[:attributes] if args.key?(:attributes)\n @resources = args[:resources] if args.key?(:resources)\n @service_config_id = args[:service_config_id] if args.key?(:service_config_id)\n end",
"title": ""
},
{
"docid": "d579c2c7fbb915fe5f0ab34aaba83d15",
"score": "0.54361266",
"text": "def update\n respond_to do |format|\n if @package_request.update(package_request_params)\n format.html { redirect_to @package_request, notice: 'Package request was successfully updated.' }\n format.json { render :show, status: :ok, location: @package_request }\n else\n format.html { render :edit }\n format.json { render json: @package_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2140625290f127379c8d5a1795fa35d",
"score": "0.543586",
"text": "def action_update\n if @current_resource.installed\n converge_by \"Updated #{new_resource.id}\" do\n imcl :install, new_resource.id,\n update_by(new_resource.service_repository).join(' '),\n base_options\n end\n new_resource.updated_by_last_action(true)\n else\n Chef::Log.info \"#{new_resource.id_ver} not installed - nothing to do\"\n end\n load_new_resource_state\n new_resource.installed(true)\n end",
"title": ""
},
{
"docid": "fcb40dfd1226bf4169c0da7a64636c85",
"score": "0.5427232",
"text": "def update!(**args)\n @has_location_interpretation = args[:has_location_interpretation] if args.key?(:has_location_interpretation)\n @install_info = args[:install_info] if args.key?(:install_info)\n @is_generic = args[:is_generic] if args.key?(:is_generic)\n @nickname_tier = args[:nickname_tier] if args.key?(:nickname_tier)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "015e9cb4dd8a29b350fdee6b347b9d44",
"score": "0.54170513",
"text": "def update\n # cyber-dojo.sh does actual [update]\nend",
"title": ""
},
{
"docid": "3c0357900e8f8a2cb734c6e708577016",
"score": "0.54139954",
"text": "def update\n # Install in pacman can be used for update, too\n self.install\n end",
"title": ""
},
{
"docid": "3c0357900e8f8a2cb734c6e708577016",
"score": "0.54139954",
"text": "def update\n # Install in pacman can be used for update, too\n self.install\n end",
"title": ""
},
{
"docid": "b18f2190c61ab2dce77494811613c2ef",
"score": "0.5408721",
"text": "def update\n respond_to do |format|\n if @special_requirement.update(special_requirement_params)\n format.html { redirect_to @special_requirement, notice: 'Special requirement was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_requirement }\n else\n format.html { render :edit }\n format.json { render json: @special_requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e5447e829d6abe5c2bd06a39b1a9f5d",
"score": "0.5407941",
"text": "def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a7d90374eb77ad8dd9b96ee24a3a1b3a",
"score": "0.5406018",
"text": "def update\n product = Product.find(params[:id])\n product_details = params.permit(:title, :inventory_count, :price)\n\n product.update(product_details)\n\n render json: product\n end",
"title": ""
},
{
"docid": "e280d0326c6ec649f29fac3a4737430d",
"score": "0.54059875",
"text": "def update\n @specification = Specification.find(params[:id])\n\n respond_to do |format|\n if @specification.update_attributes(params[:specification])\n format.html { redirect_to @specification, notice: 'Specification was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @specification.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "982351d94a6bf2bede6acac57fc7aed0",
"score": "0.5403701",
"text": "def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end",
"title": ""
},
{
"docid": "010282a631a3a4255ebda1499e856c98",
"score": "0.5400878",
"text": "def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "45753f1b34794aed11ca67b937e2cc2f",
"score": "0.5400531",
"text": "def update\n @installation_site = InstallationSite.find(params[:id])\n\n respond_to do |format|\n if @installation_site.update_attributes(params[:installation_site])\n format.html { redirect_to @installation_site, notice: 'Installation site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @installation_site.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bd9dfcae3a4919e05763a0f0e20017a",
"score": "0.5398225",
"text": "def update!(**args)\n @supports_partial_fulfillment = args[:supports_partial_fulfillment] if args.key?(:supports_partial_fulfillment)\n @supports_synchronous_execution = args[:supports_synchronous_execution] if args.key?(:supports_synchronous_execution)\n end",
"title": ""
},
{
"docid": "5190bf4b476da05000dfb7844648271c",
"score": "0.539186",
"text": "def update\n respond_to do |format|\n if @request.update(package_params)\n format.html { redirect_to @request, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "024a1a2917f82beaa681eb1c2a42166e",
"score": "0.5391484",
"text": "def set_installation\n @installation = Installation.find(params[:id])\n end",
"title": ""
},
{
"docid": "5a5440a465e29d1f228f986a4ecdb8fa",
"score": "0.5390073",
"text": "def update\n if @package.update(package_params)\n render :show, status: :ok, location: @package\n else\n render json: @package.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f428de7e796d0a27fd38e8d1a64f1e4c",
"score": "0.5384356",
"text": "def UpdateTicket params = {}\n \n APICall(path: 'tickets.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "fc9828155463226cb3f56bd9cfb007a8",
"score": "0.53824997",
"text": "def update(attributes: {})\n attributes = attributes.with_indifferent_access\n clean_attributes(attributes)\n titleize(attributes)\n sync_tags(attributes)\n parse_ingredients(attributes)\n recipe.update(attributes)\n recipe_response\n rescue StandardError => e\n error_response(e)\n end",
"title": ""
},
{
"docid": "7cbcb2cda6e100042f124dacd474f3be",
"score": "0.5382236",
"text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "99de1ee51639b741650413b6ad94732a",
"score": "0.53798825",
"text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99de1ee51639b741650413b6ad94732a",
"score": "0.53798825",
"text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99de1ee51639b741650413b6ad94732a",
"score": "0.53798825",
"text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99de1ee51639b741650413b6ad94732a",
"score": "0.53798825",
"text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0116e532480bccbccdf20b1f2e4cde7",
"score": "0.5372408",
"text": "def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef3dfc97885dffb0ae06b626f339f369",
"score": "0.53714114",
"text": "def update\n @complaint = Complaint.find(params[:id])\n\n if @complaint.update_attributes(params[:complaint])\n head :no_content\n else\n render json: @complaint.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "256494593f6b47f3826c4e47c65276ac",
"score": "0.5370826",
"text": "def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to @request, notice: 'Request was successfully updated.' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82147f3248a47655c7e64cb63d529ece",
"score": "0.5367132",
"text": "def set_installation\n @installation = Installation.find(params[:id])\n end",
"title": ""
},
{
"docid": "82147f3248a47655c7e64cb63d529ece",
"score": "0.5367132",
"text": "def set_installation\n @installation = Installation.find(params[:id])\n end",
"title": ""
}
] |
e74f8f623d090b06c82c497621a5f2be
|
GET /auctions/1 GET /auctions/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "b910a495c53edc895db1065244ec3bb4",
"score": "0.77117133",
"text": "def index\n\t\t@auction_items = @auction.auction_items\n\t\trender json: @auction_items.as_json\n\tend",
"title": ""
},
{
"docid": "b87d39fffd897b27c5ea8b7b3c02fa57",
"score": "0.7681789",
"text": "def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end",
"title": ""
},
{
"docid": "b95b26e5445bcbec59708a8a6ec65c31",
"score": "0.75758666",
"text": "def show\n render json: @auction\n end",
"title": ""
},
{
"docid": "5aed1237d2ceaae37064ccd262eeb0b1",
"score": "0.7447109",
"text": "def show\n\t\trender json: @auction_item.as_json\n\tend",
"title": ""
},
{
"docid": "a3a63d696d3aaeecff0dfa1107ff8d15",
"score": "0.7319728",
"text": "def index\n user_id = @user.id\n @auctions = Auction.where(\"seller_id = ?\", user_id)\n\n # get all belong auctions\n render json: @auctions\n end",
"title": ""
},
{
"docid": "297de47d6e33ccb11e393c4466403c46",
"score": "0.71859163",
"text": "def show\n #@item = Bid.find(params[:auction_uniq_id])\n\n @bid = Bid.all\n @item = Item.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bid }\n end\n end",
"title": ""
},
{
"docid": "661aa0aa8dbc308da6d1abdb0df6e694",
"score": "0.7030111",
"text": "def show\n \n @auction = Auction.find(params[:id])\n\tadd_crumb @auction.title, ''\n\t\n\t# check the owner of auction\n\t@user = User.find(@auction.user_id)\n\t@owner = current_user == @user\n\t\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @auction }\n end\n end",
"title": ""
},
{
"docid": "72ceb73c3f78bddf2d0a51a95047a6a8",
"score": "0.7006114",
"text": "def index\n if current_user.admin? || current_user.creator?\n @auctions = Auction.all\n else\n @auctions = current_user.auctions\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @auctions }\n end\n end",
"title": ""
},
{
"docid": "eb6a6a1f9a9186c80503fcedaf4da60d",
"score": "0.6900339",
"text": "def new\n @auction = Auction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auction }\n end\n end",
"title": ""
},
{
"docid": "bd97d289d4476a0a5db0c79bc6f649b2",
"score": "0.6871605",
"text": "def index\n @auction_items = AuctionItem.all\n end",
"title": ""
},
{
"docid": "a31670fcf871556afdbc2ee8531464ab",
"score": "0.6832682",
"text": "def show\n @auction = Auction.find(params[:id])\n @auction_users = AuctionUser.find_all_by_auction_id(params[:id])\n if (@auction.phase == Auction::PHASES[:first]) || (@auction.phase == Auction::PHASES[:start]) && !(current_user.auction_admin?)\n @auction_user = AuctionUser.find_by_user_id(current_user.id)\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @auction }\n end\n end",
"title": ""
},
{
"docid": "e3405b4e7d50105cef9fc20ec880ba83",
"score": "0.6764159",
"text": "def index\n @auction1s = Auction1.all\n \n end",
"title": ""
},
{
"docid": "e03fad107dcff26b367bf853d6cf9cbb",
"score": "0.6754685",
"text": "def show\n @bidding = Bidding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bidding }\n end\n end",
"title": ""
},
{
"docid": "ae12ecb049875692f2963c08f0b3a1ee",
"score": "0.67412204",
"text": "def index\n @auctions = Auction.find_consignments\n respond_to do |format|\n format.html # index.rhtml\n end\n end",
"title": ""
},
{
"docid": "5e9bb9580a2a55272a0c35da5fcf937c",
"score": "0.6713402",
"text": "def index\n @bids = @item.auction.bids\n end",
"title": ""
},
{
"docid": "e84ca14a1f8d8209f7fdfedc104ab012",
"score": "0.67072374",
"text": "def index\n @comments = Comment.where(\n \"auction_id = ? \",\n params[:auction_id])\n\n render json: @comments\n end",
"title": ""
},
{
"docid": "42f16e1c3f051ae2e8a91c621c777cf4",
"score": "0.67071885",
"text": "def index\n #@auctions = Auction.all\n\t@search = Auction.search(params[:search])\n @auctions = @search.all\n\t@auctions = @search.paginate(:page => params[:page], :per_page => 8)\n\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @auctions }\n end\n end",
"title": ""
},
{
"docid": "c40e0bb153086f2ce1e21b786b75df8d",
"score": "0.66385025",
"text": "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",
"title": ""
},
{
"docid": "b304af310519f33cfcd4b914561396dc",
"score": "0.65081954",
"text": "def item(opts={})\r\n opts[:output] = 'json'\r\n opts[:callback] = 'callback'\r\n Yahoo::Request.get(\"http://auctions.yahooapis.jp/AuctionWebService/V2/auctionItem\", Yahoo::Api.merge(opts))\r\n end",
"title": ""
},
{
"docid": "598723c8e078cd26bcc6fcc69373ca42",
"score": "0.64939857",
"text": "def new\n authenticate_user!\n @auction = Auction.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auction }\n end\n end",
"title": ""
},
{
"docid": "91d853f4870c321cb12868365b28fd94",
"score": "0.6490676",
"text": "def show\n render json: @bid\n end",
"title": ""
},
{
"docid": "5489edbd8a42df3e7fd5773260eb30c5",
"score": "0.6420514",
"text": "def all \n @auctions\n end",
"title": ""
},
{
"docid": "bcd7b13d2b90ace9ed11d7c31b75d49f",
"score": "0.6415611",
"text": "def show\n @auction_item = AuctionItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @auction_item }\n end\n end",
"title": ""
},
{
"docid": "109a7a6c54e682207cd27f7099e1f702",
"score": "0.6410362",
"text": "def index\n\n @auctionables = Auctionable.all\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.6409855",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.6409855",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.6409855",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.6409855",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.6409855",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "fbbb29b25682ece4aa8aa89bf60916f8",
"score": "0.6325019",
"text": "def show\n @bid = current_user.bids.where(auction_id: params[:auction_id]).order(amount: :desc).offset(1).first\n end",
"title": ""
},
{
"docid": "3f8bcef5ad18ffa7278a52f4844c9280",
"score": "0.6323026",
"text": "def show\n @user = User.find_by_id(session[:user_id])\n @auction = Auction.find(params[:id])\n @seller = User.find_by_username(@auction.user_name)\n @bid = Bid.new\n @bid.auction_id = @auction.id\n @bid_count = Bid.find_by_sql(\"SELECT COUNT(auction_id) AS bid_count FROM bids WHERE auction_id = #{@auction.id}\")\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @auction }\n end\n end",
"title": ""
},
{
"docid": "b6236443d3530edd78e94f6a01b7ef8a",
"score": "0.6299152",
"text": "def index\n @merchant = Merchant.find(session[:user_id])\n \n @auctions = Auction.find(:all, :conditions => [\"`merchant_id` = ? and auction_start <= ? and auction_end >= ? and auction_ended != ? and auction_deleted != ?\",@merchant.merchant_id, Time.now.iso8601, Time.now.iso8601, \"1\", \"1\"], :order => \"auction_start desc\")\n \n @auctions.each do |a|\n url = URI.parse('http://beta.ayopasoft.com/AyopaServer/current-auction-info')\n post_args1 = {'auctionID' => a.auction_id}\n resp, data = Net::HTTP.post_form(url, post_args1)\n result = JSON.parse(data)\n \n a.current_price = result['current_price'] \n a.current_level = result['current_level']\n a.next_price = result['next_price']\n a.next_level = result['next_level']\n a.lowest_price = result['lowest_price']\n a.lowest_level = result['lowest_level']\n a.rebate_total = result['rebate_total']\n a.commission_total = result['commission_total']\n a.auction_total = result['auction_total']\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @merchants }\n end\n end",
"title": ""
},
{
"docid": "1c00b1f8ed55042cf6b529d329e4cd8f",
"score": "0.62975496",
"text": "def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end",
"title": ""
},
{
"docid": "7d3d29ec852dec17c42dde7340b47c2f",
"score": "0.6270434",
"text": "def index\n @bids = Bid.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bids }\n end\n end",
"title": ""
},
{
"docid": "83f80b7ee36a54cea62363a87f4557b5",
"score": "0.62403667",
"text": "def index\n @arrangements = Arrangement.query_list(params[:auction_id], params[:accept_status])\n render json: @arrangements, status: 200\n end",
"title": ""
},
{
"docid": "8e711ef13cb1187832cfe6aebc57cdfe",
"score": "0.6223402",
"text": "def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end",
"title": ""
},
{
"docid": "a2f6078b717fee4dbd8796306d82ecd1",
"score": "0.6220862",
"text": "def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "d12f956df1f83b2aebb1ccf339e0a0f7",
"score": "0.6217859",
"text": "def bid_lists\n\t\tauction_item_bids = @auction.auction_item_bids.where(user_id: current_user.id)\n\t\trender json: @auction_item_bids.as_json\n\tend",
"title": ""
},
{
"docid": "d4b1a15f0c3fe527a4d864d112e7cefb",
"score": "0.6209165",
"text": "def show\n @bowl = Bowl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bowl }\n end\n end",
"title": ""
},
{
"docid": "3830b81fe5a9779d4da12a30cda22c9d",
"score": "0.6195471",
"text": "def show\n @beer = BreweryDB.beer(params[:id]) \n render json: @beer\n end",
"title": ""
},
{
"docid": "da460a5d363429d78c81accc93afe7eb",
"score": "0.6177709",
"text": "def set_auction1\n @auction1 = Auction1.find(params[:id])\n end",
"title": ""
},
{
"docid": "c698ce9581c9b7c97123c87997545fe6",
"score": "0.6160314",
"text": "def show\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_bid }\n end\n end",
"title": ""
},
{
"docid": "00ad5e7cc7c3ad346bb6a8ad59645737",
"score": "0.61485684",
"text": "def set_bid\n @bid = Bid.find_by({\n :id => params[:id],\n :auction_id => params[:auction_id]})\n\n render json: nil, status: :not_found if @bid.nil? || @bid.auction.seller.id != @user.id\n end",
"title": ""
},
{
"docid": "d91c959fc3983db716c73f248c9d8dd3",
"score": "0.6147288",
"text": "def set_auction_item\n @auction_item = AuctionItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "20130e65e4e2a633a6fac37d24c91748",
"score": "0.61377746",
"text": "def index\n @birds = Bird.all.to_a\n begin\n respond_to do |format|\n format.json { render json: {items: @birds, description: \"List all visible birds in the registry\", additionalProperties: false, title: \"POST /birds [request]\",:status => OK } }\n end\n rescue => e\n render json: ({:status => INTERNAL_SERVER_ERROR})\n end\n end",
"title": ""
},
{
"docid": "12ea101542bab3130880457a7ba2bafe",
"score": "0.6090081",
"text": "def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end",
"title": ""
},
{
"docid": "00a226c4fd18011541ec66f182878c71",
"score": "0.6076621",
"text": "def show\n render \"api/v1/bounties/show\"\n end",
"title": ""
},
{
"docid": "d27c5ad51addd40b2ded3cccf0092cd9",
"score": "0.6075356",
"text": "def show\n render json: @bike #serializer: Web::V1::BikeSerializer\n end",
"title": ""
},
{
"docid": "f1ecd551292c2e222e24b12e90241dfc",
"score": "0.6058984",
"text": "def show\n\n\n @buisness = Buisness.find(params[:id])\n\n if @buisness==nil\n render text: \"Cannot find the specified buisness in the database\"\n end\n render json: @buisness\n end",
"title": ""
},
{
"docid": "0570b2322551a907621789b74652b7a7",
"score": "0.60571575",
"text": "def show\n @brewhouse = Brewhouse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brewhouse }\n end\n end",
"title": ""
},
{
"docid": "3b7cab920789f0b4a5a2a9d0e9b879f7",
"score": "0.60525316",
"text": "def set_auction_item\n @auction_item = AuctionItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "3b7cab920789f0b4a5a2a9d0e9b879f7",
"score": "0.60525316",
"text": "def set_auction_item\n @auction_item = AuctionItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "cd4c61ea9bdde46b6b0bb592f68611a4",
"score": "0.6048398",
"text": "def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end",
"title": ""
},
{
"docid": "7c076309d3c46a3400fcaaa6720da428",
"score": "0.6039756",
"text": "def new\n @bid = Bid.new\n @item = Item.find(params[:id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"title": ""
},
{
"docid": "111b4f0c6ecf31c93d8954bc01d0440b",
"score": "0.6025267",
"text": "def show\n @boat = Boat.find(params[:id])\n\n render json: @boat\n end",
"title": ""
},
{
"docid": "aa2121ebc65b1be1936c70fb0a890cfc",
"score": "0.6024872",
"text": "def show\n \trespond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bid }\n end\n end",
"title": ""
},
{
"docid": "2e41fc1af65af61e372a947173d45a09",
"score": "0.6014473",
"text": "def get_bike(bikeID, userID)\n user = User.find_by(id: userID)\n authorize_time_check(user)\n response = RestClient.get('https://www.strava.com/api/v3/gear/'+bikeID, {Authorization: 'Bearer ' + user.access_token})\n bike = JSON.parse(response)\n end",
"title": ""
},
{
"docid": "24743a4fe19e45305f2ac9cd74e0bbad",
"score": "0.60089546",
"text": "def show\n @broad = Broad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @broad }\n end\n end",
"title": ""
},
{
"docid": "47f7fa03a57868fccae1acfdaa08c8c6",
"score": "0.6005821",
"text": "def show\n @bike = Bike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bike }\n end\n end",
"title": ""
},
{
"docid": "7874a49fe8d66ff4f22e000b1dfd25e1",
"score": "0.5962852",
"text": "def show\n @borrower = Borrower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @borrower }\n end\n end",
"title": ""
},
{
"docid": "dc5b53685b45be2a58f2f81468ab8784",
"score": "0.594923",
"text": "def create\n @auction = Auction.new(auction_params)\n\n respond_to do |format|\n if @auction.save\n format.html { redirect_to @auction, notice: 'Запись успешно создана.' }\n format.json { render :show, status: :created, location: @auction }\n else\n format.html { render :new }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "978cc89b75e80c3a509be0afb9f8a0e8",
"score": "0.594636",
"text": "def create\n @auction = Auction.new(params[:auction])\n\t\n\t#authorize! :read, @auction\n\t\n respond_to do |format|\n if @auction.save\n format.html { redirect_to @auction, notice: 'Auction was successfully created.' }\n format.json { render json: @auction, status: :created, location: @auction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "957323d8865828d6bbf5d2175a413a7b",
"score": "0.59414667",
"text": "def show\n render(:json => Burn.find(params[:id]).as_json)\n rescue ActiveRecord::RecordNotFound\n render(:json => {error: \"no burn with that id found}\"}, :status => 404)\n end",
"title": ""
},
{
"docid": "e3e05a272d4d70bbade191d7694f809c",
"score": "0.59281564",
"text": "def index\n \n @admins = Admin.find(:all)\n \n @merchants = Merchant.find(:all, :order => \"merchant_name\")\n \n @auctions = Auction.find(:all, :conditions => [\"auction_start <= ? and auction_end >= ? and auction_ended != ? and auction_deleted != ?\", Time.now.iso8601, Time.now.iso8601, \"1\", \"1\"], :order => \"auction_start desc\")\n \n @auctions.each do |a|\n url = URI.parse('http://beta.ayopasoft.com/AyopaServer/current-auction-info')\n post_args1 = {'auctionID' => a.auction_id}\n resp, data = Net::HTTP.post_form(url, post_args1)\n result = JSON.parse(data)\n \n a.current_price = result['current_price'] \n a.current_level = result['current_level']\n a.next_price = result['next_price']\n a.next_level = result['next_level']\n a.lowest_price = result['lowest_price']\n a.lowest_level = result['lowest_level']\n a.rebate_total = result['rebate_total']\n a.commission_total = result['commission_total']\n a.auction_total = result['auction_total']\n if a.auction_end < Time.now.iso8601 \n a.auction_expired = 1\n end\n \n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admins }\n end\n end",
"title": ""
},
{
"docid": "eeb2df02ad036fc5fc8ac91ad6ae0933",
"score": "0.5926675",
"text": "def index\n @auction_values = Auction::Value.all\n end",
"title": ""
},
{
"docid": "e447010eb13de818c8ae2913a07b128b",
"score": "0.59252614",
"text": "def show\n coin = Coin.find(params[:id]) \n require 'net/http'\n url = url = \"https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=#{coin.coin_api_id}&order=market_cap_desc&per_page=100&page=1&sparkline=false&price_change_percentage=1h\"\n request = URI.parse(url)\n response = Net::HTTP.get_response(request)\n crypto_hash = JSON.parse(response.body)\n coin.image = crypto_hash[0]['image']\n coin.current_price = crypto_hash[0]['current_price']\n coin.price_change_percentage_1h_in_currency = crypto_hash[0]['price_change_percentage_1h_in_currency']\n coin.high_24h = crypto_hash[0]['high_24h']\n coin.low_24h = crypto_hash[0]['low_24h']\n coin.total_volume = crypto_hash[0]['total_volume']\n coin.market_cap = crypto_hash[0]['market_cap']\n coin.market_cap_rank = crypto_hash[0]['market_cap_rank']\n coin.circulating_supply = crypto_hash[0]['circulating_supply']\n\n # Serializer\n # render json: CoinSerializer.new(coin)\n render json: coin\n end",
"title": ""
},
{
"docid": "73f18c754746aadbb4023c6aa04b5412",
"score": "0.59114796",
"text": "def show\n @our_coin = OurCoin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @our_coin }\n end\n end",
"title": ""
},
{
"docid": "ddb62ae03e0d4af63fc7265afd669e89",
"score": "0.588315",
"text": "def index\n @birds = Bird.where(visible: true)\n render json: @birds, status: 200\n end",
"title": ""
},
{
"docid": "f92c7e9548b1af904366a59f4ac1ec90",
"score": "0.5881555",
"text": "def create\n @auction = Auction.new(params[:auction])\n @auction.phase = Auction::PHASES[:init]\n respond_to do |format|\n if @auction.save\n format.html { redirect_to @auction, notice: t('auctions.flash.notice.created') }\n format.json { render json: @auction, status: :created, location: @auction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa8212221120563726c085c14bfb7d10",
"score": "0.58786595",
"text": "def show\n @booking = Booking.find(params[:id])\n render json: @booking\nend",
"title": ""
},
{
"docid": "00f1eee8f96fa09d001504e7735a3875",
"score": "0.5877665",
"text": "def items_for_bidder\n @auction_item = AuctionItem.where([\"bidderNumber = ?\", params[:id]])\n\n respond_to do |format|\n format.html # items_for_bidder.html.erb\n end \n end",
"title": ""
},
{
"docid": "82d750ba7ebe9ab73331ddede0ef7f15",
"score": "0.58570397",
"text": "def show\n @holding = Holding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @holding }\n end\n end",
"title": ""
},
{
"docid": "76a96804f2117432d5d0d99e0e9c50a6",
"score": "0.58552426",
"text": "def index\n @brochures = Brochure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brochures }\n end\n end",
"title": ""
},
{
"docid": "6b21ccb82548e5d048b5c6c50517cb2a",
"score": "0.58497745",
"text": "def create\n @auction = Auction.new(auction_params)\n @auction.seller = @user\n\n if @auction.save\n render json: @auction, status: :created, location: seller_auction_url(@auction)\n else\n render json: @auction.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f607a29fca4bdaba2f3d8a9682e0bd05",
"score": "0.58389753",
"text": "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"title": ""
},
{
"docid": "f607a29fca4bdaba2f3d8a9682e0bd05",
"score": "0.58389753",
"text": "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"title": ""
},
{
"docid": "42668e70d291f1fd839aaca9ca3748ae",
"score": "0.5837997",
"text": "def bird_specification\n @bird = Bird.find(params[:id])\n if @bird\n @bird = JSON.parse(@bird.to_json)\n @bird[\"id\"]=params[:id]\n render json: @bird.except(\"_id\"), status: :ok\n else\n render :nothing => true, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "4a2b45925a115751df0545dedf8f60b6",
"score": "0.5834426",
"text": "def get_brandings\n request :get, \"/v3/brandings.json\"\n end",
"title": ""
},
{
"docid": "620ecaf9c5f8cc47909ec1122cff52f4",
"score": "0.58333135",
"text": "def show_beer\n render json: BreweryDb::ShowBeer.new(params[:beerId]).results\n end",
"title": ""
},
{
"docid": "8ef701f198b4c61bf82f1bcd05950f70",
"score": "0.5831111",
"text": "def index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end",
"title": ""
},
{
"docid": "374c9c7ada402868aba26df646949580",
"score": "0.5829337",
"text": "def new\n @bidding = Bidding.new\n @item = Item.find(cookies[:remember_item_token])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bidding }\n end\n end",
"title": ""
},
{
"docid": "2d1ae097967286723bef6e3fb3331cde",
"score": "0.5825951",
"text": "def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend",
"title": ""
},
{
"docid": "677f37423a892f21f107104c81edb97f",
"score": "0.5821725",
"text": "def index\n @holdings = Holding.select(\"*, ((bid - price) * qty) as gain\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holdings }\n end\n end",
"title": ""
},
{
"docid": "a7aed0159e7cfff04dbbff9323321681",
"score": "0.5821339",
"text": "def index\n @biddings = Bidding.all\n end",
"title": ""
},
{
"docid": "60e04edee2724f5075796812ac7a8f5b",
"score": "0.5798223",
"text": "def show\n @brochure = Brochure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brochure }\n end\n end",
"title": ""
},
{
"docid": "963dc7a6eef3fdde1e4caa982e2b42bd",
"score": "0.5793851",
"text": "def show\n @brain = Brain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brain }\n end\n end",
"title": ""
},
{
"docid": "a237e46c2556457059cba95aab526bae",
"score": "0.5786941",
"text": "def show\n @bidding = params[:bidding]\n @bid_event = BidEvent.new\n @bid_amount = @auctionable.bid_events.blank? ? @auctionable.base_price : @auctionable.bid_events.last.amount\n @participants = Participant.all\n render layout: 'application'\n end",
"title": ""
},
{
"docid": "85097bb250194cfe6f333f24ac4e5fbb",
"score": "0.5780737",
"text": "def create\n \tbid_p = (params[:bid] || {}).merge({user:current_user})\n \tbegin\n\t\t @bid = @auction.bid(bid_p)\n\t\t respond_to do |format|\n\t\t if @bid.save\n\t\t format.html { redirect_to @auction, notice: t(:bid_created) }\n\t\t format.json { render json: @auction, status: :created, location: @bid }\n\t\t else\n\t\t format.html { render action: \"new\" }\n\t\t format.json { render json: @bid.errors, status: :unprocessable_entity }\n\t\t end\n\t\t end\n\t rescue Exception => e\n\t \tredirect_to @auction, notice: t(:auction_closed) if e.message == 'Auction Closed'\n\t end\n end",
"title": ""
},
{
"docid": "e8f896014b373ca98fd9abb15856ad75",
"score": "0.57784504",
"text": "def list_ingredients\n rid = params[:id]\n items = Aws.get_ingredients_from_db(rid)\n render :json => items\n end",
"title": ""
},
{
"docid": "62de74584f20732a2af2dc7b0f3569a2",
"score": "0.5777769",
"text": "def show\n @bili = Bili.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bili }\n end\n end",
"title": ""
},
{
"docid": "40c109ec954dd1d0bb0dd109c5e494f4",
"score": "0.57774156",
"text": "def index\n @bills = @dwelling.bills\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end",
"title": ""
},
{
"docid": "650d44db57535307470d698e8385728b",
"score": "0.57742393",
"text": "def show\n @borrow_request = BorrowRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @borrow_request }\n end\n end",
"title": ""
},
{
"docid": "19776ccc61bb3c7a49b0af52774e2d38",
"score": "0.5772983",
"text": "def show\n @boat = Boat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json {render json: @boat}\n end\n end",
"title": ""
},
{
"docid": "419c55bdaf3c1e033350ab5dcd3660b3",
"score": "0.57682437",
"text": "def show\n render json: @used_bike, serializer: Web::V1::UsedBikeSerializer\n end",
"title": ""
},
{
"docid": "436fc82cc08e9f37ca2649e61a871e85",
"score": "0.57673484",
"text": "def show\n @bid = @swarm_request.bids.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bid }\n end\n end",
"title": ""
},
{
"docid": "7cba67eb5278730a68bff9a8d51b06ba",
"score": "0.57614154",
"text": "def index\n @utilized_bitcoin_wallets = UtilizedBitcoinWallet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @utilized_bitcoin_wallets }\n end\n end",
"title": ""
},
{
"docid": "258ed7f3ee33e8737f4abf28b7225395",
"score": "0.5761193",
"text": "def getbatteries\n puts params\n buildid = params[\"buildingid\"]\n\n batteries = Battery.where(:building_id => buildid)\n\n puts batteries.inspect\n puts \"#################################################\"\n \n respond_to do |format|\n format.json { render json: batteries }\n end\n end",
"title": ""
},
{
"docid": "0bbca1c30010863af6d23f0b93fab80f",
"score": "0.5746901",
"text": "def show\n @photo_booth = PhotoBooth.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo_booth }\n end\n end",
"title": ""
},
{
"docid": "7a65f0ec4d37e0b6965a12fee12d9b9e",
"score": "0.5745803",
"text": "def show\n bike = Bike.find(params[:id]);\n render json: {status: 'SUCCESS', message:'Loaded bike', data:bike}, status: :ok\n end",
"title": ""
},
{
"docid": "7434de9c0888830cf7b4b4e1336b45b5",
"score": "0.5741575",
"text": "def show\n @bet = Bet.find_all_by_id(params[:id])\n # session[\"last_bet_id\"] = @bet.id\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end",
"title": ""
},
{
"docid": "9628cbd7217e4f94a674bfe1014d714d",
"score": "0.5740956",
"text": "def show\n render json: Agent.find(params[:id]).buyers\n end",
"title": ""
}
] |
9557e604f3cb39e58eb194238e1806db
|
image location ??????? Create a database of images that have location name and url loop through and see how many image has location that is not NIL or empty [] location = result["data"][19]["location"]["name"] count = how many friends who likes her
|
[
{
"docid": "ee315280c99bdd9fb35018093aa0ba3a",
"score": "0.5649503",
"text": "def count\ncount = result[\"data\"][1][\"likes\"][\"count\"]\nend",
"title": ""
}
] |
[
{
"docid": "778519ecd25dcdccfd3048b46ccdcaac",
"score": "0.66854066",
"text": "def find_trail_and_counts(data_with_location)\n trail_data = Hash.new(0)\n data_with_location.each do |image|\n name = image.location.name\n trail_data[name] += 1\n end \n return trail_data\n end",
"title": ""
},
{
"docid": "fa04466f28fdc6c578fb2d1668d60163",
"score": "0.623237",
"text": "def friendPhotos\n\t\tid = params[:id]\n\t\tcountry = params[:location]\n\t\t@user = User.find_by(fb_id: id)\n\t\tlocations = @user.locations.all\n\t\t@locations = []\n\t\tlocations.each do |location|\n\t\t\t@locations.push(code(location.location_name)) unless @locations.include? code(location.location_name)\n\t\tend\n\t\tif (country)\n\t\t\t@photos = @user.photos.where(location_name: country)\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json { render :json => { msg: @photos, user: @user }}\n\t\t\tend\n\t\telse\n\t\t\tsorted_photos = @user.photos.sort_by &:updated_at\n\t\t\tif (sorted_photos.length >= 1)\n\t\t\t\t@recent_location = sorted_photos[0].location_name \n\t\t\t\t@recent_photos = @user.photos.where(location_name: @recent_location)\n\t\t\telse\n\t\t\t\t@recent_location = \"nowhere\"\n\t\t\t\t@recent_photos = []\n\t\t\tend\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json { render :json => { msg: @recent_photos, user: @user, locations: @locations }}\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5edf002508ab8569060013c1b196d117",
"score": "0.61942023",
"text": "def location\n @images = Photo.where(image_type: :location).paginate(page: params[:page], per_page: 12)\n end",
"title": ""
},
{
"docid": "9a6a77f43804c2badc7ae8d583e4a625",
"score": "0.6188061",
"text": "def pictures\n fb = fbobject\n @photos = []\n @myphotos = fb.get_connections(\"me\", \"photos\")\n @fbfriends = fb.get_connections(\"me\", \"friends\", :fields => \"id,name,gender,relationship_status,first_name,last_name,picture\")\n i = 0\n @fbfriends.each do |friend|\n #friends_friends = fb.get_connections(friend['id'], \"friends\", :fields => \"id,name,gender,relationship_status,first_name,last_name,picture\")\n friendsphotos = fb.get_connections(friend['id'], \"photos\")\n @photos << friendsphotos\n i = i + 1\n if i > 10\n break\n end\n end\n\n p = @photos\n end",
"title": ""
},
{
"docid": "d3d70ae50c7255859a7a061dd8943463",
"score": "0.60959375",
"text": "def filteredimgcounts\n mypics = params[:mypics]\n if mypics.nil?\n mypics = 0\n end\n\n followingpics = params[:followingpics]\n if followingpics.nil?\n followingpics = 0\n end\n\n query = ::Image.filteredimgcounts(params[:auth_token], params[:lat], params[:long], params[:radius],\n params[:altmin], params[:altmax],\n params[:timemin], params[:timemax],\n params[:taglist], params[:userlist],\n mypics, followingpics)\n # This will issue a query, but only with the attributes we selected above.\n # It also returns a simple Hash, which is significantly more efficient than a\n # full blown ActiveRecord model.\n results = ActiveRecord::Base.connection.select_all(query)\n render json: results\n end",
"title": ""
},
{
"docid": "e37d6f2169aa2555dcb158ef5e200af1",
"score": "0.60955375",
"text": "def profile_image_happiness img = nil\n if img != nil\n #formatting url\n img = img + \"?x=.png\"\n #pp :info, \"Searching for face in #{img}\"\n \n #executing search\n arr = @client.detect_faces(img) #call whatever calls the FaceAPI\n arr = smile_info(arr) #format the search results\n return 0 if arr.length == 0\n # expecting arr = [[boolean,int],[boolean,int].....]\n\n #pp :info, \"faces array: #{arr}\"\n \n #tabulating results\n score = 0\n arr.each do |n|\n s = n[1]\n s *= -1 if !n[0]\n score += s\n end\n score.to_f / arr.length.to_f\n else\n 0\n end # if != nil\n end",
"title": ""
},
{
"docid": "d28693057819691a46f99135e8729ce7",
"score": "0.6021227",
"text": "def fill_images\n\t \n interval = ((self.max_timestamp - self.min_timestamp) / interval_count )\n \n instagram = Instaconcert::Instagram.new(:client_id => \"46bd5797cd3d4ea685cbe3372510cf0c\")\n \n instagram_image_array = []\n #Make the API Media/Search calls\n interval_count.times do |i| \n insta_call = instagram.media_search(self.lat, self.long, \n self.max_timestamp - interval*(interval_count-(i+1)),\n self.min_timestamp + interval*(i), \n self.distance)\n\n if ( !insta_call[\"data\"].nil? && insta_call[\"meta\"][\"code\"] = 200 ) then\n instagram_image_array += insta_call[\"data\"]\n end\n end\n \n max_likes = 0\n \n instagram_image_array.each_with_index do |img, i|\n new_img = Image.new\n new_img.fill_image(img)\n new_img.event_id = self.id\n new_img.save\n \n #this is broken \n if new_img[:like_count] >= max_likes then\n self.thumb_img_id = new_img[:id]\n self.save \n end\n \n end\n end",
"title": ""
},
{
"docid": "68d2fe87b4536bd9386c3542569063ad",
"score": "0.5998182",
"text": "def image_location\n \"#{location.name}, on image ##{location.image_id} (#{image})\" if location\n end",
"title": ""
},
{
"docid": "d936b357c3826a4879d711f0715ad6fe",
"score": "0.59661525",
"text": "def recent_instagram_images(latitude,longitude)\n counter = 0\n response = nil\n while counter < 5 && !response\n begin\n response = Instagram.media_search(latitude,longitude)\n puts counter += 1\n rescue Instagram::BadRequest => e\n e.inspect\n end\n end\n\n return response.map do |item|\n item.images.low_resolution.url\n end\nend",
"title": ""
},
{
"docid": "85f0f3835285d6656a7ced4eac295608",
"score": "0.5960309",
"text": "def image_location\n data.image_location\n end",
"title": ""
},
{
"docid": "0a855390221cbc47299b34f4f0dcd7a1",
"score": "0.59489447",
"text": "def instagram_ll(lat, long)\n meters_in_km = 1000\n\n entities = []\n\n # there are lots of issues with Instagram's media search, so let's try to catch them\n begin\n\n images = Instagram.media_search(\n lat.to_s,long.to_s,\n :distance => 5000, # largest radius possible\n :min_timestamp => (Time.now.tv_sec - 5*3600)) # max age = 5 hours ago\n\n rescue Instagram::BadRequest => e\n\n puts e.message\n return entities\n\n end\n\n if !images.empty?\n images.each do |image|\n entity = Entity.new\n\n # # TODO get followers_count, media_count, maybe we'll use this to influence interestingness\n # image_user = Instagram.user(image.user.id)\n # followers_count = image_user.counts.followed_by\n # media_count = image_user.counts.media\n\n entity.type = \"image\"\n entity.source = \"Instagram\"\n entity.external_url = image.link\n entity.media_url = image.images.standard_resolution.url\n\n entity.posted_at = Time.at(image.created_time.to_i)\n entity.username = image.user.username\n entity.real_name = image.user.full_name\n\n # Build caption using the location name, if it exists,\n # and then add the actual Instagram caption\n entity.caption = \"\"\n if image.location.is_a?(Hash) && !image.location.name.nil?\n entity.caption += image.location.name + \": \"\n end\n if !image.caption.nil? && !image.caption.text.nil?\n entity.caption += image.caption.text\n end\n\n # need to do it this way or there are problems with the method 'count'\n likes_count = image.likes[\"count\"]\n comments_count = image.comments[\"count\"]\n # comments need a boost, since they are usually fewer in number\n activity = likes_count + comments_count * 10.0\n\n # graph this at desmos.com/calculator\n # will return a number from ~0 to less than 100, which is the asymptote\n entity.interestingness = (1 / Math.log(1/(0.0003*activity + 1.01))).to_i + 100\n\n entity.radius_distance = Geocoder::Calculations.distance_between([lat, long], [image.location.latitude, image.location.longitude]) * meters_in_km\n\n # # TODO set displayability_rank\n # entity.displayability_rank\n\n # let's store the entire object in here too!\n entity.data = image\n entities << entity\n end\n end\n\n return entities\n end",
"title": ""
},
{
"docid": "7b46c7fa33057ed043cf46cf53917586",
"score": "0.58919036",
"text": "def get_number_of_images\n find_elements(FOUND_IMAGES).size\n end",
"title": ""
},
{
"docid": "9cdca0c042088649710dcba3b2310537",
"score": "0.58697695",
"text": "def find_data_with_location(all_data)\n @data_with_location = Array.new\n all_data.each do |image|\n unless image.location.nil?\n @data_with_location << image\n end\n end\n return @data_with_location\n end",
"title": ""
},
{
"docid": "fb4cec184d566a6f8e9d3b8986338f87",
"score": "0.586546",
"text": "def photos_count(dato)\n camera = dato['photos'].map{|x| x['name']}\n cantidad = (dato['photos'].map{|x| x['name']}).count\n pp \"Son #{cantidad} Fotos\"\nend",
"title": ""
},
{
"docid": "d946cd70cffd00f7b8c96d1831dc1365",
"score": "0.58607954",
"text": "def photos_count (data)\n photos = data[\"photos\"].map{|x| x['camera']['full_name']} #buscando las camaras en el hash\n cam = \"\"\n photos.each do |name|#generando el hash\n cam += \"{#{name}}\"\n end\n puts cam\n puts photos.count\nend",
"title": ""
},
{
"docid": "e513aacbae1460aa62c674f403498307",
"score": "0.58592147",
"text": "def index\n profile=YelpTools.search('33127', yelp_parameters(\"Nightlife\", 40))\n @image_urls=[]\n \n profile.businesses.each do |biz|\n biz.image_url\n found_place=Place.find_or_create_by(name: biz.name, address: biz.location.address.flatten.join, phone: biz.phone, city: biz.location.city, state_code: biz.location.state_code, postal_code: biz.location.postal_code, neighborhoods: get_neighborhood(biz), coordinate_latitude: biz.location.coordinate.latitude, coordinate_longitude: biz.location.coordinate.longitude, yelp_id: biz.id, image_url: biz.image_url)\n # found_place.image_url=biz.image_url\n @image_urls << biz.image_url\n end\n\n @places = Place.all\n \n unless session[:user_id]\n @places=Place.first 3\n @image_urls=@image_urls.slice 0,3\n end\n end",
"title": ""
},
{
"docid": "d30e4fca14263e51a5ac76ed4d9f6509",
"score": "0.5858589",
"text": "def friends_with_pictures\n @client.selection.me.friends.info![\"data\"].each do |friend|\n friend[\"picture\"] = @client.selection.user(friend[:id]).picture\n end\n end",
"title": ""
},
{
"docid": "42e72425bc0e07ae4105349205ead432",
"score": "0.5841323",
"text": "def images_count\n process_response(get('/images_count'))[\"images_count\"][\"count\"]\n end",
"title": ""
},
{
"docid": "0458df0c39276f2915d0a800a685d8cb",
"score": "0.583872",
"text": "def photos_count (data)\n photos = data[\"photos\"].map{|x| x['camera']['full_name']} #buscando las camaras en el hash\n cam = \"\"\n photos.each do |name|#generando\n cam += \"{#{name}}\"\n end\n puts cam\n puts photos.count\nend",
"title": ""
},
{
"docid": "238027aa3b9e593d93542a7ac0f44d8d",
"score": "0.5837835",
"text": "def google_image_info(name,start_time)\n google_image_links = []\n count = 0\n begin\n Google::Search::Image.new(:query => (name+\" gameplay\")).each do |image|\n if image.width > 700 \n google_image_links<< image.uri\n count+=1\n end\n if count>15\n break\n end\n end\n rescue\n if Time.now<start_time+8.seconds\n sleep(0.2)\n google_image_info(name,start_time,false)\n else \n return google_image_links\n end\n end\n return google_image_links\n end",
"title": ""
},
{
"docid": "33b46772b6641e3027b733ca7b3a425a",
"score": "0.5824762",
"text": "def photos_count(hash)\n n_photo = Hash.new(0) #hash que devuelve el numero de fotos\n hash['photos'].each do |reco|\n x = reco[\"camera\"][\"full_name\"]# x es una variable creada por mi\n if n_photo[x] \n n_photo[x] += 1\n else \n n_photo[x] = 1\n end\n end\n return n_photo\nend",
"title": ""
},
{
"docid": "304601de2b611c34662ccd339fa6f070",
"score": "0.58096445",
"text": "def get_place_image prefecture_name, place_name\n search_name = [prefecture_name, place_name].join(' ')\n doc = Nokogiri::HTML(open(URI.encode(\"http://kanko.travel.rakuten.co.jp/tabinote/search/#{search_name}/\"))) \n result = doc.xpath('//div[@id=\"resultArea\"]/div[@id=\"result\"]')\n image_url = result.empty? ? '' : doc.css('div#result ul li#spot01 span.spotPhoto img')[0]['src']\n temp_image_url = image_url\n temp_image_url['/thumb/'] = '/normal/' if temp_image_url.include?('/thumb/')\n \n file_exists?(temp_image_url) ? temp_image_url : image_url\nend",
"title": ""
},
{
"docid": "848a44f78af185191c43dc9732daf54a",
"score": "0.5761193",
"text": "def image_count\n records.length\n end",
"title": ""
},
{
"docid": "d7fc20f85eb5cc7c2e7a643792f5bd11",
"score": "0.57592916",
"text": "def photos_count(hash)\n new_hash={}\n new_hash1={}\n new_arr=[]\n h={}\n hash.each do |k,v|\n v.each do |q, b|\n new_hash.merge!(q.select {|x| x == \"camera\"})\n new_hash.each do |l, m|\n m.each do |n, o|\n new_hash1.merge!(m.select {|z| z == \"full_name\" })\n end\n new_hash1\n end\n new_hash1.each do |i, l|\n new_arr.push(l)\n end\n end\n end\n h= Hash.new(0)\n new_arr.each {|v| h.store(v, h[v]+1)}\n h\nend",
"title": ""
},
{
"docid": "d1cb45663a0446b79aab2be8f26f6363",
"score": "0.5737175",
"text": "def image_urls\n photos = @data[\"photos\"][0]\n original_size = photos[\"original_size\"]\n alt_sizes = photos[\"alt_sizes\"]\n alt_maxes = alt_sizes.sort_by{|img| -(img[\"width\"] * img[\"height\"]) }\n\n images = []\n images << original_size[\"url\"] if original_size\n images.concat(alt_maxes.map{|p| p[\"url\"] } )\n\n images\n end",
"title": ""
},
{
"docid": "45661d3fc1e4e03190ef50c645c8279b",
"score": "0.5729136",
"text": "def images_node\n json[\"images\"] || json[\"smallImageUrls\"].collect { |url| {\"hostedSmallUrl\" => url} }\n end",
"title": ""
},
{
"docid": "5324c4a86417b56b13b0c46193f78945",
"score": "0.57286507",
"text": "def filtered\n mypics = params[:mypics]\n if mypics.nil?\n mypics = 0;\n end\n\n followingpics = params[:followingpics]\n if followingpics.nil?\n followingpics = 0;\n end\n\n @images = Image.filteredmeta(params[:auth_token], params[:lat], params[:long], params[:radius],\n params[:altmin], params[:altmax],\n params[:timemin], params[:timemax],\n params[:taglist], params[:userlist],\n mypics, followingpics, params[:maxcount])\n\n respond_to do |format|\n format.html { render 'index' }\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "83fe2805accddca9407ca22a334b401c",
"score": "0.5718592",
"text": "def show\n find_location\n #@images = @location.images.showable.published.find(:all, {:order => 'is_main_image DESC'})\n @images = @location.images.showable.find(:all, {:order => 'is_main_image DESC'})\n \n location_url = location_rewrite_url(create_rewrite_hash(@location.rewrite))\n \n if @images.length > 0\n image_path = root_url + get_location_image_path(@images.first, {:size => :fancybox})\n else\n image_path = \"#{root_url}/images/logo_de_cup.jpg\"\n end\n image_path.gsub!('//', '/')\n \n @facebook_tags['og:type'] = 'restaurant'\n @facebook_tags['og:url'] = location_url\n @facebook_tags['og:image'] = image_path\n \n if geo_location = @location.geo_location\n @facebook_tags['og:latitude'] = geo_location.lat\n @facebook_tags['og:longitude'] = geo_location.lng\n end\n @facebook_tags['og:street-address'] = @location.street\n @facebook_tags['og:locality'] = @location.zip_code.city.name\n @facebook_tags['og:region'] = @location.zip_code.city.state.name\n @facebook_tags['og:postal-code'] = @location.zip_code.code\n @facebook_tags['og:country-name'] = 'Germany'\n @facebook_tags['og:email'] = @location.email if @location.email?\n @facebook_tags['og:phone_number'] = @location.phone if @location.phone?\n @facebook_tags['og:fax_number'] = @location.fax if @location.fax?\n \n @twitter_tags['twitter:url'] = location_url\n @twitter_tags['twitter:image'] = image_path\n \n @schema_org_tags['image'] = image_path\n \n @locations_close_to_this = locations_close_to_this(@location)\n\n @map_locations = map_marker_data(@location, true)\n \n @page_header_tags_configurator.set_location(@location)\n \n get_review_template_with_questions(@location)\n end",
"title": ""
},
{
"docid": "db24bc1208d428b3ad25dfdef89e9691",
"score": "0.5700401",
"text": "def images_location\n dc_get_site.params.dig('dc_image', 'location') || 'images'\nend",
"title": ""
},
{
"docid": "b41b4e15ddade040ff047e85a171db5b",
"score": "0.5699759",
"text": "def check_img\n arr = []\n # todo: only load the image refs, no need to load entire image object for each row\n images = Image.recent_user_images(@user.id)\n arr = images.collect { |img| img.image_ref }\n\n # return array in a hash, we may need to add other properties later\n render :json => {:refs => arr}, :callback => params[:callback]\n end",
"title": ""
},
{
"docid": "24153c657cd23665245a62b394c65c74",
"score": "0.5691206",
"text": "def getPhotoStack(parsedJson)\n counter = 0\n while parsedJson['data']['children'][counter] != nil\n imagesURL = parsedJson['data']['children'][counter]['data']['url']\n \n #Following conditional treats case where link in reddit node is a .jpg or .png\n puts \"tester #{imagesURL[-4]}\"\n if imagesURL[-4] == '.'\n return imagesURL \n \n else\n biggestPhotoUrl = findBiggestPhotoUrl(imagesURL)\n puts \"\\n\\n Photo from reddit node #{counter} from url:#{imagesURL} - #{biggestPhotoUrl} \\n\\n\"\n @photo_set << biggestPhotoUrl\n counter += 1\n end\n end\n \n\n end",
"title": ""
},
{
"docid": "2abab322ac77d48e8cb739a8aac0c174",
"score": "0.5690754",
"text": "def photo_count\n self.dig_for_integer(\"listingSummary\", \"photoCount\")\n end",
"title": ""
},
{
"docid": "222a9441430f3683424f340ff51b2a32",
"score": "0.5688412",
"text": "def by_friends\n filtered_params[:sort_direction] = \"desc\"\n filtered_params[:sort_field] = \"images.created_at\"\n images = current_user.friends_images.public_access.paginate_and_sort(filtered_params)\n render json: images, meta: { total: images.total_entries }\n end",
"title": ""
},
{
"docid": "37bd2b4c9c5fe9c96a0fe76a0cbd4f28",
"score": "0.5684969",
"text": "def get_images_url(lat,lng)\n photos = []\n latitude = (lat+0.01).to_s\n longitude =(lng+0.01).to_s\n url = 'http://www.panoramio.com/map/get_panoramas.php?set=public&from=0&to=20&minx='+lng.to_s+'&miny='+lat.to_s+'&maxx='+longitude+'&maxy='+latitude+'&size=original&mapfilter=true'\n status = Timeout::timeout(30){\n response = HTTParty.get(url)\n json = JSON.parse(response.body)\n count = 0\n json['photos'].each do |photo|\n if(count <= 5 and photo['width'] >= 1000 and photo['width'] <= 2000 and photo['height'] <= 1000)\n photos.append(photo)\n count = count + 1\n end\n end\n }\n return photos\n end",
"title": ""
},
{
"docid": "0fd9afbb72851c5698573d991740e2e4",
"score": "0.5683448",
"text": "def count_images(image_name)\n image_count = 0\n for i in 1..@num_frames\n $ie.frame(:index, i).images.each do |image|\n if image.src =~ /#{image_name}/\n image_count +=1\n end\n end\n end\n puts \"Found #{image_count} occurences of #{image_name}\"\n return image_count\n end",
"title": ""
},
{
"docid": "a7d002bedf35d9523e30a85a02073c88",
"score": "0.56829906",
"text": "def like_count\n Like.count(:conditions=>[\"likable_id=? and likable_type=?\",self.id,\"Image\"])\n end",
"title": ""
},
{
"docid": "410fb15112f85c66ad4400112c942f25",
"score": "0.5670598",
"text": "def like_image\n @like += 1\n end",
"title": ""
},
{
"docid": "29bacf294494ffb686bb6f646ead271b",
"score": "0.5644694",
"text": "def cant(hash)\n list_cam = ''\n n_photo = Hash.new(0) #hash que devuelve el numero de fotos\n hash['photos'].each do |reco|\n x = reco[\"camera\"][\"full_name\"]# x es una variable creada por mi\n if n_photo[x] \n n_photo[x] += 1\n else \n n_photo[x] = 1\n end\n end\n\n n_photo.each do |key, value|\n list_cam += list_g(key, value.to_s)\n end\n return list_cam\nend",
"title": ""
},
{
"docid": "e4407b1ebbaf3139d3e4e62104ccea1c",
"score": "0.5634562",
"text": "def num_photo(id_user)\n msg_query(id_user).map { |msg| msg['foto']}.sum \nend",
"title": ""
},
{
"docid": "8729e5c7bbd6d82a0fc12df7b55924e5",
"score": "0.5624408",
"text": "def hood_pic\n foo = []\n self.activities.each do |activity|\n activity.reviews.each do |review|\n if review.picture\n foo << review.picture\n end\n end\n end\n foo.sample.img_url\n end",
"title": ""
},
{
"docid": "a9d865edc82aba8ef50eabe05ff23ac8",
"score": "0.5613732",
"text": "def pixi_count loc\n active_pixis_by_site(loc).size rescue 0\n end",
"title": ""
},
{
"docid": "5ffa72de04354a1b4720de8d8e2c14c5",
"score": "0.5611786",
"text": "def index\n @city = Location.find_by_woeid(params[:woeid])\n @trends = Trend.search_trends(params[:woeid])\n\n @trend_names = @trends.map { |t| t[:name].delete(\" \").delete(\"#\") }\n\n @images = []\n response = \"\"\n\n @trend_names.each do |tn|\n response = Image.search_by_tag(tn)\n image_hash = response['data'].sample\n if image_hash.present?\n @images << image_hash\n end\n end\n\n @trend_image_hash = {}\n i = 0\n while i < @images.count do\n @trend_image_hash[@trend_names[i]] = @images[i]\n i += 1\n end\n\n end",
"title": ""
},
{
"docid": "16e1c1e36f9b0fc698b2ce4b155eb633",
"score": "0.5609819",
"text": "def find_and_set_image\n if image.url.index(\"missing\")\n results = []\n search = Google::Search::Image.new do |search|\n search.query = self.name\n search.size = :small\n end\n search.find { |item| results << item }\n url = results.first.uri\n\n self.image = url if url\n \n self.save!\n end\n end",
"title": ""
},
{
"docid": "09e235f6ada8024ac9c7aa07f8172597",
"score": "0.5587714",
"text": "def photo\n if @list_len == 0 # no photos for that location\n return { \"uploaded_by\" => \"Sorry, looks like Flickr doesn't have any photos for this location!\", \"profile_link\" => \"https://www.flickr.com/\", \"photo_url\" => \"https://www.flickr.com/\" }\n else # only one photo for the location, so we don't need to generate a random number\n if @list_len == 1\n photo = @photos_list[0].to_hash\n else # get a random photo from the list\n random = Random.new.rand(@list_len)\n photo = @photos_list[random].to_hash\n end\n id = photo[\"id\"]\n secret = photo[\"secret\"]\n @info = flickr.photos.getInfo :photo_id => id, :secret => secret\n uploaded_by = \"Photo by #{@info[\"owner\"][\"username\"]} on Flickr\"\n profile_link = FlickRaw.url_profile(@info)\n photo_url = FlickRaw.url_b(@info)\n return { \"uploaded_by\" => uploaded_by, \"profile_link\" => profile_link, \"photo_url\" => photo_url }\n end\n end",
"title": ""
},
{
"docid": "987b8e3823cdfbcc785477d4df251e39",
"score": "0.558127",
"text": "def likes\n render :json => Photo.find(params[:id]).likes.count\n end",
"title": ""
},
{
"docid": "a46d0db0e5c2d2166dc550265b5d4f5f",
"score": "0.5576631",
"text": "def images_urls\n urls=[]\n artist.records.each do |r|\n urls << r.identifier.select {|x| x.include?(\"http\") && !x.include?(\"IMAGE\")}\n end\n urls.flatten\n end",
"title": ""
},
{
"docid": "de22f6c9e695a312ec7e2e5b4898a6a8",
"score": "0.5571511",
"text": "def photos_count\n 1\n end",
"title": ""
},
{
"docid": "6398912698d66bb46da527f6b009807c",
"score": "0.55646217",
"text": "def count\n count = result[\"data\"][1][\"likes\"][\"count\"]\nend",
"title": ""
},
{
"docid": "05baae52d93b03eb6a22762705c5d2db",
"score": "0.55594856",
"text": "def search_for_images(token)\n request = {\n :RequestHeader => { :Token => token},\n :SearchForImages2RequestBody => {\n :Query => { :SearchPhrase => @phrase},\n :ResultOptions => {\n :ItemCount => 25,\n :ItemStartNumber => 1\n },\n :Filter => { :ImageFamilies => [\"editorial\"] }\n }\n }\n response = post_json(request)\n\n #status = response[\"ResponseHeader\"][\"Status\"]\n #images = response[\"SearchForImagesResult\"][\"Images\"]\n end",
"title": ""
},
{
"docid": "9e42c30011c17129920e9dd96c89c0d3",
"score": "0.5559032",
"text": "def jpeg_count\n records.select{|r| r[:path] =~ /\\.jpg$/}.length\n end",
"title": ""
},
{
"docid": "7e25fd0cee7acac67b89bda3f3597225",
"score": "0.55580163",
"text": "def find_popular_images\n Rails.logger.fatal 'WelcomeController#find_popular_images'\n Rails.logger.info \"\\033[32mSTART WelcomeController#find_popular_images\\033[0m\"\n images = Image.order(likes_count: :desc).limit(5)\n return if images.empty?\n\n index = 0\n result_arr = []\n while index < images.size\n result_arr << images[index] if images[index].path.width > images[index].path.height\n index += 1\n end\n Rails.logger.info \"\\033[32mEND WelcomeController#find_popular_images\\033[0m\"\n result_arr\n end",
"title": ""
},
{
"docid": "78380be0e8acce6a19618d3a5e3da21d",
"score": "0.5553206",
"text": "def index\n @pictures = Picture.where(nil).order(\"created_at DESC\")\n if !params[:search].blank? && !params[:search][:location].blank?\n url = \"https://maps.googleapis.com/maps/api/place/textsearch/json?input=#{params[:search][:location]}&key=AIzaSyB3FXtpUa5MQ_rX_frJUEWx9hGJSwb0qJ4\"\n response = open(url).read\n response_json = JSON.parse(response)\n location = response_json[\"results\"][0][\"geometry\"][\"location\"]\n url = \"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=#{location[\"lat\"]},#{location[\"lng\"]}&radius=1500&key=AIzaSyB3FXtpUa5MQ_rX_frJUEWx9hGJSwb0qJ4\"\n response = open(url).read\n response_json = JSON.parse(response)\n\n locations = [params[:search][:location]]\n response_json[\"results\"].each do |result|\n locations << result[\"name\"]\n end\n @pictures = @pictures.location_search(locations).order(\"created_at DESC\")\n elsif params[:location]\n @pictures = @pictures.location_search([params[:location]]).order(\"created_at DESC\")\n end\n @pictures\n end",
"title": ""
},
{
"docid": "54636954671192a3a24bdbe535fc448e",
"score": "0.55523264",
"text": "def photo_index_georss\r\n @photos = Photo.marked_objects.find(:all, :order => 'rating_total Desc')\r\n set_headers\r\n record_stats('photo_index_georss')\r\n end",
"title": ""
},
{
"docid": "f0ae8fc26f262b080d1526fabd39a3d3",
"score": "0.5546501",
"text": "def photos\n if !@hash.key?('photos') then nil\n else\n @hash['photos'].reduce([]) do |start, hash|\n photo_hash = hash.select do |key, _value|\n key_lists = %w[photo_reference]\n key_lists.include? key\n end\n start << photo_hash\n end\n end\n end",
"title": ""
},
{
"docid": "aff9787829841ea118e10d5eac1da74b",
"score": "0.5538669",
"text": "def get_crime_rating(location)\n count = 0\n BikeCrimesJSON[\"data\"].each do |crime|\n if crime[24] and crime[23] and location[:lng] and location[:lat]\n distance = (crime[24].to_f - location[:lng])**2 + (crime[23].to_f - location[:lat])**2\n count += 1 if Math.sqrt(distance) < 0.05\n end\n\n end\n [count,count > 100 ? \"High risk\" : count > 50 ? \"Medium risk\" : count > 10 ? \"Low risk\" : \"Safe\"]\nend",
"title": ""
},
{
"docid": "cff3eba71dde781be531886b8e30a57b",
"score": "0.5537868",
"text": "def fb_friends\n\t facebook { |fb| \n\t \tfb.get_connection(\"me\", \"friends\").sort { |a,b| a[\"name\"].downcase <=> b[\"name\"].downcase } if fb\n\t\t\t#fb.get_connection(\"me\", \"friends\").sort { |a,b| a[\"name\"].downcase <=> b[\"name\"].downcase }.each do |f|\n\t\t\t# f[\"image\"]= fb.get_picture(f[\"id\"])\n\t\t\t#end\n\t }\n\tend",
"title": ""
},
{
"docid": "e7a653ed089e347aa56c1e70af63efc0",
"score": "0.5535841",
"text": "def venues_with_insufficient_photos( min_photos)\n loosers = Photo.group(:location_id)\n .having('count(*) < ?', min_photos)\n .order(count_all: :asc)\n .count\n # Get locations by its name\n insufficient_photos = []\n loosers.each do |location_id, count_photos|\n location = Location.find_by_id(location_id)\n if location\n insufficient_photos << [location, count_photos] if location.active\n else\n # photo without location\n @logger.warn(\"Venue with Id: #{location_id} not found, but photo record still exist\")\n end\n end\n insufficient_photos\n end",
"title": ""
},
{
"docid": "ac422bf21bd01dda299992f4404ab3fe",
"score": "0.5525132",
"text": "def find_images(doc)\n source = doc.search(\"guid\").inner_html\n @@logger.debug(\"searching in #{source}\")\n images = []\n \n #begin\n # doc.search(\"media:content\").each do |image|\n # images << {\n # :image => image.attributes['url'],\n # :summary => image.search(\"media:description\").inner_html.strip,\n # :source => source_name,\n # }\n # end\n #rescue Exception => ex\n # @@logger.error(ex)\n #end\n \n images\n end",
"title": ""
},
{
"docid": "9c8f83995fcee7d129f96931578ead2c",
"score": "0.5524648",
"text": "def findPicture(data, doc)\n # Directory to prepend to relative image links:\n image_tag = doc.at_css('img[src^=\"photos\"]')\n if image_tag\n data['photo_url'] = BASE_URL + image_tag['src']\n else\n puts \"No image tag for #{data['name']} #{data['url']}\\n#{doc.at_css('#content').inner_html}\"\n end\nend",
"title": ""
},
{
"docid": "9c8f83995fcee7d129f96931578ead2c",
"score": "0.5524648",
"text": "def findPicture(data, doc)\n # Directory to prepend to relative image links:\n image_tag = doc.at_css('img[src^=\"photos\"]')\n if image_tag\n data['photo_url'] = BASE_URL + image_tag['src']\n else\n puts \"No image tag for #{data['name']} #{data['url']}\\n#{doc.at_css('#content').inner_html}\"\n end\nend",
"title": ""
},
{
"docid": "74a4a50efec561592140f4e556d4fbd2",
"score": "0.5523489",
"text": "def photos_data\n path = File.join(Rails.root, \"lib\", \"album_data\", \"sani_android_photos\")\n @json = \"empty\"\n f = File.open(path, \"r\") do |f|\n @json = f.read()\n end\n @photos = JSON.parse @json\n @pretty_photos = JSON.pretty_generate @photos\n @buckets = {}\n @photos.each do |p|\n @buckets[p[\"bucket_display_name\"]] ||= []\n @buckets[p[\"bucket_display_name\"]] << p\n end\n render :template => \"admin/stats/photos_data\"\n end",
"title": ""
},
{
"docid": "ef5dfd6de3ec57f18f369629addd464c",
"score": "0.5522571",
"text": "def filteredcontent\n mypics = params[:mypics]\n if mypics.nil?\n mypics = 0\n end\n\n followingpics = params[:followingpics]\n if followingpics.nil?\n followingpics = 0\n end\n\n @images = Image.filteredcontent(params[:auth_token], params[:lat], params[:long], params[:radius],\n params[:altmin], params[:altmax],\n params[:timemin], params[:timemax],\n params[:taglist], params[:userlist],\n mypics, followingpics, params[:maxcount])\n\n respond_to do |format|\n # format.html { render 'index' }\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "79894b20629a3176fbc15aae3a4e31a9",
"score": "0.5519948",
"text": "def image_urls\n response[\"imageUrls\"]\n end",
"title": ""
},
{
"docid": "e858199fe2b11a4e3e49a07b6beb1752",
"score": "0.5518351",
"text": "def image_urls\n photos.map {|h|\n o = h['original_size']['url']\n if File.exist?(resource_path(o))\n resource_path(o)\n else\n a = h['alt_sizes'].find {|h| h['width'] == 500 }\n if a\n resource_path(a['url'])\n else\n resource_path(o)\n end\n end\n }\n end",
"title": ""
},
{
"docid": "98c9c94b1b627be91bff43a3ff4c2009",
"score": "0.5514624",
"text": "def fetch_images!\n validate_keywords\n @keywords.each do |keyword|\n image = nil\n loop do\n image = flickr.photos.search(text: keyword, \n sort: 'interestingness-desc', \n privacy_filter: 1, \n per_page: 1).first\n break if image\n # Repeat with a random word if image not found \n keyword = dictionary.get_random_words(1).first\n end \n download_image(image)\n end \n end",
"title": ""
},
{
"docid": "8484fed24c4e2cc731fca718692a7368",
"score": "0.55128706",
"text": "def get_remote_images\n if params[:term] == nil\n doc = Nokogiri::XML(open(\"http://www.vam.ac.uk/api/xml/museumobject/\"))\n parse_xml(doc)\n else\n doc = Nokogiri::XML(open(\"http://www.vam.ac.uk/api/xml/museumobject/?q=#{params[:term]}&images=1\"))\n parse_xml(doc)\n end\n end",
"title": ""
},
{
"docid": "71775c7fe32bdac0ecabcbf716601918",
"score": "0.55111635",
"text": "def get_image_urls(json_response)\n parsed_json = JSON.parse(json_response)\n photos_json_array = parsed_json[\"photos\"]\n image_url_array = []\n photos_json_array.each { |photo|\n image_url_array << photo[\"image_url\"]\n }\n\n image_url_array\n end",
"title": ""
},
{
"docid": "35595e5f1a73b9847563ed982d9b7a2d",
"score": "0.55004495",
"text": "def photos_count(hash)\r\n f = 0\r\n r = 0\r\n m = 0\r\n c = 0\r\n n = 0\r\n m1 = 0\r\n n1 = 0\r\n has = {}\r\n hash.each do |key, value|\r\n (value).each do |k|\r\n k.each do |ke,va|\r\n if ke == 'camera'\r\n va.each do |clave,valor|\r\n if clave == 'name' \r\n has[valor] = va[valor]\r\n case valor\r\n when 'FHAZ'\r\n f += 1\r\n has[valor] = f\r\n when 'RHAZ'\r\n r += 1\r\n has[valor] = r\r\n when 'MAST'\r\n m += 1\r\n has[valor] = m\r\n when 'CHEMCAM'\r\n c += 1\r\n has[valor] = c\r\n when 'MAHLI' \r\n m1 += 1\r\n has[valor] = m1\r\n when 'NAVCAM'\r\n n1 += 1\r\n has[valor] = n1\r\n end\r\n end\r\n end\r\n end\r\n end\r\n end \r\n end\r\n return has \r\nend",
"title": ""
},
{
"docid": "e5278da10607f457b6843534bd99ccab",
"score": "0.5499124",
"text": "def index\n @location_images = LocationImage.all\n end",
"title": ""
},
{
"docid": "88ef451e96c3235c15f8ebc4fd171801",
"score": "0.5495746",
"text": "def image_count\n return 0 unless @source.present?\n\n cooked_document.search(\"img\").reject do |t|\n dom_class = t[\"class\"]\n if dom_class\n (Message.white_listed_image_classes & dom_class.split(\" \")).count > 0\n end\n end.count\n end",
"title": ""
},
{
"docid": "0a80320ab9d1d8963bb496f85b47963b",
"score": "0.54916024",
"text": "def gatherImages(query,start_idx,count)\n manager = ImageFinder.new(query,start_idx)\n urls = manager.findImages(count)\n manager.saveImagesFromUrls(urls)\n end",
"title": ""
},
{
"docid": "b952ff9c6e7f007bc9f6352e04336bf5",
"score": "0.548771",
"text": "def search_image\n\t\t# @search_image = Opinion.new\n\t\t@search_results = []\n\tend",
"title": ""
},
{
"docid": "b11458fa0fbf8ed3fdf409508d420a62",
"score": "0.548752",
"text": "def image_count\n @image_count ||= 0\n end",
"title": ""
},
{
"docid": "e586faf187814cc60426d1e20adaea1c",
"score": "0.5481084",
"text": "def used_images\n result = content.scan(/!\\[.*\\]\\(.*\\/image\\/(\\d.*)\\/.*\\)/)\n image_ids = result.nil? ? nil : result.map{ |i| i[0].to_i }.uniq\n image_ids\n end",
"title": ""
},
{
"docid": "3b471c9d26056888de13132517c1e2e2",
"score": "0.5480959",
"text": "def get_images_info\n ret = Array.new\n gpxFile = self.get_gpx\n if gpxFile\n @doc = Nokogiri::XML(File.open(gpxFile))\n wayPts = @doc.xpath '//gpx:wpt', @@gpx_namespace\n wayPts.each do |wpt|\n nameNodes = wpt.xpath './gpx:name', @@gpx_namespace\n isPicture = nameNodes.children.first.inner_text == 'Photographier'\n if isPicture\n elem = Hash.new\n filename = wpt.xpath('./gpx:link/gpx:text', @@gpx_namespace).first.inner_text\n datetime = wpt.xpath('./gpx:time', @@gpx_namespace).first.inner_text\n elem['filename'] = self.base_url + '/picture/' + filename\n elem['thumbnail'] = self.base_url + '/thumbnail/' + filename\n elem['minimage'] = self.base_url + '/min/' + filename\n elem['lat'] = wpt['lat']\n elem['lon'] = wpt['lon']\n elem['datetime'] = datetime\n ret.push elem\n end\n end\n end\n return ret\n end",
"title": ""
},
{
"docid": "1789ca0eb3e480d3c3d565d3647ed628",
"score": "0.5473477",
"text": "def liked\n images = current_user.source_liked_images.paginate_and_sort(filtered_params)\n render json: images, meta: { total: images.total_entries }\n end",
"title": ""
},
{
"docid": "ce54bc1f9c82d85caeff8c212f583488",
"score": "0.54656017",
"text": "def photos_count (hash)\n\n content = []\n hash.each do |k, v|\n content = v\n end\n\n #First array for save names\n camera_names = []\n\n content.each do |i|\n #Collect all names\n i.each do |k, v|\n if k == \"camera\"\n v.each do |k, v|\n if k == \"name\"\n camera_names.push v\n end\n end\n end\n end\n end\n\n #Creating a new hash\n grouped = camera_names.group_by{|x| x}\n\n grouped.each do |k, v|\n grouped [k] = v.count\n end\n \n #Print response\n print grouped\n print \"\\n\"\n return grouped\n \nend",
"title": ""
},
{
"docid": "fe78053508b6f0c90e707dc9c7778cd8",
"score": "0.5457331",
"text": "def getHomePageImages \n image_name = []\n @response = smvGetFeatureImages(params, request.env)\n @images = @response.getValue()\n logger.info(\"getHomePageImages::---#{@images}\")\n @images.each do |val| \n name = \"[\\\"http://img.sharemyvision.com/theme1/homepage/\"+val+\".jpg\\\",\\\"\\\",\\\"\\\",\\\"\\\"]\";\n image_name.push(name) \n logger.info(\"getHomePageImages::Images:----#{name}\") \n end\n if image_name.empty?\n logger.info(\"getHomePageImages::No Image returned\")\n end\n logger.info(\"getHomePageImages::Image json:--#{image_name}\")\n return image_name\n end",
"title": ""
},
{
"docid": "ea5c8c67462478ca5ba74a06cfe2a328",
"score": "0.54554194",
"text": "def indexbbox\n current_photo_ids = params['current_markers'].split(',').map{ | item | item.to_i }\n\n categories = extract_categories_from_params\n\n unless categories.empty?\n search = Sunspot.search (Photo) do\n #y latitude\n #x longitude\n # eager load user and named_location of each photo, to avoid N+1 queries\n data_accessor_for(Photo).include = [:user, :named_location]\n\n with(:coordinates).in_bounding_box([params[:sw_y], params[:sw_x]], [params[:ne_y], params[:ne_x]])\n with(:category_id, categories)\n with(:show_on_map, true)\n\n paginate(:page => 1, :per_page => 60)\n order_by :created_at, :desc\n end\n\n photos = []\n\n location_ids = []\n search.results.each do |photo|\n if photo.named_location_id == nil || location_ids.index(photo.named_location_id) == nil\n photos.append photo\n if photo.named_location_id != nil\n location_ids.append photo.named_location_id\n end\n end\n if photos.length == 25\n break;\n end\n end\n\n # if location_google_id is set, the map for a named location details view is requested, so the best\n # photo of that location is always included\n unless params[:location_google_id].nil?\n detail_location = NamedLocation.find_by_google_id( params[:location_google_id])\n unless detail_location.nil?\n detail_photo = detail_location.best_photo\n unless detail_photo.nil?\n if photos.index(detail_photo).nil?\n photos << detail_photo\n end\n end\n end\n end\n\n # if detail_photo_id param is set, the photo with that id will by all means be in the results\n unless params[:detail_photo_id].nil?\n detail_photo = Photo.find(params[:detail_photo_id])\n\n unless detail_photo.nil?\n if photos.index(detail_photo).nil?\n photos << detail_photo\n end\n end\n end\n\n # set current_user on all photos before calling voted_by_current_user\n photos.each { |photo|\n photo.current_user = current_user\n }\n\n new_photo_ids = photos.map{|photo| photo.id}\n\n to_remove_ids = current_photo_ids - new_photo_ids\n\n to_add_ids = new_photo_ids - current_photo_ids\n\n to_add_photos = []\n\n photos.each{ |photo|\n unless to_add_ids.index(photo.id).nil?\n to_add_photos << photo\n end\n }\n\n render :json => {:to_add_photos => to_add_photos, :to_remove_ids => to_remove_ids}\n else\n # no markers should be displayed, remove all of them\n to_remove_ids = current_photo_ids\n to_add_photos = []\n render :json => {:to_add_photos => to_add_photos, :to_remove_ids => to_remove_ids}\n end\n end",
"title": ""
},
{
"docid": "d94131b253f417de6e816089b508996c",
"score": "0.5445676",
"text": "def friends(facebook_session, friends_location)\n #FacebookFriends.asynch_getfriendslocation(self.location, facebook_session, friends_location)\n article_friends = []\n # Find all friends within 200 miles of this article.\n friends_location.each do |friend_location|\n if friend_location[:geo] && self.location\n begin\n if friend_location[:geo].distance_from(self.location, :units=>:miles).round <= 200\n article_friends << {:name => friend_location[:name], :uid => friend_location[:uid], :geo => friend_location[:geo]}\n puts \"This user is good! #{friend_location[:name]}\"\n end\n rescue Exception => e \n puts \"Error with Geocoding: #{e} with city: #{location['city']}, state: #{location['state']}, country: #{location['country']}\"\n end\n end\n end\n return article_friends\n end",
"title": ""
},
{
"docid": "e27c9b930e26b5bc83963b041fee2df2",
"score": "0.54395694",
"text": "def images\n object[\"images\"]\n end",
"title": ""
},
{
"docid": "61721851b6de510cddddf777743a7492",
"score": "0.54322815",
"text": "def images_from_replies\n artist_responses = api_replies[\"responses\"].to_a.select { _1[\"user_id\"].to_i == artist_id.to_i }\n urls = artist_responses.pluck(\"content_raw\").flat_map { URI.extract(_1) }\n urls.select { Source::URL.parse(_1)&.image_url? }.uniq\n end",
"title": ""
},
{
"docid": "0c251f47a3c62f3be8ce9901bedcd575",
"score": "0.5432185",
"text": "def flickr_photos_info(timezone, max_photos = 10)\r\n flickr = Flickr.new(FLICKR_API_KEY)\r\n photonames = self.flickr_ids\r\n#MES- TODO: For testing, using the smedberg@gmail.com Flickr user, and a fuzzy start of 2006-02-26 shows photos of my Hawaiian vacation.\r\n tz = timezone.nil? ? User::DEFAULT_TIME_ZONE_OBJ : timezone\r\n date_local = tz.utc_to_local(self.fuzzy_start)\r\n date_start_string = date_local.fmt_date_for_mysql\r\n date_end_string = (date_local + 24 * 60 * 60).fmt_date_for_mysql\r\n photos_found = 0\r\n in_past = self.occurs_in_past?\r\n photo_info = []\r\n photonames.each do |pname|\r\n begin\r\n user = flickr.users(pname)\r\n rescue RuntimeError => e\r\n #MES- Ignore the error- the library throws when a user isn't found\r\n end\r\n if !user.nil?\r\n photos = []\r\n #MES- First, see if any of the users have photos that match the tags\r\n if !self.flickr_tags.blank?\r\n #MES- If there are no photos, the flickr library fails\r\n begin\r\n photos = photos + flickr.photos_fixed({:user_id => user.id, :tags => self.flickr_tags, :per_page => max_photos.to_s, :tag_mode => 'all'})\r\n #user.tag(self.flickr_tags)\r\n rescue Exception => e\r\n #MES- Ignore the error- the library can't handle empty lists\r\n end\r\n end\r\n #MES- Second, see if there are any photos for the time of the plan (which only happens if the plan is in the past)\r\n if in_past\r\n #MES- Note: it seems like the dates are midnight to midnight, so if you want photos taken on the 25th, you'd set the\r\n # min to 25th and the max to the 26th\r\n #MES- If there are no photos, the flickr library fails\r\n begin\r\n photos = photos + flickr.photos_fixed({:user_id => user.id, :min_taken_date => date_start_string, :max_taken_date => date_end_string, :per_page => max_photos.to_s})\r\n rescue Exception => e\r\n #MES- Ignore the error- the library can't handle empty lists\r\n end\r\n end\r\n photos.each do | photo |\r\n #MES- Note, the click-through URL is to the Large image. When I tried the Medium, it\r\n # uses \"Michael Smedberg\" as my Flickr username, but should use \"smedberg\". This appears\r\n # to be a bug in Flickr, rather than in the Ruby library- the Flickr API is returning\r\n # \"Michael Smedberg\" for username, but expects \"smedberg\" in URLs\r\n thumb, large = nil, nil\r\n sizes = photo.sizes\r\n #MES- Is there a thumbnail?\r\n thumb = sizes.find{|asize| asize['label'] == 'Thumbnail'}\r\n if !thumb.nil?\r\n #MES- Look for a larger size\r\n large = sizes.find{|asize| asize['label'] == 'Original'}\r\n large = sizes.find{|asize| asize['label'] == 'Large'} if large.nil?\r\n large = sizes.find{|asize| asize['label'] == 'Medium'} if large.nil?\r\n large = thumb if large.nil?\r\n end\r\n \r\n photo_info << [thumb['source'], large['url']]\r\n \r\n photos_found += 1\r\n \r\n #MES- Did we find all the photos we need?\r\n break if photos_found >= max_photos\r\n end\r\n \r\n #MES- Did we find all the photos we need?\r\n break if photos_found >= max_photos\r\n end\r\n end\r\n\r\n return photo_info\r\n end",
"title": ""
},
{
"docid": "7079269693b6b3707fc15f13603be6b5",
"score": "0.5429617",
"text": "def query_image\n\t\t@js_custom_turbolink = { 'turbolinks-track' => true, \"turbolinks-eval\" => false } \n\t\t\n\t\treturned = Unsplash::Photo.search(params[:search], rand(1..2), 20)\n\t\t@search_results = []\n\t\treturned.each do |image|\n\t\t\t@search_results << image.urls\n\t\tend\n\t\trender json: @search_results\n\tend",
"title": ""
},
{
"docid": "7c351e5b0d846e1644a2ff5a7dd9b6e8",
"score": "0.5423552",
"text": "def get_instagram_api(name, lat, lng)\n url = \"https://api.instagram.com/v1/locations/search?lat=#{lat}&lng=#{lng}&access_token=#{ENV['INSTAGRAM_ACCESS_TOKEN']}\"\n response = RestClient.get(url)\n parsed_response = ActiveSupport::JSON.decode(response)\n\n parsed_response['data'].each do |restaurant|\n jarow = FuzzyStringMatch::JaroWinkler.create(:native)\n match = jarow.getDistance(name, restaurant['name'])\n\n if match > 0.75\n puts match\n puts restaurant['name']\n puts restaurant['id']\n break if restaurant['id'] == '0'\n # ActionCable.server.broadcast('loading_channel',\n # {message: restaurant['name']})\n get_instagram_images(restaurant['id'])\n add_instagram_to_restaurant(restaurant['id'])\n break\n end\n end\n end",
"title": ""
},
{
"docid": "c2b116235b93fce36f5c68ed41641780",
"score": "0.542146",
"text": "def check_image(image)\n list_of_images = image_list\n if list_of_images[:exit_code] == 0 && list_of_images[:images].include?(image['img_name'] => \"active\")\n return true\n end\n return false\nend",
"title": ""
},
{
"docid": "91c1733eb7bd0c694390bffb5b53abf3",
"score": "0.54122114",
"text": "def get_photo\n get_places # Get nearby Google places\n\n @places[\"results\"].each do |place| # Process each result\n if place[\"photos\"] and place[\"types\"] #Look for a usable photo\n place[\"types\"].each do |type|\n if ACCEPTABLE_IMG_TYPES.include? type # Remove types that don't match\n photo = place[\"photos\"].first\n @license = photo[\"html_attributions\"] if photo[\"html_attributions\"]\n photo_ref = photo[\"photo_reference\"]\n @src = \"https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&maxheight=400&photoreference=#{photo_ref}&sensor=true&key=#{API_KEY}\"\n response = Net::HTTP.get_response(URI.parse(@src))\n @res = response.body\n break # since we now have a photo, break the loop\n end\n end\n end #of photo processing\n end\n end",
"title": ""
},
{
"docid": "252871c16a22f7473ceca19cd3cd86c8",
"score": "0.5406301",
"text": "def cover_picture_lists\n name = \"#{@name}料理\"\n ret = @gateway_class.new(@token, name, @cx).search_photo\n if ret.key?('items')\n cover_pictures = ret['items']\n cover_pictures.map do |cover_picture|\n {\n picture_link: cover_picture['link'],\n article_link: cover_picture['image']['contextLink']\n }\n end\n else [] end\n end",
"title": ""
},
{
"docid": "a7a8ab2a0268624ed454417586dafaf5",
"score": "0.5396173",
"text": "def findBiggestPhotoUrl(imagesURL)\n # @parsedJson['data']['children'].each { |dogurl| dogurl['data']['url'] NEED TO ADD CLOSING } \n \n #debug puts imagesURL\n \n response = RestClient.get(imagesURL)\n @doc = Nokogiri::HTML(response.body)\n \n highestPicLength = 0\n \n bestURL = 0;\n \n #debug puts @doc.inspect\n \n @doc.css(\"img\").each do |node|\n imgurl = node['src']\n response = RestClient.get imgurl, :accept => 'image/jpeg'\n #debug puts \" \\n\\n\\n\\n\\n #{imgurl} \\n\\n\"\n #debug puts \"\\n\\n length: #{response.headers[:content_length]} \\n\\n\"\n length = response.headers[:content_length].to_i\n \n if length > highestPicLength\n highestPicLength = length;\n bestURL = imgurl\n end\n \n end\n #debug puts bestURL\n bestURL\n end",
"title": ""
},
{
"docid": "446bfc21c96d7b7f33b06edf9bc20257",
"score": "0.53939563",
"text": "def search_for_image_names(parse_a)\n\tparse_a.search(\"//td\").each do |td_element|\n\t\t imgs = td_element.search(\"img\")\n\t\t if imgs.any?\n\t\t \tthen imgs.each {|image| puts \"Found Image called #{image[:src]}\"}\n \t end\n\t end\nend",
"title": ""
},
{
"docid": "d21248a80311d0977de4a677365959a3",
"score": "0.53922737",
"text": "def quick_view_images\n returned_images = []\n images = @record.fetch('ImageQuickViewItems', {})\n if images.count > 0\n images.each do |quick_view_item|\n image_id = quick_view_item['DbId']\n image_accession = quick_view_item['An']\n image_type = quick_view_item['Type']\n # todo: change to https, large/small url?\n image_url = quick_view_item['Url']\n returned_images.push({url: image_url, id: image_id, accession_number: image_accession, type: image_type})\n end\n end\n returned_images\n end",
"title": ""
},
{
"docid": "f851f23cecb20a0c9b2542dc2a270245",
"score": "0.5389042",
"text": "def rating_overall_image\n @hash[\"Rating\"][\"Overall\"][\"Image\"]\n end",
"title": ""
},
{
"docid": "5f951cad2d39cf22b72178b41e599de4",
"score": "0.5387093",
"text": "def images\n if @images.nil?\n @images = []\n image_nodes = FeedTools::XmlHelper.try_xpaths_all(self.root_node, [\n \"image\",\n \"logo\",\n \"apple-wallpapers:image\",\n \"imageUrl\"\n ])\n unless image_nodes.blank?\n for image_node in image_nodes\n image = FeedTools::Image.new\n image.href = FeedTools::XmlHelper.try_xpaths(image_node, [\n \"url/text()\",\n \"@rdf:resource\",\n \"@href\",\n \"@url\",\n \"text()\"\n ], :select_result_value => true)\n if image.href.nil? && image_node.base_uri != nil\n image.href = \"\"\n end\n begin\n if !(image.href =~ /^file:/) &&\n !FeedTools::UriHelper.is_uri?(image.href)\n stored_base_uri =\n FeedTools::GenericHelper.recursion_trap(:feed_link) do\n self.base_uri if self.feed != nil\n end\n image.href = FeedTools::UriHelper.resolve_relative_uri(\n image.href, [image_node.base_uri, stored_base_uri])\n end\n rescue\n end\n if self.configurations[:url_normalization_enabled]\n image.href = FeedTools::UriHelper.normalize_url(image.href)\n end \n image.href.strip! unless image.href.nil?\n next if image.href.blank?\n image.title = FeedTools::XmlHelper.try_xpaths(image_node,\n [\"title/text()\"], :select_result_value => true)\n image.title.strip! unless image.title.nil?\n image.description = FeedTools::XmlHelper.try_xpaths(image_node,\n [\"description/text()\"], :select_result_value => true)\n image.description.strip! unless image.description.nil?\n image.link = FeedTools::XmlHelper.try_xpaths(image_node,\n [\"link/text()\"], :select_result_value => true)\n image.link.strip! unless image.link.nil?\n image.height = FeedTools::XmlHelper.try_xpaths(image_node,\n [\"height/text()\"], :select_result_value => true).to_i\n image.height = nil if image.height <= 0\n image.width = FeedTools::XmlHelper.try_xpaths(image_node,\n [\"width/text()\"], :select_result_value => true).to_i\n image.width = nil if image.width <= 0\n image.style = FeedTools::XmlHelper.try_xpaths(image_node, [\n \"style/text()\",\n \"@style\"\n ], :select_result_value => true)\n image.style.strip! unless image.style.nil?\n image.style.downcase! unless image.style.nil?\n @images << image unless image.url.nil?\n end\n end\n for link_object in self.links\n if link_object.type != nil && link_object.type =~ /^image/\n image = FeedTools::Image.new\n image.href = link_object.href\n image.title = link_object.title\n @images << image unless image.href.nil?\n end\n end\n end\n return @images\n end",
"title": ""
},
{
"docid": "ad48b0c0cf906b565e18dc1b45fe4d06",
"score": "0.53857553",
"text": "def only_imgur_images\n imgur_array = []\n @data[\"data\"][\"children\"].each do |hash|\n if hash[\"data\"][\"url\"] =~ /http:\\/\\/i.imgur.com/\n imgur_array << hash[\"data\"][\"url\"]\n end\n end\n imgur_array\n end",
"title": ""
},
{
"docid": "47756ea7854176134c2340a2e6f0dfe0",
"score": "0.53831303",
"text": "def image_url(food_json)\n url = food_json['images'][0]['hostedLargeUrl']\n url = 'Sorry, I can not provide you picture of this food' if url.nil?\n url\n end",
"title": ""
},
{
"docid": "3894782ad482d14244714f1b6e744234",
"score": "0.5382829",
"text": "def check_for_image?\n \timg = record && record.image\n \timg = nil if img and (!img.ab_record_id || img.ab_record_id==0) and !img.facebook_event_id\n \tfriends = record && record.friends\n \treturn true if !img and (!friends or friends.count == 0)\n \treturn true if img and !img.image and Time.now - img.mtime > 1.minutes\n \treturn false\n end",
"title": ""
},
{
"docid": "3ff8a1e78453a9d6f6f3d3e073cff6f7",
"score": "0.53808963",
"text": "def photo_lists\n photo_infos = photo_details\n if photo_infos != []\n photo_infos.map do |photo_info|\n thumb = photo_info['thumb']\n {\n link: @gateway_class.new(@token, photo_info['photo_reference'], thumb).place_photo,\n thumb: thumb\n }\n end\n else photo_infos end\n end",
"title": ""
},
{
"docid": "6e5492f394725284034a24f8d46cb327",
"score": "0.5380771",
"text": "def has_more_images?\n images.not_avatar.any?\n end",
"title": ""
},
{
"docid": "43c81892990e4b1e05bfe7d1ae708a8f",
"score": "0.537831",
"text": "def get_image_count\n begin\n if @filename == ''\n raise \"No file name specified\"\n end\n str_uri = $productURI + \"/slides/\" + @filename + \"/images\"\n signed_uri = Common::Utils.sign(str_uri)\n response = RestClient.get(signed_uri, :accept => 'application/json')\n json = JSON.parse(response)\n return json[\"Images\"][\"List\"].count\n rescue Exception=>e\n print e\n end\n end",
"title": ""
},
{
"docid": "20ca7e9feb350c4bfdeec731a904767d",
"score": "0.5377624",
"text": "def check_for_image_updates(params)\n\t\t\tavatars = []\n\t\t\tparams[:site][:doctors_attributes].each_with_index do |doctor, index|\n\t\t\t\timage_params = params[:site][:doctors_attributes][index.to_s][\"image\"]\n\t\t\t\tdoc = doctor[1].to_hash\n\t\t\t\tdoc[\"image\"] = doc[\"image\"].original_filename unless doc[\"image\"].blank?\n\n\t\t\t\tif image_params != nil\n\t\t\t \tavatars << image_params.tempfile.path\n\t\t\t else\n\t\t\t \tavatars << nil\n\t\t\t end\n\t\t\tend\n\t\tend",
"title": ""
}
] |
73f65d6eaaa33fa84122f40bbf5c4aa3
|
look for archive.org locations, or identifiers, or local ids to reference as embeddable iframe source
|
[
{
"docid": "e10c13da62ecccbcd667feb5a672eaa5",
"score": "0.6406861",
"text": "def iframe_url_for_document(document={})\n if archive_org_id = archive_org_id_for_document(document)\n return \"https://archive.org/stream/#{archive_org_id}?ui=full&showNavbar=false\"\n end\n end",
"title": ""
}
] |
[
{
"docid": "2de84c5057550a83c5977a05b310b8e0",
"score": "0.58984745",
"text": "def show\n # This is a Test for iFrame\n # @url = Location.find(params[:id])\n @locations = @location.nearbys(1)\n end",
"title": ""
},
{
"docid": "5d065ba702a7bf22964aef10fcb1fef7",
"score": "0.5801819",
"text": "def allowed_iframe_hosts\n /.*/\n end",
"title": ""
},
{
"docid": "f433421d5f538b2eefe5256c77ef84dd",
"score": "0.5561887",
"text": "def embed_tag_urls\n urls 'embed', 'src'\n end",
"title": ""
},
{
"docid": "0d043d21b7028c129e406d97ec159d7a",
"score": "0.55168027",
"text": "def nav_point_content_sources\n @found_content_sources = []\n find_content_sources(nav_map)\n @found_content_sources.map{|s| s.split('#').first}.compact.uniq\n end",
"title": ""
},
{
"docid": "06b0cbfaddcb5c17e92897f4800962ec",
"score": "0.54891235",
"text": "def any_source\n embed_src.presence || href.presence\n end",
"title": ""
},
{
"docid": "b8f66732d28bd7c3254aa642b60fb09b",
"score": "0.54837424",
"text": "def is_embeddable_source_url\n (source_url && source_url =~ /youtube|vimeo|soundcloud|spotify/)\n end",
"title": ""
},
{
"docid": "2aa381524c5f79386a6aa3dcb035d0f2",
"score": "0.54497945",
"text": "def convert_embeds(document)\n convert_embed_xpath_to_url(document, \"//embed[@src]\") do |matching_element|\n matching_element['src']\n end\n convert_embed_xpath_to_url(document, \"//param[@name='movie' or @name='src']\") do |matching_element|\n matching_element['value']\n end\n end",
"title": ""
},
{
"docid": "44321461147ed7291226cf4818567f87",
"score": "0.54193145",
"text": "def extract_url(content)\n page = Nokogiri::HTML(content)\n url = ''\n inputs = page.search('iframe')\n inputs.each do |node|\n url = node['src']\n end\n return url\n end",
"title": ""
},
{
"docid": "507195faa247248cdf93a66b48cf9afa",
"score": "0.53581107",
"text": "def video_src\n Nokogiri::HTML(embed_code).at_css(\"iframe\")[:src]\n end",
"title": ""
},
{
"docid": "bce5b21f7ccad5d4789c53d9c8a05c10",
"score": "0.53250635",
"text": "def iframe\n SELECTOR_MAPPING[ENDPOINT_FORM]['Editor']['iframe'][SELECTOR]\n end",
"title": ""
},
{
"docid": "4b28b2a978ca966e937d97bf3f7ab585",
"score": "0.5301198",
"text": "def video_src\n doc.at_css('script[id~=page-json]').inner_text =~ /['\"]iframe_url['\"]\\:\\s*?['\"](.*?)['\"],/\n $1\n rescue\n nil\n end",
"title": ""
},
{
"docid": "053ec9892677824bfc5c14a8c2073b43",
"score": "0.52963525",
"text": "def teams_embedded_content_url\n return @teams_embedded_content_url\n end",
"title": ""
},
{
"docid": "d3113357aaaa1304e740effbe11466c5",
"score": "0.5294393",
"text": "def in_iframe(identifier, frame=nil, &block)\n frame = [] if frame.nil?\n frame << {iframe: identifier}\n block.call(frame)\n end",
"title": ""
},
{
"docid": "c4dca34dd559f15e4e6462cae79190a7",
"score": "0.527404",
"text": "def extract_embed(content_url)\n\t\t\tprimed_url = content_url.sub!(\"watch?v=\", \"embed/\")\n\t\t\turl = primed_url.split(\"&\")[0]\n\t\tend",
"title": ""
},
{
"docid": "e3e6fad1e0a2e1161f0b83ff12f465c0",
"score": "0.5244177",
"text": "def recognize_first_embed_video_code_at link\n return nil\n agent, agent.user_agent_alias, agent.redirect_ok = WWW::Mechanize.new, 'Linux Mozilla', true\n oldal = agent.get(link)\n if oldal.is_a? WWW::Mechanize::Page\n if oldal = oldal/\"embed\"\n return oldal.first.to_xhtml unless oldal.empty?\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "3e5f4a48c8dffa6d5d7599102dd2aa63",
"score": "0.5242306",
"text": "def xref_urls; end",
"title": ""
},
{
"docid": "78b2c031df901b0fff9be46036af1971",
"score": "0.5235945",
"text": "def search_ads (driver, web_url_para, sheet)\n\tweb_url = web_url_para\n\t#--------------------------------------------------------\n\t#web_url_domain:the domian of the web page\n\t#--------------------------------------------------------\n\tweb_url_domain_raw = web_url.match(/https?\\:\\/\\/(.*?)\\/.*?/)\n\tweb_url_domain = web_url_domain_raw[1]\n\n\t\n\tdriver.get web_url\n\tsleep 3\n\n\t#--------------------------------------------------------\n\t#get <iframe ...>...<\\iframe>\n\t#--------------------------------------------------------\n\thtml_source = driver.page_source\n\tmatch_iframe = html_source.scan(/(<\\s*iframe\\s.*?>.*?<\\s*\\/\\s*iframe\\s*>)/)\n\n\t#--------------------------------------------------------\n\t#select the third party hide ads url from iframe.src\n\t#iframe_src_hide:hide ad url\n\t#ad_hide_num: number\n\t#--------------------------------------------------------\n\tiframe_src_hide_raw = match_iframe.map do |ifr|\n\t\tif (src_match = ifr[0].to_s.match(/(<\\s*iframe\\s.*?(src=\\\"(.*?)\\\".*?>))/) )\n\t\t\tsrc_matched_hide = src_match[1].gsub(/\\&\\;/,\"&\")\n\t\t\thide_condition_1 = src_matched_hide.match(/.*?\\swidth\\s*\\=\\s*\\\"\\s*0\\s*px\\s*\\\"\\s.*?height\\s*=\\s*\\\"\\s*0\\s*px\\s*\\\".*/)\n\t\t\thide_condition_2 = src_matched_hide.match(/.*?\\sheight\\s*\\=\\s*\\\"\\s*0\\s*px\\s*\\\"\\s.*?width\\s*=\\s*\\\"\\s*0\\s*px\\s*\\\".*/)\n\t\t\thide_condition_3 = src_matched_hide.match(/.*?style\\s*=\\s*\\\".*?width\\s*:\\s*0\\s*px\\s*;.*?height\\s*:\\s*0\\s*px.*?\\\"/)\n\t\t\thide_condition_4 = src_matched_hide.match(/.*?style\\s*=\\s*\\\".*?height\\s*:\\s*0\\s*px\\s*;.*?width\\s*:\\s*0\\s*px.*?\\\"/)\n\t\t\thide_condition_5 = src_matched_hide.match(/.*?\\sdisplay\\s*=\\s*\\\"\\s*none\\s*\\\"\\s*/)\n\t\t\thide_condition_6 = src_matched_hide.match(/.*?style\\s*=\\s*\\\".*?display\\s*:\\s*none\\s*.*?\\\"/)\n\t\t\tif (hide_condition_1 || hide_condition_2 || hide_condition_3 || hide_condition_4 || hide_condition_5 || hide_condition_6)\n\t\t\t\t# alert(\"123\");\n\t\t\t\tsrc_matched = src_match[3].gsub(/\\&\\;/,\"&\")\n\t\t\t\tsrc_matched = src_matched.match(/https?\\:\\/\\/(.*)\\/.*/)\n\t\t\t\tif src_matched\n\t\t\t\t\tdomain_judge_raw = src_matched[0].to_s.match(/https?\\:\\/\\/(.*?)\\/.*?/)\n\t\t\t\t\tdomain_judge = domain_judge_raw[1]\n\t\t\t\t\tif domain_judge.to_s == web_url_domain.to_s\n\t\t\t\t\t\t#the same domain\n\t\t\t\t\t\tsrc_matched = nil\n\t\t\t\t\telse\n\t\t\t\t\t\t#not the same domain\n\t\t\t\t\t\tsrc_matched[0]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tsrc_matched = nil\n\t\t\tend\n\t\tend\n\tend\n\tiframe_src_hide = iframe_src_hide_raw.compact\n\tad_hide_num = iframe_src_hide.size\n\t$hide_ads_num = $hide_ads_num + ad_hide_num\n\n\t#--------------------------------------------------------\n\t#select the third party ads url from iframe.src\n\t#iframe_src:ad url\n\t#ad number\n\t#--------------------------------------------------------\n\tiframe_src_show_raw = match_iframe.map do |ifr|\t\n\t\tif (src_match = ifr[0].to_s.match(/(<\\s*iframe\\s.*?(src=\\\"(.*?)\\\".*?>))/) )\n\t\t\tsrc_matched_hide = src_match[1].gsub(/\\&\\;/,\"&\")\n\n\t\t\thide_condition_1 = src_matched_hide.match(/.*?\\swidth\\s*\\=\\s*\\\"\\s*0\\s*px\\s*\\\"\\s.*?height\\s*=\\s*\\\"\\s*0\\s*px\\s*\\\".*/)\n\t\t\thide_condition_2 = src_matched_hide.match(/.*?\\sheight\\s*\\=\\s*\\\"\\s*0\\s*px\\s*\\\"\\s.*?width\\s*=\\s*\\\"\\s*0\\s*px\\s*\\\".*/)\n\t\t\thide_condition_3 = src_matched_hide.match(/.*?style\\s*=\\s*\\\".*?width\\s*:\\s*0\\s*px\\s*;.*?height\\s*:\\s*0\\s*px.*?\\\"/)\n\t\t\thide_condition_4 = src_matched_hide.match(/.*?style\\s*=\\s*\\\".*?height\\s*:\\s*0\\s*px\\s*;.*?width\\s*:\\s*0\\s*px.*?\\\"/)\n\t\t\thide_condition_5 = src_matched_hide.match(/.*?\\sdisplay\\s*=\\s*\\\"\\s*none\\s*\\\"\\s*/)\n\t\t\thide_condition_6 = src_matched_hide.match(/.*?style\\s*=\\s*\\\".*?display\\s*:\\s*none\\s*.*?\\\"/)\n\n\t\t\tunless (hide_condition_1 || hide_condition_2 || hide_condition_3 || hide_condition_4 || hide_condition_5 || hide_condition_6)\n\t\t\t\tsrc_matched = src_match[3].gsub(/\\&\\;/,\"&\")\n\t\t\t \tsrc_matched = src_matched.match(/https?\\:\\/\\/(.*)\\/.*/)\n\t\t\t\tif src_matched\n\t\t\t\t\tdomain_judge_raw = src_matched[0].to_s.match(/https?\\:\\/\\/(.*?)\\/.*?/)\n\t\t\t\t\tdomain_judge = domain_judge_raw[1]\n\t\t\t\t\tif domain_judge.to_s == web_url_domain.to_s\n\t\t\t\t\t\t#the same domain\n\t\t\t\t\t\tsrc_matched = nil\n\t\t\t\t\telse\n\t\t\t\t\t\t#not the same domain\n\t\t\t\t\t\tsrc_matched[0]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tsrc_matched = nil\n\t\t\tend \n\n\t\tend\n\tend\n\tiframe_src_show = iframe_src_show_raw.compact\n\tad_show_num = iframe_src_show.size\n\n\t#--------------------------------------------------------\n\t#all ads \n\t#--------------------------------------------------------\n\tiframe_src = iframe_src_hide + iframe_src_show\n\tad_num = iframe_src.size\n\n\t$all_ads_num = $all_ads_num + ad_num\n\t\n\n\n\n\t#--------------------------------------------------------\n\t#select ad domian \n\t#src_domain:ad url domain\n\t#--------------------------------------------------------\n\tsrc_domain_raw = iframe_src.map do |sr|\t\n\t\tif (domain_match = sr.to_s.match(/https?\\:\\/\\/(.*?)\\/.*?/) )\n\t\t\tdomain_matched = domain_match[1]\n\t\tend\n\tend\n\tsrc_domain = src_domain_raw.compact\n\n\t#--------------------------------------------------------\n\t#file operation\n\t#--------------------------------------------------------\n\n\t# time = Time.now\n\t# time_stamp = \"-\" + time.month.to_s + time.day.to_s + \"_\" + time.hour.to_s + time.min.to_s + time.sec.to_s\n\t# sheet_name = web_url_domain.to_s + time_stamp\n\t\n\t# book = Spreadsheet::Workbook.new \n\t# shee2 = book.create_worksheet :name => 'My Second Worksheet' \n\t# sheet = excel_fil.worksheet 0 \n\n\n\tsheet[$web_num + 0,0] = \"Web url\"\n\tsheet[$web_num + 0,1] = web_url\n\tsheet[$web_num + 1,0] = \"The num of ads\"\n\tsheet[$web_num + 1,1] = ad_num\n\tsheet[$web_num + 1,2] = \"The num of hide ads\"\n\tsheet[$web_num + 1,3] = ad_hide_num\n\tsheet[$web_num + 2,0] = \"The url domain of ads\"\n\tsheet[$web_num + 2,1] = \"The url of ads\" + \"(The top \" + String(ad_hide_num) + \" are hidden ads)\"\n\tad_num.times do |n|\n\t\ti = n + 3 + $web_num\n\t\tsheet[i,0] = src_domain[n]\n\t\tsheet[i,1] = iframe_src[n]\n\tend\n\t$web_num = $web_num + ad_num + 3 + 1\n\tputs \"This page has searched successfully: #{web_url_para}\"\n\nend",
"title": ""
},
{
"docid": "fa72c95df0945261b758eb8d8ab77558",
"score": "0.52358484",
"text": "def embed_code(subdomain, url, options={})\n options = {:width => '400', :height => '240'}.merge(options)\n <<-EOF\n <iframe src=\"#{Api.host(subdomain)}/openid/embed?#{embed_params(url, options)}\"\n scrolling=\"no\" frameBorder=\"no\" style=\"width:#{options[:width]}px;height:#{options[:height]}px;\" id=\"rpx_now_embed\" allowtransparency=\"allowtransparency\">\n </iframe>\n EOF\n end",
"title": ""
},
{
"docid": "515933957bc42618aa46927d74fb63c7",
"score": "0.52235603",
"text": "def show\n @scrapping = Scrapping.find(params[:id])\n url = \"http://embed.ly/docs/explore/oembed?url=#{@scrapping.url}\"\n require 'net/http'\n require 'rubygems'\n require 'nokogiri'\n require 'open-uri'\n\n doc = Nokogiri::HTML(open(url))\n logger.debug \"#{doc}\\n\\n\\n\\n\\n\\n\"\n @provider_url = \"\"\n @provider_url << doc.css('#provider_url').text\n @e_provider_url = \"\"\n @e_provider_url << doc.css('.e_provider_url').text\n @provider_name = \"\"\n @provider_name << doc.css('#provider_name').text\n @e_provider_name = \"\"\n @e_provider_name << doc.css('.e_provider_name').text\n @type = \"\"\n @type << doc.css('#type').text\n @e_type = \"\"\n @e_type << doc.css('.e_type').text\n @title = \"\"\n @title << doc.css('#title').text\n @e_title = \"\"\n @e_title << doc.css('.e_title').text\n @description = \"\"\n @description << doc.css('#description').text\n @e_description = \"\"\n @e_description = doc.css('.e_description').text\n @url = \"\"\n @url = doc.css('#url').text\n @e_url = \"\"\n @e_url = doc.css('.e_url').text\n @width = \"\"\n @width = doc.css('#width').text\n @e_width = \"\"\n @e_width = doc.css('.e_width').text\n @height = \"\"\n @height = doc.css('#height').text\n @e_height = \"\"\n @e_height = doc.css('.e_height').text\n @html = \"\"\n @html = doc.css('#html').text\n @e_html = \"\"\n @e_html = doc.css('.e_html').text\n @thumbnail = \"\"\n @thumbnail = doc.css('#thumbnail').text\n @e_thumbnail = \"\"\n @e_thumbnail = doc.css('#embedcontent img').text\n @thumbnail_url = \"\"\n @thumbnail_url = doc.css('#thumbnail_url').text\n @e_thumbnail_url = \"\"\n @e_thumbnail_url = doc.css('.e_thumbnail_url').text\n @thumbnail_width = \"\"\n @thumbnail_width = doc.css('#thumbnail_width').text\n @e_thumbnail_width = \"\"\n @e_thumbnail_width = doc.css('.e_thumbnail_width').text\n @thumbnail_height = \"\"\n @thumbnail_height = doc.css('#thumbnail_height').text\n @e_thumbnail_height = \"\"\n @e_thumbnail_height = doc.css('.e_thumbnail_height').text\n @author = \"\"\n @author = doc.css('#author').text\n @e_author = \"\"\n @e_author = doc.css('.e_author').text\n @author_url = \"\"\n @author_url = doc.css('#author_url').text\n @e_author_url = \"\"\n @e_author_url = doc.css('.e_author_url').text\n @display = \"\"\n @display = doc.css('#display').text\n @e_display = \"\"\n @e_display = doc.css('.e_display').text\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scrapping }\n end\n end",
"title": ""
},
{
"docid": "4f3e0527e82775c8112b486b82e598fe",
"score": "0.52169317",
"text": "def embeddable_url\n return 'https://www.youtube.com/embed/' + video_id if source == 'youtube'\n return 'https://player.vimeo.com/video/' + video_id if source == 'vimeo'\n end",
"title": ""
},
{
"docid": "a7aa1b4143dea2c405aa65327661e245",
"score": "0.52143663",
"text": "def embeddable?(content_url)\n @providers.any?{ |provider| provider.regex =~ content_url }\n end",
"title": ""
},
{
"docid": "abeba67562c8769fe0fab6909bfc46b3",
"score": "0.52119863",
"text": "def wikiloc( trip_id, measures = \"off\", maptype = \"M\", size = [500,400] )\n\tsize.collect! {|i| i.to_i }\n\tsize[0] = 500 if size[0] == 0\n\tsize[1] = 400 if size[1] == 0\n\t%Q|<iframe frameBorder=\"0\" src=\"http://www.wikiloc.com/wikiloc/spatialArtifacts.do?event=view&id=#{h trip_id}&measures=#{h measures}&title=on&near=on&images=on&maptype=#{maptype}\" width=\"#{size[0]}px\" height=\"#{size[1]}px\"></iframe>|\nend",
"title": ""
},
{
"docid": "24e15f12e3ccdaf84de8c4e03511cdad",
"score": "0.5202322",
"text": "def hosted_sources(loc, key)\n @member.hosted_sources.collect{|hs| link_to(hs.name, hs)}.join(\", \")\n end",
"title": ""
},
{
"docid": "2cf19b438d305650a15697af4841f73d",
"score": "0.5191751",
"text": "def detect_album_or_song\n if self.link =~ /(album)/\n \"<iframe src='https://open.spotify.com/embed/album/#{album_code}' width='300' height='auto' frameborder='0' allowtransparency='true' allow='encrypted-media'></iframe>\"\n else\n \"<iframe src='https://open.spotify.com/embed/track/#{track_code}' width='300' height='auto' frameborder='0' allowtransparency='true' allow='encrypted-media'></iframe>\"\n end\n end",
"title": ""
},
{
"docid": "d022039e510dea85e2d2302257d76a1a",
"score": "0.51822835",
"text": "def subset_external_uri()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3348396eacbc4f7a555fb188fb230512",
"score": "0.5175403",
"text": "def get_embed_url(embed_code)\n regex = /(youtu\\.be\\/|youtube\\.com\\/(watch\\?(.*&)?v=|(embed|v)\\/))([^\\?&\"'>]+)/\n url = \"\" #placeholder url\n\n if embed_code.match(regex) != nil && embed_code.include?(\"iframe\")\n youtube_id = embed_code.match(regex)[5]\n Rails.logger.debug \"youtube_id : #{youtube_id}\"\n url = \"http://www.youtube.com/embed/\"+youtube_id\n end\n return url\n end",
"title": ""
},
{
"docid": "a312938469641e659a8c5f7829dc664a",
"score": "0.5141849",
"text": "def url_for_frameset; end",
"title": ""
},
{
"docid": "a312938469641e659a8c5f7829dc664a",
"score": "0.5141849",
"text": "def url_for_frameset; end",
"title": ""
},
{
"docid": "2f51aa4b416737eb0ae5a422ac263af2",
"score": "0.5128007",
"text": "def embedded_link_available?(url_data)\n merged_params = merged_embedded(url_data)\n\n # test if embedded flag is in path or url parameter\n embedded_link = url_for(merged_params)\n embedded_link_params = Rails.application.routes.recognize_path(embedded_link)\n embedded_link_params[:embedded].present?\n end",
"title": ""
},
{
"docid": "44378ae53f67378d9045e6f911fd5073",
"score": "0.511992",
"text": "def origin_listing_id\n case self.broker_site_name\n when 'citi-habitats'\n reg = self.origin_url.match(/\\/(\\d+)\\//)\n if reg\n reg[1]\n end\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "cbfe60a373327f6339284d1c69324b18",
"score": "0.5084637",
"text": "def affiliated_sources(loc, key)\n @member.affiliated_sources.collect{|as| \n (['list', 'feature'].include?(as.status)) ? link_to(as.name, as) : as.name\n }.join(\", \")\n end",
"title": ""
},
{
"docid": "5e83cc235c1782fc4098c840b83e3efd",
"score": "0.50471544",
"text": "def embed_url(host)\n return InstExercise.embed_url(host, self.short_name)\n end",
"title": ""
},
{
"docid": "43d9202717fc3981051a212e909b9c13",
"score": "0.5043811",
"text": "def verify_oembed_html\n return if self.data[:raw][:oembed][:html].blank?\n html = Nokogiri::HTML self.data[:raw][:oembed][:html]\n self.verify_oembed_html_script(html)\n self.verify_oembed_html_iframe(html)\n end",
"title": ""
},
{
"docid": "0c124f3340419414b3576682e063afa0",
"score": "0.50303555",
"text": "def post_info_for(url)\n puts \"post_info_for(#{url})\"\n page = $agent.get(url)\n #puts url\n #puts page.search('iframe').select { |i| i['src'] =~ /tumblr\\.com/ }.inspect\n\n if page.iframes.blank?\n puts \"No iframes? Aborting...\"\n return\n end\n iframe_url = page.iframes.select { |i| i.src =~ /tumblr\\.com/ }[0].src\n\n # puts \"Getting iframe @ #{iframe_url.inspect}...\"\n iframe = $agent.get(iframe_url)\n return { :reblog_link => iframe.links.first.href }\n\nrescue\n STDERR.puts \"(!!) Error getting original page: #{$!} \\n#{$!.backtrace.join('\\n\\t')}\"\nend",
"title": ""
},
{
"docid": "dfce7134f0180b35ef60e118826cd342",
"score": "0.5027691",
"text": "def add_oembed(el, href, title, alt_text = nil)\n \n providers = {\n :twitter => \"https://api.twitter.com/1/statuses/oembed.json?url=%s\",\n :youtube => \"http://www.youtube.com/oembed?url=%s&format=json&maxwidth=550\",\n :flickr => \"http://flickr.com/services/oembed?url=%s&maxwidth=460&format=json&maxwidth=550\",\n :vidler => \"http://lab.viddler.com/services/oembed/?url=%s&type=simple&format=json\",\n :qik => \"http://qik.com/api/oembed.json?url=%s&maxwidth=550\",\n :revision3 => \"http://revision3.com/api/oembed/?url=%s&format=json&maxwidth=550\",\n :hulu => \"http://www.hulu.com/api/oembed.json?url=%s&maxwidth=550\",\n :vimeo => \"http://vimeo.com/api/oembed.json?url=%s&maxwidth=550\",\n :collegehumor => \"http://www.collegehumor.com/oembed.json?url=%s&maxwidth=550\",\n # :pollyeverywhere => \"http://www.polleverywhere.com/services/oembed?url=%s&format=json\",\n # :opera => \"http://my.opera.com/service/oembed/?url=%s\",\n :embedly => \"http://api.embed.ly/1/oembed?url=%w&maxwidth=550\",\n :ifixit => \"http://www.ifixit.com/Embed?url=%s&format=json\",\n :smugmug => \"http://api.smugmug.com/services/oembed/?url=%s&format=json\",\n :slideshare => \"http://www.slideshare.net/api/oembed/2?url=%s&format=json&maxwidth=550\",\n :wordpress => \"http://public-api.wordpress.com/oembed/1.0/?format=json&url=%s&maxwidth=550\"\n }\n # ready the hash for matching\n provider_names = (providers.keys.each { |name| name.to_s }).join('|')\n # match possible providers to see if we have a provider suitable for embedding the current href/url \n result = href.match provider_names\n if result and result[0]\n safe_href = CGI.escape(href)\n provider = result[0].to_sym\n oembed_url = providers[provider] % safe_href\n # unique figure id\n fig_id = rand(1000)\n # oembed \n el = Element.new :oembed\n begin\n # get the oEmbed content\n result = JSON.parse(open(oembed_url).read)\n el.attr['provider_name'] = result['provider_name']\n case result['type']\n when \"photo\"\n title = result['title']\n el.attr['role'] = \"img\"\n img = Element.new(:img)\n img.attr['src'] = result['url']\n img.attr['alt'] = result['title']\n img.attr['width'] = result['width']\n img.attr['height'] = result['height']\n img.children.clear\n el.children << img\n when \"video\"\n title = result['title']\n el.attr['html'] = CGI.unescapeHTML(result['html'])\n when \"rich\"\n el.attr['html'] = CGI.unescapeHTML(result['html'])\n end\n \n if title\n # unique figure id\n el_id = rand(1000)\n el.attr['id'] = el_id\n cap = Element.new(:figCaption, title)\n cap.attr['id'] = el_id\n if el.attr['role'] === \"img\"\n link = Element.new(:a, result['author_name'])\n link.attr['href'] = result['author_url']\n cap.children << link\n end\n el.children << cap \n end\n @tree.children << el\n \n rescue\n warning(\"Could not retrieve oEmbed information for URL #{oembed_url}\")\n end\n else\n warning(\"No oEmbed provider found for URL #{href}\")\n end\n \n \n \n # if el.type == :a\n # el.attr['href'] = href\n # else\n # el.attr['src'] = href\n # el.attr['alt'] = alt_text\n # el.children.clear\n # end\n # el.attr['title'] = title if title\n # @tree.children << el\n end",
"title": ""
},
{
"docid": "71a988a70bacf4153afeef235eb353ae",
"score": "0.50271815",
"text": "def bandcamp_embed(part1, part2)\n\n iframe = \"<iframe class=\\\"bandcamp_iframe\\\" style=\\\"border: 0; width: 100%; height: 120px;\\\"\n src=\\\"#{part1}size=medium#{part2}\\\" seamless></iframe>\"\n iframe.html_safe\n end",
"title": ""
},
{
"docid": "88e08e2b519ec5d652ba5b1c8d21624d",
"score": "0.50266415",
"text": "def setIFrameURL\n #parse json and get src attribute for provided artifact_name\n @artifact_json = JSON.parse(File.read(File.join(Rails.root,'app','assets','artifacts','artifact.json')))\n end",
"title": ""
},
{
"docid": "d17446c1773f3cf6dc7cb951c234011c",
"score": "0.5018163",
"text": "def set_embed\n if self.category == 'youtube'\n code = self.link.split('=')[1]\n self.embed = \"<iframe width='700' height='400' src='http://www.youtube.com/embed/#{code}' frameborder='0' allowfullscreen></iframe>\"\n elsif self.category == 'slideshare'\n url = 'http://www.slideshare.net/api/oembed/2?url=' + link + '&format=xml&maxwidth=700&maxheight=400'\n slideshare_iframe = open_xml(url).xpath(\"//html\").children.first.text.split('<div').first\n code = slideshare_iframe.split('/embed_code/')[1].split('\"').first\n self.embed = '<iframe src=\"http://www.slideshare.net/slideshow/embed_code/' + code + '\" width=\"700\" height=\"400\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" style=\"border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px\" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>'\n end\n end",
"title": ""
},
{
"docid": "48085d7d9ed66b17afaff35287d8c408",
"score": "0.5015344",
"text": "def grab_embed(post, main_object)\n b = post.match(EmbeditRuby::EXTRACT_URL)\n url = b[1].nil? ? b[2].strip! : b[1].strip!\n embedit_data = main_object.embeds.find_by_url(url)\n end",
"title": ""
},
{
"docid": "7ce89982db54509500918c8b8e7735a2",
"score": "0.50104177",
"text": "def origins; end",
"title": ""
},
{
"docid": "ce41900880f8738ae0e0efdcdf21d53c",
"score": "0.4997325",
"text": "def iframe_embed_collection(ifrm_embd_detail, options={})\n ifrm_embds = []\n ifrm_embd_detail.each do |ifrmembd|\n hash = {}\n hash[:src] = ifrmembd.value.strip\n ifrm_embds << hash\n end\n collection_attr(ifrm_embds, options)\n end",
"title": ""
},
{
"docid": "a79a9303c6e6d69b0d9b00c965799de7",
"score": "0.4986552",
"text": "def locations\n body_element = hpricot_doc.at(@content_css_selector)\n master_extractor = Extractors::Master.new(body_element)\n master_extractor.locations\n end",
"title": ""
},
{
"docid": "726135f76db8012dbedf3fb20bb33243",
"score": "0.49851686",
"text": "def embed_link\n self.embed = detect_album_or_song\n end",
"title": ""
},
{
"docid": "561dbb24c8afdee51bc43dd378e2a266",
"score": "0.49787456",
"text": "def enhance_referent(request, data)\n \n entry = data[\"items\"].first\n \n\n if (volumeInfo = entry[\"volumeInfo\"])\n \n title = volumeInfo[\"title\"]\n title += \": #{volumeInfo[\"subtitle\"]}\" if (title && volumeInfo[\"subtitle\"])\n \n element_enhance(request, \"title\", title)\n element_enhance(request, \"au\", volumeInfo[\"authors\"].first) if volumeInfo[\"authors\"]\n element_enhance(request, \"pub\", volumeInfo[\"publisher\"])\n \n element_enhance(request, \"tpages\", volumeInfo[\"pageCount\"])\n \n if (date = volumeInfo[\"publishedDate\"]) && date =~ /^(\\d\\d\\d\\d)/\n element_enhance(request, \"date\", $1)\n end\n \n # LCCN is only rarely included, but is sometimes, eg:\n # \"industryIdentifiers\"=>[{\"type\"=>\"OTHER\", \"identifier\"=>\"LCCN:72627172\"}], \n # Also \"LCCN:76630875\"\n #\n # And sometimes OCLC number like:\n # \"industryIdentifiers\"=>[{\"type\"=>\"OTHER\", \"identifier\"=>\"OCLC:12345678\"}],\n # \n (volumeInfo[\"industryIdentifiers\"] || []).each do |hash|\n \n if hash[\"type\"] == \"ISBN_13\"\n element_enhance(request, \"isbn\", hash[\"identifier\"])\n \n elsif hash[\"type\"] == \"OTHER\" && hash[\"identifier\"].starts_with?(\"LCCN:\")\n lccn = normalize_lccn( hash[\"identifier\"].slice(5, hash[\"identifier\"].length) )\n request.referent.add_identifier(\"info:lccn/#{lccn}\")\n \n elsif hash[\"type\"] == \"OTHER\" && hash[\"identifier\"].starts_with?(\"OCLC:\")\n oclcnum = normalize_lccn( hash[\"identifier\"].slice(5, hash[\"identifier\"].length) )\n request.referent.add_identifier(\"info:oclcnum/#{oclcnum}\")\n end\n \n end \n end \n end",
"title": ""
},
{
"docid": "05df3849ede7e82223cc50840b64c7c3",
"score": "0.4973255",
"text": "def embed_video_code\n \"<iframe/>\"\n end",
"title": ""
},
{
"docid": "93dc84c75b4651a839ceedbe3f6a4f19",
"score": "0.4962874",
"text": "def location\n fetch('the_expanse.locations')\n end",
"title": ""
},
{
"docid": "f3bac45d045a64a779557d160feb6bdf",
"score": "0.4959393",
"text": "def content_sources\n return @content_sources\n end",
"title": ""
},
{
"docid": "ad29d69c59e46dbc95120a12a0753dd6",
"score": "0.49562198",
"text": "def loc?\n term_config.url_config.template.starts_with? 'http://id.loc.gov/authorities/'\n end",
"title": ""
},
{
"docid": "b2faac927e60b49c6abb0b13f61da820",
"score": "0.49555612",
"text": "def embed_id\n match = @node.inner_text.strip.match(self.class.url_regexp)\n \"#{match[:handle]}/#{match[:id]}\" if match\n end",
"title": ""
},
{
"docid": "5fd8494437450d5f1c4e2ca21e771dcf",
"score": "0.49505025",
"text": "def embed( url, options = [ ])\n\n\t\t\t@embed ||= { }\n\t\t\t@embed[ local_variables ] ||= (\n\n\t\t\t\tmedia = nil\n\n\t\t\t\t@collection.providers( url ) do | provider |\n\t\t\t\t\tif ( media = provider.embed( url, options ))\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tmedia\n\t\t\t)\n\t\tend",
"title": ""
},
{
"docid": "297b7570f2920dd12cabd441e936d91f",
"score": "0.4940819",
"text": "def retrieve_remote_geocoordinate_resources(site)\n base_uri = site[0..site.rindex(/\\//)]\n country_codes = []\n page = Nokogiri::HTML(open(site))\n\n #puts page.class # => Nokogiri::HTML::Document\n links = page.css('div table tr td a')\n links.each do |link|\n #Nokogiri::XML::Element method\n if link.key?(\"href\")\n if link[\"href\"].length > 7 and link[\"href\"][0..7] == \"cntyfile\"\n if link[\"href\"][0] != \"#\"\n link_string = link[\"href\"].to_s\n country_codes << link_string[9..-5]\n end\n end\n end\n end\n\n return country_codes\nend",
"title": ""
},
{
"docid": "8d16d05db0686485fdd5195b333ca786",
"score": "0.4939704",
"text": "def slideshare( embed_code )\n\t%Q|<iframe src=\"http://www.slideshare.net/slideshow/embed_code/#{embed_code}\" width=\"425\" height=\"355\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"></iframe>|\nend",
"title": ""
},
{
"docid": "cbba8415b71a2d84607423e92a7616f4",
"score": "0.49340212",
"text": "def embed_video_code\r\n \"<iframe />\"\r\n end",
"title": ""
},
{
"docid": "de05b2f706f655f562b8352e9daa4ea0",
"score": "0.4931099",
"text": "def extract_art(doc)\n url = nil\n element = doc.at(\"* div[@class='LargeItemPhoto150'] a[@href^=javascript]\")\n href = element[\"href\"] if !element.nil? && !element[\"href\"].nil?\n if href\n match, url = *href.match(/javascript:photo_opener\\('(http:\\/\\/.*.jpg)&/)\n end\n url \n end",
"title": ""
},
{
"docid": "5163cfd849f1a1480bc023f25bf603d6",
"score": "0.49285606",
"text": "def popup_source(subdomain, url, options={})\n <<-EOF\n <script src=\"#{Api.host}/openid/v#{extract_version(options)}/widget\" type=\"text/javascript\"></script>\n <script type=\"text/javascript\">\n //<![CDATA[\n RPXNOW.token_url = '#{url}';\n RPXNOW.realm = '#{subdomain}';\n RPXNOW.overlay = true;\n #{ \"RPXNOW.language_preference = '#{options[:language]}';\" if options[:language] }\n #{ \"RPXNOW.default_provider = '#{options[:default_provider]}';\" if options[:default_provider] }\n #{ \"RPXNOW.flags = '#{options[:flags]}';\" if options[:flags] }\n //]]>\n </script>\n EOF\n end",
"title": ""
},
{
"docid": "5d009e503dd36055b8c5de258ff9d912",
"score": "0.49277887",
"text": "def urls\n references.map do |el|\n case el\n when %r{^IANA$}\n IANA_URL % [ @media_type, @sub_type ]\n when %r{^RFC(\\d+)$}\n RFC_URL % $1\n when %r{^DRAFT:(.+)$}\n DRAFT_URL % $1\n when %r{^\\{([^=]+)=([^\\}]+)\\}}\n [$1, $2]\n when %r{^\\[([^=]+)=([^\\]]+)\\]}\n [$1, CONTACT_URL % $2]\n when %r{^\\[([^\\]]+)\\]}\n CONTACT_URL % $1\n else\n el\n end\n end\n end",
"title": ""
},
{
"docid": "1f68698f251702daa72dfc86e3cd8caa",
"score": "0.49258444",
"text": "def all_linked_zone_identifiers; end",
"title": ""
},
{
"docid": "5faa1aba7d83eaeea2837a13201a7324",
"score": "0.49143478",
"text": "def content_area\n current_page.frame(:name, /isolatedWorkArea/)\n end",
"title": ""
},
{
"docid": "d10d5f6dc869ccdc698bc0689c899794",
"score": "0.49073476",
"text": "def viewer\n @urls = SlideUrl.find(:all)\n end",
"title": ""
},
{
"docid": "ef0d21a89aaabdb2afaefbe0665a1d4e",
"score": "0.48973882",
"text": "def sourcelookup\n all_matching_records = []\n msg = 'Sourcelookup of '\n if params[:doi]\n msg << \"doi #{params[:doi]}\"\n logger.info(msg)\n all_matching_records += DoiSearch.search(params[:doi].strip)\n elsif params[:pmid]\n msg << \"pmid #{params[:pmid]}\"\n logger.info(msg)\n all_matching_records += PubmedHarvester.search_all_sources_by_pmid(params[:pmid].strip)\n else\n raise ActionController::ParameterMissing, :title unless params[:title].presence\n title = params[:title].delete('\"')\n msg << \"title '#{title}'\"\n logger.info(msg)\n if Settings.WOS.enabled\n query = \"TI=\\\"#{title}\\\"\"\n query += \" AND PY=#{params[:year]}\" if params[:year]\n wos_matches = WebOfScience.queries.user_query(query).next_batch.to_a # limit: only 1 batch\n all_matching_records += wos_matches\n logger.debug(\" -- WOS (#{wos_matches.length})\")\n end\n if Settings.SCIENCEWIRE.enabled\n sw_matches = ScienceWireClient.new.query_sciencewire_for_publication(nil, nil, nil, params[:title], params[:year], params.fetch(:max_rows, 20).to_i)\n all_matching_records += sw_matches\n logger.debug(\" -- sciencewire (#{sw_matches.length})\")\n end\n # lastly, always check for manual\n results = Publication.joins(:user_submitted_source_records)\n .where(UserSubmittedSourceRecord.arel_table[:title].matches(\"%#{params[:title]}%\"))\n results = results.where(year: params[:year]) if params[:year]\n logger.debug(\" -- manual source (#{results.length})\")\n all_matching_records += results\n end\n # When params[:maxrows] is nil/zero, -1 returns everything\n matching_records = all_matching_records[0..params[:maxrows].to_i - 1]\n respond_to do |format|\n format.json do\n render json: wrap_as_bibjson_collection(msg, matching_records)\n end\n end\n end",
"title": ""
},
{
"docid": "4f1b694cc133411f4347a53a142311e3",
"score": "0.48944134",
"text": "def hulu_sources\n [\n source_obj(\"free_web_sources\", \"hulu_free\"),\n source_obj(\"subscription_web_sources\", \"hulu_plus\"),\n source_obj(\"subscription_web_sources\", \"hulu_with_showtime\")\n ]\n end",
"title": ""
},
{
"docid": "19df45b4525f4b9d05e3eb45ab65f83b",
"score": "0.488163",
"text": "def get_video_iframe url\n video_id = find_video_id url\n uri = \"https://vimeo.com/api/oembed.json?url=https%3A//vimeo.com/#{ video_id }\"\n response = Net::HTTP.get( URI.parse( uri ))\n json = JSON.parse response\n json['html'].html_safe\n end",
"title": ""
},
{
"docid": "fcff95b17196e88bacd5ff58e0ea1890",
"score": "0.48783252",
"text": "def landing_page\n identifiers.find { |i| DMP_ID_TYPES.include?(i.identifier_format) }\n end",
"title": ""
},
{
"docid": "ae5f26b589ccd71a37de85033e7e6300",
"score": "0.48718247",
"text": "def teams_embedded_content_url=(value)\n @teams_embedded_content_url = value\n end",
"title": ""
},
{
"docid": "688d16d6ab6aa727887ae70024b7ce78",
"score": "0.48661375",
"text": "def invite_show\n render_iframe(show_invite_url(:only_path => false, :canvas => false, :id => params[:id], :meeting_id => params[:meeting_id]) )\n end",
"title": ""
},
{
"docid": "47acc1dd40cc355830fee1ecc4d5b07c",
"score": "0.48578784",
"text": "def extract( source )\n\n\t\t\t@extract ||= { }\n\t\t\t@extract[ local_variables ] ||= (\n\n\t\t\t\tif ( url =~ URI::regexp )\n\t\t\t\t\treturn [ source ] if @collection.has_provider?( source )\n\t\t\t\t\tsource = HTTP.get( URI( source ))\n\t\t\t\tend\n\n\t\t\t\turls = self._extract_urls( source )\n\t\t\t\tembeddable = [ ]\n\n\t\t\t\turls.each do | url |\n\t\t\t\t\tembeddable.push( url ) if @collection.has_provider?( url )\n\t\t\t\tend\n\n\t\t\t\tembeddable.uniq\n\t\t\t)\n\t\tend",
"title": ""
},
{
"docid": "60b2cd45dd6b828f1e6f550a8678af88",
"score": "0.4857371",
"text": "def scrape_xur_location\n doc = Nokogiri::HTML(open(@url))\n @date = doc.css(\".col-xs-12>h2\").first.children.first.text\n\n # first row with xurs inventory\n row = doc.css(\".col-xs-12.col-sm-6>h2\").first.parent.parent\n if row.css(\".col-xs-12.col-sm-6>img\").any?\n # for example: '/assets/findxur/xur-location-speaker-north.png'\n path = doc.css(\".col-xs-12.col-sm-6>img\").first.attributes['src'].value\n @map = \"#{@url.scheme}://#{@url.host}#{path}\"\n elsif row.css(\"p\").any?\n @map = row.css(\"p\").text\n else\n @map = \"Couldn't find him\"\n end\n end",
"title": ""
},
{
"docid": "675bc678009d91a2e902419a3bf95c18",
"score": "0.48546493",
"text": "def find_by_url_mask\n masked_resources = UrlMask.find_resource_by_url( request.path )\n logger.info \"#{masked_resources}\".color(:yellow)\n unless masked_resources.empty?\n prepare_variables_for_masked_resources( masked_resources )\n prepare_resources_by_region( masked_resources )\n logger.info \"\\n Found content for regions, #{@_content_for_region}\".color :green\n end \n end",
"title": ""
},
{
"docid": "9264a0832f5d71c5bab5a63c8bda9ba1",
"score": "0.4850866",
"text": "def visible_pages_with_embeddables\n InteractivePage\n .includes(sections: {page_items: :embeddable})\n .where(:lightweight_activity_id => self.id, :is_hidden => false)\n .order(:position)\n end",
"title": ""
},
{
"docid": "f8d470cdb59414a3df31380f6d53657d",
"score": "0.4847842",
"text": "def view_embedded?\n params[:view_as]&.in? %w[embedded simple-embedded]\n end",
"title": ""
},
{
"docid": "13d5ee73b5fbc1a04fdd86d45a8ae00d",
"score": "0.484752",
"text": "def oembed_url(doc)\n self.class.oembed_url(doc)\n end",
"title": ""
},
{
"docid": "e6c5e305c482a56dcd25053610feb1a4",
"score": "0.48437622",
"text": "def sources\n fetch(:sources)\n end",
"title": ""
},
{
"docid": "970cea083d42c50b5a8e50538406ea25",
"score": "0.48410866",
"text": "def oembed_url\n \"https://vimeo.com/api/oembed.json?url=#{source_url}\"\n end",
"title": ""
},
{
"docid": "75a84f897637d8cba91eb721ead973ce",
"score": "0.48354194",
"text": "def embedded_object\n case @element.embed_type.to_sym\n when :youtube_video\n youtube_node\n when :vimeo_video\n vimeo_node\n when :facebook_video\n facebook_node\n when :tweet\n tweet_node\n when :slideshare\n iframe_node\n when :soundcloud\n soundcloud_node\n end\n end",
"title": ""
},
{
"docid": "b1f03cd867b1a7c55c02147f2d59d371",
"score": "0.4832948",
"text": "def embed_playback_url\n\nend",
"title": ""
},
{
"docid": "f2f4bd9f38dbe7985c3bc682c613e22d",
"score": "0.48325878",
"text": "def extract_fbid(element)\n begin\n result= element.search(%|[@alt]|).attr('src').match(/q\\d*_/).to_s.sub('q','').sub('_','')\n rescue\n result=nil\n end\n return result\n end",
"title": ""
},
{
"docid": "72293e6fa15cde6932813419cefc36c6",
"score": "0.4827728",
"text": "def source_url\n \"https://vimeo.com/#{@element.embed_id}\"\n end",
"title": ""
},
{
"docid": "52ccc0f5dc294521725a2f7357d6d94f",
"score": "0.48264548",
"text": "def url_content\n self.urn\n end",
"title": ""
},
{
"docid": "6468599b1e4567701e23fbc5b4d4cdd7",
"score": "0.4826244",
"text": "def update_original_iframe_url\n begin\n iframe_url = self.html_content_to_html.css('iframe').first['src'].to_s\n self.update(:iframe_url_original => iframe_url)\n rescue\n puts \"error in the update\"\n end\n end",
"title": ""
},
{
"docid": "d56a91d4a75f40ba92f0a2ad8fdf5742",
"score": "0.4825471",
"text": "def site_ids_for_location(radius, location)\n html = search_by_location(radius, location)\n detail_links = Canmore::Parser::Search.new(html).detail_links\n six_digits = /site\\/([0-9]{6})\\//\n detail_links.select {|link| link.to_s =~ six_digits}.map {|link| link.to_s.match(six_digits)[1]}\n end",
"title": ""
},
{
"docid": "cefac7f5324b008cde8e0ced27569b82",
"score": "0.4825301",
"text": "def search_links(electronic_access)\n urls = []\n unless electronic_access.nil?\n links_hash = JSON.parse(electronic_access)\n links_hash.first(2).each do |url, text|\n link = link_to(text.first, \"#{ENV['proxy_base']}#{url}\", target: '_blank')\n link = \"#{text[1]}: \".html_safe + link if text[1]\n urls << content_tag(:div, link, class: 'library-location')\n end\n end\n urls\n end",
"title": ""
},
{
"docid": "658143b79aa0bb22ea815c4a1cd147f0",
"score": "0.4821733",
"text": "def get_publisher\n # TODO: temporary solution for one publisher\n get_publisher_by_link_to_front_page\n end",
"title": ""
},
{
"docid": "7c2829b6fccd46b46021e92d69dd2902",
"score": "0.48134094",
"text": "def file_scoped_include?(ex_metadata, ids, locations); end",
"title": ""
},
{
"docid": "e1c3bea6adbaabeda13f532f4588ea65",
"score": "0.48106948",
"text": "def search_origin\n if origin == \"official\"\n query.where(decidim_author_id: nil)\n elsif origin == \"citizens\"\n query.where.not(decidim_author_id: nil)\n else # Assume 'all'\n query\n end\n end",
"title": ""
},
{
"docid": "af2bbb97f6ab0bfb55abfc5595878af4",
"score": "0.48073962",
"text": "def show\n @seances = Seance.where(movie_id: params[:id]).seven_days_from_now.where(block: false)\n if /src\\s*=\\s*\"([^\"]*)\"/.match(@movie.url_trailer) == nil\n @src = \"https://www.youtube.com/embed/H-IVzFIRSVE\"\n else\n @src = /src\\s*=\\s*\"([^\"]*)\"/.match(@movie.url_trailer)[1]\n end\n end",
"title": ""
},
{
"docid": "bf85f340764b34195fe27a48f3572241",
"score": "0.48065135",
"text": "def author_display_location\r\n return \"\" if user.blank?\r\n\r\n if source\r\n return user.display_location unless user.proxy_user?\r\n if partner_review\r\n loc = partner_review.partner_reviewer.location\r\n return loc.blank? ? \"Unknown\" : loc\r\n end\r\n end\r\n\r\n \"Unknown\"\r\n end",
"title": ""
},
{
"docid": "2491ccf79d88c135900062d97afdde60",
"score": "0.4804361",
"text": "def emulate_iframe_widget\n widget_name = params[:widget_name]\n (@base_widget_name, @widget_format) = $1, $2 if widget_name =~ /(.*)-(\\w*-\\w*)/\n if (@base_widget_name.nil? || @widget_format.nil?)\n render_404 and return\n end\n render(:layout => \"widget_iframe\")\n end",
"title": ""
},
{
"docid": "264ce737ddc249339477c4b67cbc7cde",
"score": "0.48035634",
"text": "def pages_with_embeddables\n return InteractivePage.includes(:interactive_items, :page_items => :embeddable).where(:lightweight_activity_id => self.id)\n end",
"title": ""
},
{
"docid": "5a72baeb53fa0f5a197569231d682717",
"score": "0.48027074",
"text": "def djatoka_init_openlayers(rft_id, div_identifier, params={})\n resolver = determine_resolver(params)\n metadata_url = resolver.metadata_url(rft_id)\n %Q|<script type=\"text/javascript\">\n jQuery(document).ready(function() {openlayersInit('#{resolver.scheme}://#{resolver.host}',\n '#{metadata_url}',\n '#{rft_id}', '#{div_identifier}');\n });\n </script>\n |\n end",
"title": ""
},
{
"docid": "d23883e03b6b547ba0291ca469fed1c6",
"score": "0.48016566",
"text": "def source_identifier\n source_well&.identifier || source_tube&.identifier\n end",
"title": ""
},
{
"docid": "ddff449d09aa534065d7af2c2bb6ee6d",
"score": "0.4798959",
"text": "def embed email\n response = RestClient.post( \"#{API[:url]}embed_document_frame\",\n 'service' => API[:service],\n 'password' => API[:password],\n 'body' => { \"document_id\" => document_id,\n \"email\" => \"petitions@example.org\",\n \"location\" => \"http:/scrive-petitions.heroku.com/#{slug}\"\n }.to_json\n )\n raise \"Could not retreive embed_frame from API!\" unless response\n\n JSON.parse(response)['link'] + \"sign\"\n end",
"title": ""
},
{
"docid": "bc0a52de394489331147669e60689c98",
"score": "0.47983995",
"text": "def remote_a\n return unless @page_a_tags\n remote_a = []\n @page_a_tags.uniq.each do |link|\n uri = URI(link[0].to_ascii)\n if uri && @site_domain\n remote_a << link[0] unless uri.host == @site_domain\n end\n end\n remote_a\n end",
"title": ""
},
{
"docid": "a903b21fb7c30d2f6a73bdf22b12d51e",
"score": "0.47957402",
"text": "def complete_url(start_url, page_source)\r\n page_source.gsub!(/<iframe.*?src\\=\\\"(.*?)\\\">/){ |m|\r\n tmp = $1\r\n if tmp =~ /^\\.\\./\r\n rep = get_full_path(start_url, tmp)\r\n else\r\n rep = get_full_path_2(start_url, tmp)\r\n end\r\n m.sub!(tmp,rep)\r\n puts m\r\n m\r\n }\r\n # url(../../fdfa.jpg)\r\n page_source.gsub!(/url\\(\\\"?(.*?)\\\"?\\)/i){ |m|\r\n tmp = $1\r\n if tmp =~ /^\\.\\./\r\n rep = get_full_path(start_url, tmp)\r\n else\r\n rep = get_full_path_2(start_url, tmp)\r\n end\r\n m.sub!(tmp,rep)\r\n puts m\r\n m\r\n }\r\n page_source\r\n end",
"title": ""
},
{
"docid": "17a7f2532478d4399803f8fd7f09ff84",
"score": "0.47910547",
"text": "def origins\n response = Sipgate.instance.own_uri_list\n return nil unless response[:status_code] == 200 && response[:own_uri_list]\n response[:own_uri_list].\n select{|uri_spec| uri_spec[:tos].include?(\"voice\") }.\n collect{|uri_spec| [\n uri_spec[:uri_alias].blank? ? uri_spec[:e164_out] : uri_spec[:uri_alias],\n uri_spec[:sip_uri]\n ]}\n end",
"title": ""
},
{
"docid": "dd5131baeadffb925578c7fe72f90d5e",
"score": "0.47893876",
"text": "def embedded?\n return embed_url && !embed_url.empty?\n end",
"title": ""
},
{
"docid": "0c13c4864fb1f73027286e96e02c01a8",
"score": "0.47887322",
"text": "def visible_pages_with_embeddables\n InteractivePage\n .includes(:page_items => :embeddable)\n .where(:lightweight_activity_id => self.id, :is_hidden => false)\n .order(:position)\n end",
"title": ""
},
{
"docid": "eaccc1cb72a5ec9abc53ced5d0471298",
"score": "0.47849298",
"text": "def fetch_source_data\n doc = Hpricot(open(@source))\n p doc\n {\n :excerpt => (doc/\"//a[@href='#{@target}']/..\").inner_html,\n :title => (doc/'//title').inner_html,\n :url => @source\n }\n end",
"title": ""
},
{
"docid": "8e2fedba92cbd398137bf4039e1da7db",
"score": "0.47806406",
"text": "def embedded_map_url\n \"http://snippets.mapmycdn.com/routes/view/embedded/#{map_my_run_id}?width=600&height=400&&line_color=E60f0bdb&rgbhex=DB0B0E&distance_markers=0&unit_type=imperial&map_mode=ROADMAP\"\n end",
"title": ""
},
{
"docid": "815eb3538ade0dfa02d52da41d5adadb",
"score": "0.47785598",
"text": "def locate\n how = @how\n what = @what\n frames = @container.document.frames\n target = nil\n\n for i in 0 .. (frames.length - 1)\n next unless target == nil\n this_frame = frames.item(i)\n if how == :index \n if i + 1 == what\n target = this_frame\n end\n elsif how == :name\n begin\n if what.matches(this_frame.name)\n target = this_frame\n end\n rescue # access denied?\n end\n elsif how == :id\n # BUG: Won't work for IFRAMES\n if what.matches(@container.document.getElementsByTagName(\"FRAME\").item(i).invoke(\"id\"))\n target = this_frame\n end\n else\n raise ArgumentError, \"Argument #{how} not supported\"\n end\n end\n \n unless target\n raise UnknownFrameException, \"Unable to locate a frame with name #{ what} \" \n end\n target \n end",
"title": ""
},
{
"docid": "684dd415dc4145ccbc2d6bb6b5662e91",
"score": "0.47769645",
"text": "def xfinity_sources\n [\n source_obj(\"free_web_sources\", \"xfinity\"),\n source_obj(\"tv_everywhere_web_sources\", \"xfinity_tveverywhere\"),\n source_obj(\"purchase_web_sources\", \"xfinity_purchase\")\n ]\n end",
"title": ""
}
] |
57236a011628d4f52fc27924758cb1c9
|
read the first argument
|
[
{
"docid": "f76faabc773d2d9b2d0a2364edde3d68",
"score": "0.0",
"text": "def hashcode_of wd\n wd.downcase.split('').sort.join('')\nend",
"title": ""
}
] |
[
{
"docid": "b91c9f0741cb94e3f7212a262891d938",
"score": "0.74486846",
"text": "def first_argument; end",
"title": ""
},
{
"docid": "b91c9f0741cb94e3f7212a262891d938",
"score": "0.74486846",
"text": "def first_argument; end",
"title": ""
},
{
"docid": "b91c9f0741cb94e3f7212a262891d938",
"score": "0.74486846",
"text": "def first_argument; end",
"title": ""
},
{
"docid": "b91c9f0741cb94e3f7212a262891d938",
"score": "0.74486846",
"text": "def first_argument; end",
"title": ""
},
{
"docid": "974fc79fe6aebe42e0389e4b9fee6e44",
"score": "0.74472064",
"text": "def first_argument\n arguments[0]\n end",
"title": ""
},
{
"docid": "7cf3e9bc30a3c440f89511e8bbca03d9",
"score": "0.72431153",
"text": "def first_argument(*args); argument(0, *args); end",
"title": ""
},
{
"docid": "a4f9e0a670868589fd10daf628ad21c7",
"score": "0.7102231",
"text": "def argumentReader \n\t\tif @argument[0].to_s == \"\" \n\t\t\tshow\n\t\telsif @argument[0] == \"add\" and @argument[1].to_s != \"\"\n\t\t\tadd(@argument[1])\n\t\telsif @argument[0] == \"rm\" and @argument[1].to_i > 0\n\t\t\trm(@argument[1])\n\t\telsif @argument[0] == (\"help\")\n\t\t\thelp\n\t\telse\n\t\t\tputs \"error: (invalid argument)\\nenter 'help' for a list of valid arguments\"\n\t\tend\n\t\t\n\tend",
"title": ""
},
{
"docid": "fd9678efd7e7aabfc5fbe6bd60870f4e",
"score": "0.70015556",
"text": "def read=(_arg0); end",
"title": ""
},
{
"docid": "f0d1ac539f917c1b6994c592cf386b94",
"score": "0.6938902",
"text": "def get_arg(read_point)\n result = read_point.next\n fail if COMMAND_LINE.exists?(result) #An arg should not be a command!\n result\n rescue\n fail \"Error in #{short_name.inspect}: Invalid argument: #{result.inspect}\"\n end",
"title": ""
},
{
"docid": "70d0a719fba7da46e9d0beb92cf614b8",
"score": "0.6861132",
"text": "def arg\n ARGV[0].to_s\nend",
"title": ""
},
{
"docid": "91db0a33ca37b1c7dffd0e9c32ef216b",
"score": "0.68529326",
"text": "def read_and_validate_arguments(arg)\n #handle error for more than one argument\n if arg.empty?\n raise \"no expression provided\"\n elsif arg.length > 1\n raise \"more than 1 expression given\"\n else\n ret = arg.shift\n return ret\n end\n\n end",
"title": ""
},
{
"docid": "c417a40b9efaafb2b8ab128be7952f5d",
"score": "0.6770479",
"text": "def read(*args)\n case args.size\n when 0\n read_all\n when 1\n read_part(args[0].to_i, \"\")\n when 2\n read_part(args[0].to_i, args[1])\n else\n raise ArgumentError, \"wrong number of arguments (#{args.size} for 0 .. 2)\"\n end\n end",
"title": ""
},
{
"docid": "22379a8daaa8b8e34934310381a16351",
"score": "0.67428654",
"text": "def arg1\n case command_type\n when C_ARITHMETIC\n @command\n when C_RETURN\n raise 'Cannot be called'\n else\n @command.split[1]\n end\n end",
"title": ""
},
{
"docid": "329c9ea85119bdc68ff0ec1fd51dcd87",
"score": "0.67072195",
"text": "def read_args\n ARGV.each_with_index do |arg, i|\n if arg[0] == '-'\n if arg == '-v'\n puts \"#{$0} version 2014-02-01\"\n else\n $stderr.puts \"unknown option #{arg}\"\n end\n elsif @path.nil?\n @path = arg\n elsif @commit_sha1.nil?\n @commit_sha1 = arg\n else\n $stderr.puts \"warning: ignoring argument '#{arg}'\"\n end\n end\n end",
"title": ""
},
{
"docid": "a1a4e602a57a5aafc512dca3ced5af23",
"score": "0.67045176",
"text": "def read(*args); end",
"title": ""
},
{
"docid": "a1a4e602a57a5aafc512dca3ced5af23",
"score": "0.67045176",
"text": "def read(*args); end",
"title": ""
},
{
"docid": "a1a4e602a57a5aafc512dca3ced5af23",
"score": "0.67045176",
"text": "def read(*args); end",
"title": ""
},
{
"docid": "4e31e79fbfcee9c17095b46537176d18",
"score": "0.6621278",
"text": "def get_arg\n\tif ARGV.length != 1 then\n message(@usage1)\n stopp\n\tend\n\n\t@file_name = ARGV[0]\n\n#File existence check\n\tif File.exist?(@file_name) == false then\n\t\tmessage(@usage3)\n\t\tstopp\n\tend\n\n#File name check: Is it the TXT file ????\n\tif File.extname(@file_name) != \".txt\" then\n\t\tmessage(@usage1)\n\t\tstopp\n\tend\n\n#Check: File size >1Mb ????\n\tif File.size(@file_name) >= 1048576 then\n\t\tmessage(@usage4)\n\t\tstopp\n\tend\n\n#Check: File is empty ???\n\tif File.size?(@file_name) == nil then\n\t\tmessage(@usage5)\n\t\tstopp\n\tend\nend",
"title": ""
},
{
"docid": "fcbc80095ee250c19bd7dcbaeb08ba1a",
"score": "0.66075784",
"text": "def readline(*rest) end",
"title": ""
},
{
"docid": "8990a7b5608d2ea736d44a576dda7adf",
"score": "0.65928537",
"text": "def get_one_optional_argument\n args = options[:args] || []\n args.first\n end",
"title": ""
},
{
"docid": "8990a7b5608d2ea736d44a576dda7adf",
"score": "0.65928537",
"text": "def get_one_optional_argument\n args = options[:args] || []\n args.first\n end",
"title": ""
},
{
"docid": "884e6787fa4562f382bae6f3457e6d20",
"score": "0.6590686",
"text": "def splat_argument\n args(:rest).first\n end",
"title": ""
},
{
"docid": "3441c4569ae206289af265fed1eb34a0",
"score": "0.65316236",
"text": "def first_argument_index\n 1\n end",
"title": ""
},
{
"docid": "6674c29bcda65f32dd82696a9e068446",
"score": "0.65245473",
"text": "def first(*args); end",
"title": ""
},
{
"docid": "1d2ded4b0b95cdde4fd891c1bcb71c9e",
"score": "0.6510277",
"text": "def first(arg0, arg1, *rest)\n end",
"title": ""
},
{
"docid": "1d2ded4b0b95cdde4fd891c1bcb71c9e",
"score": "0.6510277",
"text": "def first(arg0, arg1, *rest)\n end",
"title": ""
},
{
"docid": "d3360e1000844364af290b658e789853",
"score": "0.6496557",
"text": "def read_and_validate_arg()\n arg = ARGV[0]\n value = arg.to_i\n\n if value < 0\n nil\n else\n value\n end\nend",
"title": ""
},
{
"docid": "80364fdadecb07537c706eeda6fe37f3",
"score": "0.6473312",
"text": "def get_next_arg\n @argv ||= ARGV\n @argv.shift\nend",
"title": ""
},
{
"docid": "5fe7d0bb04cd600225dd85d703a5eb40",
"score": "0.64410096",
"text": "def first_argument_index; end",
"title": ""
},
{
"docid": "5fe7d0bb04cd600225dd85d703a5eb40",
"score": "0.64410096",
"text": "def first_argument_index; end",
"title": ""
},
{
"docid": "5fe7d0bb04cd600225dd85d703a5eb40",
"score": "0.64410096",
"text": "def first_argument_index; end",
"title": ""
},
{
"docid": "5fe7d0bb04cd600225dd85d703a5eb40",
"score": "0.64410096",
"text": "def first_argument_index; end",
"title": ""
},
{
"docid": "5fe7d0bb04cd600225dd85d703a5eb40",
"score": "0.64410096",
"text": "def first_argument_index; end",
"title": ""
},
{
"docid": "5fe7d0bb04cd600225dd85d703a5eb40",
"score": "0.64410096",
"text": "def first_argument_index; end",
"title": ""
},
{
"docid": "dfadd8a7cbdc893db7eb5b8de6581010",
"score": "0.6411259",
"text": "def input=(_arg0); end",
"title": ""
},
{
"docid": "dfadd8a7cbdc893db7eb5b8de6581010",
"score": "0.6411259",
"text": "def input=(_arg0); end",
"title": ""
},
{
"docid": "dfadd8a7cbdc893db7eb5b8de6581010",
"score": "0.6411259",
"text": "def input=(_arg0); end",
"title": ""
},
{
"docid": "e920ee66558d640f5cbc73d8bb59099f",
"score": "0.63633585",
"text": "def next_arg(argv)\n option?(argv.at(0)) ? nil : argv.shift\n end",
"title": ""
},
{
"docid": "bd92744f627b658d14d11a166dafc09e",
"score": "0.6343101",
"text": "def arg1(line)\n case line[/^[.:\\w-]*/]\n when \"add\", \"sub\", \"neg\", \"eq\", \"gt\", \"lt\", \"and\", \"or\", \"not\"\n return line\n else\n line.gsub!(/^[.:\\w-]*/,\"\")\n return line[/^*[.:\\w_]+/]\n end\n end",
"title": ""
},
{
"docid": "809a201c18feeb5dc89aa9d83bdeef6f",
"score": "0.63253665",
"text": "def sysread(*rest) end",
"title": ""
},
{
"docid": "51e387a53535b67d1b5744df4edc1cc1",
"score": "0.6324875",
"text": "def arg\n ARGV.shift.tap do |arg|\n if arg.nil?\n die 'expected an argument; got none'\n end\n end\nend",
"title": ""
},
{
"docid": "89ca2f10469a64e0bb185647fcdcb6bf",
"score": "0.63144004",
"text": "def peek\n @args.first\n end",
"title": ""
},
{
"docid": "dcde33018b6130bd531ef3d32ca6676a",
"score": "0.63118416",
"text": "def get_input\n input = nil\n\n input = (ARGV.count == 1) ? ARGV.first : ARGV.join(' ')\n\n if ARGV.empty?\n input = STDIN.read\n end\n\n input.strip.gsub(/[,]/, '').gsub(/\\n/, '')\nend",
"title": ""
},
{
"docid": "2cf5831d623a12e4e6a5b508681b1a10",
"score": "0.62678105",
"text": "def fetch_parameter(name)\n index = ARGV.index(name)\n if index == nil || index >= ARGV.length\n raise ArgumentError.new(\"Parameter #{name} has not been provided\")\n end\n \n ARGV[index + 1]\nend",
"title": ""
},
{
"docid": "b2557f4b5a7478d6609ae6316fc721fc",
"score": "0.62576455",
"text": "def first=(_arg0); end",
"title": ""
},
{
"docid": "d9c38b4229fac8d7e5d5167e5858d043",
"score": "0.62445617",
"text": "def second_argument(*args); argument(1, *args); end",
"title": ""
},
{
"docid": "b82fdd1c5fdcae622ded04bb02846d22",
"score": "0.61671525",
"text": "def cli_arguments=(_arg0); end",
"title": ""
},
{
"docid": "3bdb1fce98b89aeefefe97cb14c02583",
"score": "0.6157738",
"text": "def hello\n puts \"Hello, #{ARGV[0]}\"\nend",
"title": ""
},
{
"docid": "890d7280818adb052e35a1e970612131",
"score": "0.615059",
"text": "def read(*rest) end",
"title": ""
},
{
"docid": "73ff8acfd9f230abbe22c8432bd645cf",
"score": "0.61469096",
"text": "def arg_string=(_arg0); end",
"title": ""
},
{
"docid": "73ff8acfd9f230abbe22c8432bd645cf",
"score": "0.61469096",
"text": "def arg_string=(_arg0); end",
"title": ""
},
{
"docid": "fd34939d0343ad2b58d9588576b06ae3",
"score": "0.6121562",
"text": "def arg(name,defval)\n previous = \"\"\n\n ARGV.each do|a| \n if previous == name\n return a\n end\n previous = a\n end\n\n return defval\nend",
"title": ""
},
{
"docid": "571489edab4681ae7a88810565be8f8b",
"score": "0.6119286",
"text": "def arg1(line)\n case line[/^[\\w-]*/]\n when \"add\", \"sub\", \"neg\", \"eq\", \"gt\", \"lt\", \"and\", \"or\", \"not\"\n return line\n else\n line.gsub!(/^[\\w-]*/,\"\")\n return line[/^*[\\w_]+/]\n end\n end",
"title": ""
},
{
"docid": "d1c0141ebf7214aa9e54023b7fd8e851",
"score": "0.61133623",
"text": "def get_argument(description = '')\n /^.*'(?<arg>.*)'.*$/.match(description)\n Regexp.last_match(:arg)\nend",
"title": ""
},
{
"docid": "b721347ad4b2f19a695f987275559d29",
"score": "0.6113252",
"text": "def arg0?; end",
"title": ""
},
{
"docid": "574ecf8ef9e901476de0c2646a502780",
"score": "0.61081505",
"text": "def parse_argv\n#--{{{\n @qpath = Q || @argv.shift\n @mode = @argv.shift\n#--}}}\n end",
"title": ""
},
{
"docid": "f32bc2b849f9e094e16e23d46d562342",
"score": "0.6098019",
"text": "def val\n @args[0]\n end",
"title": ""
},
{
"docid": "9a4708b3fb6165f5109a98d693196748",
"score": "0.60946053",
"text": "def parse_args(args); end",
"title": ""
},
{
"docid": "4ad2cecdb18887d3182585993d5318a0",
"score": "0.6084263",
"text": "def parser=(_arg0); end",
"title": ""
},
{
"docid": "4ad2cecdb18887d3182585993d5318a0",
"score": "0.6084263",
"text": "def parser=(_arg0); end",
"title": ""
},
{
"docid": "8b7fdc352ad708eeb3c762e541b76857",
"score": "0.60823524",
"text": "def cli_user_input(arg_array)\n @cli_read_path = arg_array[0]\n @cli_write_path = arg_array[1]\n @cli_message = file_read(@cli_read_path)\n if arg_array.length == 3\n @cli_key = arg_array[2] \n @cli_date = date_formatter\n end\n @cli_date = arg_array[3] if arg_array.length == 4\n end",
"title": ""
},
{
"docid": "2aec63683633ca3feca48e69bd1fb6a2",
"score": "0.6079729",
"text": "def last_argument; end",
"title": ""
},
{
"docid": "2aec63683633ca3feca48e69bd1fb6a2",
"score": "0.6079729",
"text": "def last_argument; end",
"title": ""
},
{
"docid": "2aec63683633ca3feca48e69bd1fb6a2",
"score": "0.6079729",
"text": "def last_argument; end",
"title": ""
},
{
"docid": "2aec63683633ca3feca48e69bd1fb6a2",
"score": "0.6079729",
"text": "def last_argument; end",
"title": ""
},
{
"docid": "fea3c9fdd98634046a0ecb81da46eeda",
"score": "0.6071025",
"text": "def arg_string; end",
"title": ""
},
{
"docid": "fea3c9fdd98634046a0ecb81da46eeda",
"score": "0.6071025",
"text": "def arg_string; end",
"title": ""
},
{
"docid": "7e9bc9d1f2c843b71eda65013d008c52",
"score": "0.60605127",
"text": "def args(*args)\n puts args[0]\n puts args[1]\nend",
"title": ""
},
{
"docid": "fa33cd43864b02c8ea66e85d72166765",
"score": "0.6059063",
"text": "def candidate\n @candidate ||= arguments.last.strip\n end",
"title": ""
},
{
"docid": "3c74af719c94cb8e18a33869dee5b0eb",
"score": "0.60551614",
"text": "def servername_from_arguments\n ARGV.shift if ARGV.count == 2\nend",
"title": ""
},
{
"docid": "fe01eac055a4752dc0c155e045e2f694",
"score": "0.6047828",
"text": "def first_line(fileName)\n begin\n file = open(fileName)\n info = file.gets\n file.close\n rescue\n file = STDIN\n pp file\n info = file.gets\n end \n \n info\nend",
"title": ""
},
{
"docid": "73c4f28fca24d02dc0888576ef7baa83",
"score": "0.6040599",
"text": "def cli=(_arg0); end",
"title": ""
},
{
"docid": "73c4f28fca24d02dc0888576ef7baa83",
"score": "0.6040599",
"text": "def cli=(_arg0); end",
"title": ""
},
{
"docid": "510e8e5b868c21d9ccb5e631ebb3f032",
"score": "0.60363626",
"text": "def arguments\n @arguments ||= line.split(/\\s+/, -1)[1..-1]\n end",
"title": ""
},
{
"docid": "53695e6e66e4bb3def514861fb9b5a6c",
"score": "0.6032153",
"text": "def parse_args(args)\n case args.first\n when /^-f|--full$/\n [:full, args[1 .. -1]]\n when /^-b|--brief$/\n [:brief, args[1 .. -1]]\n else\n [:brief, args]\n end\n end",
"title": ""
},
{
"docid": "273df3e4a86cc627db605fb16f105e3a",
"score": "0.60288256",
"text": "def first\n @first ||= get_limited_arg(:first)\n end",
"title": ""
},
{
"docid": "65ebe000bf0bf50bab9ae59cfc325892",
"score": "0.6027246",
"text": "def process_arguments\n @source = @arguments[0]\n end",
"title": ""
},
{
"docid": "eb06e5ff8901d9fdaa732b40394c9dc9",
"score": "0.6016256",
"text": "def argument_1(tokens, command)\n\t\tcommand == 'C_ARITHMETIC' ? tokens[0] : tokens[1]\n\tend",
"title": ""
},
{
"docid": "8181cb56d8afa180498290b0d2c1fee0",
"score": "0.6002204",
"text": "def first_argument\n children[first_argument_index]\n end",
"title": ""
},
{
"docid": "89340ebc7b01b9a7710ceba16a205d69",
"score": "0.6001327",
"text": "def args=(_arg0); end",
"title": ""
},
{
"docid": "89340ebc7b01b9a7710ceba16a205d69",
"score": "0.6001327",
"text": "def args=(_arg0); end",
"title": ""
},
{
"docid": "89340ebc7b01b9a7710ceba16a205d69",
"score": "0.6001327",
"text": "def args=(_arg0); end",
"title": ""
},
{
"docid": "89340ebc7b01b9a7710ceba16a205d69",
"score": "0.6001327",
"text": "def args=(_arg0); end",
"title": ""
},
{
"docid": "89340ebc7b01b9a7710ceba16a205d69",
"score": "0.6001327",
"text": "def args=(_arg0); end",
"title": ""
},
{
"docid": "89340ebc7b01b9a7710ceba16a205d69",
"score": "0.6001327",
"text": "def args=(_arg0); end",
"title": ""
},
{
"docid": "89340ebc7b01b9a7710ceba16a205d69",
"score": "0.6001327",
"text": "def args=(_arg0); end",
"title": ""
},
{
"docid": "89340ebc7b01b9a7710ceba16a205d69",
"score": "0.6001327",
"text": "def args=(_arg0); end",
"title": ""
},
{
"docid": "15dee640a619805e84cb936d98524bec",
"score": "0.60006374",
"text": "def next_arg(arg, args)\n arg =~ /=/ ? arg.sub(/.*=\\s*/,'') : args.shift\nend",
"title": ""
},
{
"docid": "8308f9d1bfb04c70c2bcd9cf12ccd753",
"score": "0.60001194",
"text": "def parse_args_for_addsub(args)\n args[1..-1]\n end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.5996568",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.5996568",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.5996568",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.5996568",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.5996568",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "8fcd692f7336fb06f117db1093d61a53",
"score": "0.5994844",
"text": "def parse_args\r\n self.type = cmd.args ? titlecase_arg(cmd.args) : \"Real\"\r\n end",
"title": ""
},
{
"docid": "3506161ba62f6ada67a6641d866a38ab",
"score": "0.5992852",
"text": "def start_argument_parsing\n file_name = evaluate_file_name(get_argument_file_name(@command_arguments))\n get_specified_file_content(file_name)\n end",
"title": ""
},
{
"docid": "ce55e06f3606fc9d1b13eb9f5a66e688",
"score": "0.59911376",
"text": "def argument; end",
"title": ""
},
{
"docid": "ce55e06f3606fc9d1b13eb9f5a66e688",
"score": "0.59911376",
"text": "def argument; end",
"title": ""
},
{
"docid": "ce55e06f3606fc9d1b13eb9f5a66e688",
"score": "0.59911376",
"text": "def argument; end",
"title": ""
},
{
"docid": "ce55e06f3606fc9d1b13eb9f5a66e688",
"score": "0.59911376",
"text": "def argument; end",
"title": ""
},
{
"docid": "ce55e06f3606fc9d1b13eb9f5a66e688",
"score": "0.59911376",
"text": "def argument; end",
"title": ""
}
] |
017b23d89c4b8c27eee30766095d75ae
|
Public: Finds the absolute paths, including hidden ones, of the files that are not used by the pod and can be safely deleted. Returns an Array of Strings containing the absolute paths.
|
[
{
"docid": "e0535996af3cef6fe8018cfbcc4ad7d2",
"score": "0.6378797",
"text": "def clean_paths\n cached_used_paths = used_paths.map{ |path| path.to_s }\n files = Dir.glob(root + \"**/*\", File::FNM_DOTMATCH)\n files.reject! do |candidate|\n candidate.end_with?('.', '..') ||\n cached_used_paths.any? { |path| path.include?(candidate) || candidate.include?(path) }\n end\n files\n end",
"title": ""
}
] |
[
{
"docid": "8bc3695a09b2ca0fead7c2553d41d2ba",
"score": "0.7198643",
"text": "def absolute_paths\n return [] unless valid?\n drive_path = MountedDrives.path_to(drive)\n relative_paths.map { |p| File.join(drive_path, p) }\n end",
"title": ""
},
{
"docid": "5649085f5e5826493e1c8f6338816ab0",
"score": "0.6980543",
"text": "def files_available\n absolute_paths.map { |path| files_at(path) }.flatten\n end",
"title": ""
},
{
"docid": "a1385282a00c7528984b54acf210994a",
"score": "0.69378346",
"text": "def expanded_clean_paths\n files = []\n clean_paths.each do |pattern|\n pattern = pod_destroot + pattern\n pattern.glob.each do |file|\n files << file\n end\n end\n files\n end",
"title": ""
},
{
"docid": "a1385282a00c7528984b54acf210994a",
"score": "0.69378346",
"text": "def expanded_clean_paths\n files = []\n clean_paths.each do |pattern|\n pattern = pod_destroot + pattern\n pattern.glob.each do |file|\n files << file\n end\n end\n files\n end",
"title": ""
},
{
"docid": "f7974e5c91c1bb32f7a144cb283b8016",
"score": "0.6722634",
"text": "def safe_paths\n read_all('**') - read_all(\"{#{RESERVED_DIRS.join(',')}}\", '**')\n end",
"title": ""
},
{
"docid": "70c6a660a02c1b025e4fc9cc46b84d0e",
"score": "0.65945184",
"text": "def paths_and_files\n list = @assets.glob(@filespecs)\n list.reject! { |path, file| @assets.ignored?(path) }\n list\n end",
"title": ""
},
{
"docid": "6dfe11f9e70b28779a6ce3c3e514650e",
"score": "0.65215343",
"text": "def paths_and_files\n list = @assets.glob(@filespecs, :preserve => true)\n list.reject! { |path, file| @assets.ignored?(path) }\n list\n end",
"title": ""
},
{
"docid": "78fb30a70ac3c7c49a6f27728059a944",
"score": "0.63801295",
"text": "def ignored_paths\n @ignored_paths.to_a\n end",
"title": ""
},
{
"docid": "370800b11ccf02a51c3d8f1b8b481616",
"score": "0.6366034",
"text": "def file_list\n Array(@path).inject(Set.new) do |list, _path|\n next list unless File.exists?(_path)\n if File.directory?(_path)\n list = list | sanitized_directory(_path)\n else\n list << _path if keep_file?(_path)\n end\n list\n end.to_a\n end",
"title": ""
},
{
"docid": "cbf24af5d4847f22dd5a638f38cfc0d4",
"score": "0.63537467",
"text": "def paths\n # roots\n roots = options[:roots]\n roots = ['.'] if roots.empty?\n\n # find files in roots\n paths = roots.flat_map { Find.find(_1).to_a }.sort\n paths = paths.select { File.file?(_1) }\n\n # strip default './'\n paths = paths.map { _1.gsub(%r{^\\./}, '') } if options[:roots].empty?\n paths\n end",
"title": ""
},
{
"docid": "aafcbf5d5d5fc4ff7e926e99ccf9c127",
"score": "0.6327541",
"text": "def ignored_paths\n return [] unless input_directory\n return @ignored_paths if @ignored_paths\n \n ignore_file = File.join(input_directory, HAMMER_IGNORE_FILENAME)\n \n @ignored_paths = [ignore_file]\n if File.exists?(ignore_file)\n lines = File.open(ignore_file).read.split(\"\\n\")\n lines.each do |line|\n line = line.strip\n @ignored_paths << Dir.glob(File.join(input_directory, \"#{line}/**/*\"))\n @ignored_paths << Dir.glob(File.join(input_directory, \"#{line.gsub(\"*\", \"**/*\")}\"))\n end\n end\n @ignored_paths.flatten!.uniq!\n return @ignored_paths || []\n rescue\n # TODO: Find out whether we actually use this rescue block.\n # It would be good to be able to output debug information into a console somewhere.\n []\n end",
"title": ""
},
{
"docid": "50506098e442c862fb03b762ba938f10",
"score": "0.62945914",
"text": "def result_paths\n paths = Dir.glob( dir.join('*') ).map {|x|\n Pathname(x)\n }\n return paths\n end",
"title": ""
},
{
"docid": "e52e886efbd3e14552f9d055c4fa0df7",
"score": "0.6287288",
"text": "def local_files\n return [] unless Dir.exist?(path)\n\n Dir.foreach(path).map do |file|\n next unless file.match(LEGAL_FILES)\n\n file_path = File.join(path, file)\n next unless File.file?(file_path)\n\n file_path\n end.compact\n end",
"title": ""
},
{
"docid": "be167aa63c8de876948f8013388c1e50",
"score": "0.62568873",
"text": "def file_paths\n file? and return [Pathname.new(basename)]\n\n @children.flat_map(&:file_paths).\n map { |path| Pathname.new(basename).join(path) }\n end",
"title": ""
},
{
"docid": "6de9908aa1a1fc97c1382c2f69b52057",
"score": "0.62240106",
"text": "def list_files\n\t\tresult = []\n\t\t@path.each_child { |path|\n\t\t\tresult << path if File::file?(path)\n\t\t}\n\t\treturn result\n\tend",
"title": ""
},
{
"docid": "283b36da2604939b21b36df1cd49d4da",
"score": "0.6208977",
"text": "def app_paths\n paths = []\n Merb::Slices.each_slice { |slice| paths += slice.collected_app_paths }\n paths\n end",
"title": ""
},
{
"docid": "e4e3f81a9292eda5993004faa549b486",
"score": "0.6207997",
"text": "def list_files \n return @paths.collect{ |p| Dir.glob(\"#{p}/*\") }\n end",
"title": ""
},
{
"docid": "862292f1716b6614d6ecf8e5ff1253be",
"score": "0.61934876",
"text": "def abs_path\n @abs_path ||=\n owner &&\n begin\n @abs_path = EMPTY_ARRAY # recursion lock.\n\n x = path.map { | dir | File.expand_path(expand_string(dir), owner.base_directory) }\n\n arch_dir = arch_dir_value\n if arch_dir\n # arch_dir = [ arch_dir ] unless Array === arch_dir\n x.map! do | dir |\n if File.directory?(dir_arch = File.join(dir, arch_dir))\n dir = [ dir, dir_arch ]\n # $stderr.puts \" arch_dir: dir = #{dir.inspect}\"\n end\n dir\n end\n x.flatten!\n # $stderr.puts \" arch_dir: x = #{x.inspect}\"\n end\n\n @abs_path = x.map{|p|[p,component.name].join('!')}\n end\n end",
"title": ""
},
{
"docid": "bef696879bb0bc7aec15643a078b2d39",
"score": "0.6129263",
"text": "def paths\n Array.new([\n File.join(TMP_PATH, TRIGGER),\n Backup::Model.file,\n Backup::Model.chunk_suffixes.map { |chunk_suffix| \"#{Backup::Model.file}-#{chunk_suffix}\" }\n ]).flatten\n end",
"title": ""
},
{
"docid": "6c374ab0b45b07c3538742094a4ecdc8",
"score": "0.61164457",
"text": "def catapult_peers_relative_paths\n []\n end",
"title": ""
},
{
"docid": "91febb9102787185f59dee9d14069256",
"score": "0.6107443",
"text": "def deletable_files\n return [] unless delete_files?\n unless @deletable\n @deletable = @bucket.objects.map(&:key) - site_files_dest\n @deletable.reject!{|f| (f =~ /^#{@remote_path}/).nil? }\n end\n @deletable\n end",
"title": ""
},
{
"docid": "4cdefe2cb748f6940b39ade95ecadfc6",
"score": "0.6100251",
"text": "def collect_none_referenced_images(images)\n legacy_images = []\n images.each do |image|\n filename = File.basename(image)\n result = system(\"grep -r '#{filename}' ./app\")\n legacy_images << image if result == false\n end\n legacy_images\n end",
"title": ""
},
{
"docid": "e3304c105a9b350aee1d912e97447ad1",
"score": "0.6099371",
"text": "def paths\n bag_files.collect { |f| f.sub(data_dir + \"/\", \"\") }\n end",
"title": ""
},
{
"docid": "326695b7db1f4d38f5361436acb4fdf1",
"score": "0.6093252",
"text": "def files\n\t\tfiles_paths = get_directory_files('')\n\t\t\n\t\tfiles_paths\n\tend",
"title": ""
},
{
"docid": "86a98e87cec7a99c3fe356bd11d4a209",
"score": "0.60872185",
"text": "def raw_paths\n return [] unless (paths = params[:paths])\n\n # Efficiently match any combination of new line characters:\n # http://stackoverflow.com/questions/10805125\n paths = paths.split(/\\r?\\n|\\r/) if paths.is_a?(String)\n # Ignore all URLs or paths with < or > in them.\n paths = paths.select(&:present?).reject { |p| p =~ /(<|>)/ }\n paths.map(&:strip)\n end",
"title": ""
},
{
"docid": "ca6306b5b43ab43885aa3915988e4c6f",
"score": "0.6078124",
"text": "def used_paths\n files = source_files(false) + resources(false) + preserve_paths + [ readme_file, license_file, prefix_header_file ]\n files.compact\n end",
"title": ""
},
{
"docid": "8f849aa4dea2152d6f0dc9f190288cb0",
"score": "0.60646266",
"text": "def directory_paths\n DataFile.all.map { |p| File.dirname(p.relative_path).split(\"/\")[0] }.uniq\n end",
"title": ""
},
{
"docid": "bb02ac8c536d16279a69b34cff2760e8",
"score": "0.6060856",
"text": "def files\n Dir.entries(@path).reject { |f| File.directory?(f) }\n end",
"title": ""
},
{
"docid": "c2521a643def6a99589f9fb53ebe9ba3",
"score": "0.60588896",
"text": "def find_paper_paths\n paper_paths = []\n Find.find(\"tmp/#{review_issue_id}\") do |path|\n paper_paths << path if path =~ /paper\\.md$/\n end\n\n return paper_paths\n end",
"title": ""
},
{
"docid": "0c63991061ed7c94e8d832432bc792d4",
"score": "0.6037423",
"text": "def paths\n @paths ||= pathnames.map(&:to_s)\n end",
"title": ""
},
{
"docid": "71a599cc28e47240e3bcf5b304b3db4d",
"score": "0.6031625",
"text": "def relevant_directory_paths\n drafts.map { |doc| relative_draft_path(doc).split(\"/\")[0] }.uniq\n end",
"title": ""
},
{
"docid": "ea49cbcaa1eb74584b4405e4511427f2",
"score": "0.6025215",
"text": "def files\n Dir.entries(@path).map do |entry|\n entry unless entry.length < 3#gets rid of files like /.. and other hidden ones\n end.compact #you have to use compact to get rid of nil values which are returned for condition above. Find out why the values are returned as nil?\n end",
"title": ""
},
{
"docid": "c09926086424f55c6732637b6a14db17",
"score": "0.601765",
"text": "def avatar_filepaths\n filepaths = []\n Dir.entries(default_avatar_dir).each do |file|\n filepaths.push file if file =~ /\\.png/\n end if File.directory? default_avatar_dir\n return filepaths\n end",
"title": ""
},
{
"docid": "316359b470cb6eb43460ad8b4196cb40",
"score": "0.6005818",
"text": "def expanded_resources\n files = []\n resources.each do |pattern|\n pattern = pod_destroot + pattern\n pattern.glob.each do |file|\n files << file.relative_path_from(config.project_pods_root)\n end\n end\n files\n end",
"title": ""
},
{
"docid": "316359b470cb6eb43460ad8b4196cb40",
"score": "0.6005818",
"text": "def expanded_resources\n files = []\n resources.each do |pattern|\n pattern = pod_destroot + pattern\n pattern.glob.each do |file|\n files << file.relative_path_from(config.project_pods_root)\n end\n end\n files\n end",
"title": ""
},
{
"docid": "503ff4411d34207a61e8b722b8a53430",
"score": "0.6002961",
"text": "def files_on_remote_for(job)\n storage = job.model.storages.first\n begin\n storage.send(:client).list_folder(remote_path_for(job)).entries.map(&:path_display).sort\n rescue DropboxApi::Errors::NotFoundError\n []\n end\n end",
"title": ""
},
{
"docid": "d13b945d5495a1f787ee04c7b70d0101",
"score": "0.5990268",
"text": "def files\n manifest.inject([]) do |memo, item|\n memo << full_path(item.first)\n end\n end",
"title": ""
},
{
"docid": "53c37cd57c5141106b7793dd670f8a3c",
"score": "0.59744424",
"text": "def files\n all_files_and_directories.reject { |path| File.directory?(path) }\n end",
"title": ""
},
{
"docid": "e5d99555a0f484922759c9f453cbc2c6",
"score": "0.59613174",
"text": "def local_files\n remote_files.map {|x| Config::SRC_DIR+'/'+ File.basename(x) }\n end",
"title": ""
},
{
"docid": "ab126e6b96bb5a8cf26fde1674fcdb2e",
"score": "0.59372467",
"text": "def favorite_paths\n @favorite_paths ||= candidate_favorite_paths.select do |p|\n p.remote? || p.path.directory? && p.path.readable? && p.path.executable?\n end\n end",
"title": ""
},
{
"docid": "270d8d9c552724ea10de3affab440d4d",
"score": "0.5935294",
"text": "def file_list\n files = Dir.glob( File.join( Rails.root , 'public', 'storage', self.site, self.name, '*' ) )\n files.delete_if {|f| File.directory?(f) }\n return files \n end",
"title": ""
},
{
"docid": "ab893cda1103e484f1af87fc85ff2301",
"score": "0.59276354",
"text": "def paths\n @paths ||= []\n end",
"title": ""
},
{
"docid": "f33771ef0e0bb088ed56fc4b00490ce0",
"score": "0.5927565",
"text": "def files_resolved\n list = files.flatten\n list = list.map{ |f| Dir[f] }.flatten\n list = list.map{ |f| File.directory?(f) ? Dir[File.join(f, '**/*.rb')] : f }\n list = list.flatten.uniq\n list = list.map{ |f| File.expand_path(f) } \n list\n end",
"title": ""
},
{
"docid": "fa3a7b5dc2b9cd9856e770d20db8839b",
"score": "0.5919409",
"text": "def find_appletfiles( excludeList=[] )\n\t\tfiles = []\n\t\tdirCount = 0\n\n\t\t# The Arrow::Path object will only give us extant directories...\n\t\t@path.each do |path|\n\n\t\t\t# Look for files under a directory\n\t\t\tdirCount += 1\n\t\t\tpat = File.join( path, @config.applets.pattern )\n\t\t\tpat.untaint\n\n\t\t\tself.log.debug \"Looking for applets: %p\" % [ pat ]\n\t\t\tfiles.push( *Dir[ pat ] )\n\t\tend\n\n\t\tself.log.info \"Fetched %d applet file paths from %d directories (out of %d)\" %\n\t\t\t[ files.nitems, dirCount, @path.dirs.nitems ]\n\n\t\tfiles.each {|file| file.untaint }\n\t\treturn files - excludeList\n\tend",
"title": ""
},
{
"docid": "1c16f9d5141f112b39af6971e96462e8",
"score": "0.5917885",
"text": "def get_all_files()\n Dir[file_path + \"/*\"]# return of array\n end",
"title": ""
},
{
"docid": "1c16f9d5141f112b39af6971e96462e8",
"score": "0.5917885",
"text": "def get_all_files()\n Dir[file_path + \"/*\"]# return of array\n end",
"title": ""
},
{
"docid": "70380c25141a81a838ba3355a482a733",
"score": "0.5917825",
"text": "def local_files\n files = []\n %w/json rb/.each do |ext|\n files << Dir[\"#{@path}/*.#{ext}\", \"#{@path}/*/*.#{ext}\", \"#{@path}/*/*/*.#{ext}\"] \n end\n files.flatten.sort.uniq\n end",
"title": ""
},
{
"docid": "7e1be1d5ba44d678a0be96587dd738ea",
"score": "0.5915071",
"text": "def _owned_files\n files = []\n File.open(self.path + '/' + self.fullname) do |f|\n loop do\n break if f.eof?\n line = f.readline()\n begin\n if _e(line) =~ RE_FILE_LIST\n f.seek(2, IO::SEEK_CUR)\n break\n end\n rescue ArgumentError\n # ArgumentError: invalid byte sequence in US-ASCII\n # so dumb, i wish i could determine a better solution for this\n true\n end\n end\n begin\n files = f.readlines().map {|line| _e(line.rstrip) }\n rescue ArgumentError\n Log.instance.debug(\"Slackware::Package\") {\n \"encoding in : \" + self.path + '/' + self.fullname\n }\n end\n end\n return files\n end",
"title": ""
},
{
"docid": "f2b2d38ecf824687c28e65dfffece284",
"score": "0.59109795",
"text": "def missing_original_dirs\n @files.select { |tf| tf.filename !~ /\\./ && !File.exists?(tf.original_path_filename) }\n end",
"title": ""
},
{
"docid": "134a8dd39b8fc8f6bda6d76454409193",
"score": "0.59068036",
"text": "def deleted_paths(paths)\n paths.select { |f| f.respond_to?(:start_with?) && f.start_with?('!') }.map { |f| f.slice(1..-1) }\n end",
"title": ""
},
{
"docid": "2e9e93895c6ee0bf1cdfabdd1a08580c",
"score": "0.58894503",
"text": "def clean_paths\n cached_used = used_files.map(&:downcase)\n glob_options = File::FNM_DOTMATCH | File::FNM_CASEFOLD\n files = Pathname.glob(root + '**/*', glob_options).map(&:to_s)\n cached_used_set = cached_used.to_set\n files.reject do |candidate|\n candidate = candidate.downcase\n candidate.end_with?('.', '..') || cached_used_set.include?(candidate) || cached_used.any? do |path|\n path.include?(candidate) || candidate.include?(path)\n end\n end\n end",
"title": ""
},
{
"docid": "17e765730de9990b5d971e8bb354592e",
"score": "0.5873094",
"text": "def file_paths(path)\n found_dbs_paths = []\n\n files = []\n files = dir(path) if directory?(path)\n files.each do |file_path|\n unless %w(. .. Shared).include?(file_path)\n found_dbs_paths.push([path, file_path].join(system_separator))\n end\n end\n\n found_dbs_paths\n end",
"title": ""
},
{
"docid": "4fd2fc4b8e98f26189036e0de420272d",
"score": "0.5872405",
"text": "def quota_paths\n # regex uses negative lookahead to ignore : preceeding //\n ENV.fetch(\"OOD_QUOTA_PATH\", \"\").strip.split(/:(?!\\/\\/)/)\n end",
"title": ""
},
{
"docid": "4fd2fc4b8e98f26189036e0de420272d",
"score": "0.5872405",
"text": "def quota_paths\n # regex uses negative lookahead to ignore : preceeding //\n ENV.fetch(\"OOD_QUOTA_PATH\", \"\").strip.split(/:(?!\\/\\/)/)\n end",
"title": ""
},
{
"docid": "3e044462cc9d382a104a14441331d453",
"score": "0.58693343",
"text": "def each(hidden: false)\n res = []\n return res unless exist?\n Find.find(@root) do |child|\n path = File.absolute_path child, @root\n name = as_name? path\n next unless name\n next if Name.hidden?(name) && !hidden\n res << path\n end\n res\n end",
"title": ""
},
{
"docid": "0efe6675619789fd12e15572a4138b82",
"score": "0.58601516",
"text": "def file_paths\n raise StandardError, 'No records were found' if records.blank?\n return [] if importerexporter.metadata_only?\n\n @file_paths ||= records.map do |r|\n file_mapping = Bulkrax.field_mappings.dig(self.class.to_s, 'file', :from)&.first&.to_sym || :file\n next if r[file_mapping].blank?\n\n r[file_mapping].split(/\\s*[:;|]\\s*/).map do |f|\n file = File.join(path_to_files, f.tr(' ', '_'))\n if File.exist?(file) # rubocop:disable Style/GuardClause\n file\n else\n raise \"File #{file} does not exist\"\n end\n end\n end.flatten.compact.uniq\n end",
"title": ""
},
{
"docid": "d59968d429ab98f2a8d27ca54157a5d5",
"score": "0.5853984",
"text": "def files_to_transfer\n list = []\n return list unless File.exist?(local_path)\n\n Dir.chdir(local_path) do\n list = Dir.glob(\"**/*\").map do |f|\n f unless File.directory? f\n end.compact!\n end\n\n list\n end",
"title": ""
},
{
"docid": "f43688d9941d2df262ed9bada7412011",
"score": "0.58525103",
"text": "def file_paths\n files = []\n if input_directory\n files = Dir.glob(File.join(Shellwords.escape(input_directory), \"/**/*\"), File::FNM_DOTMATCH)\n \n files.reject! { |a| a =~ /\\/\\.git\\// }\n files.reject! { |a| a =~ /\\/\\.svn\\// }\n files.reject! { |a| a =~ /\\.DS_Store/ }\n files.reject! {|file| file.include?(output_directory)}\n files.reject! {|file| File.directory?(file)}\n \n # .ht files are Apache!\n files.reject! {|file| File.basename(file).start_with?('.') && !File.basename(file).start_with?('.ht')}\n \n # This is where I tried to ignore directories which start with a .\n # TODO: ignore directories which start with a .\n # files.reject! {|file| file.split(\"/\")[0..-2].select { |directory| directory.start_with? \".\"}.length > 0}\n # files.reject! { |a| a =~ /\\.{1,2}$/ }\n end\n \n files\n end",
"title": ""
},
{
"docid": "6a4996d5762d9f148230f748c511d8fd",
"score": "0.5851429",
"text": "def part_paths\n Pathname.glob(file_path.sub(/.zip\\z/, '.z*')).reject do |path|\n path.to_s =~ /.md5\\z/\n end\n end",
"title": ""
},
{
"docid": "1ce566c808e6c6bf1a20812ba480f758",
"score": "0.5830315",
"text": "def untracked_files\n `git --work-tree=#{git.dir} --git-dir=#{git.dir}/.git ls-files -o -z --full-name --exclude-standard`.split(\"\\x0\")\n end",
"title": ""
},
{
"docid": "65681d1b999c4631a8ea37b7278e723e",
"score": "0.58277655",
"text": "def files\n Dir[\"#{path}/*\"].map{|filename|\n filename.gsub(\"#{path}/\",\"\")\n }\n end",
"title": ""
},
{
"docid": "e638e781c761ca6900c83e7fb373b928",
"score": "0.58271086",
"text": "def abs_ct_cgroup_paths\n to_abs_paths(rel_ct_cgroup_paths)\n end",
"title": ""
},
{
"docid": "f0d054cbe2e7f7b9f6902dafc9466a8f",
"score": "0.58250284",
"text": "def all_files\n locations = tracked_locations\n locations.map do |loc|\n loc_pat = File.join(loc, '**/*')\n Dir.glob(loc_pat, File::FNM_DOTMATCH)\n .select{|e| File.file?(e)}\n end.flatten\n end",
"title": ""
},
{
"docid": "0b82f98921e9c8ddb0e51afca42f8064",
"score": "0.5819051",
"text": "def filepaths\n list = []\n list += documents\n list += bins\n list += etcs\n return list\n end",
"title": ""
},
{
"docid": "31907de0ed063ca1b122cce6adbd55fc",
"score": "0.581625",
"text": "def find_paths(paths)\n paths.map do |path|\n if path.include?('*')\n Dir.glob(path)\n else\n path\n end\n end.flatten\n end",
"title": ""
},
{
"docid": "2606a7aa4e7a389f8e28516f857ecbac",
"score": "0.5810936",
"text": "def files\n Dir[\"#{path}/**/*\"].reject do |entry|\n File.directory?(entry)\n end\n end",
"title": ""
},
{
"docid": "60c9004cdd137fcee1701e4a40df7534",
"score": "0.58015686",
"text": "def get_rpm_ghost_files\n files = []\n files.push components.flat_map(&:rpm_ghost_files)\n files.flatten.uniq\n end",
"title": ""
},
{
"docid": "13417d75567b132d8d838de89bc79b36",
"score": "0.57996976",
"text": "def all_song_paths\n all_song_files.map{ |file| file['path'] }\n end",
"title": ""
},
{
"docid": "ece3a8fc96b23c8247d6a4fd4ebdc20f",
"score": "0.5793868",
"text": "def get_file_list\n files = ::Dir[@root + \"/**/*\"]\n files.delete_if {|file| ::FileTest.directory?(file) }\n\n files\n end",
"title": ""
},
{
"docid": "284e5d8f4703d1d595cddf3c7a2592f1",
"score": "0.5793004",
"text": "def find_files(p)\n if !$current_biosphere_path_stack\n $current_biosphere_path_stack = \".\"\n end\n relative_path = $current_biosphere_path_stack + \"/\" + p\n entries = Dir[(relative_path)] - [\".\", \"..\"]\n return entries\n end",
"title": ""
},
{
"docid": "8ae50589f44f418223b49ed1a7be1385",
"score": "0.5792346",
"text": "def to_paths\n @filenames.map{|f| File.join(@directory, f) }\n end",
"title": ""
},
{
"docid": "452708440d645c442e45dfd71700371d",
"score": "0.57814896",
"text": "def part_paths\n @part_paths ||= Pathname.glob(file_path.sub(/.zip\\z/, '.z*')).reject do |path|\n path.to_s =~ /.md5\\z/\n end\n end",
"title": ""
},
{
"docid": "e4c1bdd42e639c02efe89478fbd3d916",
"score": "0.57774574",
"text": "def load_paths\r\n report_nonexistant_or_empty_plugin! unless valid?\r\n \r\n returning [] do |load_paths|\r\n load_paths << lib_path if has_lib_directory?\r\n load_paths << app_paths if has_app_directory?\r\n end.flatten\r\n end",
"title": ""
},
{
"docid": "7442550878322cb6fb24f1d7d5c49267",
"score": "0.5775586",
"text": "def absolute_output_directories\n settings[:output].map do |dir|\n Pathname.new(File.absolute_path(dir))\n end\n end",
"title": ""
},
{
"docid": "9c04bf443e86cb04e4fc52437b80595d",
"score": "0.5774834",
"text": "def files\n Dir.entries(path) - %w[. ..]\n end",
"title": ""
},
{
"docid": "a86a3ca12776b9a011896e0e56dd6a90",
"score": "0.57696956",
"text": "def files\n children(:no_dirs => true)\n end",
"title": ""
},
{
"docid": "98580b82bbd69139508013d0b77e7222",
"score": "0.57662207",
"text": "def list\n returning Array.new do |names|\n Dir.entries(basedir).each do |filename|\n if File.file?(File.join(basedir, filename))\n names << filename\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78f77dbacf45a31c25b5d2cc1f2217f",
"score": "0.5763332",
"text": "def metadata_paths\n @metadata_paths ||= bag_paths.map do |b|\n Dir.glob(\"#{b}/**/*\").select { |f| File.file?(f) && f.ends_with?(metadata_file_name) }\n end.flatten.compact\n end",
"title": ""
},
{
"docid": "4df90ae84451296be55036be65214892",
"score": "0.5760976",
"text": "def find_non_existing_files\n files = traverse([:name, :status, :parent])\n files.flatten.reject{|f| f[:status] != FileData::STATUS_NOT_FOUND}.map{|f| f.delete(:status); f}\n end",
"title": ""
},
{
"docid": "65147f7c53159a180f5d203bfe747be4",
"score": "0.5758362",
"text": "def still_image_paths\n \tDir[\"#{get_images_folder}/*.jpg\"]\n end",
"title": ""
},
{
"docid": "276370b3c52d0f082429130113accf27",
"score": "0.57464355",
"text": "def paths\n map{ |dir| Pathname.new(dir) }\n end",
"title": ""
},
{
"docid": "48af9c378fb3366fd30ab1b989cd59e2",
"score": "0.57445043",
"text": "def cookbook_file_paths(cookbook_name)\n ckbk = run_context.cookbook_collection[cookbook_name]\n files = []\n\n (ckbk.manifest['files'] || ckbk.manifest['all_files']).each do |file_info|\n files << file_info['path']\n end\n files\n end",
"title": ""
},
{
"docid": "580666720e97bc40c920fbe86da58eed",
"score": "0.5743793",
"text": "def search_not_exists_files\n not_exists_files = Array.new\n get_list_for_search.each do |name|\n not_exists_files.push(name) unless File.file?(CUR_FOLDER + name)\n end\n\n return not_exists_files\nend",
"title": ""
},
{
"docid": "88626f7ea329a8915fc176635facf2a3",
"score": "0.5738994",
"text": "def file_paths\n raise StandardError, 'No records were found' if records.blank?\n @file_paths ||= records.map do |r|\n next unless r[:file].present?\n r[:file].split(/\\s*[:;|]\\s*/).map do |f|\n file = File.join(path_to_files, f.tr(' ', '_'))\n if File.exist?(file) # rubocop:disable Style/GuardClause\n file\n else\n raise \"File #{file} does not exist\"\n end\n end\n end.flatten.compact.uniq\n end",
"title": ""
},
{
"docid": "c4c973f92608a24d98d087e53df6d3e2",
"score": "0.5738664",
"text": "def scaffold_files\n Find.find(scaffold_path).to_a.reject do |file| \n file == scaffold_path\n end\n end",
"title": ""
},
{
"docid": "cb8d1806063de9a559cd8854a5407b27",
"score": "0.57376724",
"text": "def filtered_files\n absolute_include_paths\n .flat_map { |path| haml_files_from_path(path) }\n .reject { |path| exclude_paths.include?(path) }\n end",
"title": ""
},
{
"docid": "d34d6a378eb4cac987520642284ef08a",
"score": "0.57346636",
"text": "def collected_app_paths\n @collected_app_paths ||= []\n end",
"title": ""
},
{
"docid": "921bacc31cdf0f1781f1ad16ecd92d94",
"score": "0.5733987",
"text": "def file_list(files)\n Array(files).map do |e|\n if File.directory?(e)\n # `expand_path` removes any trailing slash from the path string\n # `String#escape_glob` handles bracket literals otherwise interpreted as glob control characters\n sanitized_path = File.expand_path(e.escape_glob)\n Dir.glob(\"#{sanitized_path}/**/*\").reject { |f| File.directory?(f) }\n else\n e\n end\n end.flatten\n end",
"title": ""
},
{
"docid": "73a1eae4fcce63837df993170086709b",
"score": "0.5723127",
"text": "def managed_directories\n [@path]\n end",
"title": ""
},
{
"docid": "31dc9ca7c2fe0192898fc424865f82c0",
"score": "0.5719257",
"text": "def unused_files( hierarchy=false )\r\n\t\tunused = (directory_files - referenced_files).sort\r\n\t\tif hierarchy\r\n\t\t\troot = File.dirname(file)\r\n\t\t\tNDD.tree_hierarchy(root) do |dir|\r\n\t\t\t\tFile.directory?(dir) ? Dir.chdir(dir){ Dir['*'].map{ |f| File.expand_path(f) } } : []\r\n\t\t\tend.map do |prefix,file|\r\n\t\t\t\tif file\r\n\t\t\t\t\tall = unused.select{ |path| path[/^#{file}/] }\r\n\t\t\t\t\tunless all.empty?\r\n\t\t\t\t\t\tsize = NiceBytes.nice_bytes(all.map{ |f| File.size(f) }.inject(:+))\r\n\t\t\t\t\t\tpartial = file.sub(/^#{root}\\//o,'')\r\n\t\t\t\t\t\tif File.directory?(file)\r\n\t\t\t\t\t\t\t\"%s %s (%d files, %s)\" % [prefix,partial,all.length,size]\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\"%s %s (%s)\" % [prefix,partial,size]\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\telse\r\n\t\t\t\t\tprefix\r\n\t\t\t\tend\r\n\t\t\tend.compact.join(\"\\n\")\r\n\t\telse\r\n\t\t\tunused\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "453c60f79f37e5cc42b24916f86cb0ca",
"score": "0.5710288",
"text": "def remove_unwanted_files\n file_array = []\n root_path = FileUtils.join_paths(@install_path, @project_name)\n unless @config_file[:remove_files].nil?\n @config_file[:remove_files].each do |file|\n file_array << FileUtils.join_paths(root_path, file)\n end\n FileUtils.remove_files(file_array)\n end\n end",
"title": ""
},
{
"docid": "0b20edb7944d7a5e39317ea5e9f184ec",
"score": "0.5702481",
"text": "def expanded_manifests_paths\n return [] if !manifests_path\n\n # Get all the paths and expand them relative to the root path, returning\n # the array of expanded paths\n paths = manifests_path\n paths = [paths] if !paths.is_a?(Array)\n paths.map do |path|\n Pathname.new(path).expand_path(env.root_path)\n end\n end",
"title": ""
},
{
"docid": "0568eefb829ac3fbf6c73f723ca1ef96",
"score": "0.5693867",
"text": "def abs_path\n @abs_path ||=\n owner &&\n begin\n @abs_path = EMPTY_ARRAY # recursion lock.\n\n x = path.map { | dir | File.expand_path(expand_string(dir), owner.base_directory) }\n\n arch_dir = arch_dir_value\n if arch_dir\n # arch_dir = [ arch_dir ] unless Array === arch_dir\n x.map! do | dir |\n if File.directory?(dir_arch = File.join(dir, arch_dir))\n dir = [ dir, dir_arch ]\n # $stderr.puts \" arch_dir: dir = #{dir.inspect}\"\n end\n dir\n end\n x.flatten!\n # $stderr.puts \" arch_dir: x = #{x.inspect}\"\n end\n #We need to pass not just a path to the rakefile but a component name\n #The way I did this is to make the environment variable contain\n #PATH_TO_COMPONENT!COMPONENT_NAME:\n #So you will end up with /cabar/comp1/Rakefile!comp1:/cabar/comp2/Rakefile!comp2\n @abs_path = x.map{|p|[p,component.name].join('!')}\n end\n end",
"title": ""
},
{
"docid": "03f88cb1b796f1cb8b50fc27e6d0245f",
"score": "0.5692821",
"text": "def get_all_files_name()\n # file_list=` find \"$(pwd)\" -type f -not -path \"$(pwd)/.dvcs/*\" ` # absolute path version\n file_list=` find -type f -not -path \"./.dvcs/*\" `\n return file_list\n end",
"title": ""
},
{
"docid": "b4a5eaa47a180730de165b5ecde30f01",
"score": "0.5682848",
"text": "def get_nonlocal_filerepos\n get_filerepoinfo('name|local')['query']['repos'].reject { |h| h.key?('local') }.collect { |h| h['name'] }\n end",
"title": ""
},
{
"docid": "605c1532a6a3b2e719793eddf7fed3d7",
"score": "0.56822455",
"text": "def all_files_in_config_info_dir\n absolute_file_paths_in_directory(self.config_info_dir)\n end",
"title": ""
},
{
"docid": "1617bc49c7ac031374ba5b5bb14295fc",
"score": "0.5676917",
"text": "def files #(update=false)\n #remove = (update ? (exclude + topline.exclude) : exclude)\n #remove = exclude\n #remove += DEFAULT_EXCLUDE unless all?\n #remove += [filename, filename.chomp('~')]\n\n files = []\n Dir.chdir(location) do\n files += Dir.multiglob_r('**/*')\n files -= Dir.multiglob_r(exclusions)\n end\n return files\n end",
"title": ""
},
{
"docid": "d87a12d8d940c5eadbfb10ed2cbc9a59",
"score": "0.5675412",
"text": "def missing_files\r\n\t\t(referenced_files - directory_files).sort\r\n\tend",
"title": ""
},
{
"docid": "e2bd165766a82fb0909a1128ccb5500b",
"score": "0.56672305",
"text": "def plugin_files\n files = []\n @plugin.packagedata.each do |name, data|\n files += data[:files].reject{ |f| File.directory?(f) }\n end\n files\n end",
"title": ""
},
{
"docid": "31c88743d36aa11b306ecf12325dc1c0",
"score": "0.56656945",
"text": "def file_paths\n @file_paths ||= begin\n @selected_files.map { |selected_file| Pathname.new(selected_file.path) }\n end\n end",
"title": ""
}
] |
4b4af5272c94b21824e917a1f6f6816f
|
argument is the original index of the SNP returns the index of the SNP in the included list these will be equal if no SNPs are excluded
|
[
{
"docid": "6c7ff5742a6d5db4d2a2a9a42ae95095",
"score": "0.6185127",
"text": "def get_snp_included_index_num(original_snp_index)\n return @index_of_included_snps[@snps[original_snp_index].name]\n end",
"title": ""
}
] |
[
{
"docid": "c82e63fec1856e8405867e4f1873deb1",
"score": "0.5903252",
"text": "def process_included\n @snps.each_with_index do |snp, index|\n if @included_snps_hash[snp.name]\n @included_snps << index\n @index_of_included_snps[snp.name] = @included_snps.length-1\n end\n end\n end",
"title": ""
},
{
"docid": "0084ffbf9e328675ecc9b3dd146c9f21",
"score": "0.57819426",
"text": "def unchanged(list, list2)\n \n result = list & list2\n indexes = result.map {|x| list.index x}\n indexes2 = result.map {|x| list2.index x}\n \n indexes.zip(indexes2)\n\n end",
"title": ""
},
{
"docid": "223a93c09646b859c9e8d09aba47e69a",
"score": "0.57383895",
"text": "def matches_in_place(a, b)\n a.map.with_index{|e,i| e == b[i]}\nend",
"title": ""
},
{
"docid": "e6ec703c7c2a3808a7bf9783189f96ef",
"score": "0.548686",
"text": "def include?(index)\n true\n end",
"title": ""
},
{
"docid": "fed899057699d735ee0f89f80c76275f",
"score": "0.5470977",
"text": "def deleted(list, list2)\n\n result = list - list2\n indexes = result.map {|x| list.index x}\n\n end",
"title": ""
},
{
"docid": "7f9dca8a8f47f19f9d3bbd33b2bd2196",
"score": "0.54628044",
"text": "def include?(position); end",
"title": ""
},
{
"docid": "84a6730e581e1336ca0b7989d7b90db0",
"score": "0.5447342",
"text": "def make_all_included\n @snps.each_with_index do |snp, index|\n @included_snps_hash[snp.name] = snp\n @included_snps << index\n @index_of_included_snps[snp.name] = @included_snps.length-1\n end\n end",
"title": ""
},
{
"docid": "1f47ee1a6a31ba802431f5a34dd204e8",
"score": "0.5441556",
"text": "def get_index_first_larger_snp(pos)\n @included_snps.each_with_index do |snp_indx, index|\n if pos < @snps[snp_indx].location.to_f\n return index\n end\n end\n end",
"title": ""
},
{
"docid": "3d65581d45418dd41ada7690012fd064",
"score": "0.5426443",
"text": "def if_ins(i,spl); end",
"title": ""
},
{
"docid": "3884908f032fa58424ceaf6bcfc1eaea",
"score": "0.5406213",
"text": "def include_at(index, mod) end",
"title": ""
},
{
"docid": "5c95bc276b81ddc1df27889d4cf6530a",
"score": "0.5392464",
"text": "def include?(x)\n @indices[x] # huh\n end",
"title": ""
},
{
"docid": "66cd196f735ee0c0b9fae0b08420c312",
"score": "0.5368039",
"text": "def invalid_position(index)\n nums = [1,2,3,4,5,6,7,8,9]\n unless nums.include?(index)\n TRUE\n end\n end",
"title": ""
},
{
"docid": "09fdbeb8c3d7c9d9989ea825dc69b879",
"score": "0.5367152",
"text": "def include?(other)\n `return self.indexOf(other) == -1 ? Qfalse : Qtrue;`\n end",
"title": ""
},
{
"docid": "09fdbeb8c3d7c9d9989ea825dc69b879",
"score": "0.5367152",
"text": "def include?(other)\n `return self.indexOf(other) == -1 ? Qfalse : Qtrue;`\n end",
"title": ""
},
{
"docid": "6aba79b1c93294fd15eaab4908bacaef",
"score": "0.53537464",
"text": "def includes_index?(index)\n (-self.length...self.length).cover?(index)\n end",
"title": ""
},
{
"docid": "21f6d59e64746a93114af39a21a5f289",
"score": "0.53533244",
"text": "def include?(other)\n set_indexes.sort & other.set_indexes.sort == other.set_indexes.sort\n end",
"title": ""
},
{
"docid": "4bb4bda562f544e776d76ff44b2bd784",
"score": "0.52991265",
"text": "def added(hxlist, hxlist2)\n\n added_or_changed = hxlist2 - hxlist \n indexes = added_or_changed.map {|x| hxlist2.index x} \n indexes\n\n end",
"title": ""
},
{
"docid": "ead2c3c3e42d8cf794ca5c79ab0deef8",
"score": "0.5289694",
"text": "def include?(list, search)\n !!list.find_index(search)\nend",
"title": ""
},
{
"docid": "d515c8b6ea43f4f27ffc36991042069e",
"score": "0.5278078",
"text": "def candidates_included_in_all_the_others(candidates_in_correct_position)\n\tcandidates_in_correct_position.each do |small|\n\t\tok = true\n\t\tcandidates_in_correct_position.each do |big|\n\t\t\tif small!=big\n\t\t\t\tunless big.source.position.include?(small.source.position)\n\t\t\t\t\tok = false\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn small if ok\n\tend\n\tnil\nend",
"title": ""
},
{
"docid": "f79350c2f9b528cd31b57f1140d264a6",
"score": "0.52747005",
"text": "def solution(a)\n a.each do |element|\n return element if a.index(element) == a.rindex(element)\n end\nend",
"title": ""
},
{
"docid": "444a1c436deb062f030f99069ffc0521",
"score": "0.5259676",
"text": "def get_index_last_smaller_snp(pos)\n @included_snps.each_with_index do|snp_indx, index|\n if pos < @snps[snp_indx].location.to_f\n return index-1\n end\n end\n end",
"title": ""
},
{
"docid": "3c90db5c7bf9a94fa9d5305e9512db37",
"score": "0.52306485",
"text": "def includ_answer(array,value)\n\t!!array.find_index(value)\nend",
"title": ""
},
{
"docid": "df3bd490b13554b0226ac089fcc2eeca",
"score": "0.52164423",
"text": "def selling_array(stonks) \n \n index_to_remove = stonks.find_index(buy(stonks))\n \nreturn index_to_remove + 1 \n\nend",
"title": ""
},
{
"docid": "ab23c614fd5e0d9ef845f6ad982fd6c1",
"score": "0.5201591",
"text": "def is_exact_match?(other_code, index)\n @seq[index] == other_code.seq[index]\n end",
"title": ""
},
{
"docid": "9c4d85395bc9a8b1062ddbea37573df9",
"score": "0.5185019",
"text": "def checkSrepIntersection\n (0..$sreps.length-1).each do |j|\n (0..$sreps.length-1).each do |i|\n if i != j\n $sreps[j].checkIntersection($sreps[i])\n end\n end\n end\n end",
"title": ""
},
{
"docid": "fe88e0f385073c703384c06404031045",
"score": "0.51778334",
"text": "def delete_over_nth(list,n)\n x = list[0]\n list.each do |item|\n if item == x\n return true\n else\n return false\n end\n p x\n end\n \nend",
"title": ""
},
{
"docid": "f1741f23696ae898d10d6f0d9b97841c",
"score": "0.5173954",
"text": "def eql?(other)\n other.is_a?(self.class) && other.index == index\n end",
"title": ""
},
{
"docid": "4fe929941983bddb8f0730f2ced78965",
"score": "0.51696545",
"text": "def inverse\n new_list = self.class.new\n origins.each do |origin|\n origin.items.each do |item, int_value|\n if self.list.none?{|item_to_search, other_value| item_to_search.equal?(item)}\n new_list.list[item] = int_value\n end\n end\n end\n\n new_list\n end",
"title": ""
},
{
"docid": "9c2a693b1608cf9d8b1fbd57d70fcf1f",
"score": "0.51363117",
"text": "def find(index)\n x = index\n while @parent_array[x] != 0\n x = @parent_array[x]\n end\n return x\n end",
"title": ""
},
{
"docid": "70365f991ea517819dd3d6d45a72fcdf",
"score": "0.5118479",
"text": "def compare_for_near_match(guess_index)\n (0..3).each do |code_index|\n next unless guess[guess_index] == code[code_index]\n\n key.push(\"O\")\n code[code_index] = 0\n break\n end\n end",
"title": ""
},
{
"docid": "b4d92b785894e42f73df90e44c670d74",
"score": "0.5112684",
"text": "def search item #(item: pointer; var index: longint): boolean\n result = false\n l = 0\n h = size - 1\n while (l <= h) do\n i = (l + h) >> 1\n case compare(self[i], item)\n when -1\n l = i + 1\n when 1\n h = i - 1\n when 0\n h = i - 1\n result = true\n l = i if @duplicates == :dup_ignore || @duplicates == :dup_replace\n end\n end\n index = l\n [result, index]\n end",
"title": ""
},
{
"docid": "48dea97ca49a6c79d25c6d34523418ff",
"score": "0.5082022",
"text": "def enable?(index); self.index == index; end",
"title": ""
},
{
"docid": "79a921b6bfa61eed952c60bb43dc9270",
"score": "0.5082011",
"text": "def variants_idx; end",
"title": ""
},
{
"docid": "f94077738f2187f0c6520cf9dea8a58f",
"score": "0.5070411",
"text": "def duplicate_viol_candidates\n @partition.find_all { |part| part.size > 1 }\n end",
"title": ""
},
{
"docid": "8bc8b75d70d041a74b5883c99bd0eb43",
"score": "0.505262",
"text": "def arr_includes(arr1, arr2)\n temp_arr2 = arr2.dup\n return false if arr2.length == 0\n arr1.each do |num|\n if temp_arr2.include? num\n index = temp_arr2.index(num)\n temp_arr2.delete_at(index)\n else\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "da7a06f9e9c8b3ae41fa912ce5559796",
"score": "0.50346506",
"text": "def remove_duplicates(nums)\n\n non_dupe_index = 0\n nums.each do |num|\n if (non_dupe_index == 0 || num > nums[non_dupe_index - 1])\n nums[non_dupe_index] = num\n non_dupe_index += 1\n end\n end\n nums.replace(nums)\n non_dupe_index\n\nend",
"title": ""
},
{
"docid": "074c5bf160d9373cfaada89c0f993379",
"score": "0.5022855",
"text": "def neighbor_exclusions(neighbor_possibilities)\n neighbor_possibilities.select do |possibilities|\n neighbor_possibilities.count(possibilities) == possibilities.length\n end\n end",
"title": ""
},
{
"docid": "c608e0349d03d1d33b3a870c985445c6",
"score": "0.49995697",
"text": "def hit_itself?\n # list.uniq removes all repeated elements from a list\n @positions.uniq.length != @positions.length\n end",
"title": ""
},
{
"docid": "c8b07eba95b5b75b6611c37786e6f405",
"score": "0.49922282",
"text": "def sockMerchant(n, ar)\n match_count = 0\n dup_arr = ar\n i = 0\n while i < dup_arr.length\n for j in i+1..dup_arr.length do\n if dup_arr[i] == dup_arr[j]\n match_count = match_count+1\n dup_arr.slice!(j)\n dup_arr.slice!(i)\n i = 0\n break\n end\n i = i+1 if j == dup_arr.length\n\n end\n end\n match_count\nend",
"title": ""
},
{
"docid": "1e8063040c0dbd23e0afc9a0293238d7",
"score": "0.4989976",
"text": "def rindex(p0) end",
"title": ""
},
{
"docid": "d6f9f4026ee07b4c6cc6a3c63abb3341",
"score": "0.4977445",
"text": "def contain?(position); end",
"title": ""
},
{
"docid": "91eb6779026b42dc0b84769dbf29365e",
"score": "0.49741513",
"text": "def oddball x\n # code here\n #ind = x.index('odd')\n\n x.include?(x.index('odd'))\nend",
"title": ""
},
{
"docid": "32707388ee934a1c3d65af6c286bd3af",
"score": "0.49649796",
"text": "def index(p0) end",
"title": ""
},
{
"docid": "32707388ee934a1c3d65af6c286bd3af",
"score": "0.49649796",
"text": "def index(p0) end",
"title": ""
},
{
"docid": "8c30583b7042dc07e4d4765555478feb",
"score": "0.49562377",
"text": "def search_vertices(list, s, index)\n for i in (0..list.length-1)\n if(!list[i].nil? and !s.nil?) \n #if the vertex exists and in the same sentence (index)\n if(list[i].name.casecmp(s) == 0 and list[i].index == index)\n # puts(\"***** search_vertices:: Returning:: #{s}\")\n return list[i]\n end\n end\n end\n # puts(\"***** search_vertices:: Returning nil\")\n return nil\nend",
"title": ""
},
{
"docid": "4a13b790b7bc3de478279a46e724551e",
"score": "0.4946569",
"text": "def duplicate_position(index)\n @lines[index-1] == \"X\" || @lines[index-1] == \"O\"\n end",
"title": ""
},
{
"docid": "e1dc33511a064f4957dc0df5732edad8",
"score": "0.4945075",
"text": "def binary_search(students, ssn)\n students.sort #must sort for binary search\n students.index(students.bsearch {|student| ssn <=> student.ssn}) || -1\nend",
"title": ""
},
{
"docid": "c244f9cf467f425f8cf4efceec88377c",
"score": "0.4942639",
"text": "def index_match(array)\n # write your code here\n array.each_with_index do |num, index|\n if num == index \n return num\n end\n end\n -1\nend",
"title": ""
},
{
"docid": "626b2d463b4d28985395713e3716dba1",
"score": "0.49398065",
"text": "def indices_equal(val)\n indices = []\n self.each_with_index do |v,i|\n if val == v\n indices << i\n end\n end\n indices\n end",
"title": ""
},
{
"docid": "282e2594585db649ac5389aff2cd9bb0",
"score": "0.49342105",
"text": "def findInsertionPt(candidate, arrayList)\n idx = 0\n arrayList.each do |rec|\n return idx if rec[0] >= candidate || rec[1] >= candidate\n idx += 1\n end\nend",
"title": ""
},
{
"docid": "b100d45fec51fbd5ad12952ad46539f1",
"score": "0.49066877",
"text": "def if_ins(i,spl)\n if self.create_arr == [] or self.create_arr == [0]\n spl.pc = i\n return spl\n else\n spl.pc += 1\n return spl\n end\n end",
"title": ""
},
{
"docid": "23167d43585bd7dd910a67f2b0abf584",
"score": "0.49062586",
"text": "def no_repeats?(song_name, songs)\n songs.each_with_index do |ele, idx| \n if ele == song_name\n return false if ele == songs[idx + 1]\n end\n end\n true\nend",
"title": ""
},
{
"docid": "4ba42d75a0d2ad380b18f272d82e6258",
"score": "0.48772478",
"text": "def solve(nums)\n nums.each_with_index do |n, i|\n if nums[i] == i\n return i\n end\n end\n return -1\nend",
"title": ""
},
{
"docid": "2dacccba7e4ceb0329e9d8dda1b0233a",
"score": "0.48741278",
"text": "def check_for_correct_value_wrong_position\n correct_value_wrong_position = 0\n @proposed_process_code.each do |value|\n if @secret_process_code.include?(value)\n @secret_process_code.delete_at(@secret_process_code.index(value) || @secret_process_code.length)\n correct_value_wrong_position += 1\n end\n end\n correct_value_wrong_position\n end",
"title": ""
},
{
"docid": "cab5f4715e939d983ab30f4ae5e83b30",
"score": "0.48724186",
"text": "def find_exact_match\n exact = 0\n index = 0\n 4.times.map do\n if @temp_code[index] == @temp_guess[index]\n exact += 1\n @temp_code.delete_at(index)\n @temp_guess.delete_at(index)\n else\n index += 1\n end\n end\n exact\n end",
"title": ""
},
{
"docid": "a8ceb5c55d33e1ebfbc1c5cd009edfcb",
"score": "0.48632285",
"text": "def <=>(otherSteak)\n @index <=> otherSteak.index\nend",
"title": ""
},
{
"docid": "273518a523735edfc39d9b34c059047f",
"score": "0.48608413",
"text": "def okay_two_sum?(arr, target)\n small = arr.select {|el| el < target}\n small.each_with_index do |e, i|\n sub_el = target - e \n # arr.delete(sub_el)\n return true if small.include?(sub_el) && small[i] != sub_el\n \n end\n false \n \n \nend",
"title": ""
},
{
"docid": "1b271633837300d6afafcc18f7c85703",
"score": "0.4858573",
"text": "def contains_nearby_duplicate(nums, k)\n nums_hash = {}\n \n nums.each_with_index do |num, index|\n return true if nums_hash[num] && index - nums_hash[num] <= k\n \n nums_hash[num] = index\n end\n \n false\nend",
"title": ""
},
{
"docid": "d05b51219c8c46d99777851935a4ed9d",
"score": "0.48559126",
"text": "def two_sum(nums, target)\n target_indexes = []\n nums.each_with_index do |primary, index|\n nums.each_with_index do |num, i|\n if primary + num == target && index != i\n target_indexes << index\n target_indexes << i\n end\n end\n end\n return target_indexes.uniq\nend",
"title": ""
},
{
"docid": "64b069601224b674ac12e3f0b145f389",
"score": "0.48508984",
"text": "def identifyAddNps\r\n pd = ParseData.new\r\n @sentences.each do |sentence|\r\n strSent = sentence.strRep\r\n \r\n sentNps = @parseAdapter.parse strSent\r\n \r\n #in the future, do a little better on matching\r\n foundNps = pd.onlyNP sentNps\r\n \r\n foundNps.sort_by{|word| word.length}.each do |foundNp|\r\n #puts \"#{foundNp}\"\r\n\r\n sentence.npAdd foundNp, newId\r\n end\r\n end\r\n\r\n #add the position on here...\r\n pos = 1\r\n @sentences.each do |sentence|\r\n sentence.npModels.each do |npModel|\r\n npModel.position = pos\r\n pos = pos + 1\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "b5624f4ba78f67fb6d533cfebf24b467",
"score": "0.48301873",
"text": "def validate_subsequence(arr1, arr2)\n\n arr2.each do |num|\n idx = arr1.index(num)\n return false if idx.nil?\n arr1 = arr1[idx+1..-1]\n end\n\n true\nend",
"title": ""
},
{
"docid": "b881d2253e33831726c8972181b0b8f5",
"score": "0.48212847",
"text": "def return_diff_betw_indexes(hash, key_1, value_1, key_2, value_2)\n array_1 = hash[:bay_1].to_a\n array_2 = hash[:bay_2].to_a\n\n full_array = array_1 + array_2\n object_1 = key_1 , value_1\n object_2 = key_2, value_2\n for item_selection in full_array\n if (item_selection == object_1) || (item_selection == object_2)#trying to make sure the code doesnt get run if there is a mistake in the input but can only check item_selection one at a time and it returns nil for the mistake and error occurs because nil cant be into a Fixnum\n #break if object_1 == nil Trying to implement a test to filter results if they contain a nil\n index_1 = full_array.index(object_1)\n index_2 = full_array.index(object_2)\n difference = index_2 - index_1\n return difference\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "0787a823b277ef7c2eb31fa02ae51cc7",
"score": "0.4806192",
"text": "def find3(a, X)\n # scan through array\n # build hash storing complement in each key\n complements = {}\n a.each_with_index do |val, ind|\n if complements[X - val]\n complements[X - val].push(ind)\n else\n complements[X - val] = [ind]\n end\n end\n\n # scan through the array again\n # get complement\n # for each value scan the remainder of the arrray\n # for a value such taht a + b = the complement\n\n # for each character we have built a dictionary such that, we can find\n # x = a + complement\n\n # [1, 2, 3]\n # 1 + 2 = 3\n # 1 + 3 = 4 =>\n\n # for each value in the array (a) look at all following values (b) and see if a + b\n # is in the dictionary, if it is, check that their indices do not collide with the index\n # stored at dict(a+b)\n\n a.each_with_index do |va, i|\n a.each_with_index do |vb, j|\n break if i == j\n\n complement = va + vb\n indices = complements[complement]\n\n indices.each do |z|\n # every index is unique\n return [i, j, z] unless z == i || z == j\n end\n end\n end\n\n return nil\nend",
"title": ""
},
{
"docid": "d425c32b94cca74ca0d6d12b1a20a479",
"score": "0.48048726",
"text": "def find_undelivered_breakfast(delivery_ids)\n unique_delivery_id = 0\n\n delivery_ids.each_with_index do |id|\n unique_delivery_id ^= id\n end\n\n unique_delivery_id\nend",
"title": ""
},
{
"docid": "4fd74f906f8bdeb64026e35b81fd49cc",
"score": "0.48030823",
"text": "def index(element); end",
"title": ""
},
{
"docid": "ad460e29ebaa96ff3131c1d95b12aef4",
"score": "0.48018092",
"text": "def search(nums, target)\n nums.each_with_index do |num, index|\n return index if num == target\n end\n -1\nend",
"title": ""
},
{
"docid": "b703e27f02a18dbd1902c297488f4f14",
"score": "0.47930047",
"text": "def semi_match(guess)\n\t\t\t# removes exact matches from guess \n\t\t\tunmatched = @indices.map {|i| guess[i]}\n\t\t\t# looks at available indices in @code and removes first instance\n\t\t\t# of a number in unmatched for each match made\n\t\t\t@indices.each {\n\t\t\t\t|i| unmatched.slice!(unmatched.index(@code[i])) if unmatched.include?(@code[i]) \n\t\t\t}\n\t\t\t# returns number of correct numbers in the incorrect place\n\t\t\t@indices.length - unmatched.length\n\t\tend",
"title": ""
},
{
"docid": "48b63cabfc2614362951b3ced984f86e",
"score": "0.47925565",
"text": "def naive(a, target)\n\ta.each do |ie, i|\n\t\ta.each do |je, j|\n\t\t\tnext if i == j # cant be the same, i assume\n\t\t\treturn true if ie + je == target\n\t\tend\n\tend\n\treturn false\nend",
"title": ""
},
{
"docid": "0dfb4a93d4d73b38a3b0bdaf76eedba3",
"score": "0.4783312",
"text": "def search_insert_position(nums, target)\n\nend",
"title": ""
},
{
"docid": "11d02d9a47ba93f64552b664b13b385d",
"score": "0.47803807",
"text": "def test_xyz_not_in_arr\n refute_includes(list, 'ttt')\n end",
"title": ""
},
{
"docid": "914432c9207f9edf77897bf301d3b735",
"score": "0.47789663",
"text": "def surrounding(index, directions = Grid::Movement, compact = true)\n result = directions.collect {|dir| neighbor(index, dir)} + [index]\n return result.compact.uniq if compact\n return result.uniq\n end",
"title": ""
},
{
"docid": "73d0e243107132e46ab0650d4dc1dfcf",
"score": "0.477352",
"text": "def findTokenExpanded( original, new )\n (0...( original.length)).each do |i|\n return i if original[i] != new[i]\n end\n nil\nend",
"title": ""
},
{
"docid": "f767dedc6d72c31384d16def15fb6a4e",
"score": "0.47716668",
"text": "def opposite_count(nums)\n pair=0\n nums.each do |num1|\n \tnums.each do |num2|\n \tif nums.index(num2)>nums.index(num1) && num2+num1==0\n pair+=1\n end\n end\n end\n return pair\n \n \n\nend",
"title": ""
},
{
"docid": "ff2663e81b567d94d4a9514dcc08dd48",
"score": "0.47683704",
"text": "def opposite_count(nums)\n count = 0\n nums.each_with_index do |num1, indx1|\n nums.each_with_index do |num2, indx2|\n result = num1 + num2\n count += 1 if indx2 > indx1 && result == 0\n end\n end\n count\nend",
"title": ""
},
{
"docid": "81dd2987c271f0aa20bbfa950dbe7443",
"score": "0.4766015",
"text": "def find_indexes_of_source_vertices\n # start with all vertices' indexes\n indexes = [*0..@vertices.length-1]\n\n @vertices.each do |vertex|\n vertex.neighbours.each_with_index do |value, neighbour_index|\n if (value == true)\n indexes = indexes - [neighbour_index]\n end\n end\n end\n\n indexes\n end",
"title": ""
},
{
"docid": "ea6715a026f99b3925b00e92611199ce",
"score": "0.47568747",
"text": "def okay_two_sum?(arr,target)\n arr = arr.sort\n arr.each_with_index do |el,i|\n difference = target - el\n dup = arr.dup\n dup.delete_at(i)\n return true if dup.binary_search(difference)\n end\n false\n\nend",
"title": ""
},
{
"docid": "2ebc17a764dfbac954efd379d00645e8",
"score": "0.47560808",
"text": "def remove_dup(a,b)\n b.each {|e| a.delete_at(a.index(e)) unless a.index(e).nil?}\n a\nend",
"title": ""
},
{
"docid": "966288b8506c118536cbcbda7381f7c4",
"score": "0.47529817",
"text": "def remove_duplicates(nums)\n \n if nums.size > 0 #make sure the array size > 0\n \n if nums[0] == \"\" # exit if the 1st element is empty\n return\n else\n compare_to = nums[0]\n index = 1\n\n # iterate through the values of the array\n while index < nums.size\n value = nums[index]\n if compare_to == value\n nums.delete_at(index) # delete value (maintain compare_to value)\n # do NOT increment index pointer \n # BC when delete value, the pointer must continue pointing to that same location since the value will update (with deletion)\n puts \"MATCH #{compare_to} compared to value: #{value} at index[#{index}]\"\n else\n puts \"NO match #{compare_to} compared to value: #{value} at index[#{index}]\"\n compare_to = value # re-configuring the value to compare against\n index += 1\n end\n end\n puts \"#{nums}\"\n return nums.length\n end\n else\n return #exit if the array doesn't have any values\n end\n\nend",
"title": ""
},
{
"docid": "5b5611521868a2c31d8b1af77952b4ab",
"score": "0.4750559",
"text": "def rank_test(index)\n @player1.deck.rank_of_card_at(index) == @player2.deck.rank_of_card_at(index)\n end",
"title": ""
},
{
"docid": "e0d332ed14d37cf934ff5edcfd132cf6",
"score": "0.47422728",
"text": "def index(list, item, &block)\r\n\t\ti = bisect_left(list, item, &block)\r\n\t\treturn list[i] == item ? i : nil\r\n\tend",
"title": ""
},
{
"docid": "7d57deb561d71f69a2da3ed4ea626642",
"score": "0.47400987",
"text": "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",
"title": ""
},
{
"docid": "55576c892ce1c38f79dcf39ccbbcd580",
"score": "0.473154",
"text": "def nameri arr, query \n len = arr.length\n for idx in 0 .. len - 1 do\n if query == arr[idx]\n return idx \n else \n end\n end\nend",
"title": ""
},
{
"docid": "4fb7954b68bf85466cef455daec942f2",
"score": "0.47268307",
"text": "def search_product(products, reference)\n product_position = false\n products.each_with_index do |product, index|\n if product[:reference] == reference\n product_position = index\n end\n end\n product_position\nend",
"title": ""
},
{
"docid": "740d4f2a4f170a2a9661995e092228a1",
"score": "0.47215542",
"text": "def missing(ordered)\n first_index = 0\n missings = []\n while first_index < ordered.size - 1\n second_index = first_index + 1\n\n first_missing = ordered[first_index] + 1\n\n until first_missing == ordered[second_index]\n missings << first_missing\n\n first_missing += 1\n end\n\n first_index += 1\n end\n missings\nend",
"title": ""
},
{
"docid": "6887a0d89bcee0a0cdf3045c6bc39844",
"score": "0.47205663",
"text": "def contains_nearby_duplicate(nums, k)\n counter = {}\n \n nums.each_with_index do |num, i|\n return true if i - counter[num] <= k if counter[num]\n \n counter[num] = i \n end\n \n false\nend",
"title": ""
},
{
"docid": "da19b400adcc78deebd718c1d7b18fcb",
"score": "0.47175393",
"text": "def c v1, v2, o\n m = false\n d = []\n (0...v2.size).each{ |j|\n if !v1.include? v2[j] + o\n d << v2[j]\n m = true\n end\n }\n for x in d\n v2.delete x\n end\n m\nend",
"title": ""
},
{
"docid": "e38301da027190972300b9e047d173a6",
"score": "0.47175357",
"text": "def they_here\n included = true\n new_animals = [\"Andean Cat\", \"Dodo\", \"Saiga Antelope\"]\n new_animals.each do |animal|\n @animal_array.each do |animal2|\n if animal == animal2\n included\n puts \"#{animal} is extinct\"\n else\n !included\n end\n end\n end\nend",
"title": ""
},
{
"docid": "85bec71fc81ce7f5fd9f34a64a71c2ff",
"score": "0.47133726",
"text": "def judge_signal(instance,signal,noneqList_custom)\n flag = true\n noneqList_custom.each do |inst,data|\n if inst == instance\n flag = false unless data.noneq_points.index(\"#{signal}\").nil?\n flag = false unless data.nocor_points.index(\"#{signal}\").nil?\n end\n end\n return flag\n end",
"title": ""
},
{
"docid": "26de47e59a04c4c6540e11527cbfa4d2",
"score": "0.47105062",
"text": "def include?(ary, value)\n !!ary.index(value)\nend",
"title": ""
},
{
"docid": "c8dc0eecafb012dfc0bdb351e703b1d4",
"score": "0.47097948",
"text": "def check_duplication (n=10)\n\n # get the first n hits\n less_hits = @hits[0..[n-1,@hits.length].min]\n averages = []\n\n less_hits.each do |hit|\n # indexing in blast starts from 1\n start_match_interval = hit.hsp_list.each.map{|x| x.hit_from}.min - 1\n end_match_interval = hit.hsp_list.map{|x| x.hit_to}.max - 1\n \n #puts \"#{hit.xml_length} #{start_match_interval} #{end_match_interval}\" \n\n coverage = Array.new(hit.xml_length,0)\n hit.hsp_list.each do |hsp|\n aux = []\n # for each hsp\n # iterate through the alignment and count the matching residues\n [*(0 .. hsp.align_len-1)].each do |i|\n residue_hit = hsp.hit_alignment[i]\n residue_query = hsp.query_alignment[i]\n if residue_hit != ' ' and residue_hit != '+' and residue_hit != '-'\n if residue_hit == residue_query \n idx = i + (hsp.hit_from-1) - hsp.hit_alignment[0..i].scan(/-/).length \n aux.push(idx)\n #puts \"#{idx} #{i} #{hsp.hit_alignment[0..i].scan(/-/).length}\"\n # indexing in blast starts from 1\n coverage[idx] += 1\n end\n end\n end\n end\n overlap = coverage.reject{|x| x==0}\n averages.push(overlap.inject(:+)/(overlap.length + 0.0))\n end\n \n # if all hsps match only one time\n if averages.reject{|x| x==1} == []\n return [\"NO\",1]\n end\n\n R.eval(\"library(preprocessCore)\")\n\n #make the wilcox-test and get the p-value\n R.eval(\"coverageDistrib = c#{averages.to_s.gsub('[','(').gsub(']',')')}\")\n R. eval(\"pval = wilcox.test(coverageDistrib - 1)$p.value\")\n pval = R.pull \"pval\"\n\n if pval < 0.01\n status = \"YES\"\n else\n status = \"NO\"\n end\n return [status, pval]\n end",
"title": ""
},
{
"docid": "6f9134c40a56440a9b9775a7493d7fe1",
"score": "0.4704341",
"text": "def phase_ii(s1, s2)\n del_dex = []\n s1 = s1.chars\n s2 = s2.chars\n s1.each_with_index do |el, idx|\n if s2.include?(el)\n del_dex << idx\n s2.delete_at(s2.index(el))\n end\n end\n del_dex.each { |i| s1[i] = nil }\n return s1.select { |el| !el.nil? }.empty? && s2.empty?\nend",
"title": ""
},
{
"docid": "af8de548f0c3d9bf0a0aa95f04660f4d",
"score": "0.47011673",
"text": "def two_sum(nums, target)\n nums.each_with_index do |ele, i|\n check = target - ele\n return i, nums.index(check) if nums.include?(check) && i != nums.index(check)\n end\nend",
"title": ""
},
{
"docid": "294d8ce911253a4d5dab2e1ff97ab6b7",
"score": "0.47009733",
"text": "def search_insert(nums, target)\n nums.each_with_index do |num, index|\n return index if num >= target\n end\n \n return nums.size\nend",
"title": ""
},
{
"docid": "f2541f3b2921e69cdce6e3137b7e8d4f",
"score": "0.46991232",
"text": "def indexable_zip_codes\n zip_codes = self.zip_codes.collect(&:zip_code) \n zip_codes << original_address.zip_code if original_address\n zip_codes\n end",
"title": ""
},
{
"docid": "42ebe01af43cab616edf8b3d69a40210",
"score": "0.46990108",
"text": "def find_dups2\n uniq.select{ |e| (self-[e]).size < self.size - 1 }\n end",
"title": ""
},
{
"docid": "42ebe01af43cab616edf8b3d69a40210",
"score": "0.46990108",
"text": "def find_dups2\n uniq.select{ |e| (self-[e]).size < self.size - 1 }\n end",
"title": ""
},
{
"docid": "c6601526eeede9f5ee1b9c96566f7619",
"score": "0.46865892",
"text": "def dutch_national_flag2(ar, index)\n i = 0\n j = ar.size - 1\n x = ar[index]\n while i < j do\n i += 1 while ar[i] <= x && i < j\n j -= 1 while ar[j] > x && j > i\n ar[i], ar[j] = ar[j], ar[i]\n end\n i = 0\n j-= 1\n while i < j do\n i += 1 while ar[i] < x && i < j\n j -= 1 while ar[j] == x && j > i\n ar[i], ar[j] = ar[j], ar[i]\n end\n ar\nend",
"title": ""
},
{
"docid": "f42aedb9494e16b5d0251a97832f53b6",
"score": "0.46827215",
"text": "def near_matches(player_code)\n imperfect_indices = find_imperfect_indices(player_code)\n\n checked = []\n near_matches = 0\n\n imperfect_indices.each do |i|\n imperfect_indices.each do |j|\n unchecked = checked.none? { |digit| self[i] == digit }\n is_match = self[i] == player_code[j]\n\n if i != j && unchecked && is_match\n checked << self[i]\n near_matches += 1\n break\n end\n end\n end\n\n near_matches\n end",
"title": ""
},
{
"docid": "ff9922569e812d110e664dbd465d132a",
"score": "0.46764624",
"text": "def equals_index?(arr)\n for i in 0...arr.length do\n if arr[i] == i\n return true\n end\n end \n return false\nend",
"title": ""
},
{
"docid": "24572e423f48899cdf5fb2555784d831",
"score": "0.46708888",
"text": "def array_difference(minuend, subtrahend)\n result = minuend.dup\n subtrahend.each do |element|\n idx = result.index(element)\n result.delete_at(idx) if idx\n end\n result\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "240a9f777ca49241e2f360b6ab8e662b",
"score": "0.0",
"text": "def set_student_group\n @student_group = StudentGroup.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60322535",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6012846",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.5923006",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.59147197",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.59147197",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.5898899",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58905005",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58905005",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58905005",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.58899754",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58778226",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\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 else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863685",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58098996",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.5740018",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.5730792",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57159567",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.56995213",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.5692253",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.5668434",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5652364",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5649457",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5637111",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.56268275",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56099206",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5595526",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.55951923",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.55885196",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55564445",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55564445",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.5509468",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5502921",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5466533",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.54644245",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.5448076",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.5445466",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.54391384",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54171526",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54118705",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54118705",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5398984",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53935355",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53935355",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.53924096",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.53874743",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5379617",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.53577393",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.53494817",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.5347875",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.5346792",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5344054",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.53416806",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53265905",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53036004",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5284624",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5283799",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.5256181",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52549016",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.52492326",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.52462375",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52388823",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52388823",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.52384317",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.5233074",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52307343",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.52247876",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.5221976",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.52215284",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215321",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213458",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.5209029",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.5206747",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.52043396",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.5203811",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5202598",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.52015066",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51961863",
"text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51961863",
"text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5190015",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5179595",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.5177569",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51727664",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51727664",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51727664",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5163597",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.51522565",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.51422286",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.5142005",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.5140699",
"text": "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",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51397085",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.5134159",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115907",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5113603",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.51112026",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110439",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110439",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110439",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.51074827",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5105795",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.50995123",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.5096676",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "b2a4ff1f0080ca2a1e6e22f77f907573",
"score": "0.50926304",
"text": "def commit\n if valid?\n callback_process = setup(controller)\n controller.after_filter callback_process, :only => action_name\n controller\n else\n Innsights::ErrorMessage.log(\"#{controller_name} class has no valid method #{action_name}\")\n end\n end",
"title": ""
}
] |
0a38c8c0a8b4f65610543588e07fbaa6
|
this object could have a 3d or 2d model show in tree
|
[
{
"docid": "56f10cfafdfbc1791c7af97341a9a835",
"score": "0.0",
"text": "def have_model_design?\n\t\t\ttrue\n\tend",
"title": ""
}
] |
[
{
"docid": "76b52ee1f400cfed8d174a9c30c5f33b",
"score": "0.63536006",
"text": "def show\n @new = false\n @single = true\n @width = @height = 150\n @vw = 80\n @vh = 40\n @vx = @tree.x - @vw/2\n @vy = @tree.y - @vh/2\n \n end",
"title": ""
},
{
"docid": "8d623a3ec6a9ad1eeb5935feb6e5e809",
"score": "0.6162543",
"text": "def tree\n @vision = Vision.first\n end",
"title": ""
},
{
"docid": "02221cd7795cb3ac761c26dd44c276c8",
"score": "0.57135445",
"text": "def index\n @trees = Tree.all\n @single = false\n @new = false\n @width = 700\n @height = 1400\n @vx = 0\n @vy = 0\n @vw = 400\n @vh = 750\n end",
"title": ""
},
{
"docid": "ebbf50024da9796a48203145f5bc596c",
"score": "0.549912",
"text": "def show_tree\n\tend",
"title": ""
},
{
"docid": "f3ef93200107f2518eb8816cf0fc2b40",
"score": "0.54568505",
"text": "def tree(capa = 1)\n R3::Tree.new(capa)\nend",
"title": ""
},
{
"docid": "01790d1a1519dbc7b914fd9dd381e2c5",
"score": "0.54525375",
"text": "def tree\n @treetop = @proj.default_ontology_class\n @proj.ontology_classes.first if !@treetop\n redirect_to :action => :new, :controller => :ontology_classes and return if !@treetop\n @colored_object_relationships = @proj.object_relationships.with_color_set\n @all_object_relationships = @proj.object_relationships \n render :action => 'ontology/tree/index'\n end",
"title": ""
},
{
"docid": "f2b3a2223a91ca6b0454ac7de1ba7ff4",
"score": "0.5445473",
"text": "def depth; end",
"title": ""
},
{
"docid": "1b9cb7792cdd777c981eeaef553edfb5",
"score": "0.53619486",
"text": "def jb_visualize3d(an, bn, tn)\n Visualizer::Cube.new(an, bn, tn, self).visualize\n end",
"title": ""
},
{
"docid": "753c6e7d4eeb6d3249c281ad43d8d90b",
"score": "0.53414196",
"text": "def modeler_description\n return 'Converts the OpenStudio model to vA3C JSON format and renders using Three.js, simulation data is applied to surfaces of the model'\n end",
"title": ""
},
{
"docid": "d9422e67ec6b43c70f0978d017f0457b",
"score": "0.52390057",
"text": "def set_tree\n @tree = Tree.with_attached_images.find(params[:id])\n end",
"title": ""
},
{
"docid": "53180cf1346ef1bd47b96c8d8d249c1b",
"score": "0.5229706",
"text": "def flamegraph_mode; end",
"title": ""
},
{
"docid": "e235908d041d72d717d98f438027d081",
"score": "0.52197653",
"text": "def run(model, runner, user_arguments)\r\n super(model, runner, user_arguments)\r\n\r\n # use the built-in error checking\r\n if !runner.validateUserArguments(arguments(model), user_arguments)\r\n return false\r\n end\r\n\r\n z = OpenStudio::Vector.new(3)\r\n z[0] = 0\r\n z[1] = 0\r\n z[2] = 1\r\n \r\n allVertices = []\r\n objVertices = \"\"\r\n objFaces = \"\"\r\n allMaterials = []\r\n\r\n # all planar surfaces\r\n model.getPlanarSurfaces.each do |surface|\r\n\r\n # handle sub surfaces later\r\n next if !surface.to_SubSurface.empty?\r\n \r\n surfaceID = getSurfaceID(surface)\r\n allMaterials << getMaterial(surface)\r\n \r\n surfaceVertices = surface.vertices\r\n t = OpenStudio::Transformation::alignFace(surfaceVertices)\r\n r = t.rotationMatrix\r\n tInv = t.inverse\r\n \r\n siteTransformation = OpenStudio::Transformation.new\r\n planarSurfaceGroup = surface.planarSurfaceGroup\r\n if not planarSurfaceGroup.empty?\r\n siteTransformation = planarSurfaceGroup.get.siteTransformation\r\n end\r\n \r\n surfaceVertices = tInv*surfaceVertices\r\n \r\n subSurfaces = []\r\n subSurfaceVertices = OpenStudio::Point3dVectorVector.new\r\n if !surface.to_Surface.empty?\r\n subSurfaces = surface.to_Surface.get.subSurfaces\r\n subSurfaces.each do |subSurface|\r\n subSurfaceVertices << tInv*subSurface.vertices\r\n end\r\n end\r\n\r\n triangles = OpenStudio::computeTriangulation(surfaceVertices, subSurfaceVertices)\r\n if triangles.empty?\r\n runner.registerWarning(\"Failed to triangulate #{surface.iddObject.name} #{surface.name} with #{subSurfaces.size} sub surfaces\")\r\n end\r\n \r\n objFaces += \"##{surface.name}\\n\"\r\n objFaces += \"g #{surface.name}\\n\"\r\n objFaces += \"usemtl #{surfaceID}\\n\"\r\n triangles.each do |vertices|\r\n vertices = siteTransformation*t*vertices\r\n normal = siteTransformation.rotationMatrix*r*z\r\n\r\n indices = []\r\n vertices.each do |vertex|\r\n indices << getVertexIndex(vertex, allVertices)\r\n end\r\n \r\n #objFaces += \" usemtl #{surfaceID}\\n\"\r\n objFaces += \" f #{indices.join(' ')}\\n\"\r\n end\r\n \r\n # now do subSurfaces\r\n subSurfaces.each do |subSurface|\r\n \r\n subSurfaceID = getSurfaceID(subSurface)\r\n allMaterials << getMaterial(subSurface)\r\n \r\n subSurfaceVertices = tInv*subSurface.vertices\r\n triangles = OpenStudio::computeTriangulation(subSurfaceVertices, OpenStudio::Point3dVectorVector.new)\r\n\r\n objFaces += \"##{subSurface.name}\\n\"\r\n objFaces += \"g #{subSurface.name}\\n\"\r\n objFaces += \"usemtl #{subSurfaceID}\\n\"\r\n triangles.each do |vertices|\r\n vertices = siteTransformation*t*vertices\r\n normal = siteTransformation.rotationMatrix*r*z\r\n\r\n indices = []\r\n vertices.each do |vertex|\r\n indices << getVertexIndex(vertex, allVertices) \r\n end \r\n #objFaces += \" usemtl #{subSurfaceID}\\n\"\r\n objFaces += \" f #{indices.join(' ')}\\n\"\r\n end\r\n end\r\n end\r\n \r\n if objFaces.empty?\r\n runner.registerError(\"Model is empty, no output will be written\")\r\n return false\r\n end\r\n\r\n # write object file\r\n obj_out_path = \"./output.obj\"\r\n File.open(obj_out_path, 'w') do |file|\r\n\r\n file << \"# OpenStudio OBJ Export\\n\\n\"\r\n file << \"mtllib surface_type.mtl\\n\"\r\n file << \"#mtllib boundary_color.mtl\\n\\n\"\r\n file << \"# Vertices\\n\"\r\n allVertices.each do |v|\r\n file << \"v #{v.x} #{v.z} #{-v.y}\\n\"\r\n end\r\n file << \"\\n\"\r\n file << \"# Faces\\n\"\r\n file << objFaces\r\n \r\n # make sure data is written to the disk one way or the other \r\n begin\r\n file.fsync\r\n rescue\r\n file.flush\r\n end\r\n end\r\n \r\n # write material files\r\n mtl_out_path = \"./surface_type.mtl\"\r\n File.open(mtl_out_path, 'w') do |file|\r\n\r\n file << \"# OpenStudio Surface Type MTL Export\\n\"\r\n allMaterials.each do |material|\r\n r = material[:surface_type_color][0]/255.to_f\r\n g = material[:surface_type_color][1]/255.to_f\r\n b = material[:surface_type_color][2]/255.to_f\r\n a = material[:surface_type_color][3]\r\n file << \"newmtl #{material[:surfaceID]}\\n\"\r\n file << \" Ka #{r} #{g} #{b}\\n\"\r\n file << \" Kd #{r} #{g} #{b}\\n\"\r\n file << \" Ks #{r} #{g} #{b}\\n\"\r\n file << \" Ns 0.0\\n\"\r\n file << \" d #{a}\\n\" # some implementations use 'd' others use 'Tr'\r\n end\r\n \r\n # make sure data is written to the disk one way or the other \r\n begin\r\n file.fsync\r\n rescue\r\n file.flush\r\n end\r\n end\r\n \r\n mtl_out_path = \"./boundary_color.mtl\"\r\n File.open(mtl_out_path, 'w') do |file|\r\n\r\n file << \"# OpenStudio Surface Type MTL Export\\n\"\r\n allMaterials.each do |material|\r\n r = material[:boundary_color][0]/255.to_f\r\n g = material[:boundary_color][1]/255.to_f\r\n b = material[:boundary_color][2]/255.to_f\r\n a = material[:boundary_color][3]\r\n file << \"newmtl #{material[:surfaceID]}\\n\"\r\n file << \" Ka #{r} #{g} #{b}\\n\"\r\n file << \" Kd #{r} #{g} #{b}\\n\"\r\n file << \" Ks #{r} #{g} #{b}\\n\"\r\n file << \" Ns 0.0\\n\"\r\n file << \" d #{a}\\n\" # some implementations use 'd' others use 'Tr'\r\n end\r\n\r\n # make sure data is written to the disk one way or the other \r\n begin\r\n file.fsync\r\n rescue\r\n file.flush\r\n end\r\n end\r\n \r\n # report final condition of model\r\n runner.registerFinalCondition(\"The building finished with #{model.getSpaces.size} spaces.\")\r\n\r\n return true\r\n\r\n end",
"title": ""
},
{
"docid": "b2e3fbd1ab89d92ec286ebc67d8e2df4",
"score": "0.5197896",
"text": "def create_tree_box(model_name,method_name,filter_type,tree_filter_id,order,filter_id)\n \n html = '<span style=\"border:1px solid #E0E0E0;color:#444;position:relative;bottom:4px;font-weight:bold;background:#EEE;padding-top:2px;padding-left:2px;padding-right:2px;padding-bottom:2px;\">'\n \n feature = modelize(model_name).send(method_name,\n tree_filter_id).join\n \n #This method is called from filter_category module, which decorates the raw feature from the DB and makes it html friendly\n html = html + html_features(feature)\n html = html + '</a> <span style=\"position:relative;bottom:1px;\">'\n\n link = self.form_cross_url(filter_type,\n filter_id,\n order,\n @sub_category_flag,\n tree_filter_id)\n\n html = html + link\n\n html = html + '</span>\n </span>'\n\n html + '<span style=\"color:#6E6A6B;size=2;position:relative;bottom:4px;background:#FFFFF;padding-top:2px;padding-left:2px;padding-right:2px;padding-bottom:2px;\"></span>'\n\n end",
"title": ""
},
{
"docid": "46784bf7c1dac62454129d5a0d44302d",
"score": "0.51872116",
"text": "def getSceneNodes\n @sceneNodes\n end",
"title": ""
},
{
"docid": "f3e5ea9aba26a51ad1e464589970aaa4",
"score": "0.51852596",
"text": "def tree\r\n @rootNode\r\n end",
"title": ""
},
{
"docid": "06f1caa727c33a651754fda7b035d51d",
"score": "0.51794726",
"text": "def object_tree\n head, *rest = array_tree\n object_subtree(head,rest)\n end",
"title": ""
},
{
"docid": "6f1bea88b7c18c9105568e9a02e8607e",
"score": "0.5176405",
"text": "def view_3D=(v) DataTypeValidator.validate \"#{self.class}.view_3D\", View3D, v; @view_3D = v; end",
"title": ""
},
{
"docid": "76d77a78a4a4cae78c2085d790bc0c9c",
"score": "0.5174024",
"text": "def material; end",
"title": ""
},
{
"docid": "76d77a78a4a4cae78c2085d790bc0c9c",
"score": "0.5174024",
"text": "def material; end",
"title": ""
},
{
"docid": "e352cb781bef22ac3daff6f8e794dc8f",
"score": "0.51695615",
"text": "def allow3DMode _obj, _args\n \"_obj allow3DMode _args;\" \n end",
"title": ""
},
{
"docid": "b45f1f9922103bbd1639d5ebc26dfc4f",
"score": "0.5151763",
"text": "def modelToWorld _obj, _args\n \"_obj modelToWorld _args;\" \n end",
"title": ""
},
{
"docid": "547502a08ced26b5e12e391e44d943dc",
"score": "0.51420015",
"text": "def grid3d(*)\n super\n end",
"title": ""
},
{
"docid": "5a36ab0e612c3fa516ca1d747b6b9f16",
"score": "0.510569",
"text": "def my_depth\n 1\n end",
"title": ""
},
{
"docid": "aa902922ff8647cf6246a5bd809e3615",
"score": "0.5094265",
"text": "def is_leaf\n true\n end",
"title": ""
},
{
"docid": "aa902922ff8647cf6246a5bd809e3615",
"score": "0.5094265",
"text": "def is_leaf\n true\n end",
"title": ""
},
{
"docid": "54926c024addd5e4bed2a0aa772311ed",
"score": "0.50809926",
"text": "def update_model_view\n\n\t\t@current_context.makeCurrentContext\n\n\n\t\t# Move the view :\n\t\tglMatrixMode(GL_MODELVIEW)\n\t\tglLoadIdentity\n\t\tgluLookAt(\t@camera.view_position.x, @camera.view_position.y, @camera.view_position.z,\n\t\t\t\t\t@camera.view_position.x + @camera.view_direction.x,\n\t\t\t\t\t@camera.view_position.y + @camera.view_direction.y,\n\t\t\t\t\t@camera.view_position.z + @camera.view_direction.z,\n\t\t\t\t\t@camera.view_up.x, @camera.view_up.y ,@camera.view_up.z)\n\n\n\t\t# If we have trackball rotation to map (this IS the test I want as it can be explicitly 0.0f) :\n\t\tif (@tracking_view_info == self) and (@trackball.rotation[0] != 0.0) then\n\t\t\tglRotatef(\t@trackball.rotation[0],\n\t\t\t\t\t\t@trackball.rotation[1],\n\t\t\t\t\t\t@trackball.rotation[2],\n\t\t\t\t\t\t@trackball.rotation[3]\t)\n\t\tend\n\n\t\t# Accumulated world rotation via trackball :\n\t\tglRotatef(@world_rotation[0], @world_rotation[1], @world_rotation[2], @world_rotation[3])\n\n\t\t# The object rotates itself after the camera rotation :\n\t\tglRotatef(@object_rotation[0], @object_rotation[1], @object_rotation[2], @object_rotation[3])\n\t\t@rotation\t\t= [0.0, 0.0, 0.0]\n\n\t\t#update_camera_string\n\n\tend",
"title": ""
},
{
"docid": "4baaf1e9884726cf097f178a72334585",
"score": "0.50732374",
"text": "def tree\n @roots = @cards.roots\n # TODO: remove jbuilder?\n render :tree, status: :ok\n end",
"title": ""
},
{
"docid": "654a2db01470e64461f101283ab1a19e",
"score": "0.5062229",
"text": "def initialize\n\t\tsuper(400,300,200,200, LIGHTGRAY)\n @depth = 30\n\t\t@groups = [:all, :distant_terrain]\n\tend",
"title": ""
},
{
"docid": "47c455261089cca50fddec9dcacde4b9",
"score": "0.5059798",
"text": "def tree_params\n params.require(:tree).permit(:x, :y, :species_id, :description)\n end",
"title": ""
},
{
"docid": "5a7d6cbc2a5b2c78e783ae0be97e949f",
"score": "0.5050006",
"text": "def grid_obj?\n return (@node_type == :lasgn and !@sons.select {|s| s.node_type == :call and !s.sons.select {|ss| ss.node_type == :const and ss.name == \"GObj\"}.empty? }.empty?)\n end",
"title": ""
},
{
"docid": "d19a9ae094873e47da0b03e0dadd609d",
"score": "0.5046771",
"text": "def modeler_description\n return \"Assigns material layer properties for all above-grade walls adjacent to outside.\"\n end",
"title": ""
},
{
"docid": "2362299767ec35021d1bf2560ecf5bc1",
"score": "0.5041988",
"text": "def get_length\n\tselection = Sketchup.active_model.selection\n\tcount = selection.length\n\tif count != 0\n\t\tselection.each { |sel|\n\t\t\torigin = sel.transformation.origin\n\t\t\tx = origin[0]\n\t\t\ty = origin[1]\n\t\t\tz = origin[2]\n\t\t\tif sel.class == Sketchup::Group\n\t\t\t\tbox = sel.local_bounds\n\t\t\telsif sel.class == Sketchup::ComponentInstance\n\t\t\t\tbox = sel.definition.bounds\n\t\t\tend\n\t\t\tmix = box.min.x.to_f\n\t\t\tmiy = box.min.y.to_f\n\t\t\tmiz = 0\n\n\t\t\tmx = box.max.x.to_f\n\t\t\tmy = box.max.y.to_f\n\t\t\tmz = 0\n\n\t\t\tname = sel.definition.name\n\t\t\t#defn = sel.definition\n\t\t\t#bbox = defn.bounds\n\t\t\t#w = bbox.width.to_l.to_s\n\t\t\t#h = bbox.height.to_l.to_s\n\t\t\t#d = bbox.depth.to_l.to_s\n\t\t\tif name != \"BASE HANDLE#1\"\n\t\t\t\tdim = sel.entities.add_dimension_linear([mix, miy, miz], [mx, my, mz], [25, 0, 0])\n\t\t\t\tdim.material = \"chartreuse\"\n\t\t\tend\n\t\t}\n\telse\n\t\tUI.messagebox \"No models are selected!\", MB_OK\n\tend\nend",
"title": ""
},
{
"docid": "522b5394fa9d953fced8ea8f73277958",
"score": "0.50383735",
"text": "def modeler_description\n return \"This uses the OpenStudio::Model::Space::fromFloorPrint method, and is very much like the Create Spaaces From Diagram tool in the OpenStudio SketchUp plugin, but lets you draw teh diagram in the tool of your choice, and then imports it into the OpenStudio application via a measure.\"\n end",
"title": ""
},
{
"docid": "1e325be867a459b6c297125937898988",
"score": "0.5037372",
"text": "def obj\n @model\n end",
"title": ""
},
{
"docid": "493f655987514d9d90d5069b1ba309b2",
"score": "0.5019955",
"text": "def layer\n end",
"title": ""
},
{
"docid": "280a027239debfbbd31a939040f7aa35",
"score": "0.5006496",
"text": "def object\n object? ? children[2] : nil\n end",
"title": ""
},
{
"docid": "4f8cd2d559912ec0a1ebdce0f66eb46e",
"score": "0.5004743",
"text": "def build_tree(model)\n # inflate the node id to test id wrap around edge cases\n ENV[\"NODES\"].to_i.times { model.create!.destroy } if ENV[\"NODES\"]\n\n n1 = model.create!\n n2 = model.create!(:parent => n1)\n n3 = model.create!(:parent => n2)\n n4 = model.create!(:parent => n2)\n n5 = model.create!(:parent => n1)\n n6 = model.create!(:parent => n5)\n\n puts \"create: #{n1.id}..#{n6.id}\" if ENV[\"NODES\"]\n [n1, n2, n3, n4, n5, n6]\n end",
"title": ""
},
{
"docid": "8bf079943f63437a67def62a7e39630c",
"score": "0.50036424",
"text": "def worldToModel _obj, _args\n \"_obj worldToModel _args;\" \n end",
"title": ""
},
{
"docid": "8daf1fc01a3aaf7bcc47d548a06eac79",
"score": "0.49873382",
"text": "def modeler_description\n return 'Not sure how I will handle arguments. Maybe lump together all spaces on same sotry that have the same multilier value. This will have variable number of arguments basd on the model pased in. Alternative is to either only allo w one group to be chosen at at time, or allow a comlex string that describes everything. Also need to see how to define shirting. There is an offset but it may be above and below and may not be equal. In Some cases a mid floor is halfway betwen floors which makes just copying the base surfaces as shading multiple times probemeatic, since there is overlap. It coudl be nice to stretch one surface over many stories. If I check for vertial adn orthogonal surface that may work fine. '\n end",
"title": ""
},
{
"docid": "2ace469125197b2579bef6f497bfabf0",
"score": "0.4976233",
"text": "def modeler_description\n return \"Calculates and assigns material layer properties of wood stud constructions for 1) above-grade walls between finished space and outside, and 2) above-grade walls between attics under insulated roofs and outside. If the walls have an existing construction, the layers (other than exterior finish, wall sheathing, and wall mass) are replaced. This measure is intended to be used in conjunction with Exterior Finish, Wall Sheathing, and Exterior Wall Mass measures.\"\n end",
"title": ""
},
{
"docid": "2ace469125197b2579bef6f497bfabf0",
"score": "0.4976233",
"text": "def modeler_description\n return \"Calculates and assigns material layer properties of wood stud constructions for 1) above-grade walls between finished space and outside, and 2) above-grade walls between attics under insulated roofs and outside. If the walls have an existing construction, the layers (other than exterior finish, wall sheathing, and wall mass) are replaced. This measure is intended to be used in conjunction with Exterior Finish, Wall Sheathing, and Exterior Wall Mass measures.\"\n end",
"title": ""
},
{
"docid": "fea771b85ebed78f4b288d702e317744",
"score": "0.4968209",
"text": "def material\n end",
"title": ""
},
{
"docid": "032c6006c271ba0803607944fe80f7be",
"score": "0.4960945",
"text": "def valid_tree?\n true\n end",
"title": ""
},
{
"docid": "032c6006c271ba0803607944fe80f7be",
"score": "0.4960945",
"text": "def valid_tree?\n true\n end",
"title": ""
},
{
"docid": "e401ca79f86dab085df8bd8011889103",
"score": "0.49598816",
"text": "def show_tree\n\t\t@root_node.show\n\tend",
"title": ""
},
{
"docid": "7fae81cdf619946747ec8a2fa9a1b20f",
"score": "0.49574137",
"text": "def modeler_description\n return 'Replaces exterior window constructions with a different construction from the model.'\n end",
"title": ""
},
{
"docid": "3473fc0d82d210c4e24d36496d36da69",
"score": "0.49570584",
"text": "def mode3d\n begin_mode3d\n begin\n yield\n ensure\n self.class.end_mode3d\n end\n end",
"title": ""
},
{
"docid": "b6c15eba1552b777fd6fa3f6969fa8f8",
"score": "0.49479032",
"text": "def find_selected_object(x, y, view)\r\n return nil if not @corners\r\n pickray = view.pickray(x, y)\r\n wall_base_plane = [ @corners[0], Z_AXIS ]\r\n orig_point = Geom::intersect_line_plane(pickray, wall_base_plane)\r\n return nil if not orig_point\r\n point = Geom::Point3d.new(orig_point)\r\n # create a transformation if wall angle is not zero\r\n rotate_transform = Geom::Transformation.rotation(@corners[0], Z_AXIS, -@wall.angle.degrees)\r\n \r\n wall_start = Geom::Point3d.new(@wall.origin)\r\n wall_end = Geom::Point3d.new(@wall.endpt)\r\n if (@wall.angle != 0)\r\n wall_start.transform!(rotate_transform)\r\n wall_end.transform!(rotate_transform)\r\n point.transform!(rotate_transform)\r\n end\r\n \r\n wall_vec = wall_end - wall_start\r\n \r\n @wall.objects.each do |obj|\r\n \r\n # find the four corners of the object\r\n wall_vec.length = obj.center_offset - obj.width/2\r\n obj_start = wall_start + wall_vec\r\n wall_vec.length = obj.width\r\n obj_end = obj_start + wall_vec\r\n obj_vec = obj_end - obj_start\r\n next if (obj_vec.length <= 0)\r\n case @wall.justify\r\n \twhen \"left\"\r\n \t\ttransform = Geom::Transformation.new(obj_start, [0, 0, 1], -90.degrees)\r\n \twhen \"right\"\r\n \t transform = Geom::Transformation.new(obj_start, [0, 0, 1], 90.degrees)\r\n \twhen \"center\"\r\n \t # TODO\r\n \telse\r\n \t transform = Geom::Transformation.new\r\n \t UI.messagebox \"invalid justification\"\r\n \tend\t\t\r\n \t\t\t\r\n \tobj_vec.transform!(transform)\r\n \tobj_vec.length = @wall.width\r\n \t obj_start_offset = obj_start.offset(obj_vec)\r\n\r\n # determine if the point lies within the rectangle\r\n # puts \"orig_point = \" + orig_point.inspect \r\n # puts \"point = \" + point.inspect\r\n # puts \"obj_start = \" + obj_start.inspect\r\n # puts \"obj_end = \" + obj_end.inspect\r\n # puts \"obj_start_offset = \" + obj_start_offset.inspect\r\n if ((point.y > MM_HouseBuilder.min(obj_start.y, obj_end.y)) &&\r\n (point.y < MM_HouseBuilder.max(obj_start.y, obj_end.y)) &&\r\n (point.x > MM_HouseBuilder.min(obj_start.x, obj_start_offset.x)) &&\r\n (point.x < MM_HouseBuilder.max(obj_start.x, obj_start_offset.x)))\r\n # puts \"found\"\r\n view.invalidate\r\n return(obj)\r\n end\r\n end\r\n return(nil) # didn't find a door or window under the mouse\r\nend",
"title": ""
},
{
"docid": "ba6a9a828fe500f4d50b56af70aaea5d",
"score": "0.49384168",
"text": "def setup\n size(800, 200)\n new_tree\nend",
"title": ""
},
{
"docid": "86aba19e8bf4b4bdff284a2b99cb06a4",
"score": "0.49342334",
"text": "def project_to_plane\n end",
"title": ""
},
{
"docid": "60e78195f2a6c4be9078d5890f10bd3c",
"score": "0.4933953",
"text": "def set_tree_plot\n @tree_plot = TreePlot.find(params[:id])\n end",
"title": ""
},
{
"docid": "59195a2e68b48ab68baedca645e93aa2",
"score": "0.49324182",
"text": "def geometry( b)\n\t\t# over-ride where neeeded, e.g. UONActor\n\tend",
"title": ""
},
{
"docid": "f733d35a79b3f77b0ff5479a2e2531fa",
"score": "0.49265018",
"text": "def depth\n self[:depth]\n end",
"title": ""
},
{
"docid": "d2e8b97ff9a83d1dc10e00a439b58785",
"score": "0.49256036",
"text": "def draw(view)\n # Drawing settings\n view.drawing_color = @color_active\n view.line_width = 5\n\n @entities.each{ |entity|\n case entity\n when nil\n next\n\n when Geom::Point3d, Sketchup::Vertex\n # Point3d / Vertex\n p1 = (entity.is_a?(Sketchup::Vertex)) ? entity.position : entity\n view.line_width = 3\n view.drawing_color = @color_active\n @transformations_active[entity].each{ |t| draw_point3d(view, p1, nil, t) }\n view.drawing_color = @color_inactive\n @transformations_inactive[entity].each{ |t| draw_point3d(view, p1, nil, t) } # We only have transformations here for vertices.\n @@last_point = p1\n\n when Geom::Vector3d\n # Vector3d\n return unless entity.valid?\n if entity.unitvector?\n draw_unitvector3d(view, @@last_point, entity, @color_active, @transformations_active[entity].first)\n else\n draw_vector3d(view, @@last_point, entity, @color_active, @transformations_active[entity].first)\n end\n\n when Sketchup::Edge, Sketchup::Curve, Sketchup::ArcCurve\n # Edge\n @transformations_active[entity].each{ |t| draw_edges(view, entity, @color_active, t) }\n @transformations_inactive[entity].each{ |t| draw_edges(view, entity, @color_inactive, t) }\n\n when Sketchup::Face\n # Face\n @transformations_active[entity].each{ |t| draw_face(view, entity, @color_active, @color_active_transparent, t) }\n @transformations_inactive[entity].each{ |t| draw_face(view, entity, @color_inactive, @color_inactive_transparent, t) }\n\n when Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, Sketchup::ComponentDefinition, Geom::BoundingBox\n # Group / Component / Image / Definition / BoundingBox\n bounds = case entity\n when Sketchup::Group then\n entity.entities.parent.bounds\n when Sketchup::ComponentDefinition then\n entity.bounds\n when Geom::BoundingBox then\n entity\n else\n entity.definition.bounds\n end\n @transformations_active[entity].each{ |t| draw_boundingbox(view, bounds, @color_active, @color_active_transparent, t) }\n @transformations_inactive[entity].each{ |t| draw_boundingbox(view, bounds, @color_inactive, @color_inactive_transparent, t) }\n\n else\n if entity.is_a?(Sketchup::Drawingelement) && !(entity.is_a?(Sketchup::Text) && !entity.has_leader?)\n # Anything else that is not a 2d screen space text (text without leader)\n # For entities with undefined shape, draw a circle around them.\n center = entity.bounds.center\n # Diameter; consider a minimum for Drawingelements that have no diameter\n diameter = [entity.bounds.diagonal/2.0, view.pixels_to_model(5, cp)].max\n @transformations_active[entity].each{ |t| draw_circle(center, diameter, @color_active, t) }\n @transformations_inactive[entity].each{ |t| draw_circle(center, diameter, @color_inactive, t) }\n end\n end\n }\n end",
"title": ""
},
{
"docid": "0f469ee197617be1801d53015cf43ecd",
"score": "0.49234578",
"text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n # get a list of OpenStudio Surfaces along with some other properties\n surface_structs = []\n model.getSpaces.each do |space|\n t = space.siteTransformation\n space.surfaces.each do |surface|\n points = (t*surface.vertices).map{|v| Topolys::Point3D.new(v.x, v.y, v.z) }\n minz = (points.map{|p| p.z}).min\n surface_type = surface.surfaceType\n boundary_type = surface.outsideBoundaryCondition\n gross_area = surface.grossArea\n\n sub_surface_structs = []\n surface.subSurfaces.each do |sub_surface|\n ss_points = (t*sub_surface.vertices).map{|v| Topolys::Point3D.new(v.x, v.y, v.z) }\n ss_gross_area = sub_surface.grossArea\n sub_surface_type = sub_surface.subSurfaceType\n sub_surface_structs << {sub_surface: sub_surface, sub_surface_type: sub_surface_type, gross_area: gross_area, points: ss_points, wire: nil}\n end\n\n surface_structs << {surface: surface, surface_type: surface_type, boundary_type: boundary_type, gross_area: gross_area, points: points, minz: minz, space: space, sub_surfaces: sub_surface_structs, face: nil, shell: nil}\n end\n end\n\n # map OpenStudio enums down to the reduced set of enums in our exported JSON\n surface_structs.each_index do |i|\n case surface_structs[i][:boundary_type]\n when 'Surface', 'Adiabatic'\n surface_structs[i][:boundary_type] = 'Adiabatic'\n when 'Outdoors'\n surface_structs[i][:boundary_type] = 'Outdoors'\n else\n surface_structs[i][:boundary_type] = 'Ground'\n end\n end\n\n # sort the OpenStudio Surfaces\n surface_types = ['Floor', 'RoofCeiling', 'Wall']\n surface_structs.sort! do |x, y|\n if ( x[:surface_type] != y[:surface_type] )\n x[:surface_type] <=> y[:surface_type]\n elsif ( x[:minz] != y[:minz] )\n x[:minz] <=> y[:minz]\n else\n x[:surface_type] <=> y[:surface_type]\n end\n end\n #surface_structs.each {|s| puts \"#{s[:surface_type]}, #{s[:gross_area]}\"}\n\n # create the Topolys Model\n tpm = Topolys::Model.new\n\n # add a Topolys Face for each OpenStudio Surface\n n = surface_structs.size\n (0...n).each do |i|\n points = surface_structs[i][:points]\n puts \"points = #{points}\"\n vertices = tpm.get_vertices(points)\n #puts \"vertices = #{vertices}\" # DLM: why does this line blow up?\n wire = tpm.get_wire(vertices)\n puts \"wire = #{wire}\"\n\n holes = []\n sub_surfaces = surface_structs[i][:sub_surfaces]\n sub_surfaces.each_index do |j|\n ss_points = sub_surfaces[j][:points]\n ss_vertices = tpm.get_vertices(ss_points)\n ss_wire = tpm.get_wire(ss_vertices)\n puts \"ss_wire = #{ss_wire}\"\n sub_surfaces[j][:wire] = ss_wire\n holes << ss_wire\n end\n\n face = tpm.get_face(wire, holes)\n if face.nil?\n # todo: log error\n puts \"cannot construct face for #{surface_structs[i][:surface].nameString}\"\n return false\n end\n\n puts \"face = #{face}\"\n face.attributes[:surface] = surface_structs[i][:surface]\n face.attributes[:surface_name] = surface_structs[i][:surface].nameString\n face.attributes[:surface_type] = surface_structs[i][:surface_type]\n face.attributes[:boundary_type] = surface_structs[i][:boundary_type]\n\n surface_structs[i][:face] = face\n\n face.outer.edges.each do |edge|\n edge.attributes[:length] = edge.length if edge.attributes[:length].nil?\n edge.attributes[:surface_names] = [] if edge.attributes[:surface_names].nil?\n edge.attributes[:surface_names] << surface_structs[i][:surface].nameString\n end\n\n end\n\n # create a Topolys Shell for each OpenStudio Space\n model.getSpaces.each do |space|\n structs = surface_structs.select{|ss| ss[:space].handle == space.handle}\n faces = structs.map{|ss| ss[:face]}\n #puts \"faces = #{faces}\" # DLM: why does this line blow up?\n puts \"faces = #{faces.size}\"\n shell = tpm.get_shell(faces)\n if shell.nil?\n puts \"cannot construct shell for #{space.nameString}\"\n return false\n end\n shell.attributes[:space] = space\n puts \"shell = #{shell}, closed = #{shell.closed?}\"\n end\n\n # find OpenStudio Surfaces connected by edges\n model.getSurfaces.each do |surface|\n face = tpm.faces.find{|f| f.attributes[:surface].handle == surface.handle}\n\n if !face\n puts \"Ooops, can't find Face for Surface #{surface.nameString}\"\n end\n\n tpm.faces.each do |f|\n next if f.id == face.id\n\n shared_edges = face.shared_outer_edges(f)\n if shared_edges && !shared_edges.empty?\n length = 0\n shared_edges.map{|e| length += e.length}\n puts \"Surface #{face.attributes[:surface].nameString} is connected to Surface #{f.attributes[:surface].nameString} by #{shared_edges.size} shared edges with length #{length}\"\n end\n end\n end\n\n # install graphviz and make sure dot is in the system path\n tpm.save_graphviz('shell.dot')\n system('dot shell.dot -Tpdf -o shell.pdf')\n\n # save the full model\n tpm.save('full_tpm.json')\n\n # create a minimal model\n minimal_model = { faces: [] }\n tpm.faces.each do |face|\n minimal_face = face.attributes.clone\n minimal_face.delete(:surface)\n minimal_face[:edges] = []\n face.outer.edges.each do |edge|\n minimal_face[:edges] << edge.attributes.clone\n end\n minimal_model[:faces] << minimal_face\n end\n\n # save the minimal model\n File.open('minimal_model.json', 'w') do |file|\n file.puts JSON.pretty_generate(minimal_model)\n end\n\n return true\n end",
"title": ""
},
{
"docid": "a253886e69d1e890bef12fdea11263bd",
"score": "0.49218136",
"text": "def graphobj?(x)\n point?(x) || shape?(x)\nend",
"title": ""
},
{
"docid": "890f8deb1698297158206f5f0b9e05e3",
"score": "0.49216646",
"text": "def create_geometry(view)\n model = view.model\n camera = view.camera\n \n model.start_operation \"Create Camera\"\n group = model.entities.add_group\n entities = group.entities\n \n # Put the camera on a new layer so that we can turn off the display of all cameras\n # note that the \"add\" method for layers will not add one if there is already\n # one with the given name\n layer = model.layers.add(\"Cameras\")\n group.layer = layer\n \n # Hardcoded parameters for the size of the camera\n w2 = 2 # actually, half the width\n h2 = 6 # half the height\n l = 24 # the length\n r1 = 2\n r2 = 3.5\n \n # Create the body of the camera\n p1 = [-l, -w2, -h2]\n p2 = [-6, -w2, -h2]\n p3 = [-6, w2, -h2]\n p4 = [-l, w2, -h2]\n face = entities.add_face p1, p2, p3, p4\n face.pushpull(2*h2)\n \n # Create the lens\n # REVIEW: I am creating the camera geometry so that the front of the lense is\n # at the eye position. This is probably not really correct. I should probably\n # have the film plane at the eye position. I am doing it this way for now so\n # that the camera geometry will never be visible. I could control this using\n # the near clipping plane, but we don't currently have any way to set that.\n numpts = 8\n angle = Math::PI*2.0/numpts\n pts1 = (0..8).collect {|i|\n a=i*angle; Geom::Point3d.new(-6, r1*Math.sin(a), r1*Math.cos(a))\n }\n pts2 = (0..8).collect {|i|\n a=i*angle; Geom::Point3d.new(0, r2*Math.sin(a), r2*Math.cos(a))\n }\n (1..8).each {|i|\n im1 = i-1\n entities.add_face(pts1[i], pts1[im1], pts2[im1], pts2[i])\n }\n\n # Create some transparent faces that show the viewing area\n if( camera.perspective? )\n layer = model.layers[\"Camera_FOV\"]\n if( not layer )\n layer = model.layers.add(\"Camera_FOV\")\n layer.visible = false\n end\n oldlayer = model.active_layer\n model.active_layer = layer\n \n #self.show_volume_faces(view, entities)\n self.show_volume_lines(view, entities)\n \n model.active_layer = oldlayer\n end\n \n # Now transform it to where the camera is\n transform = CameraRep.get_transform_from_view(view)\n group.move!(transform)\n \n # Save the camera parameters (other than orientation) as attributes\n @rep = group\n self.set_attributes(camera)\n \n model.commit_operation\n @rep\nend",
"title": ""
},
{
"docid": "abf639177ee5377529b37755e14b4a6e",
"score": "0.4916566",
"text": "def modeler_description\n return 'Determine the thickness of expanded polystyrene insulation required to meet the specified R-value. Find all the constructions used by exterior walls in the model, clone them, add a layer of insulation to the cloned constructions, and then assign the construction back to the wall.'\n end",
"title": ""
},
{
"docid": "423f229dd7857b8e9401a4ef435ed2bd",
"score": "0.49160993",
"text": "def root?\n self.depth.zero?\n end",
"title": ""
},
{
"docid": "423f229dd7857b8e9401a4ef435ed2bd",
"score": "0.49160993",
"text": "def root?\n self.depth.zero?\n end",
"title": ""
},
{
"docid": "7ddf6c108171f339dd139e8b45bff4d1",
"score": "0.49155667",
"text": "def find_selected_object(x, y, view)\r\n # puts \"corners = \" + @corners.inspect\r\n return nil if (@corners.length != 5)\r\n pickray = view.pickray(x, y)\r\n wall_base_plane = [ @corners[0], Z_AXIS ]\r\n orig_point = Geom::intersect_line_plane(pickray, wall_base_plane)\r\n # puts \"pt = \" + orig_point.inspect\r\n return nil if not orig_point\r\n point = Geom::Point3d.new(orig_point)\r\n # create a transformation if wall angle is not zero\r\n rotate_transform = Geom::Transformation.rotation(@corners[0], Z_AXIS, -@wall.angle.degrees)\r\n \r\n wall_start = Geom::Point3d.new(@wall.origin)\r\n wall_end = Geom::Point3d.new(@wall.endpt)\r\n if (@wall.angle != 0)\r\n wall_start.transform!(rotate_transform)\r\n wall_end.transform!(rotate_transform)\r\n point.transform!(rotate_transform)\r\n end\r\n \r\n wall_vec = wall_end - wall_start\r\n \r\n @wall.objects.each do |obj|\r\n \r\n # find the four corners of the object\r\n wall_vec.length = obj.center_offset - obj.width/2\r\n obj_start = wall_start + wall_vec\r\n wall_vec.length = obj.width\r\n obj_end = obj_start + wall_vec\r\n obj_vec = obj_end - obj_start\r\n next if (obj_vec.length <= 0)\r\n case @wall.justify\r\n \twhen \"left\"\r\n \t\ttransform = Geom::Transformation.new(obj_start, [0, 0, 1], -90.degrees)\r\n \twhen \"right\"\r\n \t transform = Geom::Transformation.new(obj_start, [0, 0, 1], 90.degrees)\r\n \twhen \"center\"\r\n \t # TODO\r\n \telse\r\n \t transform = Geom::Transformation.new\r\n \t UI.messagebox \"invalid justification\"\r\n \tend\t\t\r\n \t\t\t\r\n \tobj_vec.transform!(transform)\r\n \tobj_vec.length = @wall.width\r\n \t obj_start_offset = obj_start.offset(obj_vec)\r\n\r\n # determine if the point lies within the rectangle\r\n # puts \"orig_point = \" + orig_point.inspect \r\n # puts \"point = \" + point.inspect\r\n # puts \"obj_start = \" + obj_start.inspect\r\n # puts \"obj_end = \" + obj_end.inspect\r\n # puts \"obj_start_offset = \" + obj_start_offset.inspect\r\n if ((point.y > MM_HouseBuilder.min(obj_start.y, obj_end.y)) &&\r\n (point.y < MM_HouseBuilder.max(obj_start.y, obj_end.y)) &&\r\n (point.x > MM_HouseBuilder.min(obj_start.x, obj_start_offset.x)) &&\r\n (point.x < MM_HouseBuilder.max(obj_start.x, obj_start_offset.x)))\r\n # puts \"found\"\r\n view.invalidate\r\n return(obj)\r\n end\r\n end\r\n return(nil) # didn't find a door or window under the mouse\r\nend",
"title": ""
},
{
"docid": "f7c538ca8544e8fb73aad24ea7edef99",
"score": "0.49138823",
"text": "def valid_tree?\n false\n end",
"title": ""
},
{
"docid": "211423f8f625b21c12099488da42cd92",
"score": "0.4913169",
"text": "def leaf?; false end",
"title": ""
},
{
"docid": "55a90d6c907905231a71a35cb40d866e",
"score": "0.49099115",
"text": "def setup\n size 640, 360, P3D\n no_stroke \n @box_size = 40\n @margin = @box_size * 2\n @depth = 400\nend",
"title": ""
},
{
"docid": "09f4e13746061328aa2aaeea91bbe401",
"score": "0.4908792",
"text": "def nebula; end",
"title": ""
},
{
"docid": "6a2ce255d3f414b44498148a1670e6d2",
"score": "0.49022794",
"text": "def graph_obj?(o)\n point?(o) or shape?(o)\nend",
"title": ""
},
{
"docid": "20df7796c1dcf86507a25d2719207643",
"score": "0.49012047",
"text": "def mat_window; @materials_window; end",
"title": ""
},
{
"docid": "e4eab7837d7d9204d7c324c1369e8ef4",
"score": "0.48930168",
"text": "def convert_to_openstudio(model,runner = nil)\n #Get 3d polygon of surface and tranform the points based on space origin and the floor origin since they each may use their own co-ordinate base system.\n total_transform = \"\"\n if self.check_keyword?(\"AZIMUTH\") or self.check_keyword?(\"TILT\")\n total_transform = get_parent(\"FLOOR\").get_transformation_matrix() * get_parent(\"SPACE\").get_transformation_matrix() * get_transformation_matrix()\n else\n total_transform = get_parent(\"FLOOR\").get_transformation_matrix() * get_parent(\"SPACE\").get_transformation_matrix()\n end\n surface_points = total_transform * self.get_3d_polygon()\n #Add the surface to the new openstudio model.\n \n os_surface = OpenStudio::Model::Surface.new(surface_points, model)\n #set the name of the surface. \n os_surface.setAttribute(\"name\", self.name)\n case self.commandName\n #Set the surface boundary condition if it is a ground surface.\n \n when \"UNDERGROUND-WALL\"\n BTAP::Geometry::Surfaces::set_surfaces_boundary_condition(model,os_surface, \"Ground\") \n when \"EXTERIOR-WALL\",\"ROOF\"\n #this is needed since the surface constructor defaults to a Ground boundary and Floor Surface type \n #when a horizontal surface is initialized. \n if os_surface.outsideBoundaryCondition == \"Ground\" and os_surface.surfaceType == \"Floor\" \n os_surface.setSurfaceType(\"RoofCeiling\") \n end\n BTAP::Geometry::Surfaces::set_surfaces_boundary_condition(model,os_surface, \"Outdoors\")\n when \"INTERIOR-WALL\"\n BTAP::Geometry::Surfaces::set_surfaces_boundary_condition(model,os_surface, \"Surface\")\n end\n \n #Add to parent space that was already created. \n os_surface.setSpace(OpenStudio::Model::getSpaceByName( model,get_parent(\"SPACE\").name).get )\n #output to console for debugging. \n BTAP::runner_register(\"Info\", \"\\tSurface: \" + self.name + \" created\",runner)\n #check if we need to create a mirror surface in another space.\n if self.check_keyword?(\"NEXT-TO\")\n #reverse the points.\n new_array = surface_points.dup\n first = new_array.pop\n new_array.insert(0,first).reverse!\n #...then add the reverse surface to the model and assign the name with a mirror suffix. \n os_surface_mirror = OpenStudio::Model::Surface.new(new_array, model)\n os_surface_mirror.setAttribute(\"name\", self.name + \"-mirror\" )\n #Assign the mirror surface to the parent space that is NEXT-TO\n os_surface_mirror.setSpace(OpenStudio::Model::getSpaceByName(model,get_keyword_value(\"NEXT-TO\")).get)\n #output to console for debugging. \n BTAP::runner_register(\"Info\", \"\\tSurface: \" + self.name + \"-mirror\" + \" created\",runner)\n end #if statement\n \n #Some switches for debugging. \n convert_sub_surfaces = true\n convert_sub_surfaces_as_surfaces = false\n \n #\n if convert_sub_surfaces\n #convert subsurfaces\n self.get_children().each do |child|\n #Get height and width of subsurface\n height = child.get_keyword_value(\"HEIGHT\").to_f\n width = child.get_keyword_value(\"WIDTH\").to_f\n \n \n #Sum the origin of the surface and the translation of the window\n x = os_surface.vertices.first().x + ( child.check_keyword?(\"X\")? child.get_keyword_value(\"X\").to_f : 0.0 )\n y = os_surface.vertices.first().y + ( child.check_keyword?(\"Y\")? child.get_keyword_value(\"Y\").to_f : 0.0 )\n z = os_surface.vertices.first().z\n \n #counter clockwise\n origin = OpenStudio::Point3d.new( x, y , z )\n p2 = OpenStudio::Point3d.new(x + width , y, z )\n p3 = OpenStudio::Point3d.new(x + width , y + height , z )\n p4 = OpenStudio::Point3d.new(x, y + height, z )\n polygon = [origin,p2,p3,p4]\n\n #get floot and space rotations\n space_azi = 360.0 - get_parent(\"SPACE\").get_azimuth()\n floor_azi = 360.0 - get_parent(\"FLOOR\").get_azimuth()\n\n \n tilt_trans = OpenStudio::Transformation::rotation(os_surface.vertices.first(), OpenStudio::Vector3d.new(1.0,0.0,0.0), OpenStudio::degToRad( self.get_tilt ))\n azi_trans = OpenStudio::Transformation::rotation(os_surface.vertices.first(), OpenStudio::Vector3d.new(0.0,0.0,1.0), OpenStudio::degToRad( 360.0 - self.get_azimuth + space_azi + floor_azi ))\n surface_points = azi_trans * tilt_trans * polygon\n if convert_sub_surfaces_as_surfaces\n #Debug subsurface\n os_sub_surface = OpenStudio::Model::Surface.new(surface_points, model)\n #set the name of the surface. \n os_sub_surface.setAttribute(\"name\", child.name)\n #Add to parent space that was already created. \n os_sub_surface.setSpace(OpenStudio::Model::getSpaceByName( model,self.get_parent(\"SPACE\").name).get )\n else\n #Add the subsurface to the new openstudio model. \n os_sub_surface = OpenStudio::Model::SubSurface.new(surface_points, model)\n #set the name of the surface. \n os_sub_surface.setAttribute(\"name\", child.name )\n #Add to parent space that was already created. \n os_sub_surface.setSurface(os_surface)\n #output to console for debugging. \n BTAP::runner_register(\"Info\", \"\\tSubSurface: \" + child.name + \" created\",runner)\n case child.commandName\n when \"WINDOW\"\n #By default it is a window. \n when \"DOOR\"\n os_sub_surface.setSubSurfaceType( \"Door\" )\n end #end case.\n \n # Add overhang for subsurface if required. Note this only supports overhangs of width the same as the window. \n if child.check_keyword?(\"OVERHANG-D\") == true\n offset = 0.0\n offset = child.get_keyword_value(\"OVERHANG-O\").to_f if child.check_keyword?(\"OVERHANG-O\")\n depth = 0.0\n depth = child.get_keyword_value(\"OVERHANG-D\").to_f \n os_sub_surface.addOverhang(\tdepth , offset )\n end\n \t\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ac621869e0a6d6fc445a78dc8f196200",
"score": "0.4892418",
"text": "def build_tree(arr)\n\tend",
"title": ""
},
{
"docid": "5ad44b68308e0315f245e615d6de0679",
"score": "0.48920745",
"text": "def inv_3d\n format_3d(inv_dims_3d) if targets_3d.present?\n end",
"title": ""
},
{
"docid": "e0eb57b45323583a0a090200505fa7ce",
"score": "0.48898193",
"text": "def is_layer?(); @type == GRT_LAYER; end",
"title": ""
},
{
"docid": "0285952e53bda6696235ae00c981180d",
"score": "0.48843",
"text": "def root_model\n node = @model\n\n loop do\n parent = node.parent\n if parent\n node = parent\n else\n break\n end\n end\n\n node\n end",
"title": ""
},
{
"docid": "0285952e53bda6696235ae00c981180d",
"score": "0.48843",
"text": "def root_model\n node = @model\n\n loop do\n parent = node.parent\n if parent\n node = parent\n else\n break\n end\n end\n\n node\n end",
"title": ""
},
{
"docid": "e91b126fcb20515f7a0a24cba4fc4562",
"score": "0.48787662",
"text": "def modeler_description\n return 'This can be modifed to alter a sub-set of the windows by filtering by sub urface type, construction, name, or orientation. '\n end",
"title": ""
},
{
"docid": "d25599ef5b04c5f2fcd929e4e86666bd",
"score": "0.487699",
"text": "def setup\n size 1024,768,P3D\n background 0\n\n @context = SimpleOpenNI.new(self)\n @zoomF =0.5\n @rotX = radians(180) # by default rotate the hole scene 180deg around the x-axis, \n # the data from openni comes upside down\n @rotY = radians(0)\n\n if !@context.isInit\n puts \"Can't init SimpleOpenNI, maybe the camera is not connected!\"\n exit\n end\n\n # disable mirror\n @context.setMirror(false)\n\n # enable depthMap generation \n @context.enableDepth()\n\n # enable skeleton generation for all joints\n @context.enableUser()\n\n stroke(255,255,255)\n smooth()\nend",
"title": ""
},
{
"docid": "6d8ff8eab7ab67b109b44ba92ac78e5c",
"score": "0.48733225",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # make a double argument for layer 1: thickness\n thick_in1 = OpenStudio::Measure::OSArgument::makeDoubleArgument('thick_in_1', true)\n thick_in1.setDisplayName('Thickness 1')\n thick_in1.setUnits('in')\n thick_in1.setDescription('Thickness of the outside layer.')\n thick_in1.setDefaultValue(2.5)\n args << thick_in1\n\n # make a double argument for layer 2: thickness\n thick_in2 = OpenStudio::Measure::OSArgument::makeDoubleArgument('thick_in_2', false)\n thick_in2.setDisplayName('Thickness 2')\n thick_in2.setUnits('in')\n thick_in2.setDescription('Thickness of the second layer. Leave blank if no second layer.')\n args << thick_in2\n\n # make a double argument for layer 3: thickness\n thick_in3 = OpenStudio::Measure::OSArgument::makeDoubleArgument('thick_in_3', false)\n thick_in3.setDisplayName('Thickness 3')\n thick_in3.setUnits('in')\n thick_in3.setDescription('Thickness of the third layer. Leave blank if no third layer.')\n args << thick_in3\n\n # make a double argument for layer 4: thickness\n thick_in4 = OpenStudio::Measure::OSArgument::makeDoubleArgument('thick_in_4', false)\n thick_in4.setDisplayName('Thickness 4')\n thick_in4.setUnits('in')\n thick_in4.setDescription('Thickness of the fourth layer. Leave blank if no fourth layer.')\n args << thick_in4\n\n # make a double argument for layer 5: thickness\n thick_in5 = OpenStudio::Measure::OSArgument::makeDoubleArgument('thick_in_5', false)\n thick_in5.setDisplayName('Thickness 5')\n thick_in5.setUnits('in')\n thick_in5.setDescription('Thickness of the fifth layer. Leave blank if no fifth layer.')\n args << thick_in5\n\n # make a double argument for layer 1: conductivity\n cond1 = OpenStudio::Measure::OSArgument::makeDoubleArgument('conductivity_1', true)\n cond1.setDisplayName('Conductivity 1')\n cond1.setUnits('Btu-in/h-ft^2-R')\n cond1.setDescription('Conductivity of the outside layer.')\n cond1.setDefaultValue(9.211)\n args << cond1\n\n # make a double argument for layer 2: conductivity\n cond2 = OpenStudio::Measure::OSArgument::makeDoubleArgument('conductivity_2', false)\n cond2.setDisplayName('Conductivity 2')\n cond2.setUnits('Btu-in/h-ft^2-R')\n cond2.setDescription('Conductivity of the second layer. Leave blank if no second layer.')\n args << cond2\n\n # make a double argument for layer 3: conductivity\n cond3 = OpenStudio::Measure::OSArgument::makeDoubleArgument('conductivity_3', false)\n cond3.setDisplayName('Conductivity 3')\n cond3.setUnits('Btu-in/h-ft^2-R')\n cond3.setDescription('Conductivity of the third layer. Leave blank if no third layer.')\n args << cond3\n\n # make a double argument for layer 4: conductivity\n cond4 = OpenStudio::Measure::OSArgument::makeDoubleArgument('conductivity_4', false)\n cond4.setDisplayName('Conductivity 4')\n cond4.setUnits('Btu-in/h-ft^2-R')\n cond4.setDescription('Conductivity of the fourth layer. Leave blank if no fourth layer.')\n args << cond4\n\n # make a double argument for layer 5: conductivity\n cond5 = OpenStudio::Measure::OSArgument::makeDoubleArgument('conductivity_5', false)\n cond5.setDisplayName('Conductivity 5')\n cond5.setUnits('Btu-in/h-ft^2-R')\n cond5.setDescription('Conductivity of the fifth layer. Leave blank if no fifth layer.')\n args << cond5\n\n # make a double argument for layer 1: density\n dens1 = OpenStudio::Measure::OSArgument::makeDoubleArgument('density_1', true)\n dens1.setDisplayName('Density 1')\n dens1.setUnits('lb/ft^3')\n dens1.setDescription('Density of the outside layer.')\n dens1.setDefaultValue(138.33)\n args << dens1\n\n # make a double argument for layer 2: density\n dens2 = OpenStudio::Measure::OSArgument::makeDoubleArgument('density_2', false)\n dens2.setDisplayName('Density 2')\n dens2.setUnits('lb/ft^3')\n dens2.setDescription('Density of the second layer. Leave blank if no second layer.')\n args << dens2\n\n # make a double argument for layer 3: density\n dens3 = OpenStudio::Measure::OSArgument::makeDoubleArgument('density_3', false)\n dens3.setDisplayName('Density 3')\n dens3.setUnits('lb/ft^3')\n dens3.setDescription('Density of the third layer. Leave blank if no third layer.')\n args << dens3\n\n # make a double argument for layer 4: density\n dens4 = OpenStudio::Measure::OSArgument::makeDoubleArgument('density_4', false)\n dens4.setDisplayName('Density 4')\n dens4.setUnits('lb/ft^3')\n dens4.setDescription('Density of the fourth layer. Leave blank if no fourth layer.')\n args << dens4\n\n # make a double argument for layer 5: density\n dens5 = OpenStudio::Measure::OSArgument::makeDoubleArgument('density_5', false)\n dens5.setDisplayName('Density 5')\n dens5.setUnits('lb/ft^3')\n dens5.setDescription('Density of the fifth layer. Leave blank if no fifth layer.')\n args << dens5\n\n # make a double argument for layer 1: specific heat\n specheat1 = OpenStudio::Measure::OSArgument::makeDoubleArgument('specific_heat_1', true)\n specheat1.setDisplayName('Specific Heat 1')\n specheat1.setUnits('Btu/lb-R')\n specheat1.setDescription('Specific heat of the outside layer.')\n specheat1.setDefaultValue(0.23)\n args << specheat1\n\n # make a double argument for layer 2: specific heat\n specheat2 = OpenStudio::Measure::OSArgument::makeDoubleArgument('specific_heat_2', false)\n specheat2.setDisplayName('Specific Heat 2')\n specheat2.setUnits('Btu/lb-R')\n specheat2.setDescription('Specific heat of the second layer. Leave blank if no second layer.')\n args << specheat2\n\n # make a double argument for layer 3: specific heat\n specheat3 = OpenStudio::Measure::OSArgument::makeDoubleArgument('specific_heat_3', false)\n specheat3.setDisplayName('Specific Heat 3')\n specheat3.setUnits('Btu/lb-R')\n specheat3.setDescription('Specific heat of the third layer. Leave blank if no third layer.')\n args << specheat3\n\n # make a double argument for layer 4: specific heat\n specheat4 = OpenStudio::Measure::OSArgument::makeDoubleArgument('specific_heat_4', false)\n specheat4.setDisplayName('Specific Heat 4')\n specheat4.setUnits('Btu/lb-R')\n specheat4.setDescription('Specific heat of the fourth layer. Leave blank if no fourth layer.')\n args << specheat4\n\n # make a double argument for layer 5: specific heat\n specheat5 = OpenStudio::Measure::OSArgument::makeDoubleArgument('specific_heat_5', false)\n specheat5.setDisplayName('Specific Heat 5')\n specheat5.setUnits('Btu/lb-R')\n specheat5.setDescription('Specific heat of the fifth layer. Leave blank if no fifth layer.')\n args << specheat5\n\n # make a double argument for drywall thickness\n drywall_thick_in = OpenStudio::Measure::OSArgument::makeDoubleArgument('drywall_thick_in', true)\n drywall_thick_in.setDisplayName('Drywall Thickness')\n drywall_thick_in.setUnits('in')\n drywall_thick_in.setDescription('Thickness of the drywall material.')\n drywall_thick_in.setDefaultValue(0.5)\n args << drywall_thick_in\n\n # make a double argument for OSB/Plywood Thickness\n osb_thick_in = OpenStudio::Measure::OSArgument::makeDoubleArgument('osb_thick_in', true)\n osb_thick_in.setDisplayName('OSB/Plywood Thickness')\n osb_thick_in.setUnits('in')\n osb_thick_in.setDescription(\"Specifies the thickness of the walls' OSB/plywood sheathing. Enter 0 for no sheathing (if the wall has other means to handle the shear load on the wall such as cross-bracing).\")\n osb_thick_in.setDefaultValue(0.5)\n args << osb_thick_in\n\n # make a double argument for Rigid Insulation R-value\n rigid_r = OpenStudio::Measure::OSArgument::makeDoubleArgument('rigid_r', true)\n rigid_r.setDisplayName('Continuous Insulation Nominal R-value')\n rigid_r.setUnits('h-ft^2-R/Btu')\n rigid_r.setDescription('The R-value of the continuous insulation.')\n rigid_r.setDefaultValue(0.0)\n args << rigid_r\n\n # make a choice argument for exterior finish material\n finishes = OpenStudio::StringVector.new\n WallConstructions.get_exterior_finish_materials.each do |mat|\n finishes << mat.name\n end\n exterior_finish = OpenStudio::Measure::OSArgument::makeChoiceArgument('exterior_finish', finishes, true)\n exterior_finish.setDisplayName('Exterior Finish')\n exterior_finish.setDescription('The exterior finish material.')\n exterior_finish.setDefaultValue(Material.ExtFinishVinylLight.name)\n args << exterior_finish\n\n return args\n end",
"title": ""
},
{
"docid": "2fc392624ad51c9af489df97184a60aa",
"score": "0.48693562",
"text": "def model\n return Sketchup.active_model if not @rep\n @rep.model\nend",
"title": ""
},
{
"docid": "a1c2cb181c145ed6cbb0fac7e98de666",
"score": "0.48669225",
"text": "def make_quadtree(pixels, width, height)\n $count = 0\n def make_quadtree_r(pixels, x, y, w, h)\n sum = 0\n (0..w-1).each do |x_off|\n (0..h-1).each do |y_off|\n sum += pixels[x+x_off][y+y_off]\n end\n end\n # all black or white test\n if sum == 0\n $count += 1\n sides = [\n CP::Shape::Segment.new($static_body, CP::Vec2.new(x,y), CP::Vec2.new(x+w,y), 0.1),\n CP::Shape::Segment.new($static_body, CP::Vec2.new(x+w,y), CP::Vec2.new(x+w,y+h), 0.1),\n CP::Shape::Segment.new($static_body, CP::Vec2.new(x+w,y+h), CP::Vec2.new(x,y+h), 0.1),\n CP::Shape::Segment.new($static_body, CP::Vec2.new(x,y+h), CP::Vec2.new(x,y), 0.1),\n ]\n sides.each{|x| x.e = 1.0; $space.add_static_shape(x)}\n Quadtree.new(0, nil, nil, nil, nil)\n elsif sum == 255*w*h\n $count += 1\n Quadtree.new(1, nil, nil, nil, nil)\n else\n Quadtree.new(nil, \n make_quadtree_r(pixels, x, y, w/2, h/2),\n make_quadtree_r(pixels, x+w/2, y, w/2, h/2),\n make_quadtree_r(pixels, x, y+h/2, w/2, h/2),\n make_quadtree_r(pixels, x+w/2, y+h/2, w/2, h/2))\n end\n end\n tree = make_quadtree_r(pixels, 0, 0, width, height)\n puts \"Number of nodes: #{$count} vs #{width*height} for full data (#{$count.to_f/(width*height)*100}%)\"\n tree\nend",
"title": ""
},
{
"docid": "f34c57560cccf82860dc57a6a686dc6f",
"score": "0.48647824",
"text": "def plane\n end",
"title": ""
},
{
"docid": "5086c452bd4bdf762ebf7062abf13808",
"score": "0.485881",
"text": "def remodel( node, info={} )\n level = info[:count] || 1\n node.attributes['level'] = level\n node\n end",
"title": ""
},
{
"docid": "5b47bea16902ca1e81887c6bcf22686e",
"score": "0.4856935",
"text": "def display_maze_with_png(grid)\n \nend",
"title": ""
},
{
"docid": "0256e5c390f271cd9c25f5932fa818d3",
"score": "0.48542398",
"text": "def create_box(origin, width, length, height)\r\n mod = Sketchup.active_model # open sketchup active_model\r\n ent = mod.entities # accessing the entities in mod\r\n\r\n # this is a basic code to make a simple box\r\n\r\n #define points for a rectangle in respect to origin point\r\n pt1 = Geom::Point3d.new(origin.x - width / 2, origin.y - length / 2, origin.z - height / 2)\r\n pt2 = Geom::Point3d.new(origin.x + width / 2, origin.y - length / 2, origin.z - height / 2)\r\n pt3 = Geom::Point3d.new(origin.x + width / 2, origin.y + length / 2, origin.z - height / 2)\r\n pt4 = Geom::Point3d.new(origin.x - width / 2, origin.y + length / 2, origin.z - height / 2)\r\n\r\n #create a group_ box group\r\n box_group = ent.add_group\r\n # create a rectanglar face\r\n face = box_group.entities.add_face(pt1, pt2, pt3, pt4)\r\n if face.normal.z < 0 # this code is used to flip the face if not upward\r\n face.reverse!\r\n end\r\n # pushpull the face to create the box\r\n face.pushpull(height)\r\n # end of the code\r\n return box_group\r\nend",
"title": ""
},
{
"docid": "48d178de14ed4126080f70b61652dd6d",
"score": "0.4854147",
"text": "def fOOrth\r\n end",
"title": ""
},
{
"docid": "48d178de14ed4126080f70b61652dd6d",
"score": "0.4854147",
"text": "def fOOrth\r\n end",
"title": ""
},
{
"docid": "6084ffa0a420cad5003f983e25483dc9",
"score": "0.485304",
"text": "def flamegraph_mode=(_arg0); end",
"title": ""
},
{
"docid": "543a7776bb51f5c745bd9e6722d57299",
"score": "0.4845151",
"text": "def render\n render_background\n # render_heat_map\n render_walls\n # render_path\n # render_labels\n render_arrows\n render_star\n render_target\n unless grid.walls.has_key?(grid.target)\n render_trail\n end\n end",
"title": ""
},
{
"docid": "071e8a1f87f55aaf9c783b80242c8c70",
"score": "0.4841578",
"text": "def root; skeleton.root; end",
"title": ""
},
{
"docid": "7e92b42fef1988c3a4996884ed35f062",
"score": "0.48360234",
"text": "def modeler_description\n return \"Creates shading surfaces by shifting the building's exterior surfaces in the specified directions (front, back, left, and/or right).\"\n end",
"title": ""
},
{
"docid": "c6686f2c4b13da35e9e4a98eca5a5bb1",
"score": "0.48343524",
"text": "def tree\n\n h.updated_tree || h.original_tree\n end",
"title": ""
},
{
"docid": "3c7fe970bf905617002e7c89e9e82263",
"score": "0.48316994",
"text": "def tree\n Tree.new(self)\n end",
"title": ""
},
{
"docid": "6284458bddd7562c0e3a85e3e8f38f1d",
"score": "0.48311368",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # populate choice argument for constructions that are applied to surfaces in the model\n construction_handles = OpenStudio::StringVector.new\n construction_display_names = OpenStudio::StringVector.new\n\n # putting space types and names into hash\n construction_args = model.getConstructions\n construction_args_hash = {}\n construction_args.each do |construction_arg|\n construction_args_hash[construction_arg.name.to_s] = construction_arg\n end\n\n # looping through sorted hash of constructions\n construction_args_hash.sort.map do |key, value|\n # only include if construction is used on surface\n if value.getNetArea > 0\n construction_handles << value.handle.to_s\n construction_display_names << key\n end\n end\n\n # make an argument for construction\n construction = OpenStudio::Measure::OSArgument.makeChoiceArgument('construction', construction_handles, construction_display_names, true)\n construction.setDisplayName('Choose a Construction to Alter.')\n args << construction\n\n # make an argument thickness\n thickness = OpenStudio::Measure::OSArgument.makeDoubleArgument('thickness', true)\n thickness.setDisplayName('Thickness of Layer 0')\n thickness.setDescription('Set Thickness of Layer 0. 0 value means do not change from default.')\n thickness.setDefaultValue(0)\n thickness.setUnits('m')\n args << thickness\n\n # make an argument density\n density = OpenStudio::Measure::OSArgument.makeDoubleArgument('density', true)\n density.setDisplayName('Density of Layer 0')\n density.setDescription('Set Density of Layer 0. 0 value means do not change from default.')\n density.setUnits('kg/m^3')\n density.setDefaultValue(0)\n args << density\n\n # make an argument thermal_absorptance\n thermal_absorptance = OpenStudio::Measure::OSArgument.makeDoubleArgument('thermal_absorptance', true)\n thermal_absorptance.setDisplayName('Thermal Absorptance of Layer 0')\n thermal_absorptance.setDescription('Set Thermal Absorptance of Layer 0. 0 value means do not change from default.')\n thermal_absorptance.setUnits('fraction')\n thermal_absorptance.setDefaultValue(0)\n args << thermal_absorptance\n\n # make an argument solar_absorptance\n solar_absorptance = OpenStudio::Measure::OSArgument.makeDoubleArgument('solar_absorptance', true)\n solar_absorptance.setDisplayName('Solar Absorptance of Layer 0')\n solar_absorptance.setDescription('Set Solar Absorptance of Layer 0. 0 value means do not change from default.')\n solar_absorptance.setUnits('fraction')\n solar_absorptance.setDefaultValue(0)\n args << solar_absorptance\n\n # make an argument visible_absorptance\n visible_absorptance = OpenStudio::Measure::OSArgument.makeDoubleArgument('visible_absorptance', true)\n visible_absorptance.setDisplayName('Visible Absorptance of Layer 0')\n visible_absorptance.setDescription('Set Visible Absorptance of Layer 0. 0 value means do not change from default.')\n visible_absorptance.setUnits('fraction')\n visible_absorptance.setDefaultValue(0)\n args << visible_absorptance\n\n # make an argument conductivity\n thermal_conductivity = OpenStudio::Measure::OSArgument.makeDoubleArgument('thermal_conductivity', true)\n thermal_conductivity.setDisplayName('Thermal Conductivity of Layer 0')\n thermal_conductivity.setDescription('Set Thermal Conductivity of Layer 0. 0 value means do not change from default.')\n thermal_conductivity.setDefaultValue(0)\n thermal_conductivity.setUnits('W/(m*K)')\n args << thermal_conductivity\n\n # make an argument specific_heat\n specific_heat = OpenStudio::Measure::OSArgument.makeDoubleArgument('specific_heat', true)\n specific_heat.setDisplayName('Specific Heat of Layer 0')\n specific_heat.setDescription('Set Specific Heat of Layer 0. 0 value means do not change from default.')\n specific_heat.setUnits('J/(kg*K)')\n specific_heat.setDefaultValue(0)\n args << specific_heat\n\n args\n end",
"title": ""
},
{
"docid": "c8c4d4320bf9bd854f2469f9b09770bc",
"score": "0.48285255",
"text": "def depth()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "f407dc6571686eb4cf285a5bd86791fd",
"score": "0.48284566",
"text": "def modeler_description\n return \"Creates multifamily geometry.\"\n end",
"title": ""
},
{
"docid": "17f7e8beb01f808741a84884649cb8a0",
"score": "0.48281115",
"text": "def print_model(problem)\n problem.objects.each do |_k, v|\n puts ''\n puts ''\n puts print_datastructure(v)\n end\n end",
"title": ""
},
{
"docid": "d11a44fb26593cc399ef74cddb7a4a6e",
"score": "0.48251683",
"text": "def valid_tree?\n true\n end",
"title": ""
},
{
"docid": "20707246423d19664d3bf082427cd699",
"score": "0.4814603",
"text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n # no arguments assign the user inputs to variables\n\n # get model objects\n surfaces = model.getSurfaces\n subSurfaces = model.getSubSurfaces\n\n # reporting initial condition of model\n runner.registerInitialCondition(\"The building has #{surfaces.size} space surfaces and #{subSurfaces.size} sub-surfaces.\")\n\n # give temp names to surfaces so there are no conflicts if this is re-run more than once.\n counter = 0\n surfaces.each do |surface|\n if !surface.space.empty?\n counter += 1\n surface.setName(\"temp #{counter}\")\n else\n # issue warning about orphan surface, and delete it (could add argument to control this)\n runner.registerWarning(\"#{surface.name} does not have a space and will be removed from the model.\")\n surface.remove\n end\n end\n\n # array of alpha characters to use in surface names\n suffix = ('a'..'z').to_a\n\n # give final names to surfaces and sub-surfaces\n surfaces = model.getSurfaces # added so don't loop through removed orphan surfaces\n surfaces.each do |surface|\n # get parent name\n\n # space name, surface type and azimuth\n space_name = surface.space.get.name\n surface_type = surface.surfaceType\n surface_azimuth = OpenStudio::Quantity.new(surface.azimuth, OpenStudio.createSIAngle)\n surface_azimuth = OpenStudio.convert(surface_azimuth, OpenStudio.createIPAngle).get.value\n surface_azimuth = format('%03d', surface_azimuth.round)\n if surface_azimuth == '360' then surface_azimuth = '0' end\n if surface_type == 'Wall'\n base_name = \"#{space_name} - #{surface_type} #{surface_azimuth}\"\n else\n base_name = \"#{space_name} - #{surface_type}\"\n end\n\n # rename (need loop to address more than one surface in space with same type and azimuth)\n counter = 0\n until suffix.include?(surface.name.get.reverse[0, 1]) # keep going until there is an alpha character at the end\n alpha = counter % 26 # gives me alpha character to use for name\n if counter > 25 # this is to address spaces with more than 26 surfaces with same azimuth. Adds second leading alpha character\n alpha2 = (counter / 26).truncate - 1\n surface.setName(\"#{base_name}:#{suffix[alpha2]}#{suffix[alpha]}\")\n else\n surface.setName(\"#{base_name}:#{suffix[alpha]}\") # this will be name until more than 26\n end\n counter += 1\n end\n end\n\n # give temp names to sub-surfaces so there are no conflicts if this is re-run more than once.\n counter = 0\n subSurfaces = model.getSubSurfaces # need to ask this a second time because some sub-surfaces may have been deleted with base surfaces\n subSurfaces.each do |subSurface|\n if !subSurface.surface.empty?\n counter += 1\n subSurface.setName(\"temp #{counter}\")\n else\n # issue warning about orphan surface, and delete it (could add argument to control this)\n runner.registerWarning(\"#{subSurface.name} does not have a parent surface and will be removed from the model.\")\n subSurface.remove\n end\n end\n\n # give final names to surfaces and sub-surfaces\n subSurfaces = model.getSubSurfaces # need to ask this again so don't loop through removed orphaned sub-surfaces\n subSurfaces.each do |subSurface|\n # get parent name\n\n # space name, surface type and azimuth\n surface_name = subSurface.surface.get.name\n\n base_name = \"#{surface_name} - Sub\"\n\n # rename (need loop to address more than one surface in space with same type and azimuth)\n counter = 0\n until suffix.include?(subSurface.name.get.reverse[0, 1]) # keep going until there is an alpha character at the end\n alpha = counter % 26 # gives me alpha character to use for name\n if counter > 25 # this is to address spaces with more than 26 surfaces with same azimuth. Adds second leading alpha character\n alpha2 = (counter / 26).truncate - 1\n subSurface.setName(\"#{base_name}:#{suffix[alpha2]}#{suffix[alpha]}\")\n else\n subSurface.setName(\"#{base_name}:#{suffix[alpha]}\") # this will be name until more than 26\n end\n counter += 1\n end\n end\n\n # TODO: - also rename shading surfaces, and try and maintain namings matched to windows by using overhang script.\n\n # reporting final condition of model\n runner.registerFinalCondition('All space surfaces and sub-surfaces have been renamed.')\n\n return true\n end",
"title": ""
},
{
"docid": "a4c13da4029c487e4829fe239ae75bef",
"score": "0.48067802",
"text": "def tree\n @tree ||= build_tree\n end",
"title": ""
},
{
"docid": "e02dc440f092d02149e83214c33e5c3b",
"score": "0.48006672",
"text": "def root=(a); skeleton.root = a; end",
"title": ""
},
{
"docid": "e4381d6affe4400cd23bd7c6118b6caf",
"score": "0.47972816",
"text": "def tree_params\n params.require(:tree).permit(:common_name, :scientific_name, :content, :fact, images: [])\n end",
"title": ""
},
{
"docid": "9f05cea1ef01c57cdbdb90cd4c398182",
"score": "0.47935146",
"text": "def visibilities; end",
"title": ""
},
{
"docid": "0d8c07d40926bddd36a15f4c7e036df4",
"score": "0.47847104",
"text": "def modeler_description\n return \"Each window in the building is assigned a thermochromic window construction and a shading control. The shading control is set to increase the window tint to meet the daylighting setpoint in the zone. If the zone already has daylighting controls, the setpoints from those controls are used. If the zone does not have controls, new controls are added at the center of the zone with a setpoint of 500 lux. These controls are only used for changing the window tint; they are not used to control the interior lighting.\"\n end",
"title": ""
}
] |
e8edbd5e6f41683995b830ef5a6bc971
|
Evaluate prefix (base_url) in order: 1. base_url key from local configuration (currently secrets) 2. from Information Service (cached) with https:// appended 3. or use PREFIX const
|
[
{
"docid": "b87e49f4241183da4cf5ac33d2019cea",
"score": "0.77915305",
"text": "def find_prefix\n url_from_config = Rails.application.secrets.base_url\n url_from_config || Utils.random_service_public_url('data_explorers') || PREFIX\n end",
"title": ""
}
] |
[
{
"docid": "9525fced117c44b6fcc61bdc616078fb",
"score": "0.7098484",
"text": "def base_prefix\n Starter::Config.read[:prefix]\n end",
"title": ""
},
{
"docid": "c8e05be1732f7bcfdf2c0226b07906ca",
"score": "0.6730685",
"text": "def prefix_url(rest_of_url='')\n prefix = Ginatra.config.prefix.to_s\n\n if prefix.length > 0 && prefix[-1].chr == '/'\n prefix.chop!\n end\n\n \"#{prefix}/#{rest_of_url}\"\n end",
"title": ""
},
{
"docid": "c048c2d43e1f638b96eef655324f51a0",
"score": "0.66797477",
"text": "def url_prefix\n client.url_prefix\n end",
"title": ""
},
{
"docid": "70a4af5e5ed9d7d83387459898026864",
"score": "0.66678053",
"text": "def connection_prefix\n \"#{connection.http.url_prefix}/#{base_path}\"\n end",
"title": ""
},
{
"docid": "ec04d338992586a8e3e44e9f2a3cd8d2",
"score": "0.6645763",
"text": "def url_prefix\n # We use file.join because the ruby url methods don't like relative\n # urls.\n File.join(\n domain,\n self['baseurl']\n )\n end",
"title": ""
},
{
"docid": "7ab56d747575b7ccdfbf70b0285f5cfc",
"score": "0.6526436",
"text": "def url_prefix\n @url_prefix ||= '/'\n end",
"title": ""
},
{
"docid": "3a70a371ebcbc7f9c99a074c79a0e35d",
"score": "0.6454424",
"text": "def pname(prefix, suffix)\n # Prefixes must be defined, except special case for empty prefix being alias for current @base\n base = if prefix(prefix)\n prefix(prefix).to_s\n elsif prefix.to_s.empty? && !validate?\n base_uri.to_s\n else\n error(\"undefined prefix\", production: :pname, token: prefix)\n ''\n end\n suffix = suffix.to_s.sub(/^\\#/, \"\") if base.index(\"#\")\n debug(\"pname\", depth: options[:depth]) {\"base: '#{base}', suffix: '#{suffix}'\"}\n process_iri(base + suffix.to_s)\n end",
"title": ""
},
{
"docid": "c9b9ef5fa940637f45fa79e5cc41dfa1",
"score": "0.64360785",
"text": "def path_prefix\n File.join PREFIX, @endpoint_name\n end",
"title": ""
},
{
"docid": "624d81fbfbc1d9239b762bd4a950a1fe",
"score": "0.64242125",
"text": "def path_prefix \n defined?(@uri_prefix)?@uri_prefix:_path_prefix \n end",
"title": ""
},
{
"docid": "d359aa33b321e065d4357fed07aa69fd",
"score": "0.6407389",
"text": "def prefix\n return @@config[:prefix]\n end",
"title": ""
},
{
"docid": "f7a0bbe32bda825971aa4650492496de",
"score": "0.63594466",
"text": "def url_prefix; end",
"title": ""
},
{
"docid": "fffdf028bb792a251714a3168b7d5e10",
"score": "0.6337853",
"text": "def base_prefix(tag)\n return \"\" if tag.blank?\n\n # get base prefix\n base_prefixes =\n GalvaniConfig[\"access_profiles\"].keys.select { |n| tag.start_with?(n) }\n\n return \"\" if base_prefixes.blank?\n\n base_prefixes[0]\n end",
"title": ""
},
{
"docid": "f9db32c778543e3df2a52ffd8877f335",
"score": "0.63044024",
"text": "def webconf_url_prefix\n path = webconf_path_prefix\n path = '/' + path unless path.match(/^\\//)\n \"#{Site.current.domain_with_protocol}#{path}\"\n end",
"title": ""
},
{
"docid": "c10addf2781e3572e295f50e36549bf6",
"score": "0.63020545",
"text": "def http_prefix\n self.url = \"http://\" + self.url unless self.url =~ /^http:\\/\\//\n end",
"title": ""
},
{
"docid": "5571b562811ea3356e57d3fde6486bdf",
"score": "0.6298711",
"text": "def prefix\n @network_conf[:prefix]\n end",
"title": ""
},
{
"docid": "1ef79614067cb3d89d87a5ced60c4bee",
"score": "0.62840056",
"text": "def path_prefix\n @path_prefix ||= \"https://api.github.com\"\n @path_prefix+=\"/\" if @path_prefix != \"\" && @path_prefix[-1] != \"/\"\n @path_prefix\n end",
"title": ""
},
{
"docid": "a79f4889169e7f72455c2e2ea198f46a",
"score": "0.6249064",
"text": "def _prefixes\n @_prefixes ||= super + ['hyrax/base']\n end",
"title": ""
},
{
"docid": "a79f4889169e7f72455c2e2ea198f46a",
"score": "0.6249064",
"text": "def _prefixes\n @_prefixes ||= super + ['hyrax/base']\n end",
"title": ""
},
{
"docid": "a79f4889169e7f72455c2e2ea198f46a",
"score": "0.6249064",
"text": "def _prefixes\n @_prefixes ||= super + ['hyrax/base']\n end",
"title": ""
},
{
"docid": "6afe58705b029592976c1edbf19f89d0",
"score": "0.6245267",
"text": "def prefix\n return @config.fetch(\"prefix\", \"\")\n end",
"title": ""
},
{
"docid": "5d3ef5b466febe35dd91af5fd726177e",
"score": "0.6243836",
"text": "def app_base_url(prefix=nil)\n \"#{settings.app_protocol || 'http'}://#{prefix}#{settings.app_host}\"\nend",
"title": ""
},
{
"docid": "5d3ef5b466febe35dd91af5fd726177e",
"score": "0.6243836",
"text": "def app_base_url(prefix=nil)\n \"#{settings.app_protocol || 'http'}://#{prefix}#{settings.app_host}\"\nend",
"title": ""
},
{
"docid": "22fe0e7fb897d0729e4067da56215105",
"score": "0.6181939",
"text": "def _prefixes\n @_prefixes ||= super + ['catalog', 'hyrax/base']\n end",
"title": ""
},
{
"docid": "22fe0e7fb897d0729e4067da56215105",
"score": "0.6181939",
"text": "def _prefixes\n @_prefixes ||= super + ['catalog', 'hyrax/base']\n end",
"title": ""
},
{
"docid": "24d1f91fc35fb901e39f018583a2baf5",
"score": "0.61750054",
"text": "def api_prefix\n @prefix\n end",
"title": ""
},
{
"docid": "ebabb8ff837fc1065f0340289cd1f19e",
"score": "0.615579",
"text": "def url_prefix\n nil\n end",
"title": ""
},
{
"docid": "368b2edf56efff000b4f3b1de3717d76",
"score": "0.61450595",
"text": "def generate_base_urls \n if(ENV['ENVIRONMENT']=='sandbox')\n @base_url = SANDBOX + BBC_DOMAIN \n @static_base_url = STATIC_SANDBOX + BBC_DOMAIN\n elsif (ENV['ENVIRONMENT']=='live' && ENV['WWW_LIVE']=='false')\n @base_url = WWW_PREFIX + BBC_DOMAIN\n @static_base_url = STATIC_PREFIX + BBC_DOMAIN\n @open_base_url = OPEN_PREFIX + BBC_DOMAIN\n elsif (ENV['ENVIRONMENT'].split('.')[0].include? 'pal') #address specific box\n @base_url = \"#{scheme}://#{ENV['ENVIRONMENT']}\" \n else\n @base_url = WWW_PREFIX + ENV['ENVIRONMENT'] + BBC_DOMAIN\n @static_base_url = STATIC_PREFIX + ENV['ENVIRONMENT'] + BBC_DOMAIN\n @open_base_url = OPEN_PREFIX + ENV['ENVIRONMENT'] + BBC_DOMAIN\n end\n end",
"title": ""
},
{
"docid": "64aee70e3cb8077583423f4d38d7152d",
"score": "0.6142656",
"text": "def with_prefix prefix\n prefix = \"/#{prefix}\".sub(%r{^//}, \"/\")\n self.class.new(:prefix => prefix, :config => config)\n end",
"title": ""
},
{
"docid": "60f621909e7cc7fc5c556b528df117bb",
"score": "0.6137632",
"text": "def prefix\n RbConfig::CONFIG['prefix']\n end",
"title": ""
},
{
"docid": "5e1e9f93464cf87b8b069c840b2f3d15",
"score": "0.611899",
"text": "def env_to_prefix\n @@env_to_prefix = {\n 'development' => 'D',\n 'photos_staging' => 'S',\n 'photos_production' => 'P'\n }\n @@my_prefix ||= @@env_to_prefix[Rails.env]\n end",
"title": ""
},
{
"docid": "fed278dbbbf908c0ab5ec658ef2dc400",
"score": "0.6114533",
"text": "def set_base(uri_prefix)\n @prefixes[\"<#{uri_prefix}\"] = '<'\n end",
"title": ""
},
{
"docid": "e7a0f73887184e1ec96809cec748ef24",
"score": "0.61073774",
"text": "def host_prefix\n 32 - @prefix\n end",
"title": ""
},
{
"docid": "28754116c304acd779ebdd6109c10e48",
"score": "0.6092318",
"text": "def service_url_base\n requested = \"#{request.scheme}://#{request.host}\".tap do |url|\n unless [ [\"https\", 443], [\"http\", 80] ].include?([request.scheme, request.port])\n url << \":#{request.port}\"\n end\n end\n end",
"title": ""
},
{
"docid": "699dcd0a8ca016dc976a45d9d07ba5ff",
"score": "0.60797167",
"text": "def prefix_path(path = \"\")\n prefix = cdn? && asset_config.fetch( \"skip_prefix_with_cdn\") ? \"\" : self. prefix\n baseurl = cdn? && asset_config.fetch(\"skip_baseurl_with_cdn\") ? \"\" : self.baseurl\n path = [baseurl, prefix, path]\n\n cdn = asset_config.fetch(\"cdn\") if asset_config.has_key?(\"cdn\")\n cdn? && cdn ? File.join(cdn, *path).chomp(\"/\") : \\\n File.join(*path).chomp(\"/\")\n end",
"title": ""
},
{
"docid": "ea034534d5d7a1205eb479403a15fcac",
"score": "0.607343",
"text": "def default_path_prefix\n @prefix ||= \"/v1/accounts/#{@account_id}\"\n end",
"title": ""
},
{
"docid": "8efcfdcdf41392da13429075e0f1b73f",
"score": "0.60063356",
"text": "def key_for(url)\r\n [@prefix, url].join\r\n end",
"title": ""
},
{
"docid": "cf28ae9aa50dceffa38307777b34790e",
"score": "0.59782666",
"text": "def current_prefix; end",
"title": ""
},
{
"docid": "cf28ae9aa50dceffa38307777b34790e",
"score": "0.59782666",
"text": "def current_prefix; end",
"title": ""
},
{
"docid": "cf28ae9aa50dceffa38307777b34790e",
"score": "0.59782666",
"text": "def current_prefix; end",
"title": ""
},
{
"docid": "3e3239c035c3ef42493a81066df47012",
"score": "0.59687287",
"text": "def prefix_path(path = nil)\n cdn = asset_config[\"cdn\"]\n base_url = baseurl\n\n path_ = []\n path_ << base_url unless base_url.empty?\n path_ << path unless path.nil?\n\n url = cdn && cdn?? File.join(cdn, *path_) : File.join(*path_)\n url.chomp(\"/\")\n end",
"title": ""
},
{
"docid": "9344809367caba6c3089dc0022cc48ab",
"score": "0.59465444",
"text": "def add_http_prefix\n return if self.blank?\n _uri = self.to_uri\n return self if _uri.nil? || _uri.is_a?(URI::FTP) || _uri.is_a?(URI::HTTP) || _uri.is_a?(URI::HTTPS) || _uri.is_a?(URI::LDAP) || _uri.is_a?(URI::MailTo)\n \"http://#{self}\"\n end",
"title": ""
},
{
"docid": "9344809367caba6c3089dc0022cc48ab",
"score": "0.59465444",
"text": "def add_http_prefix\n return if self.blank?\n _uri = self.to_uri\n return self if _uri.nil? || _uri.is_a?(URI::FTP) || _uri.is_a?(URI::HTTP) || _uri.is_a?(URI::HTTPS) || _uri.is_a?(URI::LDAP) || _uri.is_a?(URI::MailTo)\n \"http://#{self}\"\n end",
"title": ""
},
{
"docid": "2846e678e73622365cc6ef235195facc",
"score": "0.5943028",
"text": "def prefix\n \"#{DESK[:site]}/api/v#{DESK[:version]}/\"\n end",
"title": ""
},
{
"docid": "875933f42f78026f370bd41866ca6635",
"score": "0.5928986",
"text": "def prefix\n fetch('name.prefix')\n end",
"title": ""
},
{
"docid": "9cd813fadbe563fd40867031a6513c1a",
"score": "0.5921637",
"text": "def prefix_check\n # if the beggining already has the http orhttps then just return\n if self.URL =~ /(^http:\\/\\/|^https:\\/\\/)/i\n return\n else\n # add http:// to the beginning\n self.URL = \"http://\" + self.URL\n end\n end",
"title": ""
},
{
"docid": "127b446fb939452c8d5d78abdaa1741a",
"score": "0.59199953",
"text": "def generate_base_urls\n environment = ENV['ENVIRONMENT'].downcase # be defensive\n\n prepare_host\n\n if environment == 'sandbox'\n @base_url = @sandbox + @bbc_domain\n @pal_base_url = @sandbox + @bbc_domain\n @ssl_base_url = @sslsandbox + @bbc_domain\n @static_base_url = @static_sandbox + @bbc_domain\n @mobile_base_url = @mobiledot_prefix + 'sandbox.dev' + @bbc_domain\n @m_base_url = @mdot_prefix + 'sandbox.dev' + @bbc_domain\n elsif environment == 'sandbox6'\n @base_url = @sandbox6 + @bbc_domain\n @pal_base_url = @sandbox6 + @bbc_domain\n @ssl_base_url = @sslsandbox6 + @bbc_domain\n @static_base_url = @static_sandbox6 + @bbc_domain\n @mobile_base_url = @mobiledot_prefix + 'sandbox' + @bbc_domain\n @m_base_url = @mdot_prefix + 'sandbox' + @bbc_domain\n elsif environment == 'live'\n @base_url = @www_prefix.chop + @bbc_domain\n @pal_base_url = @pal_prefix + environment + @bbc_domain\n @ssl_base_url = @ssl_prefix.chop + @bbc_domain\n @static_base_url = @static_prefix.chop + @bbci_domain\n @open_base_url = @open_prefix.chop + @bbc_domain\n @mobile_base_url = @mobiledot_prefix.chop + @bbc_domain\n @m_base_url = @mdot_prefix.chop + @bbc_domain\n else\n @base_url = @www_prefix + environment + @bbc_domain\n @pal_base_url = @pal_prefix + environment + @bbc_domain\n @ssl_base_url = @ssl_prefix + environment + @bbc_domain\n @static_base_url = @static_prefix + environment + @bbci_domain\n @static_base_url = @static_prefix.chop + @bbci_domain if environment == 'live'\n @open_base_url = @open_prefix + environment + @bbc_domain\n @mobile_base_url = @mobiledot_prefix + environment + @bbc_domain\n @m_base_url = @mdot_prefix + environment + @bbc_domain\n end\n\n proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']\n proxy_parts = proxy.scan(%r{(?:http://)?([^\\:]+)(?::(\\d+))?}) if proxy && !proxy.empty?\n if proxy_parts && !proxy_parts.empty?\n @proxy_host = proxy_parts[0][0]\n @proxy_port = if proxy_parts[0][1]\n proxy_parts[0][1]\n else\n '80'\n end\n end\n end",
"title": ""
},
{
"docid": "f549fb57c08e02ce13c17981dcaa8a76",
"score": "0.59147125",
"text": "def blast_url_prefix\n Sequence.blast_url_prefix\n end",
"title": ""
},
{
"docid": "ac269568564bd481f64807a341abb21e",
"score": "0.5911756",
"text": "def get prefix\n\n cached_prefix = nil\n \n #Check to see if the cache should be refreshed, if not search the cache\n if refresh_cache? == TRUE\n refresh_cache!\n else\n @@thread_lock.synchronize {\n cached_prefix = @@service_cache.detect { |service| service[:prefix] == prefix }\n }\n end\n \n #If we already have an entry in our cache return that, otherwise fetch from the db\n #and store in the cache\n if cached_prefix\n return cached_prefix\n else\n #Fetch the service details from the database\n begin\n service = PcoOutboundservice.find(:first, :conditions => [\"PHONEPREFIX = ?\", \"?\" + prefix])\n rescue => err\n return { :result => -1, :error => err }\n end\n \n #Evaluate and return the appropriate results\n if service\n @@thread_lock.synchronize {\n @@service_cache << breakdown_cli_components(prefix, service)\n }\n return breakdown_cli_components(prefix, service)\n else\n return { :result => -1, :error => \"No Service Found\" }\n end\n end\n end",
"title": ""
},
{
"docid": "7aea8467774d016de5db3e4be4f0c6ab",
"score": "0.5911135",
"text": "def prefix_to_host(prefix)\n @@order_routes = {\n 'D' => \"development.photos.zangzing.com\",\n 'S' => \"staging.photos.zangzing.com\",\n 'P' => \"www.zangzing.com\"\n }\n host = @@order_routes[prefix]\n end",
"title": ""
},
{
"docid": "d4ba363f164e777919f991220e172075",
"score": "0.5891149",
"text": "def uri_prefix(service = \"api\")\n \"https://#{service}#{sandbox ? \".sandbox\" : \"\"}.ebay.com/ws\"\n end",
"title": ""
},
{
"docid": "3e8721762277dbb1f1d72cc78751c355",
"score": "0.58834994",
"text": "def url_helper_prefix\n if defined?(namespace_prefix)\n STDERR.puts <<END.gsub(\"\\n\", ' ')\nDEPRECATION WARNING: \nThe make_resourceful #namespace_prefix accessor\nis deprecated and will be removed in 0.3.0.\nOverride #url_method_prefix instead.\nEND\n return namespace_prefix\n end\n \n prefixes = namespaces.empty? ? parents : namespaces\n prefixes.empty? ? '' : \"#{prefixes.join('_')}_\"\n end",
"title": ""
},
{
"docid": "75b36db79649d3d813785be228db5809",
"score": "0.5869919",
"text": "def set_uri_prepend\n\t\tprefix = \"\"\n\n\t\tif (self.config['uri_fake_params_start'])\n\t\t\tprefix << '/%3fa=b/../'\n\t\tend\n\n\t\tif (self.config['uri_fake_end'])\n\t\t\tprefix << '/%20HTTP/1.0/../../'\n\t\tend\n\n\t\tprefix\n\tend",
"title": ""
},
{
"docid": "e837b154a8538bb41e30d45d1d3ff03e",
"score": "0.5868431",
"text": "def live_url_prefix=(value)\n if not value[\"https://\"].nil?\n value[\"https://\"] = \"\"\n end\n @live_url_prefix = value\n end",
"title": ""
},
{
"docid": "e8063c4aeeed0d2811d2f7d9af871627",
"score": "0.5868293",
"text": "def _prefixes\n @_prefixes ||= super + ['catalog']\n end",
"title": ""
},
{
"docid": "fa2e53f6b89960fca42fc15826de756b",
"score": "0.585908",
"text": "def __prefix__\n instance_variable_defined?(:@__prefix__) ?\n @__prefix__ :\n __name__.split('::').last.downcase.to_sym\n end",
"title": ""
},
{
"docid": "4a9c86ac4ac6761b7ae4205f3e46a4c1",
"score": "0.58587885",
"text": "def base_prefix\n HaridsyncHelpers.ensure_uppercase_dn_component(user['ou'] || DEFAULT_PREFIX)\n end",
"title": ""
},
{
"docid": "7787dd5dac036eeb0e13529f3f4c4f35",
"score": "0.58548146",
"text": "def api_prefix\n client.api_prefix\n end",
"title": ""
},
{
"docid": "e65499f8a9d212bbafa85227ad50129d",
"score": "0.58458936",
"text": "def live_url_prefix=(value)\n value['https://'] = '' unless value['https://'].nil?\n @live_url_prefix = value\n end",
"title": ""
},
{
"docid": "a4bbf2d7c9e7ffa6bcb3f23f66ddef07",
"score": "0.5839299",
"text": "def host_prefix\n 128 - @prefix\n end",
"title": ""
},
{
"docid": "52ae705d49eb819caddd4426cf2bb73d",
"score": "0.5838915",
"text": "def _prefixes\n @_prefixes ||= super + ['catalog', 'curation_concern/base']\n end",
"title": ""
},
{
"docid": "31821edc724bedbf0ee5f5b27df14852",
"score": "0.58387184",
"text": "def prefixes; end",
"title": ""
},
{
"docid": "74e0ab416a0d17ed8c5b6b1e4e5a8d92",
"score": "0.58380187",
"text": "def urls\r\n keys.map{ |k| k[/^#{@prefix}(.*)/, 1] }\r\n end",
"title": ""
},
{
"docid": "7d3a30f44e064c173fe726fd2d6d325b",
"score": "0.58352196",
"text": "def app_url \n prefix = settings.app_base_auth_login.blank? ? '' : \"#{settings.app_base_auth_login}:#{settings.app_base_auth_pass}@\"\n app_base_url prefix\nend",
"title": ""
},
{
"docid": "7d3a30f44e064c173fe726fd2d6d325b",
"score": "0.5834917",
"text": "def app_url \n prefix = settings.app_base_auth_login.blank? ? '' : \"#{settings.app_base_auth_login}:#{settings.app_base_auth_pass}@\"\n app_base_url prefix\nend",
"title": ""
},
{
"docid": "e9a209128e2070269066b5b20829a01c",
"score": "0.58283156",
"text": "def _prefixes\n @_prefixes ||= super + ['catalog']\n end",
"title": ""
},
{
"docid": "4c5615f3046c4633621731ddd8094fab",
"score": "0.5821158",
"text": "def lookup_namespace(prefix)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "836fb876378e582218be52027142e668",
"score": "0.5818273",
"text": "def _prefixes\n @_prefixes ||= super + ['catalog', 'curation_concern/base']\n end",
"title": ""
},
{
"docid": "241b9aad2e7fe4874d5b409fe038214d",
"score": "0.5814247",
"text": "def prefix\n response[\"prefix\"]\n end",
"title": ""
},
{
"docid": "2a65d77b2d28afd755fda698bd27292b",
"score": "0.5811644",
"text": "def base_url\n \"http#{configuration[:secure] ? 's' : ''}://#{configuration[:api_url]}/spaces/#{configuration[:space]}\"\n end",
"title": ""
},
{
"docid": "706f03c0b82edfa5f32593d7755036d4",
"score": "0.58027434",
"text": "def prefix(value = nil)\n if value.nil?\n @prefix\n else\n @prefix = Utils::PathPrefix.new(value)\n end\n end",
"title": ""
},
{
"docid": "706f03c0b82edfa5f32593d7755036d4",
"score": "0.58027434",
"text": "def prefix(value = nil)\n if value.nil?\n @prefix\n else\n @prefix = Utils::PathPrefix.new(value)\n end\n end",
"title": ""
},
{
"docid": "268b889d90577b5106c2d660bd09c42f",
"score": "0.5797676",
"text": "def read_prefix\n ns, uri = match(RE_PREFIX)\n ns.nil? ? nil : add_prefix(ns, uri)\n end",
"title": ""
},
{
"docid": "39471ed971b2573ab92d1d78681f6970",
"score": "0.5790694",
"text": "def url_helper_prefix\n namespaces.empty? ? '' : \"#{namespaces.join('_')}_\"\n end",
"title": ""
},
{
"docid": "623c7712f17f8233df2294eeceb6b974",
"score": "0.5780595",
"text": "def base_uri\n @proxy ? @proxy : @uri\n end",
"title": ""
},
{
"docid": "706681007fadb488015609934d3b3281",
"score": "0.5771473",
"text": "def user_prefixes\n isupport[\"PREFIX\"].values\n end",
"title": ""
},
{
"docid": "302347eea29739302a3d99c9210a4c91",
"score": "0.5767998",
"text": "def prefix_url(path)\n host = request.port == 80 ? request.host : request.host_with_port\n \"#{request.protocol}#{host}#{path}\"\n end",
"title": ""
},
{
"docid": "302347eea29739302a3d99c9210a4c91",
"score": "0.5767998",
"text": "def prefix_url(path)\n host = request.port == 80 ? request.host : request.host_with_port\n \"#{request.protocol}#{host}#{path}\"\n end",
"title": ""
},
{
"docid": "cbf1197390184e70a9d02e8337116af9",
"score": "0.5752196",
"text": "def _prefixes\n @_prefixes ||= super + ['catalog']\n end",
"title": ""
},
{
"docid": "ef57adb66fb7cb867b3660e64eab7bdc",
"score": "0.5742083",
"text": "def user_prefixes\n isupport['PREFIX'].values\n end",
"title": ""
},
{
"docid": "203853e491364fa2c985326ce303289e",
"score": "0.57370627",
"text": "def host\n self.url_prefix.host\n end",
"title": ""
},
{
"docid": "aeb48f1b9c0d88457b84187dcd602bd2",
"score": "0.57221323",
"text": "def base_uri(in_or_out = :in)\n Rails.my_config(\"base_uri_#{in_or_out}\".to_sym)\n end",
"title": ""
},
{
"docid": "ae9fe14b1289248a1be0641a8419f972",
"score": "0.57203376",
"text": "def host_prefix_name\n \"#{@host}.#{@name}\"\n end",
"title": ""
},
{
"docid": "b9d47f99ebc396815eb36b6aa985f80f",
"score": "0.5716829",
"text": "def prefix\n p = @options[:prefix].to_s\n p unless p.empty?\n end",
"title": ""
},
{
"docid": "421168144c2a0b9d76162863fc5319ba",
"score": "0.57097775",
"text": "def setting_prefix\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "106b001460b356127af3f51de3fa8ea0",
"score": "0.5700225",
"text": "def prefix=(value = \"/\")\n # Replace :placeholders with '#{embedded options[:lookups]}'\n prefix_call = value.gsub(/:\\w+/) { |key| \"\\#{URI::DEFAULT_PARSER.escape options[#{key}].to_s}\" }\n\n # Clear prefix parameters in case they have been cached\n @prefix_parameters = nil\n\n silence_warnings do\n # Redefine the new methods.\n instance_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1\n def prefix_source() \"#{value}\" end\n def prefix(options={}) \"#{prefix_call}\" end\n RUBY_EVAL\n end\n rescue Exception => e\n logger.error \"Couldn't set prefix: #{e}\\n #{code}\" if logger\n raise\n end",
"title": ""
},
{
"docid": "b115bbde32441c996d7cdea58ae99d2e",
"score": "0.5699861",
"text": "def base_url\n get_data_from_yml_file(\"environment_urls.yml\")[\"#{application_environment}_BASE_URL\"]\n end",
"title": ""
},
{
"docid": "35776f49b6dbf5af36efe803db6c6a37",
"score": "0.5699239",
"text": "def path_prefix\n Merb.config[:path_prefix]\n end",
"title": ""
},
{
"docid": "2acf8b8470cb19d5d37b839e30d45768",
"score": "0.56941617",
"text": "def calculateBaseUrl(url)\n str = url.schema + \"://\"\n str += url.host\n str += \":\" + url.port.to_s if url.port\n str += url.path if url.path\n str\n end",
"title": ""
},
{
"docid": "e9c056a38e77bca24c7235fed8851c9d",
"score": "0.56898004",
"text": "def prefix(prefix, iri = nil)\n # Relative IRIs are resolved against @base\n iri = process_iri(iri) if iri\n super(prefix, iri)\n end",
"title": ""
},
{
"docid": "bd2aafbee6348e1c11a5ff3e3ee7d142",
"score": "0.5681292",
"text": "def bucket_prefix\n @bucket_prefix ||= if shrine_storage.prefix\n shrine_storage.prefix.chomp('/') + '/'\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "266934cb864bf58ffe54e6d455842bd9",
"score": "0.567989",
"text": "def requires_prefix?\n\n\t\treturn @requires_prefix unless @requires_prefix.nil?\n\n\t\trequires_prefix = false\n\n\t\t@services.each do |svc|\n\n\t\t\tif svc.respond_to? :requires_prefix?\n\n\t\t\t\tcase rp = svc.requires_prefix?\n\t\t\t\twhen nil, false\n\n\t\t\t\t\t;\n\t\t\t\twhen true\n\n\t\t\t\t\trequires_prefix ||= true\n\t\t\t\twhen :parts\n\n\t\t\t\t\trequires_prefix = rp\n\t\t\t\t\tbreak\n\t\t\t\telse\n\n\t\t\t\t\twarn \"unrecognised return from requires_prefix? for service #{svc}: #{rp} (#{rp.class})\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t@requires_prefix = requires_prefix\n\tend",
"title": ""
},
{
"docid": "c380618a86dba1c5e6cf02b06187975d",
"score": "0.56792045",
"text": "def namespace_uri(prefix)\r\n @namespaces[prefix]\r\n end",
"title": ""
},
{
"docid": "e9640a2b17e2f2deee54e4ae229d94f6",
"score": "0.56734264",
"text": "def base_url\n @base_url = \"#{scheme}://#{host}\"\n end",
"title": ""
},
{
"docid": "0c2d9bb00522c48ce469c7856ef93821",
"score": "0.56675",
"text": "def prefix\n @prefix\n end",
"title": ""
},
{
"docid": "0c2d9bb00522c48ce469c7856ef93821",
"score": "0.56675",
"text": "def prefix\n @prefix\n end",
"title": ""
},
{
"docid": "47122f2ea88887aad1f9c3b1d1bcd2bd",
"score": "0.56666327",
"text": "def prefix(value = Undefined)\n if value.equal?(Undefined)\n @prefix\n else\n @prefix = value\n end\n end",
"title": ""
},
{
"docid": "498ba40fec0824aff901ffe3995a8713",
"score": "0.5657505",
"text": "def base_path\n File.join(path_prefix)\n end",
"title": ""
},
{
"docid": "48a552aeee2fa3dbe3619fd307e1f589",
"score": "0.5657078",
"text": "def base_url\n scheme = request.scheme\n port = request.port\n url = \"#{scheme}://#{host}\"\n if scheme == \"http\" && port != 80 || scheme == \"https\" && port != 443\n url << \":#{port}\"\n end\n url << request.script_name\n end",
"title": ""
},
{
"docid": "22321588585ac8dcf2b0f9bd3824165c",
"score": "0.5655824",
"text": "def current_prefix\n if !config.use_base && content_type == 'text/css'\n ''\n else\n config.assets_prefix\n end\n end",
"title": ""
},
{
"docid": "e1d7a235757ea808d9babd2ebe31fe7c",
"score": "0.56531763",
"text": "def path_prefix=(value); end",
"title": ""
}
] |
33cfdef9127bea9bc321b1eb41dbc962
|
Checks if the category param is present in the url params, then whitelist the properties of the category param.
|
[
{
"docid": "17d1f0f2991d66a95111452646c32953",
"score": "0.0",
"text": "def category_param\n result = params.require(:category).permit(:label)\n result[\"name\"] = result.delete \"label\"\n result\n end",
"title": ""
}
] |
[
{
"docid": "968dcf688f6bb7ac49dfbef4d670a4b3",
"score": "0.6403232",
"text": "def category_params\n params.require(:category).permit(:name) #name of category has been whitelisted\n end",
"title": ""
},
{
"docid": "aa89f609e585b786970186dd463c334f",
"score": "0.64019066",
"text": "def filtering_params(params)\n\t\tparams.slice(:category)\n\tend",
"title": ""
},
{
"docid": "1831b7cf0c97477f2fe837ca2a3e7982",
"score": "0.6396328",
"text": "def category_params\n params.fetch(:category, {})\n end",
"title": ""
},
{
"docid": "1831b7cf0c97477f2fe837ca2a3e7982",
"score": "0.6396328",
"text": "def category_params\n params.fetch(:category, {})\n end",
"title": ""
},
{
"docid": "1831b7cf0c97477f2fe837ca2a3e7982",
"score": "0.6396328",
"text": "def category_params\n params.fetch(:category, {})\n end",
"title": ""
},
{
"docid": "1831b7cf0c97477f2fe837ca2a3e7982",
"score": "0.6396328",
"text": "def category_params\n params.fetch(:category, {})\n end",
"title": ""
},
{
"docid": "47474f03f07480a7b176dd7eb4fdc791",
"score": "0.61045295",
"text": "def category_params\n params.fetch(:category, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "8178d3f1437c4834762e23dd0c7ff214",
"score": "0.599946",
"text": "def category\n whitelist_api['category']\n end",
"title": ""
},
{
"docid": "2f165d7337a980ae24f62f12720f40e5",
"score": "0.5954297",
"text": "def category_params\n params.require(:category).permit!\n end",
"title": ""
},
{
"docid": "c7395fa94b0700bac1b082c854180830",
"score": "0.5929913",
"text": "def category_params\n params[:category]\n end",
"title": ""
},
{
"docid": "0569ee43aafbc837458e03c15d8b0c29",
"score": "0.5924274",
"text": "def category_params\n params.fetch(:category, {}).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "e4058d0d8e3422544af0873a79099627",
"score": "0.590224",
"text": "def category_params\n params.permit(:category)\n end",
"title": ""
},
{
"docid": "c29cb81fdb72c066b9fd9b4c07cda2ed",
"score": "0.58684546",
"text": "def filter_params\n {\n store: current_store,\n live: true,\n permitted_categories: @category.self_and_maybe_descendants\n }\n end",
"title": ""
},
{
"docid": "4294fb1249e7cf916ac9b3df0685bfa2",
"score": "0.5852625",
"text": "def use_specific_category(url)\n if @opt[:use_category].present?\n if url.include?(\"/#{@opt[:use_category]}/d/\")\n return true\n else\n throw_error(:wrong_category, 'Craigslist post is not from accepted category.')\n end\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "81ce38e80207fb585e683094dfb4fbcd",
"score": "0.5849991",
"text": "def category_params\n params.require(:category).permit(:name, :include_words, :exclude_words, :color)\n end",
"title": ""
},
{
"docid": "39ce018b3f6bef93e3562fc65a29cb2d",
"score": "0.58064425",
"text": "def category_whitelist\n valid = ['Theatre', 'Performing Arts', 'Popular Music', 'Jazz',\n 'Classical', 'Classic Rock', 'Film']\n create = false\n @event.xpath('category_list').xpath('category').each do |category|\n name = category.xpath('name').inner_html.gsub('&', '&')\n create |= valid.include?(name)\n end\n return create\n end",
"title": ""
},
{
"docid": "a546d0afd8053a9391ee954246e5948f",
"score": "0.5797192",
"text": "def format_categories_param\n return unless params[:categories]\n\n if params[:categories].is_a?(String)\n params[:categories] = params[:categories].split(',')\n end\n end",
"title": ""
},
{
"docid": "17199cc7d6eaf54b2a6651ec0451dc0d",
"score": "0.57887733",
"text": "def product_category_params\n params.fetch(:product_category, {})\n params.require(:product_category).permit(:name, :image_url, :redirect_url)\n end",
"title": ""
},
{
"docid": "f49b29e06fbaecd77508caea6df335be",
"score": "0.57790065",
"text": "def filtering_params(params)\n params.slice(:category, :query, :allfilter)\n end",
"title": ""
},
{
"docid": "bceb4369d32b428cdc00e503ff5844d4",
"score": "0.57778144",
"text": "def filter_constraints\n if params[:path]\n category = category_by_path\n render json: category.filter_constraints(filter_params)\n else\n render json: SitescanCommon::Category.constraints(filter_params)\n end\n end",
"title": ""
},
{
"docid": "9954d11696de0304a0c82c55a72859e8",
"score": "0.5758941",
"text": "def category_params\n params.require(:category).permit(:category)\n end",
"title": ""
},
{
"docid": "f60da46d907c328e58a9536b07b9cc8a",
"score": "0.5745578",
"text": "def property_category_params\n params.require(:property_category).permit(:name)\n end",
"title": ""
},
{
"docid": "ee972995cb8fd46648fbbdde65de0a43",
"score": "0.57409185",
"text": "def category_params\n params.require(:category).permit(:name, :slug)\n end",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.5721966",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "cefe0d95f954c2977699a50523ba86b4",
"score": "0.5709907",
"text": "def category_params\n params.require(:category).permit(:id, :name, :slug, :parent_id) if params.has_key?(:category)\n end",
"title": ""
},
{
"docid": "ffe3a0d7633be9f54dafa0311cc44e34",
"score": "0.57094544",
"text": "def category_params\n\t\tparams.require(:category).permit(*Category::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend",
"title": ""
},
{
"docid": "71eeb469d4f1adc692072e51218c8d7a",
"score": "0.57024264",
"text": "def category_name_params\n params.fetch(:category_name, {})\n end",
"title": ""
},
{
"docid": "a44f0e34bc634e9f27c220438b3a47a9",
"score": "0.5693069",
"text": "def determineCatParam(cat_param)\n if ((cat_param == \"All\") || (cat_param == nil))\n cat_param = [\"Full Body\", \"Lower Body\", \"Upper Body\", \"Torso\", \"Legs\", \"Hips\", \"Shoulders\", \"Arms\", \"Chest\", \"Back\"]\n else \n cat_param\n end\n end",
"title": ""
},
{
"docid": "096fc87857a6144cbcdee3f27c899972",
"score": "0.56915534",
"text": "def filter\n if params[:path]\n category = SitescanCommon::Category.find_by! path: params[:path]\n render json: category.filter\n else\n render json: SitescanCommon::AttributeClass.filter\n end\n end",
"title": ""
},
{
"docid": "1decb71d1162f2ee661a30ff45199645",
"score": "0.5684352",
"text": "def set_param_category\n @param_category = ParamCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "d60e9aa508511fee2da0b889ee146fbe",
"score": "0.56811446",
"text": "def category_params\n permitted_params = []\n\n I18n.available_locales.each do |locale|\n permitted_params << \"category_#{locale}\".to_sym\n end\n\n permitted_params << :public if current_user.admin?\n\n params.require(:category).permit(permitted_params).merge(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "1af548ebdcc9a1792bf898db6fec4e81",
"score": "0.56757915",
"text": "def category_params\n params.require(:category).permit(\n :parent_id, :live, :name, :subtitle, :product_scope, :view_mode,\n :filtering, :nesting, :redirecting\n )\n end",
"title": ""
},
{
"docid": "cf337b6641fca7c20bb5515b6e6820eb",
"score": "0.56712973",
"text": "def category_params\n params.require(:category).permit(:category_name)\n end",
"title": ""
},
{
"docid": "cf337b6641fca7c20bb5515b6e6820eb",
"score": "0.56712973",
"text": "def category_params\n params.require(:category).permit(:category_name)\n end",
"title": ""
},
{
"docid": "37b7a753533d04437d12ed79e34b407a",
"score": "0.56550187",
"text": "def category_params\n params.require(:category).permit(:category_id)\n\n \t# :coffeehouse, :fast_food, :fast_casual, :casual, :fine, :bar_or_pub, :nightclub)\n end",
"title": ""
},
{
"docid": "7777dca0499b6de3e928bfaa9420c13d",
"score": "0.56495506",
"text": "def product_category_params\n params.fetch(:product_category, {}).permit(:product_id, :category_id)\n end",
"title": ""
},
{
"docid": "a0376d99ccf0f3444b966c25ee3fdb6c",
"score": "0.56465364",
"text": "def category_params\n params.require(:category).permit(:name, :post_type_id, :description, :display_in_navbar, :imagesrc)\n end",
"title": ""
},
{
"docid": "72338c57ba59df92e12ea5e01f6f4f4a",
"score": "0.5643588",
"text": "def category_params\n params.require(:category).permit(:name, :type_no, :is_public)\n end",
"title": ""
},
{
"docid": "e4ea1e45290f993dc6d3995dbe295375",
"score": "0.5638055",
"text": "def fetch_category!\n @category = if params[:category_slug].present?\n Category.find_by_slug(params[:category_slug])\n elsif @listing\n @listing.category\n end\n redirect_to listings_path if !@category\n end",
"title": ""
},
{
"docid": "fbc15de74b2d8a587264c6840a48e664",
"score": "0.56325114",
"text": "def filter_listings_by_category\n category_filter = Category.find_by(id: (params[:categoryFilter] || session[:categoryFilter]))\n @listings = Listing.listings_in_category(category_filter, @location)\n session[:categoryFilter].clear if session[:categoryFilter]\n end",
"title": ""
},
{
"docid": "356e855478f9cee07fe4b86a677372fa",
"score": "0.56072414",
"text": "def category_params\n params[:category].permit(:name, :photo)\n end",
"title": ""
},
{
"docid": "b6f9168df677f8d29ff93adb8ad2d639",
"score": "0.5582959",
"text": "def product_category_params\n params[:product_category]\n end",
"title": ""
},
{
"docid": "40a09068f73480fe594bf7ac938f5801",
"score": "0.55827683",
"text": "def category_check\n \n category = Category.where(name: category_params[:category][:name])\n\n if ! category[0] \n category = Category.create(name: category_params[:category][:name])\n end\n\n return category\n\n end",
"title": ""
},
{
"docid": "22a131315cae9d134557d15b4823ac4b",
"score": "0.55808693",
"text": "def filter\n if !params[:category_url_name].blank? && !params[:archive_date].blank?\n redirect_to blog_category_archive_path(params[:category_url_name], params[:archive_date])\n elsif !params[:category_url_name].blank?\n redirect_to blog_category_path(params[:category_url_name])\n elsif !params[:archive_date].blank?\n redirect_to blog_archive_path(params[:archive_date])\n else\n redirect_to blog_path\n end\n end",
"title": ""
},
{
"docid": "b5019c293ce7d0bdc61297f43a2c3627",
"score": "0.5576205",
"text": "def should_exclude_category(cat_name, cat_url)\n\texclude_cat = false\n\n\tcat_info_to_exclude = @current_page.get_categories_to_exclude\n\t\n\tcat_info_to_exclude.each do |cat_info|\n\t exclude_cat = true if cat_info.include?(cat_name) # exact title match if => IS NOT included in the cat_info\n\t begin\n\t\t if cat_info.include?(\"=>\") # partial title or url match if => IS included in the cat_info\n\t\t\tinfo_type = cat_info.split(\"=>\")[0] \n\t\t\tinfo_value = cat_info.split(\"=>\")[1] \n\n\t\t\texclude_cat = true if info_type == \"url\" && !info_value.include?(\"%\") && cat_url.include?(info_value)\n\t\t\texclude_cat = true if info_type == \"url\" && info_value.include?(\"%\") && cat_url.end_with?(info_value.gsub(\"%\",\"\"))\n\t\t\texclude_cat = true if info_type == \"title\" && cat_name.strip.include?(info_value) # partial title match \n\t\t end\n\t rescue\n\t \tplog(\"ERROR WHEN TRYING TO EXCLUDE CATEGORY: #{cat_name} :: #{cat_url}\",\"red\")\n\t end\n\tend\n return exclude_cat\nend",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.557527",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "65243cd93f14ecf62a6c338876225a35",
"score": "0.55666316",
"text": "def category_params\n params.require(:category).permit(:title, :color).merge(:user_id => current_user.id)\n end",
"title": ""
},
{
"docid": "a34bfa2dfdaa939cc5bb5e8e37b32084",
"score": "0.55639976",
"text": "def book_category_params\n params.fetch(:book_category, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "5cfaa8a2d5ef1b415a326a0636cea65e",
"score": "0.5555232",
"text": "def category_params\n params.require(:category).permit(:name, :public, :category_id, :type_id)\n end",
"title": ""
},
{
"docid": "5287a5db322da1da7c10c6ab90b15fc9",
"score": "0.5550028",
"text": "def set_category\r\n @category = params[:category_id].blank? ? nil : Category.find(params[:category_id])\r\n end",
"title": ""
},
{
"docid": "b3f6b71aaf4c4d9f125343535ac27b09",
"score": "0.554736",
"text": "def cat_params\n params[:cat]\n end",
"title": ""
},
{
"docid": "8c1b747547d4fb7da285dc4a68f81685",
"score": "0.5544109",
"text": "def category_params\n params.require(:category).permit(:name, :img_url)\n end",
"title": ""
},
{
"docid": "4b2377aec063a3d06a27aed5c37f4c81",
"score": "0.55431306",
"text": "def category_params\n params.require(:category).permit(:name, :table, :order, :visible, :color)\n end",
"title": ""
},
{
"docid": "d9682bc9945cdcae955a98c4d015d1a7",
"score": "0.55362403",
"text": "def valid_category_params\n params.require(:valid_category).permit(:name)\n end",
"title": ""
},
{
"docid": "3147758b022ee516e5fd1be4e514f4de",
"score": "0.55349123",
"text": "def category_params\n params.require(:category).permit(:title, :desc, :slugged)\n end",
"title": ""
},
{
"docid": "1809a8e26716cc543f57c2a881c4abb1",
"score": "0.55324554",
"text": "def category_params\n params.require(:category).permit(:name, :is_active)\n end",
"title": ""
},
{
"docid": "d9ac791d10e4053539af995a21260c12",
"score": "0.55270565",
"text": "def category_params\n begin\n params.require(:category).permit(:name, :description)\n rescue\n {}\n end\n end",
"title": ""
},
{
"docid": "a1353ff3fafdff831b2a95ce13a70d9f",
"score": "0.55259424",
"text": "def category_params\n params.fetch(:categories, {}).permit(:root_category_id, :name)\n end",
"title": ""
},
{
"docid": "485352d2f8991d9fdb306abe88d8410c",
"score": "0.5518169",
"text": "def component_params\n # params.require(:component).permit(:title)\n # params.require(:component).permit!\n\n # if params[:component][:categories].blank?\n\n # params.require(:component).permit!\n\n # else\n\n # params.require(:component).permit!.merge({\n # categories: (params[:component][:categories]).delete_if { |k, v| v.empty? }\n # }) \n\n # end\n\n if params[:component][:categories]\n\n# http://stackoverflow.com/questions/24939971/how-to-remove-empty-parameters-from-params-hash\n # new_params[:categories].reject!{|_, v| v.blank?} # remove empty params (which are hash values)\n\n# http://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-transform_values-21\n# http://stackoverflow.com/questions/5878697/how-do-i-remove-blank-elements-from-an-array\n\n# p \"params[:categories] = \" + params[:categories].inspect\n\n params[:component][:categories].transform_values! { |value| value.reject(&:empty?) } # remove nested array empty elements\n\n params[:component][:categories].reject!{|k, v| v.blank?} # remove empty array (no filter value was set)\n\n end\n\n # if new_params[:component_subtype_id]\n\n # new_params = new_params.merge(\n # new_params.delete_if { |k, v| v.empty? }\n # )\n\n # end\n\n # p \"params = \" + params.inspect\n\n params.require(:component).permit!\n # params.permit!\n\n end",
"title": ""
},
{
"docid": "14f54bce9c54138ca0e06b03bff385b2",
"score": "0.55175996",
"text": "def category_params\n permitted = Category.globalize_attribute_names + [:is_active, :color_hex]\n params.require(:category).permit(*permitted)\n end",
"title": ""
},
{
"docid": "4da0eada2f361bfd1efdfb6ce727475f",
"score": "0.5517595",
"text": "def category_params\n params.require(:category).permit(:name, :picurl)\n end",
"title": ""
},
{
"docid": "b0b511a0b5af5ed0843a8283b6ef6452",
"score": "0.55140847",
"text": "def prodcategory_params\n params.require(:prodcategory).permit(:category)\n end",
"title": ""
},
{
"docid": "48232b2297a2482bcd6d7c77d2fead12",
"score": "0.550045",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "939c3c24cb06f73720e80b51d3a01f86",
"score": "0.5496373",
"text": "def category_params\n params.require(:category).permit(:name, :url_image)\n end",
"title": ""
},
{
"docid": "49c2d200923691cc4e36e1d4a1a3d10f",
"score": "0.54779625",
"text": "def listing_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "5dc12a10c49755052e72f9a1865e7eba",
"score": "0.54774165",
"text": "def category_params\n\t\tparams.require(:category).permit(:name)\n\t\t\n\tend",
"title": ""
},
{
"docid": "1ce90f9f472c42a9915155fe117954a9",
"score": "0.54764265",
"text": "def category_params\n params.require(:category).permit(:name, :description, :public)\n end",
"title": ""
},
{
"docid": "581ef3b9732c7e2a1115257e77d18965",
"score": "0.54722506",
"text": "def category_params\n params.require(:category).permit(:name).merge(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "6aced79ad94bbe959b6226a58f857ac9",
"score": "0.54691625",
"text": "def category_params\n params.require(:category).permit(:name, :category)\n end",
"title": ""
},
{
"docid": "c8d7cb201fea62ea50937cd6764f2993",
"score": "0.546811",
"text": "def category_params\n params.require(:category).permit(:category_name, :description, :order_by)\n end",
"title": ""
},
{
"docid": "050fcef07208f8050c90f187065a6501",
"score": "0.54582816",
"text": "def category_params\n params.require(:category).permit(:title, :description, :slug)\n end",
"title": ""
},
{
"docid": "931750ff9394c08f7300e6d1016698cc",
"score": "0.54550695",
"text": "def list_category_params\n params.require(:list_category).permit(:name)\n end",
"title": ""
},
{
"docid": "9db83badba95162f812a24ac6203c386",
"score": "0.54535824",
"text": "def category_params\n params.require(:category).permit(\n :name\n )\n end",
"title": ""
},
{
"docid": "01542941696101983f636c01c8a297ad",
"score": "0.54507744",
"text": "def category_params\n params.require(:category).permit(:title,\n :to_nav,\n :priority,\n :preview_priority,\n :preview_class,\n :product_ids => [])\n end",
"title": ""
},
{
"docid": "7daa5c55ed3c6aaaa9b857855e1f9577",
"score": "0.5443189",
"text": "def category_params\n params.require(:category).permit(:name, :description, :user_id, :img_url, product_ids:[])\n end",
"title": ""
},
{
"docid": "024d94f896c54f7e2fcc2f914daff34d",
"score": "0.543381",
"text": "def category_params\n params.require(:category).permit(:title, :rule_ids=>[])\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.5428968",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
}
] |
773573237aa04ea26bcfdcd0129a5258
|
returns the correct player, X, for the third move expect(game.current_player.token).to eq("X")
|
[
{
"docid": "2b17da0f9895d811c4e23dbfaa77188b",
"score": "0.0",
"text": "def current_player\n @board.turn_count % 2 == 0 ? @player_1 : @player_2\n end",
"title": ""
}
] |
[
{
"docid": "ab7e90d374f7df083fee05380ecbf8b6",
"score": "0.73506325",
"text": "def current_player(board)\n turn_number = turn_count(board) + 1\n token = (turn_number % 2 == 1) ? \"X\" : \"O\"\n return token\nend",
"title": ""
},
{
"docid": "c9f7b213b0406978d55fd371a0cb06c8",
"score": "0.73097456",
"text": "def current_player\n\t\tif board.turn_count.odd?\n\t\t\tplayer_2 # If the number of turns is an odd number it is Player two with the \"O\" token\n\t\telse\n\t\t\tplayer_1 # If the number of turns is an even number it is Player one with the \"X\" token\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e8b3877d0fb610ed33da7f68a8380220",
"score": "0.7275978",
"text": "def get_player_token\n self.token == \"X\" ? \"O\" : \"X\"\n end",
"title": ""
},
{
"docid": "2d6817e7ab563f72a0e46bd14eb9289e",
"score": "0.6943224",
"text": "def current_player\n if @board.turn_count % 2 == 0 \n player_1 # return \"X\"\n else\n player_2 # return \"O\"\n end\n end",
"title": ""
},
{
"docid": "6420ae24f682df9eaa333cf600f4a1a2",
"score": "0.6942539",
"text": "def first_move(board)\n if self.token == \"X\"\n player_move = \"5\"\n elsif self.token == \"O\"\n board.cells[4] == \"X\" ? player_move = \"1\" : player_move = \"5\"\n end\n player_move\nend",
"title": ""
},
{
"docid": "a40e4fc6f12df425a259de8b24231ae7",
"score": "0.69143087",
"text": "def opponent_token\n self.token == \"X\" ? \"O\" : \"X\"\n end",
"title": ""
},
{
"docid": "fc485c8b464976037b83b3dab26814ec",
"score": "0.6885399",
"text": "def opponent_token\n self.token == \"X\" ? \"O\" : \"X\"\n end",
"title": ""
},
{
"docid": "8efab39f8a8cea87da9121b1096f8dd6",
"score": "0.68720895",
"text": "def current_player\n num_turns = turn_count\n if num_turns % 2 == 0\n player = \"X\"\n else\n player = \"O\"\n end\n player\n end",
"title": ""
},
{
"docid": "f4a7e0d120375ce346b6af9ec0aedc8c",
"score": "0.6862925",
"text": "def player_1 \n \t\t@token = \"X\"\n \t\t@player_1\n \tend",
"title": ""
},
{
"docid": "fc2d2e48f353b60bee39631d257868b0",
"score": "0.6823152",
"text": "def current_player\n if turn_count % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\n end",
"title": ""
},
{
"docid": "bd15b3f35b0d95ed7e84eac6c8c0acba",
"score": "0.68135476",
"text": "def current_player\n player = nil\n num_of_turns % 2 == 0 ? player = 'x' : player = 'o'\n \n return player\n end",
"title": ""
},
{
"docid": "c30b64ebb72a0adc4ccc656ad8712051",
"score": "0.6806316",
"text": "def current_player\n if turn_count % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\n end",
"title": ""
},
{
"docid": "61f1c1263037b35cd9d1bfe660eebd4d",
"score": "0.6783394",
"text": "def current_player\n turn_count%2 == 1? \"O\":\"X\"\n end",
"title": ""
},
{
"docid": "05df6f111393066a7166df215ddd9321",
"score": "0.6774527",
"text": "def current_player\n if turn_count % 2 == 0\n \"X\"\n else\n \"O\"\n end\n end",
"title": ""
},
{
"docid": "c106f34cb02cde557f3bf50c4e334439",
"score": "0.67715263",
"text": "def current_player()\n num_moves = turn_count()\n # using ternary operator\n num_moves % 2 == 0 ? current_player = \"X\" : current_player = \"O\"\n current_player\n end",
"title": ""
},
{
"docid": "292e6be5f7da25eea4343a095827fa8d",
"score": "0.67661434",
"text": "def current_player\n if turn_count % 2 == 0\n return \"X\"\n end\n \"O\"\n end",
"title": ""
},
{
"docid": "238f31ededfc45db0c2cc2819a15399e",
"score": "0.6746555",
"text": "def current_player\n if turn_count % 2 == 0\n \"X\"\n else\n \"O\"\n end\n end",
"title": ""
},
{
"docid": "8e76aa8d789c406cb3e498511b141b47",
"score": "0.67407334",
"text": "def current_player ## comes with readme\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "3c92080186afd9194ca9592b69ea802a",
"score": "0.6732206",
"text": "def current_player\n player_x = \"X\"\n player_o = \"O\"\n if @board.count(\"X\")==@board.count(\"O\")\n return player_x\n else \n return player_o\n end \n end",
"title": ""
},
{
"docid": "21aa51080c554f67e6790d447db957cd",
"score": "0.6730964",
"text": "def current_player(board)\r\n\r\n num_turns = turn_count(board)\r\n if num_turns % 2 == 0\r\n player = \"X\"\r\n else\r\n player = \"O\"\r\n end\r\n return player\r\nend",
"title": ""
},
{
"docid": "0f23468cd396f0666ef1180e56ff7009",
"score": "0.67303556",
"text": "def current_player\n (turn % 2 == 0) ? 'X' : 'O'\n end",
"title": ""
},
{
"docid": "54ebf8778e209cc4f0655e6679128ba2",
"score": "0.6691631",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "54ebf8778e209cc4f0655e6679128ba2",
"score": "0.6690736",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "54ebf8778e209cc4f0655e6679128ba2",
"score": "0.6690736",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "54ebf8778e209cc4f0655e6679128ba2",
"score": "0.6690736",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "54ebf8778e209cc4f0655e6679128ba2",
"score": "0.6690736",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "54ebf8778e209cc4f0655e6679128ba2",
"score": "0.6690736",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "54ebf8778e209cc4f0655e6679128ba2",
"score": "0.6690736",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "54ebf8778e209cc4f0655e6679128ba2",
"score": "0.6690736",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "54ebf8778e209cc4f0655e6679128ba2",
"score": "0.6690736",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "df1e42054041e9d20b223272d8b86433",
"score": "0.66897154",
"text": "def current_player\r\n turn_count % 2 == 0 ? \"X\" : \"O\"\r\n end",
"title": ""
},
{
"docid": "df1e42054041e9d20b223272d8b86433",
"score": "0.66897154",
"text": "def current_player\r\n turn_count % 2 == 0 ? \"X\" : \"O\"\r\n end",
"title": ""
},
{
"docid": "62911f43e9e93e9c0a7733e51166da84",
"score": "0.66893196",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n current_player = \"X\"\n else\n current_player = \"O\"\n end\n return current_player\nend",
"title": ""
},
{
"docid": "62911f43e9e93e9c0a7733e51166da84",
"score": "0.66893196",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n current_player = \"X\"\n else\n current_player = \"O\"\n end\n return current_player\nend",
"title": ""
},
{
"docid": "8fa128db68e815aa183ec9b78814f7b6",
"score": "0.6681243",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\n end",
"title": ""
},
{
"docid": "c5efd6c5e8a553d381c030da4ef31fe1",
"score": "0.6677044",
"text": "def current_player\n self.turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "31e0e7c63347cb64f8765641111f88da",
"score": "0.66678995",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n \"X\"\n else\n \"O\"\n end\n end",
"title": ""
},
{
"docid": "1f2cbd5ccc73b3761127c7c5c78c07c6",
"score": "0.66655594",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0 || turn_count(board) == 0 \n return \"X\"\n else\n return \"O\"\n end\n end",
"title": ""
},
{
"docid": "2401c16ff16c7c7e3a9178eed815c41b",
"score": "0.6658304",
"text": "def current_player\n t_count = turn_count\n t_count == 0 || t_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "d032e308c1ab91c0390961b47b8273db",
"score": "0.6655667",
"text": "def current_player\n player = \"\"\n if turn_count % 2 == 0\n player= \"X\"\n else\n player = \"O\"\n end\n player\n end",
"title": ""
},
{
"docid": "1f89c40c8cdd36be3879654e2f4f300e",
"score": "0.6655168",
"text": "def current_player\n count = turn_count\n player = count.even? ? \"X\" : \"O\"\n return player\n end",
"title": ""
},
{
"docid": "62f102ae01e68568c17770761e816a98",
"score": "0.66548145",
"text": "def turn(board)\n puts \"Please enter 1-9:\"\n location = gets.strip\n if valid_move?(board, location)\n token = current_player(board) #This was not clear in the instructions on how to get the correct token\n move(board, location, token)\n else\n turn(board)\n end\n display_board(board)\nend",
"title": ""
},
{
"docid": "44e9e8264f5b71a58d6d97d23517c750",
"score": "0.6648532",
"text": "def current_player\r\n (turn_count % 2 == 0)? \"X\" : \"O\"\r\nend",
"title": ""
},
{
"docid": "4c3185de92c84180df5d3d8de1c5b3ed",
"score": "0.6647635",
"text": "def current_player()\n next_turn = turn_count()\n if next_turn % 2 == 0 \n return 'X'\n else \n return 'O'\n end\nend",
"title": ""
},
{
"docid": "027830ee9a0944f6a6a60120e5b27ea5",
"score": "0.66367406",
"text": "def current_player\n player = turn_count.even? ? \"X\" : \"O\"\n return player\n end",
"title": ""
},
{
"docid": "7b402de860df5a1083b9211747fd5cb6",
"score": "0.6633283",
"text": "def current_player\n turn_count.even? ? \"X\" : turn_count.odd? ? \"O\" : \"X\"\n end",
"title": ""
},
{
"docid": "a9a3c144e34cc63498a66e5cbd3e6102",
"score": "0.66246474",
"text": "def current_player( board )\n if turn_count( board ) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "9bf2ab6802a213ba141996f32e5bab13",
"score": "0.6624137",
"text": "def current_player(board)\n if turn_count(board)%2 == 0\n current_player = \"X\"\n else\n current_player = \"O\"\n end\n return current_player\nend",
"title": ""
},
{
"docid": "0945ea8789f65b66b15351f94e4deb44",
"score": "0.6615287",
"text": "def current_player\n if turn_count%2 == 0\n current_player = \"X\"\n else\n current_player = \"O\"\n end\n return current_player\nend",
"title": ""
},
{
"docid": "865be142b56be86c826d693b746d2e22",
"score": "0.66119224",
"text": "def current_player\n counter = 0\n board.cells.each do | occ_pos |\n if occ_pos == \"X\" || occ_pos ==\"O\"\n counter+=1\n end\n end\n counter\n if counter % 2 == 0\n player_1 # these were defined in the init method with the values player_1 == X and player_2 == O\n else\n player_2\n end\n end",
"title": ""
},
{
"docid": "1784968dd67b454b399407dd773cc540",
"score": "0.65893495",
"text": "def current_player\n turnnumber = turn_count\n turnnumber.even? ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "9c9511383dcec5502afadebe0891c0ca",
"score": "0.6584565",
"text": "def current_player(board)\n turn = turn_count(board)\n if turn % 2 == 0\n return \"X\"\n else\n return \"O\"\n end \nend",
"title": ""
},
{
"docid": "2ce7a2cd2539f3aff3881b4b5e014dab",
"score": "0.65823215",
"text": "def current_player(board)\n turn = turn_count(board)\n if turn % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "0c8cd60e1020dff55fededef85965d1f",
"score": "0.657733",
"text": "def current_player(board)\n turns_taken = turn_count(board)\n\n if turns_taken % 2 == 0\n \"X\"\n else\n \"O\"\n end\nend",
"title": ""
},
{
"docid": "6fa3fdd8f6f9e3ce32352969ec734074",
"score": "0.6574259",
"text": "def current_player(board)\n turn = turn_count(board)\n if turn%2 == 0\n return \"X\"\n else\n return 'O'\n end\nend",
"title": ""
},
{
"docid": "b7538e8f4e69b44b72315de308cb79ee",
"score": "0.657127",
"text": "def current_player(board)\n turns = turn_count(board)\n return turns % 2 == 0 ? 'X' : 'O'\nend",
"title": ""
},
{
"docid": "67aedbfa7381d0d241decc4dddec6f4c",
"score": "0.6568748",
"text": "def current_player(board)\n if turn_count(board)%2 ==0\n current_player = \"X\"\n else\n current_player = \"O\"\nend\nreturn current_player\nend",
"title": ""
},
{
"docid": "e5842b0527241896eeceaa700cd486e0",
"score": "0.65653515",
"text": "def current_player(board)\n if (turn_count(board) % 2 == 0)\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "811add828db4bbfa10f5099586c6c24c",
"score": "0.65349704",
"text": "def current_player(board)\n board_count = turn_count(board)\n if board_count % 2 == 0\n player = \"X\"\n else\n player = \"O\"\n end\nend",
"title": ""
},
{
"docid": "c99fb101c03554dde7684689e59ca5eb",
"score": "0.6532186",
"text": "def current_player(board)\n turns = turn_count(board) % 2\n if turns == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "d5e5a50a69ce9accd33848a1ebf9312e",
"score": "0.65317374",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "0e20aa0b1f104023c27ade261fdb05bf",
"score": "0.6529667",
"text": "def current_player(board)\n (turn_count(board) % 2 == 0)? \"X\" : \"O\"\nend",
"title": ""
},
{
"docid": "6d7323e91e75cc852b236a98e3186cfe",
"score": "0.65287995",
"text": "def current_player\n\n turn_count % 2 == 0 ? \"X\" : \"O\"\n\n end",
"title": ""
},
{
"docid": "884f3e96c46a7f8e073296c25b338c7e",
"score": "0.65265363",
"text": "def current_player(board)\n turn_count(board) % 2 == 0? \"X\" : \"O\"\nend",
"title": ""
},
{
"docid": "8f98d7a2418db36faaa6a55e09d80e14",
"score": "0.65181816",
"text": "def current_player(board)\n\tturn_count(board) % 2 == 0 ? \"X\" : \"O\"\nend",
"title": ""
},
{
"docid": "0d7ed32e8b548663de4fb5509a3737eb",
"score": "0.65151876",
"text": "def current_player\n # BASED ON THE #turn_count METHOD, ASSUMING \"X\" GOES FIRST, DETERMINE WHOSE TURN IT IS\n # to use binding.pry, type in \"learn\" in the terminal and it will come up. Type in \"board\" for example\n if turn_count.even?\n \"X\"\n else\n \"O\"\n end\n end",
"title": ""
},
{
"docid": "d6209623280ec361b4ab219690f0bf49",
"score": "0.6512897",
"text": "def current_player\n j = turn_count\n if j % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "a094839c8baa5cf0694810182612d17d",
"score": "0.6512344",
"text": "def player_move\n pm = get_player_move.to_sym\n \n if spot_taken? pm\n player_move\n else\n @board[pm] = player_symbol\n @whose_turn = :computer\n pm\n end\n end",
"title": ""
},
{
"docid": "1a72640d46224ab940d04abb20ac3773",
"score": "0.65098816",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else \n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "b4ab47710f5dcbc290870ede6895d4d1",
"score": "0.65045524",
"text": "def move(board)\n\n player_occupied_cells = []\n board.cells.each_with_index do |cell, i|\n if cell == get_player_token\n player_occupied_cells << i\n end\n end\n\n # if player goes first and goes in a corner, play the center space\n if board.turn_count == 1 && !board.cells.include?(self.token) && !board.taken?(5)\n return \"5\"\n\n # on turn 3, if player has 2 tokens in corners, play an edge\n elsif board.turn_count == 3 && board.cells.count(self.token) == 1 && CORNERS.include?(player_occupied_cells[0]) && CORNERS.include?(player_occupied_cells[1])\n return \"2\"\n\n # otherwise, check if we can win or are in danger of losing\n elsif check_win_lose_combos(board) != nil\n return check_win_lose_combos(board).to_s\n\n # if not in danger of losing or able to win at the moment check -\n # does the list of empty positions contain any corner spaces? if so, return the first one\n elsif find_empty_positions(board).detect {|position| [1, 3, 7, 9].include?(position)} != nil\n return find_empty_positions(board).detect {|position| [1, 3, 7, 9].include?(position)}.to_s\n\n # if there are no empty corners, return the first empty space on the board\n else\n return find_empty_positions[0].to_s\n end\n end",
"title": ""
},
{
"docid": "50ba097e9dc75b6475c5fcc9c26e6b12",
"score": "0.6502115",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\nelse\n return \"O\"\nend\nend",
"title": ""
},
{
"docid": "46a661f4028790642575c87a10ddc5d5",
"score": "0.6499736",
"text": "def next_player\n @current_player = if @current_player == 'X'\n 'O'\n else\n 'X'\n end\n end",
"title": ""
},
{
"docid": "d877daa5f540e306655684b1ed383b0d",
"score": "0.64989614",
"text": "def current_player(board)\n player = \"\"\n if turn_count(board) % 2 == 0\n player= \"X\"\n else\n player = \"O\"\n end\n player\nend",
"title": ""
},
{
"docid": "6a7980785b3bebcdb9ac81e4ac5ac916",
"score": "0.6498891",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0 \n return \"X\"\n else \n return \"O\"\n end \nend",
"title": ""
},
{
"docid": "cebd4d4d40a7fd6f52840bcf8d73a990",
"score": "0.64950955",
"text": "def current_player(board)\n turn_count(board)%2==0? \"X\":\"O\"\nend",
"title": ""
},
{
"docid": "f50abb4ad522068f6939e4bcc44673d6",
"score": "0.6493638",
"text": "def current_player(board)\n turns_played = turn_count(board)\n if turns_played % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "f50abb4ad522068f6939e4bcc44673d6",
"score": "0.6493638",
"text": "def current_player(board)\n turns_played = turn_count(board)\n if turns_played % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "0d111125c3eed0dedee79399971bafe6",
"score": "0.6491919",
"text": "def current_player\n turn_count % 2 == 0 ? \"X\" : \"O\"\n end",
"title": ""
},
{
"docid": "2e6a455f757e15f0e7d795deb3a75226",
"score": "0.64890164",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0 \n return \"X\"\n else \n return \"O\"\nend \nend",
"title": ""
},
{
"docid": "b1fd04f0bb1f072972ad494992f0c803",
"score": "0.6475601",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n elsif turn_count(board) % 2 != 0\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "beab56efec56978eeed6613ade81dbb0",
"score": "0.6471423",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n \"X\"\n elsif turn_count(board) % 2 == 1\n \"O\"\n end\nend",
"title": ""
},
{
"docid": "61e3af41a1e61a4e27df2cb66602515a",
"score": "0.64696544",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend",
"title": ""
},
{
"docid": "67f0f1f8eb1ddbba10f660fe105aadf0",
"score": "0.6467465",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n \"X\"\n else\n \"O\"\n end\nend",
"title": ""
},
{
"docid": "c6ca44f9e565abc27d246606a84ecdc6",
"score": "0.64656687",
"text": "def current_player\n if turn_count.even? == true\n return \"X\"\n elsif turn_count.odd? == true\n return \"O\"\n end\n end",
"title": ""
},
{
"docid": "d25f74cf442bb8cbb9c094ec07386a16",
"score": "0.6461698",
"text": "def current_player(board)\r\n if turn_count(board)%2 ==0 #modulo (%) operator \r\n current_player = \"X\"\r\n else\r\n current_player = \"O\"\r\nend\r\nreturn current_player\r\nend",
"title": ""
},
{
"docid": "1aad706240fcb5ce3fffb4f332260902",
"score": "0.64611316",
"text": "def current_player(board)\n turn_counter_2 = turn_count(board)\n turn_counter_2 % 2 == 0 ? current_player = \"X\" : current_player = \"O\"\nend",
"title": ""
},
{
"docid": "f1bede5054d6bbe685e49b5b8effd02d",
"score": "0.645651",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n \"X\"\n else\n \"O\"\n end\nend",
"title": ""
},
{
"docid": "f1bede5054d6bbe685e49b5b8effd02d",
"score": "0.645651",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n \"X\"\n else\n \"O\"\n end\nend",
"title": ""
},
{
"docid": "f1bede5054d6bbe685e49b5b8effd02d",
"score": "0.645651",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n \"X\"\n else\n \"O\"\n end\nend",
"title": ""
},
{
"docid": "15dd63c27d5de25a46a42194c95cb706",
"score": "0.6456405",
"text": "def does_player_have_position?(index, token)\n @board.spaces[index] == token\n end",
"title": ""
},
{
"docid": "02e2ef9b4c736e0cf3601abd440d77e3",
"score": "0.64526945",
"text": "def winner\n if board.turn_count.odd? \n winner = \"X\" # The player with the \"X\" token has won the game\n else\n winner = \"O\" # The player with the \"O\" token has won the game\n end\n\tend",
"title": ""
}
] |
dde3db0cf89a365e966d7f17425b8c1a
|
FizzBuzz Define a method called fizzbuzz with parameters called num_1, num_2, and range.
|
[
{
"docid": "b5f36db1ff1b2cef3acdb2886b1b941b",
"score": "0.7438379",
"text": "def fizzbuzz(num_1, num_2, range)\n#Create a for loop for a variable named i from 1 to range variable.\n (1..range).each do |i|\n#Write a conditional statement to see if 0 can be the remainder of the division of i/num_1 AND ALSO i/num_2\n if i % num_1 === 0 && i % num_2 === 0\n#Print fizzbuzz if the above is true\n puts 'fizzbuzz'\n#Continue conditional statement to see if 0 can be the remainder of the division of i/num_1\n elsif i % num_1 === 0\n#Print fizz to terminal if above is true\n puts 'fizz'\n#Continue conditional statement to see if 0 can be the remainder of the division of i/num_2\n elsif i % num_2 === 0\n#Print buzz to terminal if above is true\n puts 'buzz'\n#Continue conditional statement providing all statements have fail thus far.\n else\n#If all the above conditionals are not true, print the value of i\n puts i\n#End if-statement\n end\n#End for loop\n end\n#End define method\nend",
"title": ""
}
] |
[
{
"docid": "eb2b55d4ca56cdbd55bbedfb0ffb1f5a",
"score": "0.8039163",
"text": "def fizzbuzz(num)\n \nend",
"title": ""
},
{
"docid": "eb2b55d4ca56cdbd55bbedfb0ffb1f5a",
"score": "0.8039163",
"text": "def fizzbuzz(num)\n \nend",
"title": ""
},
{
"docid": "9784d9ad1ce7ba02ac9cfb6eedd6b65f",
"score": "0.80358577",
"text": "def fizzbuzz(num)\n\nend",
"title": ""
},
{
"docid": "09a2d4e486ad5d71eaa4440c61140d76",
"score": "0.7947195",
"text": "def fizzbuzz(num_1, num_2, range) #This line starts defining a method called fizzbuzz and in parenthesis has num_1, num_2, and range as parameters\n (1..range).each do |i| #This line is telling you that from any number 1 to range(what will be passed when invoking the method) - for each number greater than or including 1, do the following lines to them. For example, if the range is 100, it will take every number between 1 and 100 and do the following:\n if i % num_1 === 0 && i % num_2 === 0 #If i divided by num_1 (number you get when invoking method) = 0 and i divided by num_2 (number you get by invoking method) = 0, THEN --both of these must be true for the next line to work\n puts 'fizzbuzz' #if both statements above are true, it will print fizzbuzz to the terminal\n elsif i % num_1 === 0 #if the above statement was not correct, then it will try this line. This line states that if i divided by num_1 is equal to 0, then this line will be true\n puts 'fizz' #if above line is true, it will print fizz to the terminal\n elsif i % num_2 === 0 #if neither of the above conditions are met, it will try this line. This line states that if i divided by num 2 = 0, then it is true\n puts 'buzz' #if above line is true, it will print buzz to the terminal\n else #if all above conditions are not met, it will treat make this condition work\n puts i #will print the number\n end #ends the if then\n end #end the .each method\nend",
"title": ""
},
{
"docid": "fbd6268f1a2ee9863e579f98dfcdd5bc",
"score": "0.7927327",
"text": "def fizzbuzz(num_1, num_2, range) # declaring the METHOD \"fizzbuzz\" with 3 set arguments\n (1..range).each do |i| # FOR LOOP that is running a loop for all values between 1 and the assigned range and running each number\n if i % num_1 === 0 && i % num_2 === 0 # IF the results of the current value divided by num_1 is a INTEGER (no decimals) and if the current value divided by num_2 is an INTEGER\n puts 'fizzbuzz' # print \"fizzbuzz\"\n elsif i % num_1 === 0 # ELSE IF the results of the current value divided by num_1 is a INTEGER\n puts 'fizz' # print \"fizz\"\n elsif i % num_2 === 0 # ELSE IF the results of the current value divided by num_2 is a INTEGER\n puts 'buzz' # print \"buzz\"\n else # ELSE\n puts i # print current value\n end # END of IF STATEMENTS\n end # END of FOR LOOP\nend",
"title": ""
},
{
"docid": "d780e316c1ba964ad79991f3e0c9c1a6",
"score": "0.7916304",
"text": "def fizzbuzz(num_1, num_2, range) # define fizzbuzz object with these values\n (1..range).each do |i| # telling the method to do this for each within the provided range\n if i % num_1 === 0 && i % num_2 === 0 # if statment that if i divided by num_1 returns remainder of zero and i divided by num_2 returns remainder of zero then\n puts 'fizzbuzz' # prints fizzbuzz to the terminal\n elsif i % num_1 === 0 # else if statment i divided by 1 with a remainder of zero equals 0\n puts 'fizz' # prints fizz to the terminal\n elsif i % num_2 === 0 # else if statement that if i divided by num_2 with a remainder of 0 then\n puts 'buzz' # prints buzz to the terminal\n else # else statemnt\n puts i # prints value i to the terminal\n end # end if statements\n end # end range each do method\nend",
"title": ""
},
{
"docid": "a384d749d172c39d18ebeaaed48b2efe",
"score": "0.7877482",
"text": "def fizzbuzz(start_num, end_num)\n (start_num..end_num).each do |num|\n \n end\nend",
"title": ""
},
{
"docid": "bf68e93631bbd52bf05fc8e0150e4d57",
"score": "0.7832615",
"text": "def fizz_buzz number\n\nend",
"title": ""
},
{
"docid": "7a5f4ec82b40b6e0412ac57791ffc5e0",
"score": "0.78209865",
"text": "def fizz_buzz number \nend",
"title": ""
},
{
"docid": "7a5f4ec82b40b6e0412ac57791ffc5e0",
"score": "0.78209865",
"text": "def fizz_buzz number \nend",
"title": ""
},
{
"docid": "7a5f4ec82b40b6e0412ac57791ffc5e0",
"score": "0.78209865",
"text": "def fizz_buzz number \nend",
"title": ""
},
{
"docid": "c30f5f8e740e784cc5f093391507b8f7",
"score": "0.7817919",
"text": "def fizzbuzz(first_num, second_num)\n (first_num..second_num).each do |number|\n puts fizz_or_buzz(number)\n end\nend",
"title": ""
},
{
"docid": "4845fc425c5a4ddfbaa4ea999c818462",
"score": "0.7792829",
"text": "def fizzbuzz(num_1, num_2, range)\n# include if/else statements\n# write code so that applies to all arguments with a range of 1 - 'choose a number'\n (1..range).each do |i|\n# print fizzbuzz if the remainder of num_1 is equal 0 and the remainder of num_2 is equal to 0\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# print fizz if the remainder of num_1 is equal 0\n elsif i % num_1 === 0\n puts 'fizz'\n# print buzz if the remainder of num_2 is equal 0\n elsif i % num_2 === 0\n puts 'buzz'\n# print the range if anything else\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "bfa6f9f3803d24f1c8d9ad55601fe5b5",
"score": "0.7714767",
"text": "def fizz_buzz(n)\n\nend",
"title": ""
},
{
"docid": "2d185ae34657f64ed610c8b9d6e91b8b",
"score": "0.77076936",
"text": "def fizzbuzz(num_1, num_2, range)\n# Generates range with a starting point of 1 for each argument\n (1..range).each do |i|\n# Conditional statement to iterate through arguments\n if i % num_1 === 0 && i % num_2 === 0\n# Output if condition is true\n# Prints string 'fizzbuzz'\n puts 'fizzbuzz'\n# Conditional statement if above condition is false\n elsif i % num_1 === 0\n# Output if condition is true\n# Prints string 'fizz'\n puts 'fizz'\n# Conditional statement if above condition is false\n elsif i % num_2 === 0\n# Output if condition is true\n# Prints string 'buzz'\n puts 'buzz'\n# Default condition statement result if all above conditions are false\n else\n# Prints number\n puts i\n# Marks end of first argument iteration\n end\n# Marks end of second argument iteration\n end\n# Marks end of third argument iteration and code block\nend",
"title": ""
},
{
"docid": "7af104e89c03f5bf8f80ed63bffadd6b",
"score": "0.76833946",
"text": "def fizzbuzz(start_num, end_num)\n\trun_times = end_num - start_num + 1\n\ti = start_num\n\trun_times.times do\n\t\tif i%3 == 0 && i%5 == 0\n\t\t\tputs \"FizzBuzz\"\n\t\telsif i%3 == 0\n\t\t\tputs \"Fizz\"\n\t\telsif i%5 == 0\n\t\t\tputs \"Buzz\"\n\t\telse\n\t\t\tputs i\n\t\tend\t\n\t\ti += 1\n\tend\t\nend",
"title": ""
},
{
"docid": "7f157c62c92cd37d4816e20de0eae480",
"score": "0.7674744",
"text": "def fizzbuzz(num_1, num_2, range)\n# Looping the method with each\n (1..range).each do |i|\n# #if i is divisible by number 1 and i is divisible by number 2\n if i % num_1 === 0 && i % num_2 === 0\n# print the method fizzbuzz\n puts 'fizzbuzz'\n# Using elsif conditional to see if i modulo of argument num_1 is equal to 0\n elsif i % num_1 === 0\n# print method fizz\n puts 'fizz'\n# Using elsif conditional to see if i modulo of argument num_2 is equal to 0\n elsif i % num_2 === 0\n# print method buzz\n puts 'buzz'\n else\n# print i\n puts i\n\n# end the method\n end\n# end the method\n end\n# end the method fizzbuzz\nend",
"title": ""
},
{
"docid": "739b2f214e3e5786245d7bd651b6e320",
"score": "0.7673406",
"text": "def fizzbuzz(n)\n # TODO\nend",
"title": ""
},
{
"docid": "c0cc4774100f765e943ce6b84620ddbb",
"score": "0.76680374",
"text": "def fizzbuzz(num_1, num_2, range) #Method fizzbuzz taking in 3 parameters\n (1..range).each do |i| #From one to value of parameter range, with counter\n if i % num_1 === 0 && i % num_2 === 0 # If counter is evenly divisble into both parameter values output fizzbuzz to console\n puts 'fizzbuzz'\n elsif i % num_1 === 0 # If counter is evenly divisble into first paramter value output fizz to console\n puts 'fizz'\n elsif i % num_2 === 0 # If counter is evenly divisble into second paramter value output buzz to console\n puts 'buzz'\n else #If counter is not evenly divisble into either value, output counter value to console\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "b9c56499287ac4febc45aeee8e74fb2f",
"score": "0.7666322",
"text": "def fizzbuzz(num_1, num_2, range)\n# begin loop which will repeat a number of times equal to the 3rd argument\n# assign the value of the current iteration to the variable 'i'\n (1..range).each do |i|\n# create conditional such that if the value of 'i' is evenly divisible\n# by both argument 1 & 2 then puts string \"fizzbuzz\"; if not, procede to next elsif statement\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# create secondary conditional statement such that if \"i\" is evenly divisible\n# by the value of the first argument puts string 'fizz'; if not, continue to next elsif statement\n elsif i % num_1 === 0\n puts 'fizz'\n# create secondary conditional statement such that if 'i' is evenly divisible\n# by the value of the second argument puts the string 'buzz'; if not, continue to the else statement\n elsif i % num_2 === 0\n puts 'buzz'\n# create final conditional statement which puts the value of i if no preceding condtions are met\n else\n puts i\n# end conditional evaluation\n end\n# end loop iteration\n end\n# end fizzbuzz method\nend",
"title": ""
},
{
"docid": "321bcc19cffe5cc610cdc5d08798e610",
"score": "0.765943",
"text": "def fizzbuzz(num_1, num_2, range) # Creaated a new method with 3 parameters\n (1..range).each do |i|\n if i % num_1 === 0 && i % num_2 === 0 # An if statement with conditionals\n puts 'fizzbuzz'\n elsif i % num_1 === 0\n puts 'fizz'\n elsif i % num_2 === 0\n puts 'buzz'\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "74615f617103ed21284780c0360ad5a1",
"score": "0.7638543",
"text": "def fizzbuzz(n)\n\nend",
"title": ""
},
{
"docid": "74615f617103ed21284780c0360ad5a1",
"score": "0.7638543",
"text": "def fizzbuzz(n)\n\nend",
"title": ""
},
{
"docid": "74615f617103ed21284780c0360ad5a1",
"score": "0.7638543",
"text": "def fizzbuzz(n)\n\nend",
"title": ""
},
{
"docid": "6e6cced83fb512067713d3cf45659edc",
"score": "0.7631035",
"text": "def fizzbuzz(num_1, num_2, range)\n # Creates a range from 1 to the argument passed in as range\n # Iterates through each number in that range\n (1..range).each do |i|\n # in each iteration if the number is divisible by num_1 with no remainder (modulo 0)\n # and the same is true for the num_2 argument, puts 'fizzbuzz'\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # If that is not the case, then if the number is divisible by num_1 with no\n # remainder (modulo 0) puts 'fizz'\n elsif i % num_1 === 0\n puts 'fizz'\n # If neither the first nor the second conditions are true, then if the number\n # is divisible by num_2 with no remainder (modulo 0) puts 'buzz'\n elsif i % num_2 === 0\n puts 'buzz'\n # If none of the first, second or third conditions are true, then\n # puts the number\n else\n puts i\n end\n # iterate through to the next item in range\n end\n # when all items in the range have been completed, the loop ends \nend",
"title": ""
},
{
"docid": "240b5406687922c44acfe7dd19231fc1",
"score": "0.7629168",
"text": "def fizzbuzz(num_1, num_2, range) #Defines method name as \"fizzbuzz\" with parameters of \"num_1\", \"num_2\", and \"range\"\n (1..range).each do |i| #Creates a for loop where local variable \"i\" is set to a non zero integer value ranging from 1 to an integer defined in the \"range\" variable.\n if i % num_1 === 0 && i % num_2 === 0 #Runs if the remainder of variable \"i\" divided by parameter \"num_1\" equals 0 AND the remainder of variable \"i\" divided by parameter \"num_2\" equals 0\n puts 'fizzbuzz' #Prints \"fizzbuzz\" string if conditions above are met.\n elsif i % num_1 === 0 #Runs if the previous condition is not met and if the remainder of \"i\" divided by parameter \"num_1\" equals 0.\n puts 'fizz' #Prints \"fizz\" string if conditions above are met.\n elsif i % num_2 === 0 #Runs if the previous conditions are not met and if the remainder of \"i\" divided by parameter \"num_2\" equals 0.\n puts 'buzz' #Prints \"buzz\" string if conditions above are met.\n else #Runs if none of the previous conditions are met.\n puts i #Prints the integer value of \"i\" if the conditions above are met.\n end #Completes if conditional\n end #Completes for loop\nend",
"title": ""
},
{
"docid": "bea1faa8d00244c766dfb18fd043f3b4",
"score": "0.761585",
"text": "def fizzbuzz(num_1, num_2, range)\n #Creates new function fizzbuzz that accepts three arguments\n (1..range).each do |i|\n #Interpolates each value through the given range\n if i % num_1 === 0 && i % num_2 === 0\n #sets conditional statement looking to see if the modulo of i/num_1 AND the modulo of i/num_2 both equal zero\n puts 'fizzbuzz'\n #if above conditional is true puts fizzbuzz string\n elsif i % num_1 === 0\n #sets new conditional to check if modulo of i/num_1 is equal to zero\n puts 'fizz'\n #If above conditional is true puts fizz string\n elsif i % num_2 === 0\n #If above two conditionals mark false, this conditional checks to see if modulo i/num_2 is equal to zero\n puts 'buzz'\n #If above conditional is true puts buzz string\n else\n #Checks to see if no conditionals are true\n puts i\n #If above copnditional is true, puts i value\n end\n #ends conditional\n end\n #ends range declaraction\nend",
"title": ""
},
{
"docid": "8dbdf451b228f20f4e5a822c1e7dc9be",
"score": "0.760453",
"text": "def fizzbuzz(num_1, num_2, range) # defines a new function called fizzbuzz, which takes 3 arguments\n (1..range).each do |i| # executes the following block of code for each number from 1 to range\n if i % num_1 === 0 && i % num_2 === 0 # if i is divisible by num_1 AND i is dividible by num_2...\n puts 'fizzbuzz' # puts fizzbuzz\n elsif i % num_1 === 0 # if i is only divisible by num_1...\n puts 'fizz' # puts fizz\n elsif i % num_2 === 0 # if i is only divisible by num_2...\n puts 'buzz' # puts buzz\n else # if i is not divisible by num_1 or num_2...\n puts i # puts i\n end # ends the if-statement\n end # ends the for loop\nend",
"title": ""
},
{
"docid": "241fbd342076915bb0e73ebc3b066d40",
"score": "0.7586465",
"text": "def fizzbuzz(num_1, num_2, range)\n#uses range operator with start of 1 and the ending of the range attribute to do it from 1 to \"range\" times\n (1..range).each do |i|\n#start if else statement with loop index value modulo by num_1 is equal to 0 AND the loop index modulo by num_2 equals 0\n if i % num_1 === 0 && i % num_2 === 0\n#if the above is true then puts fizzbuzz\n puts 'fizzbuzz'\n#if the above statment isnt true move to this new statment: if loop index value modulo by num_1 equals zero\n elsif i % num_1 === 0\n# if above statment is true then puts fizz\n puts 'fizz'\n#if above statment isnt true move to this new statment: if loop index value module by num_2 is 0\n elsif i % num_2 === 0\n#if above statment is true then puts buzz\n puts 'buzz'\n#if all statements above are not true move here\n else\n#if above statement is true then puts loop index value\n puts i\n#ends if else statement\n end\n# ends the loop\n end\n# ends the method for fizzbuzz\nend",
"title": ""
},
{
"docid": "6f817027711bd1904ef82c3db076fd32",
"score": "0.75772613",
"text": "def fizzbuzz(num_1, num_2, range)\n# using the range function and the loop function, the method fizzbuzz will evaluate each number\n# starting with '1' and continuing until the given integer. Setting 'i' as the argument\n (1..range).each do |i|\n# starting an if...else statement if the evauluated number modulo of argument num_1\n# AND num_2 is equal to 0 then put 'fizzbuzz'\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# if the evauluated number modulo of argument num_1 is equal to 0 put 'fizz'\n elsif i % num_1 === 0\n puts 'fizz'\n# if the evauluated number modulo of argument num_2 is equal to 0 put 'buzz'\n elsif i % num_2 === 0\n puts 'buzz'\n# if none of the above statements are true put 'i' or the current number of the loop\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "3c9a0002dee8dffd30ab388cf3e7408d",
"score": "0.7566423",
"text": "def fizzbuzz(num1, num2)\n\tresults = (num1..num2).each do |num|\n\t\tif num % 3 == 0 && num % 5 == 0\n\t\t\tputs \"FizzBuzz\"\n\t\telsif num % 3 == 0\n\t\t\tputs \"Fizz\"\n\t\telsif num % 5 == 0\n\t\t\tputs \"Buzz\"\n\t\telse\n\t\t\tputs num\t\n\t\tend\n\tend\n\tresults\nend",
"title": ""
},
{
"docid": "743b5ca0aa46244976fd818d2a6039cc",
"score": "0.75643075",
"text": "def fizzbuzz(num_1, num_2, range)\n# create a method to iterate the range of integers represented by i\n (1..range).each do |i|\n# create an if statement: if i modulo num_1, is 0 part of num_1 and i is the modulo of num_2 is 0 included in num_2\n if i % num_1 === 0 && i % num_2 === 0\n# prints 'fizzbuzz'\n puts 'fizzbuzz'\n# create an elsif statement: elsif i is the modulo operator of num_1, is 0 part of num_1\n elsif i % num_1 === 0\n# prints 'fizz'\n puts 'fizz'\n# create another elsif statement: elsif i is the modulo operator of num_2 is 0 part of num_2\n elsif i % num_2 === 0\n puts 'buzz'\n# for all other possibilities, print i\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "468fa39fb84bd02371a482fbfc0f617f",
"score": "0.7560785",
"text": "def fizzbuzz(num_1, num_2, range)\n# Creating a range statement, from 1 to the #range argument and calling for each of those numbers(i) to do...\n (1..range).each do |i|\n# Starting an if statement with numbers (i) and if the module of i and num1 equals 0 AND the module of i and num2 is also equal to 0\n if i % num_1 === 0 && i % num_2 === 0\n# if the statement about is true, pring the following\n puts 'fizzbuzz'\n# If the statement from above is not true, but the module of i and num1 is equal to 0\n elsif i % num_1 === 0\n# Print the following if the elsif statement from abobe is true\n puts 'fizz'\n# If the above is false, but the module of i and num2 is equal to zero\n elsif i % num_2 === 0\n# Print the following if the above elsif statement is true\n puts 'buzz'\n# If all the statements from above are false, then perform the following\n else\n# print the following if the none of the statements above are true\n puts i\n# End if statement\n end\n# end range statement\n end\n# end method\nend",
"title": ""
},
{
"docid": "8b024f997444686304c70e66b9e97e87",
"score": "0.75084317",
"text": "def fizzbuzz(num_1, num_2, range)\n # each loop that will iterate across an array created using the starting value 1\n # an inclusive range operator and arguement input to define the range of integers in the array\n (1..range).each do |i|\n if i % num_1 === 0 && i % num_2 === 0 # if the modulo of the current iterative integer(i) and both input integers = 0,\n # the method puts fizzbuzz\n puts 'fizzbuzz'\n elsif i % num_1 === 0 # if only the modulo of i and num_1 = 0 the method puts fizz\n puts 'fizz'\n elsif i % num_2 === 0 # if only the modulo of i and num_2 = 0 the method puts buzz\n puts 'buzz'\n else # for all other input value results, the method prints the integer being iterated(i)\n puts i\n end # designated the end of the if, elsif, else methods\n end # designated the end of the each loop\nend",
"title": ""
},
{
"docid": "9449798dab7ad00dea5ef56719845800",
"score": "0.7486828",
"text": "def fizzbuzz(num_1, num_2, range)\n # do if statetment for each value between 1 and set range\n (1..range).each do |i|\n # creating a if then statement/ if the value of remainder `num_1` is 0 and the value of the remainder `num_2` is also 0 then output next line\n if i % num_1 === 0 && i % num_2 === 0\n # if output\n puts 'fizzbuzz'\n # elsif value of remainder `num_1` is 0 then output next line\n elsif i % num_1 === 0\n # elsif output\n puts 'fizz'\n # elsif value of remainder `num_2` is 0 then output next line\n elsif i % num_2 === 0\n # elsif output\n puts 'buzz'\n # else statement\n else\n # else output\n puts i\n # if then block end\n end\n # fizzbuzz method block end\n end\n # build_a_bear method block end\nend",
"title": ""
},
{
"docid": "74cc004ca664a218c3c4ecfe6be2b74c",
"score": "0.7484745",
"text": "def fizzbuzz(num_1, num_2, range)\n # start an each loop for each value in an array consisting of the numbers 1 up to and including the value of the range argument\n # assigning the next value to the variable i upon each loop iteration\n (1..range).each do |i|\n # run conditional to check if the value of the remainder of i divided by the argument num_1 AND the argument num_2\n # is equal to zero, aka i is divisable by both num_1 and num_2\n if i % num_1 === 0 && i % num_2 === 0\n # if conditional passes, print the string 'fizzbuzz' to the terminal\n puts 'fizzbuzz'\n # run conditional to check if the value of the remainder of i divided by the argument num_1\n # aka i is divisable by num_1\n elsif i % num_1 === 0\n # if conditional passes, print the string 'fizz' to the terminal\n puts 'fizz'\n # run conditional to check if the value of the remainder of i divided by the argument num_2\n # aka i is divisable by num_2\n elsif i % num_2 === 0\n # if conditional passes, print the string 'buzz' to the terminal\n puts 'buzz'\n # block to run should none of the above conditionals pass\n else\n # print the value of the variable i to the terminal\n puts i\n # declare end of if/elsif/else statement\n end\n # declare end of the each loop\n end\n# declare end of fizzbuzz method\nend",
"title": ""
},
{
"docid": "bd2ed9738467502c6403a5eb42f3eba5",
"score": "0.7481699",
"text": "def fizzbuzz(num_1, num_2, range)\n (1..range).each do |i|\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n elsif i % num_1 === 0\n puts 'fizz'\n elsif i % num_2 === 0\n puts 'buzz'\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "4ad8d424cde5de50f4bea087f5e443f3",
"score": "0.74589545",
"text": "def fizzbuzz(num_1, num_2, range)\n (1..range).each do |i| # the start of a for each loop, |i| is the placeholder used\n if i % num_1 === 0 && i % num_2 === 0 # if i is divisible by num_1 and num_2 then:\n puts 'fizzbuzz' # print to console\n elsif i % num_1 === 0 # if i is only divisible by num_1\n puts 'fizz' # print\n elsif i % num_2 === 0 # if i is only divisible by num_2\n puts 'buzz'\n else # if i isn't divisible by num_1 or num_2 then just print i to console\n puts i\n end # end of if/else\n end # end of for each loop\nend",
"title": ""
},
{
"docid": "86f6dfcaaedc01c2cf20a8c60ae3726d",
"score": "0.7456363",
"text": "def fizzbuzz(num_1, num_2, range)\n # define a block to output a range to be iterated when method is called\n (1..range).each do |i|\n # declare conditional statement using if to determine if the remainder of \"i\" divided by \"num_1\" AND also by \"num_2\" is 0\n if i % num_1 === 0 && i % num_2 === 0\n # print the following string if the if statement is true\n puts 'fizzbuzz'\n # declare conditional statment using elsif to dtermine if the remainder of \"i\" divided by \"num_1\" is 0\n elsif i % num_1 === 0\n # print the following string if the if statement is false and the elsif statement is true\n puts 'fizz'\n # decalre conditional statment using elsif to determine if the remainder of \"i\" divided by \"num_2\" is 0\n elsif i % num_2 === 0\n # print the following statement if the if and previous elsif statements are false and the curretn elsif statement is true\n puts 'buzz'\n # declare conditional statement using else\n else\n # print the current value of the \"i\" variable if all other conditional statements are false\n puts i\n # end of conditional statements\n end\n # end of block using each mthod\n end\n# end of \"fizzbuzz\" method\nend",
"title": ""
},
{
"docid": "3d5c2081340f0a7cb23e1fc960449011",
"score": "0.7436187",
"text": "def fizzbuzz(num_1, num_2, range)\n# inclusive range operator, that will iterate through each number\n (1..range).each do |i|\n# modulo operator divides left number by both num_1 and num_2 and gets a remainder\n# of 0, the i is a multiple of both, and it will return FizzBuzz\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# if the modulo operator finds a 0 remainder for the left number and num1 ONLY,\n# return 'fizz'\n elsif i % num_1 === 0\n puts 'fizz'\n# else if the modulo operator finds a 0 remainder for the left number and num2 ONLY,\n# return 'buzz'\n elsif i % num_2 === 0\n puts 'buzz'\n# else if modulo operator finds a >0 remainder for both, return i value\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "6b033975de802a8f002a9d96aaf30ed1",
"score": "0.7435517",
"text": "def fizzbuzz(num_1, num_2, range)\n # starting iteration with the range from 1 to the inputted range argument\n (1..range).each do |i|\n # start of if else statement if the number is divisible with no remainder by num_1 and it is divisible with no remainder by num_2\n if i % num_1 === 0 && i % num_2 === 0\n # if both conditions are met, print fizzbuzz\n puts 'fizzbuzz'\n # else if the number is only divisible with no remainder by num_1,\n elsif i % num_1 === 0\n #print fizz\n puts 'fizz'\n # else if the number is only divisible with no remainder by num_2,\n elsif i % num_2 === 0\n # print buzz\n puts 'buzz'\n # if the number is not divisible by either num_1 or num_2 with no remainder\n else\n # print the number\n puts i\n # denoting the end of the if statement\n end\n # denoting the end of the interpolation loop\n end\n# denoting the end of the overall method\nend",
"title": ""
},
{
"docid": "f043b8434a300514255836f4875c68e6",
"score": "0.7434314",
"text": "def fizzbuzz(num_1, num_2, range)\n # start at 1 and go to the idicated number by range, count by 1's\n (1..range).each do |i|\n # if num_1 and num_2 are both zero print fizzbuzz\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n #replace num_1 with fizz\n elsif i % num_1 === 0\n puts 'fizz'\n #replace num_2 with buzz\n elsif i % num_2 === 0\n puts 'buzz'\n else\n # anything else pring the number\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "074cb723bc22a202dd2e27600cde147a",
"score": "0.7433758",
"text": "def fizzbuzz(num_1, num_2, range)\n (1..range).each do |i| # determines how long the current index will repeat\n if i % num_1 === 0 && i % num_2 === 0 # if a number within the range is a multiple of num_1 or num_2, \"fizzbuzz\" will print\n puts 'fizzbuzz'\n elsif i % num_1 === 0 # if a number within the range is a multiple of only num_1, \"fizz\" will print\n puts 'fizz'\n elsif i % num_2 === 0 # if a number within the range is a muliple of only num_2, \"buzz\" will print\n puts 'buzz'\n else\n puts i # if a number within the range is neither a mulitple of num_1 nor num_2, then the intiger will print\n end\n end\nend",
"title": ""
},
{
"docid": "d574859489a7dece42ea5c8105b384f0",
"score": "0.74242574",
"text": "def fizzbuzz(num1, num2)\n num_range = (num1..num2).to_a\n num_range.each do |num|\n if num % 3 == 0 and num % 5 == 0\n puts \"FizzBuzz\"\n elsif num % 3 == 0\n puts \"Fizz\"\n elsif num % 5 == 0\n puts \"Buzz\"\n else\n puts num\n end\n end\nend",
"title": ""
},
{
"docid": "3b5e0d884875961444579208c51b620b",
"score": "0.74159855",
"text": "def fizzbuzz(num_1, num_2, range) #Method called fizzbuzz with 3 parameters\n (1..range).each do |i| #For loop that executes i for each number in range. Range is from 1 to argument passed through parameter range.\n if i % num_1 === 0 && i % num_2 === 0 #If statement where two conditions have to be met for code to be executed\n puts 'fizzbuzz' #String printed if conditions were met and boolean is true\n elsif i % num_1 === 0 #If condtion is met code will be executed\n puts 'fizz' #String printed if condition is met and boolean is true\n elsif i % num_2 === 0 #If condition is met code block will be executed\n puts 'buzz' #String printed if condition is met and boolean is true\n else #Will execute if any result other than the coniditions in the if/elsif statements above\n puts i #Prints i\n end #Terminate for loop\n end #Terminates if statement\nend",
"title": ""
},
{
"docid": "e857a50d578dd93d4b049ff46fa517f6",
"score": "0.7407638",
"text": "def fizzbuzz(num_1, num_2, range)\n # Invokes the for-loop method \"each\" with rnage of interger\n (1..range).each do |i|\n # varriable \"i\" against parameter \"num_1\" is the\n # same class as the interger 0\n # varriable \"i\" into the parameter \"num_2\" is the\n # same class as the interger 0\n # The logical AND operator checks if both === methods returned TRUE\n # If yes, returns TRUE. If no, returns FALSE.\n if i % num_1 === 0 && i % num_2 === 0\n # If TRUE, prints the string 'fizzbizz'\n # if the if statemnt returns FALSE = nothing.\n puts 'fizzbuzz'\n # elsif statement above returns TRUE, prints the string 'fizz'\n # if the elsif statemnt above returns FALSE, nothing.\n elsif i % num_1 === 0\n # Calculates the modulus of the \"i\" variable into the parameter num_2.\n # Evaluates if the return of the above calculation is an interger.\n puts 'fizz'\n\n elsif i % num_2 === 0\n # If no nother if/els if statement has returned TRUE, this line will run\n else\n # Prints the current value of the varribale \"i\" to the console.\n puts i\n # Ends the if/elsif/els statements\n end\n # Ends the \".each\" method invocation\n end\n # Ends the definitions of the \"fizzbuzz\" method.\n end",
"title": ""
},
{
"docid": "206f4010b3d6e7725489929ebcf47f57",
"score": "0.7402139",
"text": "def fizzbuzz(num1, num2)\n results = []\n num1.upto(num2) do |num|\n if num % 3 == 0 && num % 5 == 0\n results << 'FizzBuzz'\n elsif num % 3 == 0\n results << 'Fizz'\n elsif num % 5 == 0\n results << 'Buzz'\n else\n results << num\n end\n end\n results\nend",
"title": ""
},
{
"docid": "36e22eb6f44f1e8be82c050ca03b7493",
"score": "0.73908794",
"text": "def fizzbuzz(num_1, num_2, range)\n (1..range).each do |i|\n# if/else arguments that are take happy/sad path based on the numbers given\n if i % num_1 === 0 && i % num_2 === 0\n# outputs 'fizzbuzz' is the num_1 returns the remainder to 0\n puts 'fizzbuzz'\n# outputs 'fizzbuzz' is the num_1 returns the remainder to 0\n elsif i % num_1 === 0\n puts 'fizz'\n# outputs 'fizzbuzz' is the num_1 returns the remainder to 0\n elsif i % num_2 === 0\n puts 'buzz'\n#outputs i if none of the other paths are taken\n else\n puts i\n end\n end\n#end of input\nend",
"title": ""
},
{
"docid": "ca71d2794a526582370cff7ff2e92e5f",
"score": "0.73877543",
"text": "def fizzbuzz(num1, num2)\n result = []\n (num1..num2).to_a.each do |num|\n if num % 3 == 0 && num % 5 == 0\n result << \"FizzBuzz\"\n elsif num % 3 == 0\n result << \"Fizz\"\n elsif num % 5 == 0\n result << \"Buzz\"\n else\n result << num\n end\n end\n result\nend",
"title": ""
},
{
"docid": "66f02a00b268b83ac063ada0adbce228",
"score": "0.7385934",
"text": "def fizzbuzz(num_1, num_2, range)\n # iterating over the range beginning with position 1\n (1..range).each do |i|\n # if i divided by num_1 is equal to zero and if i divided by num_2 is also equal to zero put fizzbuzz\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # if i divided by num_1 is equal to zero put fizz\n elsif i % num_1 === 0\n puts 'fizz'\n # if i divided by num_2 is equal to zero put buzz\n elsif i % num_2 === 0\n puts 'buzz'\n # if none of the criteria above met then put the iterate value\n else\n puts i\n # end if/elsif condition\n end\n # end of method definition\n end\n # end code block\nend",
"title": ""
},
{
"docid": "6ee010ed86795e57f4bb047737e99421",
"score": "0.73785496",
"text": "def fizzbuzz(num_1, num_2, range)\n # Iterate through an array with integer values from 1 to range\n # For each integer, i\n (1..range).each do |i|\n # If the moduli of i over num_1 and i over num_2 both equal zero\n if i % num_1 === 0 && i % num_2 === 0\n # print 'fizzbuzz' to the terminal\n puts 'fizzbuzz'\n # Otherwise, if the modulus of i over num_1 is equal to zero\n elsif i % num_1 === 0\n # Print 'fizz' to the terminal\n puts 'fizz'\n # Otherwise, if the modulus of i over num_2 is equal to zero\n elsif i % num_2 === 0\n # Print 'buzz' to the terminal\n puts 'buzz'\n # Otherwise\n else\n # Print i (the integer) to the terminal\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "32aa94b7b744a0840c428cef9bf8c011",
"score": "0.7378429",
"text": "def fizzbuzz(num_1, num_2, range)\n #This repeats the following code for the duration of the range of the argument.\n (1..range).each do |i|\n #if i is divisible by number 1 and i is divisible by number 2 it puts fizzbuzz.\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n #otherwise if i is divisble by number 1 it puts fizz.\n elsif i % num_1 === 0\n puts 'fizz'\n #otherwise if the i is divisible by number 2 it puts buzz.\n elsif i % num_2 === 0\n puts 'buzz'\n else\n #or else it puts i.\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "fe35d0285f7f9a02a844967a411bb1c7",
"score": "0.73531705",
"text": "def fizzbuzz(num1, num2)\n num1.upto(num2) do |i|\n if i % 15 == 0\n puts \"FizzBuzz\"\n elsif i % 3 == 0\n puts \"Fizz\"\n elsif i % 5 == 0\n puts \"Buzz\"\n else\n puts i\n end \n end\nend",
"title": ""
},
{
"docid": "bc3efb7fb5eaba22a8efdcb17e64888c",
"score": "0.7347852",
"text": "def FizzBuzz\n \nend",
"title": ""
},
{
"docid": "df90f65646d6e344365f5edc2c30e0f6",
"score": "0.7343116",
"text": "def fizzbuzz(num1, num2)\n (num1..num2).each do |num|\n if (num % 3).zero? && (num % 5).zero?\n print \"FizzBuzz#{num == num2 ? '' : ', '}\"\n elsif (num % 3).zero?\n print \"Fizz#{num == num2 ? '' : ', '}\"\n elsif (num % 5).zero?\n print \"Buzz#{num == num2 ? '' : ', '}\"\n else\n print \"#{num}#{num == num2 ? '' : ', '}\"\n end\n end\nend",
"title": ""
},
{
"docid": "8ae77457dd32ce6b0798c09d2d212a9e",
"score": "0.73320776",
"text": "def fizz_buzz_to(limit)\t# Define the function and parameter\r\n 1.upto(limit).each do |num| \t# Define a loop, starting from 1 and going up to the parameter. Each time through the loop, assign the number to the variable \"num\"\r\n puts fizzbuzz(num) \t# Apply the fizzbuzz function to num and print the result\r\n end \t# end the loop\r\nend",
"title": ""
},
{
"docid": "5a45636700de403222cf52dde1ee0785",
"score": "0.73314655",
"text": "def fizzbuzz(num_1, num_2, range) # Define FizzBuzz method with arguments.\n (1..range).each do |i| # for-loop Parenthesis contain 1 and ... denoting several numbers in a range with a .each operator.\n if i % num_1 === 0 && i % num_2 === 0 # If the i percentage of num_1 is equal to 0 and the integer percentage of num_2 is equal to 0, print \"fizzbuzz\". If false, go to next elsif.\n puts 'fizzbuzz' # If above is true print. If false, skip.\n elsif i % num_1 === 0 # elsif the i percentage of num_1 is equal to 0 print 'fizz'. If false continue.\n puts 'fizz' # If above is true print. If false, skip.\n elsif i % num_2 === 0 #elsif i percentage of num_2 is equal to 0 print 'buzz'. If false continue.\n puts 'buzz' # If above is true print. If false, skip.\n else # If all other if/elsif statements are not true print i.\n puts i # Print i.\n end # End if statement block.\n end # End code block.\nend",
"title": ""
},
{
"docid": "951a960f5837f442da1546becf05a1fa",
"score": "0.7325037",
"text": "def fizzbuzz(num1, num2)\n (num1..num2).each do |n|\n if n % 3 == 0 && n % 5 == 0\n puts \"FizzBuzz\"\n elsif n % 3 == 0\n puts \"Fizz\"\n elsif n % 5 == 0\n puts \"Buzz\"\n else\n puts n\n end\n end\nend",
"title": ""
},
{
"docid": "c147ad7810cfeeb85fa1197bb61b5e1a",
"score": "0.7322941",
"text": "def fizzbuzz(num_1, num_2, range)\n (1..range).each do |i| # Defining a range operator for a loop (.. will include the last number). Do each number between 1 and whatever number is listed as the range argument.\n if i % num_1 === 0 && i % num_2 === 0 # defines logic for a conditional statement\n puts 'fizzbuzz' # defines output is abive condition is true.\n elsif i % num_1 === 0 # defines logic for a conditional statement\n puts 'fizz' # defines output is abive condition is true.\n elsif i % num_2 === 0 # defines logic for a conditional statement\n puts 'buzz' # defines output is abive condition is true.\n else #defines that if all above conditions are false it should provide the oputput on the next line.\n puts i\n end # ends the conditional methods\n end #ends the loop\nend",
"title": ""
},
{
"docid": "9a76e3c5cf706783937d1b53e5453f22",
"score": "0.7322421",
"text": "def fizz_buzz_to(limit)\n# This defines the variable \"fizz_buzz-to\" and explains in parenthesis what parameters can be passed into it.\n# In this case, there is only one parameter: limit.\n 1.upto(limit).each do |num|\n#Here we are using a loop to say that from integers 1 up to whatever number is placed in the parameter limit, do the following.\n puts fizzbuzz(num)\n#So for integers from 1 up until the established limit, run that number through the fizzbuzz variable and print the result (which, based on our case options, will be \"FizzBuzz\", \"Fizz\", \"Buzz\" or the number itself.)\n end\n #This ends the steps within the loop.\nend",
"title": ""
},
{
"docid": "1f3c3b06c80e92250ee2ead23121086b",
"score": "0.731638",
"text": "def fizzbuzz(num1, num2)\n num_range = (num1..num2).to_a\n result =\n num_range.map do |num|\n if num % 3 == 0 && num % 5== 0\n \"Fizz Buzz\"\n elsif num % 3 == 0\n \"Fizz\"\n elsif num % 5 == 0\n \"Buzz\"\n else\n num\n end\n end\n result.join(', ')\nend",
"title": ""
},
{
"docid": "8005910fba4f846a2f3888f66783914a",
"score": "0.7310956",
"text": "def fizzbuzz(num_1, num_2, range)\n # Iterates i from 1 to the range specified by the range parameter which means it performs the loop range times\n (1..range).each do |i|\n # if the current (or i'th) number is divisible by num_1 and num_2\n if i % num_1 === 0 && i % num_2 === 0\n # Prints this statement if the conditions in the if statement are met\n puts 'fizzbuzz'\n # If the previous if-statement conditions are not met, this then checks to see if the\n # current (or i'th) number is only divisible by num_1\n elsif i % num_1 === 0\n # Prints this statement if the conditions in the elsif statement are met\n puts 'fizz'\n # If the previous elsif-statement conditions are not met, this then checks to see if the\n # current (or i'th) number is divisible by num_2\n elsif i % num_2 === 0\n # Prints this statement if the conditions in the elsif statement are met\n puts 'buzz'\n # If none of the previous conditions are met\n else\n # Prints the current (or i'th) charachter is none of the previous conditions were met\n puts i\n # Ends the if/elsif/else statments\n end\n # Ends the loop\n end\n# Ends the method definition\nend",
"title": ""
},
{
"docid": "c84f40b135b65bc96d827780be29fc0d",
"score": "0.7298079",
"text": "def fizzbuzz(num_1, num_2, range)\n # uses .each method to loop through the range object (1..range) which has includes the integers 1 through the argument passed for the parameter range\n (1..range).each do |i|\n # starts the logic for the loop. For each integer in the range object (i) if i has a remainder of 0 after being divided by the the value of the argument num_1\n # AND i has a remainder of 0 after being divided by the value of the argument num_2\n if i % num_1 === 0 && i % num_2 === 0\n # prints the string \"fizzbuzz\" if i % num1 === 0 and i % num_2 === 0 are evaluated to true\n puts 'fizzbuzz'\n # if i % num_1 === 0 or i % num_2 is evaluted to false i is divided by the value of the argument num_1 and if the remainder of 0 is returned the conditional is evaluated to true\n elsif i % num_1 === 0\n # if i % num_1 === 0 is evaluated to true then the string 'fizz' is logged to the console\n puts 'fizz'\n # if i % num_2 === 0 is evaluated to false then i is checked to see if it has a remainder of 0 after being divided by the value of the argument num_2\n elsif i % num_2 === 0\n # if i % num_2 === 0 is evaluted to true then log the string 'buzz' to the console\n puts 'buzz'\n # if i % num_1 === 0 && i % num_2 === 0, i % num_1 === 0, and i % num_2 === 0 are all evaluated to false move on to the next line (62)\n else\n # if all other if evaluations were evaluted to false then log the value of i to the console\n puts i\n # ends the if/else logic\n end\n # ends the for loop logic\n end\n# ends the defining of the method fizzbuzz\nend",
"title": ""
},
{
"docid": "bd1ab20eef800ffed01ef1fd721e6ebf",
"score": "0.7297364",
"text": "def fizz_buzz(n1, n2)\n n1.upto(n2).each do |num|\n case\n when (num % 3 == 0) && (num % 5 == 0) then p 'FizzBuzz'\n when num % 5 == 0 then p 'Buzz'\n when num % 3 == 0 then p 'Fizz'\n else p num\n end\n end\nend",
"title": ""
},
{
"docid": "01a0dceae3fb333b9e725f7bf413f3f6",
"score": "0.7297339",
"text": "def fizzbuzz_to(limit)\n\n# In line 34, we are using the upto integer method. We are using object 1 and calling the method upto the number passed as the limit param to loop through all the numbers from 1 to the param.\n# We are starting a do block to put all the numbers from the upto method loop into the variabl i. \t\n 1.upto(limit) do |i|\n\n# In line 38, we are calling the fizzbuzz method and passing in the param i. Printing the result of fizzbuzz. \t\n puts(fizzbuzz(i))\n\n#in line 41, we are ending the do block.\n end\n\n#in line 44, we are ending the method. \nend",
"title": ""
},
{
"docid": "68503e46676467036dfab5f7352cef8c",
"score": "0.7278516",
"text": "def fizzbuzz(num) \n\tif num % 15 == 0\n\t \"fizzbuzz\"\n elsif num % 5 == 0\n \t \"buzz\"\n elsif num % 3 == 0\n \t\"fizz\"\n else\n \tnum\n end\nend",
"title": ""
},
{
"docid": "e7273d4b7346e789a09ef0500398b375",
"score": "0.727109",
"text": "def fizzbuzz(num_1, num_2, range)\n# Apply inclusive range operator and iterator from 1 to the value input for the range parameter \n (1..range).each do |i|\n# Check to see if the modulus of i and the argument passed as num_1 equals zero AND the modulue of i and num_2 equals 0\n if i % num_1 === 0 && i % num_2 === 0\n# If the case above is true, print string value\n puts 'fizzbuzz'\n# If the first if-statement is unsatisifed, check to see if the modulus of i and num_1 equals 0\n elsif i % num_1 === 0\n# If the case above is true, print String value\n puts 'fizz'\n# If the elsif statement above is unsatisifed, check to see if the modulus of i and num_2 equals 0\n elsif i % num_2 === 0\n# If the case above is true, print String value\n puts 'buzz'\n# If none of the previous conditions are true, print i value.\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "80fff2d69cd3f47323abdac8d272baac",
"score": "0.7263862",
"text": "def fizzbuzz(num_1, num_2, range)\n #for an inclusive range between one and up to and including the range variable...\n (1..range).each do |i|\n # print to console 'fizzbuzz' for each number where i is evenly divisible by\n # num_1 AND num_2 (with no remainders)\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # print 'fizz' if only divisible by num_1\n elsif i % num_1 === 0\n puts 'fizz'\n # print 'buzz' if only divisible by num_2\n elsif i % num_2 === 0\n puts 'buzz'\n # for all other cases, just print i local variable / the number from our range to console\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "35f3ecf57b81aeae0551d3858b19ae08",
"score": "0.7258456",
"text": "def fizzbuzz(num_1, num_2, range)\n# iterate over the range (from 1 to range using only integers)\n (1..range).each do |i|\n# if statement puts 'fizzbuzz' if the current integer in range is divisible with no emainder by both num_1 AND num_2\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# elsif statement puts 'fizz' if current integer is divisible with no remainder only by num_1\n elsif i % num_1 === 0\n puts 'fizz'\n# elsif statement puts 'buzz' if current integer is divisible with no remainder only by num_2\n elsif i % num_2 === 0\n puts 'buzz'\n# else statement says if none of the above is true, put the current integer\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "39d87c8f468096e4f934cec048149630",
"score": "0.72460604",
"text": "def buzzfizz(n)\n\nend",
"title": ""
},
{
"docid": "0e2950cc2add494538147faa89d44246",
"score": "0.7244752",
"text": "def fizzbuzz(first_num, end_num)\n first_num..end_num.times do |num|\n if (num % 3 == 0) && (num % 5 == 0) \n puts \"fizzbuzz\"\n elsif (num % 3 == 0)\n puts \"fizz\"\n elsif (num % 5 == 0)\n puts \"buzz\"\n else\n puts num\n end\n end\nend",
"title": ""
},
{
"docid": "a72f4e63530fa3ec48b05f38e963b645",
"score": "0.72435707",
"text": "def fizzbuzz(num_1, num_2, range)\n # From 1 to whatever number is set in the range it will print out each of the\n # numbers until a set of conditions are met and will print a string\n # in place of a number. \"i\" is a variable\n (1..range).each do |i|\n # prints a string if the modulus between i and num_1 argument\n # AND modulus between i and num_2 equals 0\n # will print \"fizzbuzz\"\n if i % num_1 === 0 && i % num_2 === 0\n #Prints \"fizzbuzz\"\n puts 'fizzbuzz'\n # Another condition. if the modulus between i and num_1 argument\n # equals 0, it will print out a string \"fizz\"\n elsif i % num_1 === 0\n # Prints \"fizz\"\n puts 'fizz'\n # Yet another condition where if the modulus between i and num_2 argument\n #equals 0, it will print out a string \"buzz\"\n elsif i % num_2 === 0\n # Prints \"buzz\"\n puts 'buzz'\n # If the above conditions aren't met, it will print i variable\n # which will be an integer instead of a string based on the range\n else\n # Prints out an integer\n puts i\n #Ends if/else\n end\n # Ends method\n end\n # Ends everything else\nend",
"title": ""
},
{
"docid": "4806b61593d198008bfbefabb8f4b798",
"score": "0.72352433",
"text": "def fizzbuzz(arg)\n if arg%15 == 0\n \"FizzBuzz\"\n elsif arg%5 == 0 \n \"Buzz\"\n elsif arg%3 == 0 \n \"Fizz\"\n else\n return\n end\nend",
"title": ""
},
{
"docid": "fe8ad539daab5750676cf901beafacca",
"score": "0.72351104",
"text": "def fizzbuzz(num_1, num_2, range)\n # 1 - range set to iterate through numbers and follow if statments\n (1..range).each do |i|\n # depending on outcome print\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n elsif i % num_1 === 0\n puts 'fizz'\n elsif i % num_2 === 0\n puts 'buzz'\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "b3abe08a864cda9c36973e86f1ae4d52",
"score": "0.7230821",
"text": "def fizzbuzz(num)\n\t\t0.upto(num) do |i|\n\t\t\tif i % 3 == 0 && i % 5 == 0\n\t\t\t\tputs 'FizzBuzz'\n\t\t\telsif i % 5 == 0\n\t\t\t\tputs 'Buzz'\n\t\t\telsif i % 3 == 0\n\t\t\t\tputs 'Fizz'\n\t\t\telse\n\t\t\t\tputs i\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c48da5bf690d22b53e9361b68a9e7012",
"score": "0.72266126",
"text": "def fizzbuzz(num_1, num_2, range)\n# uses the range argument.\n (1..range).each do |i|\n# uses the if i % num_1 === 0 && i % num_2 === 0 statement if true.\n if i % num_1 === 0 && i % num_2 === 0\n#puts 'fizzbuzz' if i % num_1 === 0 && i % num_2 === 0 is true.\n puts 'fizzbuzz'\n#uses i % num_1 === 0 if the if statment is false.\n elsif i % num_1 === 0\n#puts 'fizz' if the if statement is false.\n puts 'fizz'\n#uses i % num_2 === 0 if previous elsif statement is false.\n elsif i % num_2 === 0\n#puts 'buzz' if previous elsif statement is true and all prior statements are false.\n puts 'buzz'\n#puts i if all prior statements are false.\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "96c050eff923401ed61f49d33c645197",
"score": "0.72216576",
"text": "def fizzbuzz(num_1, num_2, range)\n# iterate over every single number in order starting with 1 using a block i\n (1..range).each do |i|\n# if i modulo num_1 includes a 0 and i modulo num_2 includes a 0\n if i % num_1 === 0 && i % num_2 === 0\n# print the string 'fizzbuzz'\n puts 'fizzbuzz'\n# if the previous condition is false then see of i modulo num_1 includes a 0\n elsif i % num_1 === 0\n# print the string 'fizz'\n puts 'fizz'\n# if the previous condition is false then see of i modulo num_2 includes a 0\n elsif i % num_2 === 0\n# print the string 'buzz'\n puts 'buzz'\n# if all the previous conditions were false then\n else\n# print i\n puts i\n# end the if statement\n end\n# end the .each method\n end\n# end the function fizzbuzz\nend",
"title": ""
},
{
"docid": "7ba95aaa16cec135d47ff65e61d6e59b",
"score": "0.72144324",
"text": "def fizzbuzz(num_1, num_2)\n result = []\n (num_1..num_2).each do |num|\n if num % 15 == 0\n result << 'FizzBuzz'\n elsif num % 5 == 0\n result << 'Buzz'\n elsif num % 3 == 0\n result << 'Fizz'\n else result << num\n end\n end\n result.join(', ')\nend",
"title": ""
},
{
"docid": "467b10299b17db4d0e556f44b81337f7",
"score": "0.71929157",
"text": "def fizzbuzz(num1, num2)\n string = ''\n nums = (num1..num2).to_a\n nums.each do |num|\n if num % 3 == 0 && num % 5 == 0\n string += \"fizzbuzz \"\n elsif num % 3 == 0\n string += \"fizz \"\n elsif num % 5 == 0 \n string += \"buzz \"\n else \n string += num.to_s + ' '\n end\n end\n p string\nend",
"title": ""
},
{
"docid": "371bb1d033f08cd3f981154e9e779f93",
"score": "0.71782464",
"text": "def fizzbuzz_to(limit)\n # Start with the number 1 and perform an action for each number up to (and including) the number fed in as the limit argument. Pass each number into the code block as an argument called i. ((This section creates a loop starting with the number 1, then 2, then 3, and so on up to the number in the limit argument. It passes the current integer into the code block as 'i' and executes the code in the block until it reaches the 'end'.))\n 1.upto(limit) do |i|\n \t# Run the fizzbuzz method with an argument of i and print out the returned value of the fizzbuzz method.\n puts(fizzbuzz(i))\n # Ends the 'do' code block.\n end\n# Ends defining the creation of the fizzbuzz_to method.\nend",
"title": ""
},
{
"docid": "c6be54638218db61a22fca501bd1c533",
"score": "0.7174544",
"text": "def fizz_buzz_2(num1, num2)\n\tnum = 0\n\n\t100.times do\n\t\tnum += 1\n\t\tif num % (num1 * num2) == 0\n\t\t\tputs \"FizzBuzz\"\n\t\telsif num % num2 == 0\n\t\t\tputs \"Buzz\"\n\t\telsif num % num1 == 0\n\t\t\tputs \"Fizz\"\n\t\telse\n\t\t\tputs num\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "cf90c9b418683427bea7c6668716ec4b",
"score": "0.71683234",
"text": "def fizzbuzz(num1, num2)\n result = []\n num1.upto(num2).each do |number|\n result << fizbuzz_validator(number) # use fizbuzz_validator method here to validate % 3 or 5\n end\n result.join(\", \")\nend",
"title": ""
},
{
"docid": "5a300f8dbf0f8876bcf566534fbfbbe0",
"score": "0.71611285",
"text": "def fizzbuzz(num_1, num_2, range)\n # from 1 to the end of range (passed in as parameter), perform for loop (each method) by declaring variable 'i'\n (1..range).each do |i|\n # conditional 1: if 'i' modulo 'num_1' is STRICTLY equal to zero AND 'i' modulo 'num_2' is STRICTLY equal to zero\n if i % num_1 === 0 && i % num_2 === 0\n # print 'fizzbuzz' to the terminal\n puts 'fizzbuzz'\n # conditional 2: if 'i' modulo 'num_1' is STRICTLY equal to zero\n elsif i % num_1 === 0\n # print 'fizz' to the terminal\n puts 'fizz'\n # conditional 3: if 'i' modulo 'num_2' is STRICTLY equal to zero\n elsif i % num_2 === 0\n # print 'buzz' to the terminal\n puts 'buzz'\n else\n # conditional 4: if none of the prior conditionals are met (return true)\n # print 'i' to the terminal\n puts i\n # end conditionals block\n end\n # end for loop (for each) block\n end\n# end method block\nend",
"title": ""
},
{
"docid": "ec160f54542d53b4c5fb646d8e1716db",
"score": "0.71528417",
"text": "def fizzbuzz(starting_num, ending_num)\n starting_num.upto(ending_num) do |num|\n if num % 3 == 0 && num % 5 == 0\n puts \"FizzBuzz\"\n elsif num % 5 == 0 \n puts \"Buzz\"\n elsif num % 3 == 0\n puts \"Fizz\"\n else\n puts num\n end\n end \nend",
"title": ""
},
{
"docid": "a4e77059447f3667556806ccb01e6819",
"score": "0.71510553",
"text": "def fizzbuzz(num)\n\t\n\tif num % 15 == 0\n\t\t\"FizzBuzz\"\n\telsif \n\t num % 3 == 0\n\t\t\"Fizz\" \n\telsif \n\t\tnum % 5 == 0\n\t\t\"Buzz\"\n\telse\n\t num\n\tend\n\nend",
"title": ""
},
{
"docid": "6fd6ca3a285ff221145adcaa03d6e46a",
"score": "0.7145923",
"text": "def fizzbuzz(num_1, num_2, range)\n # Add range agrument with iterator.\n (1..range).each do |i|\n # Add elsif statement where if the remiander of i for both num_1 and num_2 is 0 then put fizzbuzz.\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # If the remainder of i for just num_1 is 0 put 'fizz' and If the remainder of i for just num_2 is 0 put 'buzz'.\n elsif i % num_1 === 0\n puts 'fizz'\n elsif i % num_2 === 0\n puts 'buzz'\n # If the remainder for i is not 0 then put the number.\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "910ca560f0f58360df2b75b066d906cc",
"score": "0.7142912",
"text": "def fizzbuzz(num_1, num_2, range)\n # uses the .each method to iterate\n (1..range).each do |i|\n #the next few lines create conditionals within the method and prints a string depending on the outcome of the conditional\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n elsif i % num_1 === 0\n puts 'fizz'\n elsif i % num_2 === 0\n puts 'buzz'\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "341fc972f8d2d82020af0846f9b6fe02",
"score": "0.7139173",
"text": "def fizzbuzz (num1, num2)\n numbers = Array(num1..num2).map do |n|\n if n % 3 == 0 && n % 5 == 0\n \"FizzBuzz\"\n elsif n % 3 == 0\n \"Fizz\"\n elsif n % 5 == 0\n \"Buzz\"\n else \n n\n end \n end\n numbers.join(', ')\nend",
"title": ""
},
{
"docid": "7dac6ea8dfee671a8b0d4bf20ff1fae0",
"score": "0.71301574",
"text": "def fizzbuzz(num_1, num_2, range)\n # executes a loop iterating through the range starting with 1 and ending at the largest number in the range\n # setting the number as 'i'\n (1..range).each do |i|\n # conditional statement if both the remainder of 'i' divided by 'num_1' is equal to zero\n # and the remainder of 'i' divided by 'num_2' is equal to zero\n if i % num_1 === 0 && i % num_2 === 0\n # if both statements are true, prints 'fizzbuzz'\n puts 'fizzbuzz'\n # if statement above is false, runs condition remainder of 'i' divided by 'num_1'\n elsif i % num_1 === 0\n # if state ment is true prints 'fizz'\n puts 'fizz'\n # if statements above are false, runs condition remainder of 'i' divided by 'num_2' is equal to zero\n elsif i % num_2 === 0\n # if statement is true prints 'buzz'\n puts 'buzz'\n # if all other conditions return false, it will run this condition\n else\n # prints 'i'\n puts i\n # closes the conditional\n end\n # closes the loop\n end\n# closes the method 'fizzbuzz'\nend",
"title": ""
},
{
"docid": "b4aa960707e0ee78f7c3d01f863c3d70",
"score": "0.71286124",
"text": "def fizzbuzz(start_num, end_num)\n result = []\n start_num.upto(end_num) do |num|\n if num % 3 == 0 && num % 5 == 0\n result << \"Fizzbuzz\"\n elsif num % 3 == 0\n result << \"Fizz\"\n elsif num % 5 == 0\n result << \"Buzz\"\n else\n result << num\n end\n end\n puts result.join(', ')\nend",
"title": ""
},
{
"docid": "d9e7b33c7675c2c2ed2293746d5e8bf4",
"score": "0.7123195",
"text": "def fizzbuzz\n\toutput=Array.new\n\trange =*(1..100)\n\t\trange.each do |i|\n\t\tif (i % 3 == 0 && i % 5 == 0)\n\t\t\toutput.push(\"FizzBuzz\")\n\t\telsif i % 3 == 0\n\t\t\toutput.push(\"Fizz\")\n\t\telsif i % 5 == 0\n\t\t\toutput.push(\"Buzz\")\n\t\telse\n\t\t\toutput.push(i)\n\t\tend\n\n\tend\nreturn output \t\nend",
"title": ""
},
{
"docid": "33e01e36fbf3d839a609d3cb0691d90a",
"score": "0.71142685",
"text": "def fizzbuzz(num_1, num_2, range)\n# takes a range of numbers from 1 to the value of range inclusively and uses the each method to iterate over every number in the range. The number is assigned to i.\n (1..range).each do |i|\n# If statement evaluates whether the modulo of i and num_1 is equal to 0 and if the modulo of i and num_2 is equal to 0. If both are true then it prints \"fizzbuzz\" to the terminal.\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# Elsif statement evaluates if the modulo of i and num_1 is equal to 0. If it is then it prints the string \"fizz\" to the terminal\n elsif i % num_1 === 0\n puts 'fizz'\n# Elsif statement evaluates if the modulo of i and num_2 is equal to 0. If it is then it prints the string \"buzz\" to the terminal\n elsif i % num_2 === 0\n puts 'buzz'\n# Else statement that will print i to the terminal if none of the other evaluate as true\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "fc98241599d6095c322d4732c4b945c9",
"score": "0.7111426",
"text": "def fizzbuzz(num)\n case\n \t#defines that the num parameter in each case described below will run\n when num % 15 == 0 then \"FizzBuzz\"\n \t#num will be divided by 15, if equals 0, \"FizzBuzz\" will result\n when num % 3 == 0 then \"Fizz\"\n \t#num will be divided by 3, if equals 0, \"Fizz\" will result\n when num % 5 == 0 then \"Buzz\"\n \t#num will be divided by 5, if equals 0, \"Buzz\" will result\n else num\n \t#if none of the above cases are true or result in 0, the original num parameter will result\n end\nend",
"title": ""
},
{
"docid": "3147d39367efa7efc9e7dff2393c1498",
"score": "0.7111158",
"text": "def fizz_buzz(number)\n\tif number%3==0 && number%5 == 0 then \"FizzBuzz\" elsif number%3 ==0 then \"Fizz\" elsif number%5 == 0 then \"Buzz\" else number end\n\t\t\nend",
"title": ""
},
{
"docid": "97209a24330863e7e0d84ab6d0df0f29",
"score": "0.71063244",
"text": "def fizzbuzz(num1, num2)\n result = []\n for number in num1..num2\n case\n when number % 3 == 0 && number % 5 == 0\n result << 'FizzBuzz'\n when number % 3 == 0\n result << 'Fizz'\n when number % 5 == 0\n result << 'Buzz'\n else\n result << number\n end\n end\n print result.join(', ')\nend",
"title": ""
},
{
"docid": "d0b87b6f8687cef7a5b37b77723c0526",
"score": "0.7102624",
"text": "def fizz_buzz(starting_num, ending_num)\n result = []\n starting_num.upto(ending_num) do |num|\n if num % 3 == 0 && num % 5 == 0\n result << 'FizzBuzz'\n elsif num % 3 == 0\n result << 'Fizz'\n elsif num % 5 == 0\n result << 'Buzz'\n else\n result << num\n end\n end\n p result.join(', ')\nend",
"title": ""
},
{
"docid": "882de0080e7c9c19366122c7161d0aff",
"score": "0.7101428",
"text": "def fizz_buzz_to(limit)\n\t#for each element from 1 - limit add that element to valiable num\n 1.upto(limit).each do |num|\n \t#print the return value of method \"fizzbuzz(num)\"\n puts fizzbuzz(num)\n end\nend",
"title": ""
},
{
"docid": "11c8eb5ff49b1fb7dc3ad957f4a168d0",
"score": "0.7097978",
"text": "def fizzbuzz(number)\n\n# in line 8, we are using a case statement.\t\n case\n\n# In line 12 we are passing our 1st condition stating when the remainder of 15 and the number param equals 0 then return 'fizzbuzz'\n when number % 15 == 0 then 'Fizzbuzz'\n\n#In line 15 we are passing our 2nd condition stating when the remainder of 3 and the number param equals 0 then return 'fizz' \t\n when number % 3 == 0 then 'Fizz'\n\n#In line 18 we are passing our 3rd condition stating when the remainder of 5 and the number param equals 0 then return 'buzz' \t\n when number % 5 == 0 then 'Buzz'\n\n#In line 21 we are passing our else condition stating when the param does not match any 3 of our conditions then just return the number. \t\n else number\n\n# In line 24 we are ending our case statement.\n end\n\n# In line 27, we are ending our definition of the fizzbuzz method. \nend",
"title": ""
},
{
"docid": "6612947611458f7a67baf20c20d6b140",
"score": "0.70897377",
"text": "def fizzbuzz_iterator(range_from, range_to)\n (range_from..range_to).each do |i|\n if divisble_by?(i,3) && divisble_by?(i,5)\n @fizzbuzz_array << 'FizzBuzz'\n elsif divisble_by?(i,3)\n @fizzbuzz_array << 'Fizz'\n elsif divisble_by?(i,5)\n @fizzbuzz_array << 'Buzz'\n else\n @fizzbuzz_array << i\n end\n end\n end",
"title": ""
},
{
"docid": "61f79741ddb159936758fba4e81005c9",
"score": "0.70882934",
"text": "def fizz_buzz number \n\tif number % 3 == 0 && number % 5 == 0\n\t\t'FizzBuzz'\n\telsif number % 5 == 0\n\t\t'Buzz'\n\telsif number % 3 == 0\n\t\t'Fizz'\n\telse\n\t\tnumber\n\tend\nend",
"title": ""
}
] |
de1f937ebc1fc608c31cfcb4a1de860c
|
Get all recent builds for a specific project
|
[
{
"docid": "2c237aeb07259af3dd1534929238196d",
"score": "0.77158344",
"text": "def recent_builds(params = {})\n CircleCi.request(conf, base_path, params).get\n end",
"title": ""
}
] |
[
{
"docid": "c08bb31452256e773433fbde01d5e1d6",
"score": "0.80826473",
"text": "def recent_builds(params = {})\n CircleCi.request(@conf, \"/project/#{username}/#{project}\", params).get\n end",
"title": ""
},
{
"docid": "1139144772b4abe8348a5b72588ed35d",
"score": "0.7228891",
"text": "def latest_builds(project, amount = 5)\n project.builds.order('build_number DESC').limit(amount).to_a\n end",
"title": ""
},
{
"docid": "ce9e4c9ed92913088ebd2ac875664639",
"score": "0.70017916",
"text": "def recent_builds(username, project, params = {})\n default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#recent_builds instead')\n new(username, project, default_config).recent_builds(params)\n end",
"title": ""
},
{
"docid": "647e72800723aac9a6147071cea94aff",
"score": "0.68459314",
"text": "def builds_for_project(name, num = 100)\n count = 0\n next_token = nil\n builds = []\n loop do\n r = client.list_builds_for_project(project_name: name, next_token: next_token)\n builds += r.ids\n break if (count += r.ids.count) >= num\n break if (next_token = r.next_token).nil?\n end\n builds.first(num)\n end",
"title": ""
},
{
"docid": "84d71276e8f6e37f8f37532fa86a8bdf",
"score": "0.6771957",
"text": "def list_all\n response_json = @client.api_get_request(\"/api/build\")\n\n return nil unless response_json\n\n response_json[\"builds\"].map do |build|\n {\n :name => build[\"uri\"].sub(/^\\//,''),\n :uri => build[\"uri\"],\n :lastStarted => build[\"lastStarted\"]\n }\n end.sort{ |x,y| x[:name] <=> y[:name]}\n\n end",
"title": ""
},
{
"docid": "083b4d4e1728b36ad5c1c402433bd068",
"score": "0.6611219",
"text": "def build_results\n CircleCi::Project.recent_builds_branch('salsify', 'dandelion', 'develop')\n end",
"title": ""
},
{
"docid": "408e9ba9e575905578767324c9fa0a50",
"score": "0.660605",
"text": "def index\n @builds = @repo.builds.order('created_at DESC')\n end",
"title": ""
},
{
"docid": "bf9a2fe89eaa3a51e5e922b307f1db1e",
"score": "0.6481806",
"text": "def builds(filters = {})\n fetch_resources_lazily(\"builds\", filters)\n end",
"title": ""
},
{
"docid": "f101f859eee3e48bebfa83017df9c1ba",
"score": "0.6451278",
"text": "def recent\n recent_projects = []\n first = Rails.cache.fetch \"recent/first\"\n second = Rails.cache.fetch \"recent/second\"\n third = Rails.cache.fetch \"recent/third\"\n\n recent_projects << first << second << third\n\n recent_projects.each do |entry|\n next if not entry\n entry[:time] = view_context.time_ago_in_words(entry[:time])\n end\n\n recent_projects.compact!\n\n render json: recent_projects\n\n end",
"title": ""
},
{
"docid": "2fe4953585aa1cb553848958c3b77ad2",
"score": "0.6430987",
"text": "def get_commits\n # get the last build number\n build_tag = last_build_git_data\n @last_build_number = build_tag[:build_number]\n if @last_build_number == 0\n puts \"unable to get last build number using git describe. It returned #{build_tag[:describe]} but \\\nexpecting something that has letters followed by numbers. Unable to continue\"\n exit 1\n end\n\n # Jenkins will tag the build before running the deploy, @last_build_number - 1 will get the previous built version to get the diff.\n # However, if prev_build is set, use that instead. \n from_build = (@prev_build.nil?) ? (@last_build_number.to_i - 1) : @prev_build.to_i\n \n # now fetch all commits for anything between the current revision and the last build number\n last_build_tag = \"#{build_tag[:tag_name]}#{from_build}\"\n # puts \"looking for commits between #{last_build_tag} and #{@build_revision}\"\n \n commits = @repo.commits_between(last_build_tag, @build_revision)\n if (commits && commits.length > 0)\n load_tasks(commits)\n else\n puts \"No commits logs (other than possibly merges) were found between tag #{last_build_tag} and build revision #{build_revision}. \\n\nNothing to report on, exiting. \"\n exit 1\n end\n end",
"title": ""
},
{
"docid": "649bfc5c684b67cf0a86cced6e938f9e",
"score": "0.63268673",
"text": "def get_builds_by_repo(repo)\n\t\treturn self.fetch(\"repos/#{repo}/builds\")\n\tend",
"title": ""
},
{
"docid": "d49135a0284342c3f1a6879db06d5f80",
"score": "0.6312895",
"text": "def get_latest_build_for_xml_publish\n ReportLog.entering(@@class_name, __method__.to_s)\n test_suite_build_list = Array.new\n # set up RTC client\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_getLatestBuildTestResults])\n @params = nil\n @payload = nil\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_GET, @api, @params, @payload)\n # run API\n ReportLog.info('Retrieving latest test results (builds) for all test suites...')\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('All latest test results (builds) retrieved. Constructing test suite build list...')\n result_hash = rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).fetch('Latest Test Suite Results')\n result_hash.each do |result|\n test_suite_build = Hash.new\n test_suite_build['build'] = result['Build']['Build Name'].to_s\n test_suite_build['git_branch'] = result['Build']['Git Branch'].to_s\n test_suite_build['sprint'] = result['Build']['Sprint'].to_s\n test_suite_build['Test Suite'] = result['Test Suite']['Name'].to_s\n\n test_suite_build_list.push(test_suite_build)\n end\n ReportLog.info('Test suite build list constructed.')\n else\n raise construct_api_failure_msg(rtc_client)\n end\n ReportLog.exiting(@@class_name, __method__.to_s)\n return test_suite_build_list\n end",
"title": ""
},
{
"docid": "bbcfedd4490b5330126d32c5c8ae86e4",
"score": "0.63115245",
"text": "def recent_commits\n\n return \"\" if !installation_selected?\n\n installation_id = session[:selected_installation]\n # installation_token = get_app_token(installation_id)\n\n @client = Octokit::Client.new(:access_token => session[:access_token])\n response = @client.find_installation_repositories_for_user(installation_id)\n\n commits = response[:repositories]\n commits.take 15\nend",
"title": ""
},
{
"docid": "5d3aa214a7a54445ea7229a86cb4ea34",
"score": "0.6234005",
"text": "def last_five_builds\n last_builds(5)\n end",
"title": ""
},
{
"docid": "fe86a6f223b41a5984445b31ef38f22b",
"score": "0.609853",
"text": "def remote_builds\n @remote_builds ||= url_request(url_of_file('builds_list')).lines.map(&:strip)\n end",
"title": ""
},
{
"docid": "9117d385050ed5d6131c04f87587f363",
"score": "0.60802555",
"text": "def possible_builds\n commits = [@job.commit]\n\n if defined?(SamsonKubernetes) && @job.deploy.kubernetes_reuse_build\n previous_scope = @job.deploy.stage.deploys.prior_to(@job.deploy).where(kubernetes_reuse_build: false)\n previous = previous_scope.first&.job&.commit\n commits.unshift previous if previous\n end\n\n Build.where(git_sha: commits).sort_by { |build| [commits.index(build.git_sha), -build.updated_at.to_i] }\n end",
"title": ""
},
{
"docid": "2a05ac1854e604edfa45f297ba809c48",
"score": "0.60799384",
"text": "def projects_tracked\n timings = Timing.for_period_of_time(self.id, 1.month.ago, Time.now)\n if timings.present?\n timings.map(&:project_id).uniq\n else\n []\n end\n end",
"title": ""
},
{
"docid": "718a8aebe0793b4bc2626df4a586fe6f",
"score": "0.6078799",
"text": "def index\n @recent_objects = AssertedDistribution.recent_from_project_id($project_id).order(updated_at: :desc).limit(10)\n end",
"title": ""
},
{
"docid": "2682a66e7d4d1fdbc7b775e424a03e24",
"score": "0.5979587",
"text": "def index\n @recent_objects = Content.recent_from_project_id($project_id).order(updated_at: :desc).limit(10)\n end",
"title": ""
},
{
"docid": "72d85b13f665224864cb1ea8fd7b4eea",
"score": "0.5962152",
"text": "def show\n @buildq = @project.builds.ransack params[:q]\n @builds = @buildq.result.page(params[:page]).order('id desc')\n end",
"title": ""
},
{
"docid": "d38d953f01c5d0b301a96e6dc5490bfb",
"score": "0.59297675",
"text": "def index\n @builds = Build.all\n end",
"title": ""
},
{
"docid": "d38d953f01c5d0b301a96e6dc5490bfb",
"score": "0.59297675",
"text": "def index\n @builds = Build.all\n end",
"title": ""
},
{
"docid": "51acff96141a63b8e5265ff6f32180cd",
"score": "0.59078455",
"text": "def recent_builds_branch(branch, params)\n CircleCi.request(@conf, \"/project/#{username}/#{project}/tree/#{branch}\", params).get\n end",
"title": ""
},
{
"docid": "dd2032a06e79470da281a06fe30254eb",
"score": "0.5882683",
"text": "def projects\n result = []\n load_attributes\n @attributes['projects'].each do |project|\n result << project['name']\n end\n puts \"Workspace projects #{result}\"\n result\n end",
"title": ""
},
{
"docid": "de30198ae86e1aa5c81ea45879746f46",
"score": "0.5881687",
"text": "def recent_builds_branch(branch, params = {})\n CircleCi.request(conf, \"#{base_path}/tree/#{branch}\", params).get\n end",
"title": ""
},
{
"docid": "3e553875c015d3a33d2da77c51802270",
"score": "0.58491206",
"text": "def filter_builds\n # Retrieve the build numbers from the latest poll\n build_nums = build_failures.flatten.map do |build_result|\n build_result['build_num']\n end\n # Remove the saved build numbers\n remainder = build_nums - existing_builds_numbers(build_nums)\n # Select the winners\n build_failures.select do |build_result|\n remainder.include?(build_result['build_num'])\n end\n end",
"title": ""
},
{
"docid": "e962de9c46e3193f66717470cf7c5fde",
"score": "0.581992",
"text": "def last_deploy_for(project)\n @projects_last_deployed_at ||= Deploy.successful.\n last_deploys_for_projects.\n includes(:project, job: :user).\n index_by(&:project_id)\n\n @projects_last_deployed_at[project.id]\n end",
"title": ""
},
{
"docid": "29a5e07c559435e2b8d23fa49f0303ed",
"score": "0.5815311",
"text": "def getprojects()\n printRepoHeader\n \n loop do\n # Print each of the new returned repositories\n begin\n get.each do |repo|\n printRepo(repo) if (@slugs.add?(repo['slug']))\n\n # Flush to prevent data loss if we crash\n STDOUT.flush\n end\n rescue Exception => msg\n STDERR.puts \"WARNING: Poll failed at #{Time.now}\"\n STDERR.puts msg\n end\n\n # Poll every 5 minutes\n sleep 300\n end\n end",
"title": ""
},
{
"docid": "6b7ac3b6a13333cbe9c97d71c317653f",
"score": "0.5813952",
"text": "def index\n @recent_objects = Citation.recent_from_project_id($project_id).order(updated_at: :desc).limit(10)\n end",
"title": ""
},
{
"docid": "112f62d0b5f0a14860d11a651981c3f4",
"score": "0.58062345",
"text": "def show\n @builds = @job_matrix.latest_builds.group_by(&:job_id)\n @build_results = BuildResult\n .where(build_id: @job_matrix.latest_builds.pluck(:id))\n .where(ubuntu_release: Rails.application.config_for(:uosci)['supported_combinations'].keys)\n .order(created_at: :desc).includes(:user).group_by(&:build_id)\n end",
"title": ""
},
{
"docid": "15027b2ddeb140a426a67b2bedf40492",
"score": "0.58031464",
"text": "def index\n @recent_objects = TaxonDetermination.recent_from_project_id($project_id).order(updated_at: :desc).limit(10)\n end",
"title": ""
},
{
"docid": "3bfc77525508f37c089ab549b8413005",
"score": "0.57855946",
"text": "def projects(params = nil)\n params = params.merge({ :current_user => @options[:current_user]})\n params = params.except(:manufacturer_id, :catg_slug, :office_id, :max_matches)\n params[:order] ||= 'recently_active'\n\n @projects_response = ProjectsIndexPresenter.new(params[:current_user], params).response\n projects = @projects_response[:projects] || []\n projects\n end",
"title": ""
},
{
"docid": "8917c519a87a938da8f6830068a132e8",
"score": "0.5768746",
"text": "def all\n @projects\n end",
"title": ""
},
{
"docid": "8917c519a87a938da8f6830068a132e8",
"score": "0.5768746",
"text": "def all\n @projects\n end",
"title": ""
},
{
"docid": "ad82470ba2bcb7689786da9c4c120122",
"score": "0.57672447",
"text": "def index\n @project = Project.find params[:project_id].to_i\n @backlogs = @project.backlogs\n end",
"title": ""
},
{
"docid": "955aea5cdb62136894ff84e1f704cd5f",
"score": "0.57543314",
"text": "def get_versions(project_id_or_key)\n get(\"projects/#{project_id_or_key}/versions\")\n end",
"title": ""
},
{
"docid": "f1e610cce6965e86cc9cce045b662672",
"score": "0.5749718",
"text": "def recent_commits\n public_events = @client.user_public_events @user[:login]\n public_events.select! { |e| e[:type] == \"PushEvent\" }\n commits = []\n public_events.each do |e|\n e[:payload][:commits].each do |c|\n c[:html_url] = \"https://github.com/#{e[:repo][:name]}/commit/#{c[:sha]}\"\n c[:shortcut] = \"#{e[:repo][:name]}@#{c[:sha][0..7]}\"\n end\n commits.concat e[:payload][:commits]\n end\n commits.take 15\nend",
"title": ""
},
{
"docid": "82a706045cbee6dbbe52c3a35586b80c",
"score": "0.57478625",
"text": "def builds\n servers.flat_map { |server| server.builds }\n end",
"title": ""
},
{
"docid": "499fe8335db623dda2c542300b3c233b",
"score": "0.5740419",
"text": "def pending_builds(project: nil)\n not_implemented(__method__)\n end",
"title": ""
},
{
"docid": "79ad12e12878cf2374c60469736b6cd3",
"score": "0.57394814",
"text": "def projects\n\t\tProject.order(\"created_at\").find_all_by_account_id(account_id).reverse\n\tend",
"title": ""
},
{
"docid": "acbe22f3b1d117ccb56deadf1ed3312d",
"score": "0.57250667",
"text": "def list_projects # :nologin:\n query = create_query(:Project, :all, :by => :title)\n show_selected_projects(query)\n end",
"title": ""
},
{
"docid": "d1fbe60a4747b1984389dcec8756658a",
"score": "0.5711857",
"text": "def all_projects()\n @endpoint = \"/projects.json?limit=100\"\n setup_get\n res = @http.request(@req)\n return JSON.load(res.body)[\"projects\"].sort_by { |proj| proj[\"name\"] }\n end",
"title": ""
},
{
"docid": "0df6af91f844b6bd6ceeb5082ddc57a4",
"score": "0.56832933",
"text": "def all_deliverable_projects\n all_digest_projects\n end",
"title": ""
},
{
"docid": "66f41516c150073d84566295214f6f45",
"score": "0.5678732",
"text": "def projects\n PivotalTracker::Project.all\n end",
"title": ""
},
{
"docid": "bbb1133c72172c2b5072799b0e461a21",
"score": "0.5677329",
"text": "def list_projects\n handle_action_exceptions(__method__) do\n cmd_line = ['listprojects']\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"title": ""
},
{
"docid": "ec10909f2942da9ee46140f6ee5b6147",
"score": "0.5677054",
"text": "def getPastTagLogs(past1 = 1, past2 = 2, filter = true)\n # only return git logs that don't contain fastlane or private\n # use those keywords for your commit to be stealth in the build change logs\n to_exec = \"git log --oneline #{past1}...#{past2}\"\n if filter == true\n to_exec += \" | { egrep -vi 'fastlane|skip_ci|Merge' || true; }\"\n end\n changes = sh(to_exec)\n changes = changes[0...12_000]\n\n f = File.new(\"./tmp/changelog.txt\", \"w\")\n f.write(changes)\n f.close\n\n UI.important(\"CHANGES SINCE LAST PROD: \")\n UI.important(changes)\n\n return changes\nend",
"title": ""
},
{
"docid": "ddac71bed1721ca4de829ee72420995a",
"score": "0.56510246",
"text": "def projects\n map(&:projects).flatten.uniq.sort\n end",
"title": ""
},
{
"docid": "ba2be4cd13be2a61eba6e1bf9ca738ed",
"score": "0.5637607",
"text": "def weekly_updates_by_project(since)\n since = Date.new(2000,01,01) if since == :all\n self.weekly_updates.where([\"weekstart > ?\",since]).order(\"project_id, weekstart desc\").group_by {|w| w.project}\n end",
"title": ""
},
{
"docid": "472cb4e183311d504166886559f95b32",
"score": "0.5635992",
"text": "def list(params = {})\n response = get_request('/projects/', params)\n response.map { |project| TheShiningSource::Project.new(project) }\n end",
"title": ""
},
{
"docid": "2177be165b9cdfdf695d4b8cd6c0fc89",
"score": "0.5632643",
"text": "def list_all\n query = create_query(:Project, :all, by: default_sort_order)\n show_selected_projects(query)\n end",
"title": ""
},
{
"docid": "0b4d70164e2ca5919ef00153f0913da6",
"score": "0.56061584",
"text": "def project_list\n project_folders = Dir::entries(::File.join(Msf::Config.log_directory, 'projects'))\n projects = []\n framework.db.workspaces.each do |s|\n if project_folders.include?(s.name)\n projects << s.name\n end\n end\n return projects\n end",
"title": ""
},
{
"docid": "6bdb6a416b72727b18121b8217e77bdf",
"score": "0.5598936",
"text": "def latest_pipelines(project_id)\n last_20_pipelines(project_id).each_with_object({}) do |pipeline, all_latest_pipelines|\n branch = pipeline['ref']\n all_latest_pipelines[branch] = pipeline if all_latest_pipelines[branch].nil?\n end\nend",
"title": ""
},
{
"docid": "0e505819a12e5e3076b53f7ea7b97815",
"score": "0.5590939",
"text": "def index\n @projects = @projects.includes(:latest_iteration).where(:tenant_id => current_user.tenant).order(\"name\").page(params[:page]).per(DEFAULT_ROWS_PER_PAGE)\n\n respond_with @projects\n end",
"title": ""
},
{
"docid": "b4d8b0ceab8e1bd2dac66032a08c6565",
"score": "0.55717945",
"text": "def available_projects_list\n uri = \"#{@api_url}?access_token=#{@access_token}\"\n get uri\n end",
"title": ""
},
{
"docid": "0113ab2129af3339e344abc8a6fed68b",
"score": "0.5569601",
"text": "def pull_projects_harvest\n harvest_uri = URI(\"https://api.harvestapp.com/v2/projects?updated_since=#{last_updated_time}\")\n\n Net::HTTP.start(harvest_uri.host, harvest_uri.port, use_ssl: true) do |http|\n harvest_request = Net::HTTP::Get.new harvest_uri\n\n harvest_request[\"Authorization\"] = \"Bearer #{harvest_access_token}\"\n harvest_request[\"Harvest-Account-ID\"] = harvest_account_id\n harvest_request[\"User-Agent\"] = harvest_user_agent\n \n harvest_response = http.request harvest_request\n json_response = JSON.parse(harvest_response.body)\n return json_response[\"projects\"]\n end\n end",
"title": ""
},
{
"docid": "cb65a0549e3ddc3b3e06f30bffc742b0",
"score": "0.555915",
"text": "def projects\n request(method: 'getAllProjects')\n end",
"title": ""
},
{
"docid": "4dd83cdd66e29a35d70d7c764db821b3",
"score": "0.5541261",
"text": "def get_all_commits_in_repo\n @branches.collect(&:commits).flatten.sort_by { |k| k.authored_date }.reverse\n end",
"title": ""
},
{
"docid": "449b7c2f039e1e87591d34f1fd12e8aa",
"score": "0.55406296",
"text": "def index\n @projects = Project.all.order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "c57b6d8020a028a55030f7511f37bfe8",
"score": "0.5516898",
"text": "def index\n @announcements = Announcement.recent(5)\n @q = Project.ransack(params[:q])\n @projects = @q.result(distinct: true)\n @projects = include_platform(@projects)\n\n filter_default_years if params[:q].nil?\n load_projects\n end",
"title": ""
},
{
"docid": "be59188fe053fb3c67498b6315cc7ff6",
"score": "0.5510997",
"text": "def project_commits(id)\n begin\n JSON(RestClient.get GITLAB_WS_URL + \"projects/#{id}/repository/commits\", {:private_token => GITLAB_TOKEN}).reverse\n rescue Exception\n return []\n end\n end",
"title": ""
},
{
"docid": "7069348cb979d801f5d0091fdfd5aceb",
"score": "0.55087566",
"text": "def get_recently_updated_datasets(base_url)\n return handle_request(URI.encode(base_url + '/revision_list'))\n end",
"title": ""
},
{
"docid": "4108e57f23f9211619ddd214b3ae8a64",
"score": "0.5508214",
"text": "def last_20_pipelines(project_id)\n api(\"projects/#{project_id}/pipelines\")\nend",
"title": ""
},
{
"docid": "03b3fc89ea15e5f4c28970dfc467add8",
"score": "0.55046314",
"text": "def listversions(project=self.project)\n get('listversions.json', project: project)['versions']\n end",
"title": ""
},
{
"docid": "4996fafa9cbbf3cab2a8a06c1fd6c0ff",
"score": "0.5502371",
"text": "def projects\n @projects\n end",
"title": ""
},
{
"docid": "e5a2673d174cc6b6d129c6edfb2c223d",
"score": "0.54970586",
"text": "def index\n @commits = @project.repo.log(10)\n respond_with @commits\n end",
"title": ""
},
{
"docid": "a8a36a9516d59a980224d42d460bcd6d",
"score": "0.549636",
"text": "def index\n @projects = current_power.projects\n end",
"title": ""
},
{
"docid": "0ee23287b0f4bb258f5be56b11adb141",
"score": "0.54913634",
"text": "def index\n @projects = current_user.projects\n @project_tasks = recently_active_tasks(@projects)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @projects }\n end\n end",
"title": ""
},
{
"docid": "d5dd6de24a3e137b3ca9a403d209c4f5",
"score": "0.548177",
"text": "def get_latest_build_number(project)\n raise \"#{self.class}#get_latest_build_number not implemented\"\n end",
"title": ""
},
{
"docid": "f40097bcbf04b9a1c809d0c8a8d4fc70",
"score": "0.54798895",
"text": "def projects\n @projects ||= Project.all\n end",
"title": ""
},
{
"docid": "cc47309a84b0d1a438804eb26f62a8ad",
"score": "0.54724187",
"text": "def last_build_git_data\n describe = @repo.recent_tag_name()\n m = describe.match(/(\\D*)(\\d+)/)\n build = 0\n if (m && m.length == 3)\n build = m[2].to_i\n tag_name = m[1]\n if (build > 0)\n puts \"most recent tag found is for build #{build}\"\n else\n build = 0\n end\n end\n { :build_number => build, :tag_name => tag_name, :describe => describe}\n end",
"title": ""
},
{
"docid": "d6440e75174ee2b426bb758455b0e233",
"score": "0.54584223",
"text": "def get_existing_commits!\n release_meta_paths = Dir.glob(\"#{RELEASE_META_DIR}/*.toml\").to_a\n\n release_meta_paths.collect do |release_meta_path|\n contents = File.read(release_meta_path)\n parsed_contents = TomlRB.parse(contents)\n release_hash = parsed_contents.fetch(\"releases\").values.fetch(0)\n release_hash.fetch(\"commits\").collect do |c|\n message_data = parse_commit_message!(c.fetch(\"message\"))\n\n {\n \"sha\" => c.fetch(\"sha\"),\n \"message\" => c.fetch(\"message\"),\n \"author\" => c.fetch(\"author\"),\n \"date\" => c.fetch(\"date\"),\n \"pr_number\" => message_data.fetch(\"pr_number\"),\n \"files_count\" => c[\"files_count\"],\n \"insertions_count\" => c[\"insertions_count\"],\n \"deletions_count\" => c[\"deletions_count\"]\n }\n end\n end.flatten\nend",
"title": ""
},
{
"docid": "eabf627c641221d8a46e15ef0df7546d",
"score": "0.54573214",
"text": "def test_it_can_get_list_of_projects\n VCR.insert_cassette 'projects'\n projects = @api.projects('writer1')\n\n assert_kind_of Array, projects\n assert_equal 3, projects.size\n\n assert_kind_of Hash, projects.first\n assert_kind_of Hash, projects.last\n\n assert_equal \"xjywplmhejceb6j3ezzlxiganmjavqio\", projects.last[\"pid\"]\n assert_equal \"l7eqkx6daomtv5iw2912p019anskzt1n\", projects.first[\"pid\"]\n assert_equal 1, projects.first[\"active\"]\n assert_equal 1, projects.first[\"main\"]\n end",
"title": ""
},
{
"docid": "9f1df8a4d9963d250e64c52f498d1452",
"score": "0.5449631",
"text": "def index\n @all_projects = Project.by_user_plan_and_tenant(params[:tenant_id], current_user)\n end",
"title": ""
},
{
"docid": "53f5d60f07a7e1ccb6fbe59857a32cd1",
"score": "0.5448744",
"text": "def projects\n investigation.try(:projects) || []\n end",
"title": ""
},
{
"docid": "0d51ce8288f41ea503a9aa15fe0c7829",
"score": "0.5446437",
"text": "def index\n @recent_objects = Image.recent_from_project_id($project_id).order(updated_at: :desc).limit(10)\n end",
"title": ""
},
{
"docid": "49cfd57469ddd4b3803a6bc8078d348b",
"score": "0.5421923",
"text": "def latest_unpassing_jobs(project_id)\n latest_jobs(project_id).each_with_object([]) do |(branch, job_names), unpassing_jobs|\n job_names.each do |job_name, job|\n unpassing_jobs << job unless job['status'] == 'success'\n end\n end\nend",
"title": ""
},
{
"docid": "ffbb6a72a54f8170812f5c526f9221b5",
"score": "0.5421053",
"text": "def index\n @projects = Project.all.order('created_at desc')\n end",
"title": ""
},
{
"docid": "723f580541bd41ab30bb2973cfdea294",
"score": "0.5414747",
"text": "def listprojects\n get('listprojects.json')['projects']\n end",
"title": ""
},
{
"docid": "df7ab413facfe7d634e921e96de6d383",
"score": "0.5414078",
"text": "def find_all(project_id)\n query = \"project:=#{project_id}\"\n cols = %w(dtLastUpdated ixBug sStatus sTitle sLatestTextSummary\n ixProject sProject sPersonAssignedTo sPriority).join(',')\n api.command(:search, :q => query, :cols => cols).collect do |ticket|\n self.new ticket[1][\"case\"]\n end.flatten\n end",
"title": ""
},
{
"docid": "220480fd8bf6f6065b3a6a215b2952ba",
"score": "0.54086095",
"text": "def latest_commit current_project = last_changed_craft, saves = save_history, new_and_changed = new_and_changed \n crft = \"Ships/#{current_project.craft_type.upcase}/#{current_project.name}.craft\" if current_project\n \n return :current_project if saves[:quicksave].nil? || saves[:quicksave].size.eql?(1)\n if new_and_changed[:changed].include?(crft) || new_and_changed[:new].include?(crft)\n return :current_project\n else \n qs_commit = saves[:quicksave].first if saves[:quicksave] \n if qs_commit && current_project\n craft_commit = current_project.history(:limit => 1).first\n t= [[:quicksave, qs_commit], [:current_project, craft_commit]].sort_by{|_, c| c.try(:date) || Time.now}.last\n return t[0]\n else\n return :current_project\n end\n end\n end",
"title": ""
},
{
"docid": "0a1b1052569b16eabc3d9aa9ce9c04f8",
"score": "0.54072046",
"text": "def in_progress_build\n active_states = [\"deploying\", \"testing\", \"monitoring\", \"awaiting_confirmation\"]\n builds_dataset.reverse_order(:id).filter(:state => active_states).first\n end",
"title": ""
},
{
"docid": "c4ab71bff0b67b8837ee33580754c9db",
"score": "0.5401794",
"text": "def index\n @recent_objects = TaxonNameRelationship.recent_from_project_id($project_id).order(updated_at: :desc).limit(10)\n end",
"title": ""
},
{
"docid": "2396a07b96f4d0fc94998dd1f16260d2",
"score": "0.53997433",
"text": "def latest_version_uri\n '/api/projects/latest_compiled_version'\n end",
"title": ""
},
{
"docid": "e31f1dbfe056adf5fc78afa7be5cfe31",
"score": "0.5399506",
"text": "def index\n @projects = Project.all.order(:start_at)\n end",
"title": ""
},
{
"docid": "80dc923ff6006b962f7a32952982e266",
"score": "0.53966326",
"text": "def index\n @projects = Project.order(\" created_at desc\")\n end",
"title": ""
},
{
"docid": "01b101cbdbf6d8d378e7e63947fdfd94",
"score": "0.5396537",
"text": "def find_all\n api.command(:listProjects).collect do |project|\n project[1]['project'].map { |p| self.new p }\n end.flatten\n end",
"title": ""
},
{
"docid": "497f942532fe7374d2666a46d8cc2e3c",
"score": "0.5394939",
"text": "def svc_build_info(env, solution)\n url = \"http://#{env}.services.gamestop.com/Ecom/#{solution}/buildinfo.txt\"\n build_text_file = []\n open(url) do |f|\n no = 1\n f.each do |lines|\n build_text_file << lines\n no += 1\n break if no > 100\n end\n end\n #version = open(url).source.match(/(^Build Number)(.*)(_\\d*\\.\\d*)/)[3]\n return build_text_file\n end",
"title": ""
},
{
"docid": "ebd789c2fe3216e7b1388af0040a18d0",
"score": "0.53947055",
"text": "def index\n @projects = Project.all.order('created_at DESC')\n end",
"title": ""
},
{
"docid": "149e7e976b453eec1700ba3448b86051",
"score": "0.539345",
"text": "def index\n @os_builds = OsBuild.all\n end",
"title": ""
},
{
"docid": "de3cb485c983fa430d0496d32ea46226",
"score": "0.5385565",
"text": "def active_projects\n self.projects.where(:is_canceled => false, :is_finished => false )\n end",
"title": ""
},
{
"docid": "23adfad49e779edfdfc6277be0752c67",
"score": "0.5382121",
"text": "def history\n @vcs.history\n end",
"title": ""
},
{
"docid": "77f99532d1ec0f8c8de502469b76b875",
"score": "0.537825",
"text": "def project_get(project)\n project_find(project)\n projects = @project.all('a[class=table-link]') if @project\n\n project_names = []\n if projects\n projects.each do |proj|\n project_names << proj.text\n end\n else\n project_names = nil\n end\n project_names\n end",
"title": ""
},
{
"docid": "935f321653285a9fa302cc3f77619c03",
"score": "0.53709984",
"text": "def last_20_jobs(project_id)\n api(\"projects/#{project_id}/jobs\").sort_by { |j| -j['id'] }\nend",
"title": ""
},
{
"docid": "73ac1ccb52391ef438f4572a6a642338",
"score": "0.53671736",
"text": "def index\n\t\t@projects = Project.where(user_id: current_user.id).order(created_at: :asc)\n\tend",
"title": ""
},
{
"docid": "9a2985f4b46044bf806608ecd6127db9",
"score": "0.5350913",
"text": "def index\n\t\t@projects = current_user.projects.order(\"created_at ASC\")\n\tend",
"title": ""
},
{
"docid": "32d1c3a02a4a1fb972363595f05ac8f7",
"score": "0.53463876",
"text": "def changed_files_since_deploy\n if File.exists?(\"log/latest-REVISION-syntaxcheck\")\n revision = File.read(\"log/latest-REVISION-syntaxcheck\").chomp\n\n `git whatchanged #{revision}..HEAD`.split(\"\\n\").select{|l| l =~ /^\\:/}.collect {|l| l.split(\"\\t\")[1]}.sort.uniq\n else\n puts \"log/latest-REVISION-syntaxcheck not found. run 'cap fetch_currently_deployed_version' to get it\"\n []\n end\n end",
"title": ""
},
{
"docid": "e1b2451026f2afeb6eeac3157aedc94e",
"score": "0.53459936",
"text": "def latest_jobs(project_id)\n last_20_jobs(project_id).each_with_object({}) do |job, all_latest_jobs|\n branch = job['ref']\n job_name = job['name']\n all_latest_jobs[branch] = {} if all_latest_jobs[branch].nil?\n all_latest_jobs[branch][job_name] = job if all_latest_jobs[branch][job_name].nil?\n end\nend",
"title": ""
},
{
"docid": "73df53971695f37e9cad6cc23eba8c67",
"score": "0.53375864",
"text": "def index\n @projects = ProjectDecorator.all\n @releases = ReleaseDecorator.recent\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @projects }\n end\n end",
"title": ""
},
{
"docid": "62e9e7520a51229ffb08a14dba31af32",
"score": "0.5334651",
"text": "def recent_branches_fast\n\t\trefs = []\n\t\trefs.concat Pathname.glob(dot_git + 'refs/heads/**/*')\n\t\trefs.concat Pathname.glob(dot_git + 'refs/remotes/**/*')\n\n\t\tbranches = refs.reject {|r| r.directory? }.sort_by {|r| r.mtime }.last(@opts[:max_num]).map {|r|\n\t\t\tref = r.read.chomp\n\t\t\tif name = ref[/ref: (.+)/, 1]\n\t\t\t\tbegin\n\t\t\t\t\t(dot_git + name).read.chomp\n\t\t\t\trescue\n\t\t\t\t\t`git rev-parse #{name}`.chomp\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tref\n\t\t\tend\n\t\t}\n\t\tretrieve_branch_details(branches)\n\tend",
"title": ""
},
{
"docid": "3d0677cf923bdd35fcf57d27de062dcf",
"score": "0.53330266",
"text": "def recent_games\n fetch_games\n end",
"title": ""
}
] |
0290059b7b695f01f2e116bba61a81ef
|
Returns a Proc that can be used as a finalizer to call `BZ2_bzDecompressEnd` with the given `stream`.
|
[
{
"docid": "f3c1f842ec2395a6cc4993d1d05afe24",
"score": "0.83835155",
"text": "def finalize(stream)\n ->(id) do\n Libbz2::BZ2_bzDecompressEnd(stream)\n end\n end",
"title": ""
}
] |
[
{
"docid": "70d771cba1d352b3dbc9c810811d65da",
"score": "0.61844575",
"text": "def StreamDataEnd(stream)\n @ole._invoke(9, [stream], [VT_BYREF|VT_DISPATCH])\n end",
"title": ""
},
{
"docid": "4d862d0b899b081d3bc52815d9525948",
"score": "0.5620141",
"text": "def pull(stream)\n stream.is_a?(Proc) && !cons?(stream) ? pull(stream.call) : stream\n end",
"title": ""
},
{
"docid": "ac4c63c7093815dfa837b7372e5f237e",
"score": "0.5435605",
"text": "def define_finalizer(obj, a_proc)\n # Smalltalk code raises ArgumentError if obj is a committed object .\n unless a_proc._kind_of?(Proc) || a_proc._isExecBlock || a_proc.respond_to?( :call )\n raise TypeError, 'define_finalizer expected a Block or Proc'\n end \n Finalizer.__create(obj, a_proc) \n self\n end",
"title": ""
},
{
"docid": "c2da00dfba0526aca216c3a094a2a35c",
"score": "0.5400644",
"text": "def stream_close\n self[STREAM_CLOSE].call\n end",
"title": ""
},
{
"docid": "7460528f0734f278215bca6040690454",
"score": "0.5333191",
"text": "def compress(stream_or_string)\n streamify(stream_or_string) do |stream|\n output = true\n status = POpen4.popen4(command, \"b\") do |stdout, stderr, stdin, pid|\n begin\n stdin.binmode\n transfer(stream, stdin)\n\n if block_given?\n yield stdout\n else\n output = stdout.read\n end\n\n rescue Exception => e\n raise RuntimeError, \"compression failed\"\n end\n end\n\n if status.exitstatus.zero?\n output\n else\n raise RuntimeError, \"compression failed\"\n end\n end\n end",
"title": ""
},
{
"docid": "b4086f8892930f4ac6aed35687ea0d46",
"score": "0.5016478",
"text": "def close\n close_stream\n end",
"title": ""
},
{
"docid": "c5ef8adfbd295cdf617729f5d56d15c2",
"score": "0.5009407",
"text": "def decompressor; end",
"title": ""
},
{
"docid": "27b1c1445d922827ed8d5f0c1bfb18fe",
"score": "0.4940846",
"text": "def decode_stream(stream)\n stream.each_line{|l|\n toks = l.split(/[ \\t\\r]/)\n next unless toks.length >= 2\n\n addrtok, optok = toks\n next unless is_addr(addrtok) && is_hexword(optok)\n\n address = hex_to_u32(addrtok)\n opcode = hex_to_u32(optok)\n\n out = decode(address, opcode)\n printf(\"%08x:\\t%08x\\t%s\\n\", address, opcode, out)\n }\nend",
"title": ""
},
{
"docid": "38932a4146543d93fb32fa36e3d779be",
"score": "0.49240097",
"text": "def finish(*args,&ruby_block)\n # Gain access to the finisher as local variable.\n finisher_proc = @finisher_proc\n # # The context is the one of the finisher.\n # Execute the code generating the finisher in context.\n HDLRuby::High.space_push(@namespace)\n HDLRuby::High.cur_block.open do\n instance_exec(ruby_block,*args,&finisher_proc)\n end\n HDLRuby::High.space_pop\n end",
"title": ""
},
{
"docid": "edc516a330c8ba402ec14085342a5b38",
"score": "0.49121022",
"text": "def close\n format.flush\n stream.close\n rescue Exception => e\n puts \"There was an issue closing the stream: #{e}\"\n end",
"title": ""
},
{
"docid": "5a49da3225ec5e117682ea649a45b49c",
"score": "0.49105358",
"text": "def close_stream\n \"</stream:stream>\"\n end",
"title": ""
},
{
"docid": "bace02e1aa4b89eef45412fe3ee9cffb",
"score": "0.4893275",
"text": "def decompress(data); end",
"title": ""
},
{
"docid": "e827054ed0448b7f3b05ffa171778537",
"score": "0.48697627",
"text": "def decrypt_stream(cipher_stream, output_stream, private_key)\n private_key = Validation.check_type_argument!(VirgilPrivateKey, private_key)\n begin\n cipher = Core::VirgilChunkCipher.new\n source = VirgilStreamDataSource.new(cipher_stream)\n sink = VirgilStreamDataSink.new(output_stream)\n cipher.decrypt_with_key(source, sink, private_key.id, private_key.raw_key)\n rescue StandardError => error\n raise VirgilCryptoException, error.message\n end\n end",
"title": ""
},
{
"docid": "7e3b660798825b07af1d132f10bb9a82",
"score": "0.48600447",
"text": "def close_stream source # :nodoc:\n @drb_streams.delete source\n @incomplete_streams.delete source\n @incomplete_timestamps.delete source\n end",
"title": ""
},
{
"docid": "0dc1a5b08599d6e4ad175a176f5ef9ca",
"score": "0.47955623",
"text": "def zipped_stream(entry)\n Zlib::GzipReader.new entry\n end",
"title": ""
},
{
"docid": "3698df6c61a54008db8320850922e393",
"score": "0.47800604",
"text": "def on_finish(path, &block)\n rules.add(path, Sawtooth::Rules::CallRule.new(:finish => block)) if block_given?\n end",
"title": ""
},
{
"docid": "41df3c0a28792a094ea4aed8b7ee1bf7",
"score": "0.475193",
"text": "def after_stream\n end",
"title": ""
},
{
"docid": "b47ab7c1248902cbf460c406d99077d5",
"score": "0.47157255",
"text": "def close\n @stream.close\n end",
"title": ""
},
{
"docid": "8a66519253ca034a7ae83a07db42bd99",
"score": "0.46943423",
"text": "def handle_streams(stdout_stream, stderr_stream, &block)\n logger.debug \"Monitoring stdout/stderr streams for output\"\n streams = [stdout_stream, stderr_stream]\n until streams.empty?\n # Find which streams are ready for reading, timeout 0.1s\n selected, = select(streams, nil, nil, 0.1)\n\n # Try again if none were ready\n next if selected.nil? or selected.empty?\n\n selected.each do |stream|\n if stream.eof?\n logger.debug \"Stream reached end-of-file\"\n if @success.nil?\n logger.debug \"Process hasn't finished, keeping stream\"\n else\n logger.debug \"Removing stream\"\n streams.delete(stream)\n end\n next\n end\n\n while data = @reader.call(stream)\n data = ((@options[:mode] == :chars) ? data.chr : data)\n stream_name = (stream == stdout_stream) ? :stdout : :stderr\n output data, stream_name, &block unless block.nil?\n buffer data, stream_name unless @options[:no_buffer]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "49b862ce66cb29c17832fc574026c810",
"score": "0.46798447",
"text": "def close_stream(env)\n env.stream_send([0, CRLF, CRLF].join)\n env.stream_close\n end",
"title": ""
},
{
"docid": "1a1cd33b70ab2de30900437b2b18bb6e",
"score": "0.4678998",
"text": "def close(error = nil)\n\t\t\t\t\t\tif @stream\n\t\t\t\t\t\t\t@stream.finish_output(error)\n\t\t\t\t\t\t\t@stream = nil\n\t\t\t\t\t\tend\n\t\t\t\t\tend",
"title": ""
},
{
"docid": "6ae8b614585be56dd8386674dce52573",
"score": "0.46516997",
"text": "def close\n @stream.close unless @stream.nil? || @stream.closed?\n end",
"title": ""
},
{
"docid": "83b57d6d91af5e4857d193fc86c83f1d",
"score": "0.4650574",
"text": "def on_finish &block\r\n @finish_block = block\r\n end",
"title": ""
},
{
"docid": "766fa9546662854332b0932d9668cbde",
"score": "0.46501675",
"text": "def when_finalized(&block)\n method_name = \"finalization_handler_#{block.object_id}\"\n define_method(method_name, &block)\n finalization_handlers << instance_method(method_name)\n end",
"title": ""
},
{
"docid": "788a99dcfe0d6d86dd4d8712ea5a04ad",
"score": "0.46414477",
"text": "def decompress(body)\n Zlib::GzipReader.new(StringIO.new(body)).read\n rescue Zlib::GzipFile::Error\n # We thought the response was gzipped, but it wasn't. Return the original\n # body back to the caller. See https://github.com/restforce/restforce/issues/761.\n body\n end",
"title": ""
},
{
"docid": "f1ac64ce753bc72a3e0fd12378da4f44",
"score": "0.4601509",
"text": "def decompress\n header = buf.u32\n return :invalid_data if (header & 0xFF) != 0x11\n decompressedSize = header >> 8\n decompressedSize = buf.u32 if decompressedSize == 0\n\n bufferLength = 0x1000\n buffer = Array.new(bufferLength)\n bufferOffset = 0\n\n flags = 0\n mask = 1\n\n outbuf = []\n until outbuf.size >= decompressedSize\n if mask == 1\n flags = buf.u8\n return :stream_too_short if flags.nil?\n mask = 0x80\n else\n mask >>= 1\n end\n\n if (flags & mask) > 0\n byte1 = buf.u8\n return :stream_too_short if byte1.nil?\n\n length = byte1 >> 4\n disp = -1\n case length\n when 0\n byte2 = buf.u8\n byte3 = buf.u8\n return :stream_too_short if byte3.nil?\n length = (((byte1 & 0x0F) << 4) | (byte2 >> 4)) + 0x11\n disp = (((byte2 & 0x0F) << 8) | byte3) + 0x1\n when 1\n byte2 = buf.u8\n byte3 = buf.u8\n byte4 = buf.u8\n return :stream_too_short if byte4.nil?\n length = (((byte1 & 0x0F) << 12) | (byte2 << 4) | (byte3 >> 4)) + 0x111\n disp = (((byte3 & 0x0F) << 8) | byte4) + 0x1\n else\n byte2 = buf.u8\n return :stream_too_short if byte2.nil?\n length = ((byte1 & 0xF0) >> 4) + 0x1\n disp = (((byte1 & 0x0F) << 8) | byte2) + 0x1\n end\n\n return :invalid_data if disp > outbuf.size\n\n bufIdx = bufferOffset + bufferLength - disp\n length.times do\n next_byte = buffer[bufIdx % bufferLength]\n bufIdx += 1\n outbuf << next_byte\n buffer[bufferOffset] = next_byte\n bufferOffset = (bufferOffset + 1) % bufferLength\n end\n else\n next_byte = buf.u8\n return :stream_too_short if next_byte.nil?\n outbuf << next_byte\n buffer[bufferOffset] = next_byte\n bufferOffset = (bufferOffset + 1) % bufferLength\n end\n end\n\n outbuf\n end",
"title": ""
},
{
"docid": "99ced0d0e5033cd420e9e126844b59d5",
"score": "0.4581944",
"text": "def capture(stream)\n begin\n stream = stream.to_s\n eval \"$#{stream} = StringIO.new\"\n yield\n result = eval(\"$#{stream}\").string\n ensure\n eval(\"$#{stream} = #{stream.upcase}\")\n end\n\n result\nend",
"title": ""
},
{
"docid": "99ced0d0e5033cd420e9e126844b59d5",
"score": "0.4581944",
"text": "def capture(stream)\n begin\n stream = stream.to_s\n eval \"$#{stream} = StringIO.new\"\n yield\n result = eval(\"$#{stream}\").string\n ensure\n eval(\"$#{stream} = #{stream.upcase}\")\n end\n\n result\nend",
"title": ""
},
{
"docid": "99ced0d0e5033cd420e9e126844b59d5",
"score": "0.4581944",
"text": "def capture(stream)\n begin\n stream = stream.to_s\n eval \"$#{stream} = StringIO.new\"\n yield\n result = eval(\"$#{stream}\").string\n ensure\n eval(\"$#{stream} = #{stream.upcase}\")\n end\n\n result\nend",
"title": ""
},
{
"docid": "d74498a40717cb6ccd55749c97795b2f",
"score": "0.45411518",
"text": "def capture(stream)\n begin\n stream = stream.to_s\n eval \"$#{stream} = StringIO.new\"\n yield\n result = eval(\"$#{stream}\").string\n ensure\n eval(\"$#{stream} = #{stream.upcase}\")\n end\n result\nend",
"title": ""
},
{
"docid": "ddade4601c0e2b7b086b4014120fcc57",
"score": "0.45360106",
"text": "def decode(&block)\n @stream.each_frame(&block)\n end",
"title": ""
},
{
"docid": "fd78eac5699e37c833876a42b6334cd2",
"score": "0.45212498",
"text": "def body_write_callback\n @body_write_callback ||= proc do |stream, size, num, object|\n headers\n result = body(chunk = stream.read_string(size * num))\n @response_body << chunk if result == :unyielded\n result != :abort ? size * num : -1\n end\n end",
"title": ""
},
{
"docid": "fcf6e9eeb8a8fd282d3b30211e967d40",
"score": "0.45125043",
"text": "def finish(&block)\n (@finish ||= [ ]) << block\n end",
"title": ""
},
{
"docid": "d2239c99525c0b12325514de5279108c",
"score": "0.45124578",
"text": "def close(close_child_stream = true)\n final = @stream_cipher.final\n @ios.write(final) if final.length > 0\n @ios.close if close_child_stream\n end",
"title": ""
},
{
"docid": "e295f8003de68c7bb208adaa438d04fd",
"score": "0.4509224",
"text": "def capture(stream)\r\n begin\r\n stream = stream.to_s\r\n eval \"$#{stream} = StringIO.new\"\r\n yield\r\n result = eval(\"$#{stream}\").string\r\n ensure\r\n eval(\"$#{stream} = #{stream.upcase}\")\r\n end\r\n\r\n result\r\n end",
"title": ""
},
{
"docid": "6acea689b6b2567e9772a70a8cf43e39",
"score": "0.4508691",
"text": "def capture(stream)\n begin\n stream = stream.to_s\n eval \"$#{stream} = StringIO.new\"\n yield\n result = eval(\"$#{stream}\").string\n ensure\n eval(\"$#{stream} = #{stream.upcase}\")\n end\n\n result\n end",
"title": ""
},
{
"docid": "6acea689b6b2567e9772a70a8cf43e39",
"score": "0.4508691",
"text": "def capture(stream)\n begin\n stream = stream.to_s\n eval \"$#{stream} = StringIO.new\"\n yield\n result = eval(\"$#{stream}\").string\n ensure\n eval(\"$#{stream} = #{stream.upcase}\")\n end\n\n result\n end",
"title": ""
},
{
"docid": "861f8a9d2feca1d2dcde99fd571cb7b6",
"score": "0.44986895",
"text": "def on_close(&block)\n raise(ArgumentError, \"Must have a Proc.\") unless block_given?\n @procs_close << block\n return self\nend",
"title": ""
},
{
"docid": "f56f3757b2e2af81ffba1d322a6b4092",
"score": "0.44858858",
"text": "def write_data_block(stream, rt, lg, data) # :nodoc:\n\t compress = 0\n\t if compress? && data.size > COMPRESSION_MIN_SIZE\n\t\tdata = Zlib::Deflate.deflate(data)\n\t\tcompress = 1\n\t end\n\n do_write do\n Logfiles.write_data_block(wio, stream.index, rt, lg, compress, data)\n end\n\tend",
"title": ""
},
{
"docid": "7b409b79e941a081ffdf088d5fbb9612",
"score": "0.44738403",
"text": "def deq(&proc)\n loop do\n batch = @out_queue.deq\n if batch == CLOSE_BATCH\n break\n end\n proc.call(batch)\n end\n end",
"title": ""
},
{
"docid": "21443bf7a21bc0007cb904626a66adf4",
"score": "0.44607514",
"text": "def close\n @processor.finish\n end",
"title": ""
},
{
"docid": "2750b27447b7d133447dd68c41e922c6",
"score": "0.44594294",
"text": "def do_finalization(key,obj)\n\t\t\t\t@finalizers.each do |f|\n\t\t\t\t\tf[0].call(key,obj,*f[1])\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "b23fb977caa3f4f32dcc2b43d307ca97",
"score": "0.44440132",
"text": "def on_eof(&block); end",
"title": ""
},
{
"docid": "3dfacde01cae87f34ea2747ea80824ff",
"score": "0.44421136",
"text": "def add_finalizer(*args,&block)\n\t\t\t\t@finalizers.push [block,args]\n\t\t\tend",
"title": ""
},
{
"docid": "70dc7d2e45082d92015956a1ce234d4f",
"score": "0.44181263",
"text": "def decompress(compressed)\n nil\n end",
"title": ""
},
{
"docid": "9057a89b932bda2587a55c5dcbd5acf4",
"score": "0.4413355",
"text": "def set_output_stream_done\n @call_finished_mu.synchronize do\n @output_stream_done = true\n maybe_finish_and_close_call_locked\n end\n end",
"title": ""
},
{
"docid": "5cf6cc2242232c1f48dc2f394eda060d",
"score": "0.43956244",
"text": "def stream_is_done?\n @stream.nil? || @stream.closed? || @stream.eof?\n end",
"title": ""
},
{
"docid": "450c36fe47b8827a22236ab40508621c",
"score": "0.43935797",
"text": "def close(buffer = \"\")\n return if @block.nil?\n\n to_call, @block = @block, nil\n to_call.call(self, slice_from_buffer(buffer))\n end",
"title": ""
},
{
"docid": "7b668d9dedb3338833b93cca54b197c2",
"score": "0.43835917",
"text": "def evaluate(stream) \n @stack = []\n @stream = stream \n @i = 0\n @error = false\n return parse \n end",
"title": ""
},
{
"docid": "0687a9fe48f9a164f0d0e9c9bb55e93d",
"score": "0.4377062",
"text": "def close\n inputstream.close\n @closed = true\n end",
"title": ""
},
{
"docid": "29cd70cadaa2ea6ae362653db0ef2795",
"score": "0.4373165",
"text": "def finish(*args,&ruby_block)\n # Gain access to the finisher as local variable.\n finisher_proc = @finisher_proc\n # Execute the code generating the accesser in context.\n HDLRuby::High.space_push(@namespace)\n HDLRuby::High.cur_block.open do\n instance_exec(ruby_block,*args,&finisher_proc)\n end\n HDLRuby::High.space_pop\n end",
"title": ""
},
{
"docid": "eefcfcfa50108cb6abc34374b613c3ab",
"score": "0.43650928",
"text": "def close\n send(\"</stream:stream>\")\n super\n end",
"title": ""
},
{
"docid": "c8ab8438d6a9acd1bfff3629fb190533",
"score": "0.4361963",
"text": "def close\n @closed = true\n @stream_fiber = nil\n nil\n end",
"title": ""
},
{
"docid": "b544aedac07c1073c3d29dfac6cb184f",
"score": "0.43609473",
"text": "def finish\n return if @inflate.total_in == 0\n @inflate.finish\n end",
"title": ""
},
{
"docid": "0e1cf0cb1f5c39711aa773b8ac294999",
"score": "0.4359394",
"text": "def finalize_stream_execution(stream_id, execution_id)\n authenticate unless authenticated?\n endpoint = \"#{@@streams_endpoint}/#{stream_id}/executions/#{execution_id}/commit\"\n response = RestClient::Request.execute(\n url: endpoint,\n method: :put,\n headers: headers('application/json')\n )\n return JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "76a6196ae7b56a13585437101e321136",
"score": "0.4349847",
"text": "def setup_finalizer\n ObjectSpace.define_finalizer(self, self.class.close_zmsg(@zmsg))\n end",
"title": ""
},
{
"docid": "1be577ab0f9b19b4e798c0f6fba5b21e",
"score": "0.43482918",
"text": "def on_finish &b\n @on_finish_cb = b\n end",
"title": ""
},
{
"docid": "ec69908c01fb08bdebe3e503d08e9b89",
"score": "0.43328837",
"text": "def stream *args, &block\n get(*args) { stream { |io| instance_exec io, &block } }\n end",
"title": ""
},
{
"docid": "3e7034403d348108c5261b81baf8b81e",
"score": "0.43211648",
"text": "def setup_finalizer\n ObjectSpace.define_finalizer(self, self.class.close_zloop(@zloop))\n end",
"title": ""
},
{
"docid": "691aeecba66ea06ebc4e06576791a189",
"score": "0.4320573",
"text": "def finalize(finalizer, options = {})\n @stack << [self.class.get_callable(finalizer, Roger::Release::Finalizers.map), options]\n end",
"title": ""
},
{
"docid": "c5442b974ea2d9bde33ab6aa39f36580",
"score": "0.43109342",
"text": "def on_end(&callback)\n @end_callback = callback\n end",
"title": ""
},
{
"docid": "c828797e12ffc34288ea9e03e03225b3",
"score": "0.4292967",
"text": "def each_chunk stream\n while !stream.eof?\n yield read_chunk stream\n end\n end",
"title": ""
},
{
"docid": "7666ddcdb2652e8ade6217fdd94a8eaf",
"score": "0.42680675",
"text": "def setup_finalizer\n ObjectSpace.define_finalizer(self, self.class.close_io(@file))\n end",
"title": ""
},
{
"docid": "403a041c021f57dc7894862436be4023",
"score": "0.42664403",
"text": "def compress(stream_or_string, options={})\n raise ArgumentError, 'Option :type required' unless options.key?(:type)\n\n string = stringify(stream_or_string)\n\n case options[:type].to_s\n when 'js'\n options = default_js_options.merge(options)\n when 'css'\n options = default_css_options.merge(options)\n else\n raise ArgumentError, 'Unknown resource type: %s' % options[:type]\n end\n\n command = [ options.delete(:java) || 'java', '-jar', JAR_FILE ]\n command.concat(command_arguments(options))\n\n stdout_str, stderr_str, status = Open3.capture3(command.join(' '), stdin_data: string, binmode: true)\n unless status.success?\n raise \"Compression failed: #{stderr_str}\"\n end\n stdout_str\n end",
"title": ""
},
{
"docid": "4f01ed0febf476c13d23fde6e7bd56db",
"score": "0.42656636",
"text": "def setup_finalizer\n ObjectSpace.define_finalizer(self, self.class.close_io(@file))\n end",
"title": ""
},
{
"docid": "082971813c3e867c18df04dedd920b97",
"score": "0.42646733",
"text": "def finish(*args,&ruby_block)\n # Gain access to the accesser as local variable.\n finisher_proc = @finisher_proc\n # Execute the code generating the accesser in context.\n HDLRuby::High.space_push(@namespace)\n HDLRuby::High.cur_block.open do\n instance_exec(ruby_block,*args,&finisher_proc)\n end\n HDLRuby::High.space_pop\n end",
"title": ""
},
{
"docid": "d414c40253195822eafda5b3f460ea37",
"score": "0.4263129",
"text": "def StreamDBWillBeDeleted(stream)\n @ole._invoke(6, [stream], [VT_BYREF|VT_DISPATCH])\n end",
"title": ""
},
{
"docid": "09bef5a2fa3bff01d0ecb5fc646660f7",
"score": "0.42630708",
"text": "def close( &block )\n compile!( :close!, &block )\n end",
"title": ""
},
{
"docid": "607fa018f7bd09312da37d3d99f1c4ee",
"score": "0.4259862",
"text": "def stream; end",
"title": ""
},
{
"docid": "607fa018f7bd09312da37d3d99f1c4ee",
"score": "0.4259862",
"text": "def stream; end",
"title": ""
},
{
"docid": "607fa018f7bd09312da37d3d99f1c4ee",
"score": "0.4259862",
"text": "def stream; end",
"title": ""
},
{
"docid": "607fa018f7bd09312da37d3d99f1c4ee",
"score": "0.4259862",
"text": "def stream; end",
"title": ""
},
{
"docid": "1fee6642c8b3dac10ec4e1174d906cb7",
"score": "0.4249426",
"text": "def response(env)\n status, headers, body = finalize(env)\n\n env[STREAM_START].call(status, headers)\n\n operation = proc { body.each { |chunk| env.stream_send(chunk) } }\n callback = proc { env.stream_close }\n\n EM.defer(operation, callback) # use an outside thread pool for streaming\n\n nil\n end",
"title": ""
},
{
"docid": "3ae7991473febdfa9b15455c0793de61",
"score": "0.42485726",
"text": "def uncompressed_size\n @deflater.closed? ? @uncompressed_size : @deflater.total_in\n end",
"title": ""
},
{
"docid": "4dea04930d4123dadf3f05a94d25ac04",
"score": "0.4238537",
"text": "def inflate2(data)\n zlib = Zlib::Inflate.new(15)\n buff = zlib.inflate(data)\n zlib.finish\n zlib.close\n buff\nend",
"title": ""
},
{
"docid": "321702e1bd0684837b870fac917de78c",
"score": "0.42357287",
"text": "def stream_finished_output(job)\n builder = EventBuilder.new(job)\n transmit event: :started, data: builder.payload(:started, nil)\n job.output.each_line do |line|\n transmit event: :message, data: builder.payload(:message, line)\n end\n transmit event: :finished, data: builder.payload(:finished, nil)\n end",
"title": ""
},
{
"docid": "a0c60adf2a99043f2b1b0ded7e6fae9a",
"score": "0.42348072",
"text": "def safe_zlib_unzip\n Zip::File.open_buffer(file)\n end",
"title": ""
},
{
"docid": "b2fdb959464cf0c814dd5889e9e4391a",
"score": "0.42345372",
"text": "def on_finish(&block)\n @options[:finish] = block\n end",
"title": ""
},
{
"docid": "1ebeabe707bb1e73d84771a477a521f9",
"score": "0.42275706",
"text": "def get_output_stream(entry, permission_int = T.unsafe(nil), comment = T.unsafe(nil), extra = T.unsafe(nil), compressed_size = T.unsafe(nil), crc = T.unsafe(nil), compression_method = T.unsafe(nil), size = T.unsafe(nil), time = T.unsafe(nil), &a_proc); end",
"title": ""
},
{
"docid": "60eef509267960e1a2f59ab472cd28f1",
"score": "0.42153537",
"text": "def do_later\n at_exit{ yield }\n end",
"title": ""
},
{
"docid": "66d0e938a548c0beaf7b24e38fdb921c",
"score": "0.4195545",
"text": "def consumeStream(stream)\n begin\n stream.consume do |message|\n\n #message.force_encoding(\"UTF-8\")\n\n @activities << message #Add to end of array.\n\n if message.scan(/\"gnip\":/).count > 1 then\n @log.warn { \"Received corrupt JSON? --> #{message}\" }\n end\n\n if @activities.length > 1000 then\n @log.debug \"Queueing #{@activities.length} activities...\"\n end\n\n end\n rescue => e\n @log.error { \"Error occurred in consumeStream: #{e.message}\" }\n consumeStream(@stream)\n end\n end",
"title": ""
},
{
"docid": "8c9af81cf6446fe57facafd8bfb07c43",
"score": "0.41818768",
"text": "def delete_from_stream(name, &blk)\n on_event(:incoming_stream) do\n instance_eval(&blk) if correct_stream?(name, :delete)\n end\n end",
"title": ""
},
{
"docid": "7d63eacbbaa39a73b4d8f68d6d74179e",
"score": "0.41815242",
"text": "def decode_from(stream)\n ::Protobuf::Decoder.decode_each_field(stream) do |tag, bytes|\n set_field_bytes(tag, bytes)\n end\n\n self\n end",
"title": ""
},
{
"docid": "977c27a4d97907f3809c0b4d4f123e56",
"score": "0.4179003",
"text": "def get_stream_data(object)\n start_word = /stream(\\n|\\r\\n)/\n end_word = /endstream/\n start_word_length = 7\n end_word_length = 9\n stream_objects = get_block_data(object, start_word, end_word, end_word_length)\n\n unless(stream_objects.empty?)\n start_index = stream_objects[0].index(start_word)\n end_index = stream_objects[0].index(end_word)\n\n # tricky stuff\n start_word_length = 8 if(stream_objects[0][1..8] == \"stream\\r\\n\")\n\n # extract 1 byte extra because endstream can have 1 random byte as end character (rtfm)\n data = stream_objects[0].slice(start_word_length, stream_objects[0].length - start_word_length - end_word_length - 1)\n end\n\n return data unless data.nil?\n end",
"title": ""
},
{
"docid": "7e8cd986c431f20bee0e5398fa63e54e",
"score": "0.41636354",
"text": "def finalize(flatten)\n @pdf_stamper.setFormFlattening flatten\n @pdf_stamper.close\n @file_reader.close\n @byte_stream.toByteArray\n end",
"title": ""
},
{
"docid": "9ebd7bc98a2a67751f9b65a68a511a2d",
"score": "0.4155973",
"text": "def finish\n # Do not close wrapped IO object in #close\n @finish = true\n close\n\n @delegate_io\n end",
"title": ""
},
{
"docid": "9e5acc6e55488515f437d7ecc1985e31",
"score": "0.41542205",
"text": "def end_listen\n @stream.end_listen\n end",
"title": ""
},
{
"docid": "98a38c409dbd9e81a2357904a3ee2dac",
"score": "0.4153741",
"text": "def service(raw)\n\t\tamfobj = AMFObject.new(raw)\n\t\tfilter_chain = FilterChain.new\n\t\tfilter_chain.run(amfobj)\n\t\tif(RequestStore.gzip)\n\t\t return Zlib::Deflate.deflate(amfobj.output_stream)\n\t\telse\n\t\t return amfobj.output_stream\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ea91af18b026b7d3a6773295849d21b9",
"score": "0.41514975",
"text": "def on_finished(&block)\n @finished_handler = block\n end",
"title": ""
},
{
"docid": "fdfec35f0f4ad60e5664726983baef5c",
"score": "0.41512468",
"text": "def close_block\n unless @rr.empty? then @r = @rr.pop end # back with the register\n @pipe.pop; @opener.pop; @finisher.pop # pop the writing stack\n ( @head.pop + @tail.pop ).join # join head and tail\n end",
"title": ""
},
{
"docid": "7824379722e74f3e54db823e157be302",
"score": "0.41499403",
"text": "def capture_output(stream = STDOUT, &_block)\n old_stdout = stream.clone\n pipe_r, pipe_w = IO.pipe\n pipe_r.sync = true\n output = \"\"\n reader = Thread.new do\n begin\n loop do\n output << pipe_r.readpartial(1024)\n end\n rescue EOFError\n end\n end\n stream.reopen(pipe_w)\n yield\n ensure\n stream.reopen(old_stdout)\n pipe_w.close\n reader.join\n pipe_r.close\n return output\n end",
"title": ""
},
{
"docid": "f7588ece4e2573bdcd2742f6d8aebe8b",
"score": "0.41494927",
"text": "def decompress_file(file, to)\n end",
"title": ""
},
{
"docid": "eabee7bbd15475676738c900e004f54e",
"score": "0.41430053",
"text": "def stream_value(stream, range = 0...@size)\n raise ArgumentError,\n \"Stream passed in must provide a write method\" unless\n stream.respond_to? :write\n\n bytes = 0\n\n value(range) do |chunk|\n bytes += stream.write(chunk)\n end\n\n bytes\n end",
"title": ""
},
{
"docid": "8f92b6474dbcbffe0915e37cc923c5f7",
"score": "0.41301733",
"text": "def deflate(s)\n Snappy.compress(s)\n end",
"title": ""
},
{
"docid": "323c5327a68cb90c046e677d7f9f8947",
"score": "0.41289017",
"text": "def dump_blocks(stream, x_start, y_start, z_start, x_end, y_end, z_end)\n\n end",
"title": ""
},
{
"docid": "98e76d9ef303c2b1e409fe3604c5e6d6",
"score": "0.41272935",
"text": "def decompress_response(response)\n if response['content-encoding'] != 'gzip'\n ::NewRelic::Agent.logger.debug \"Uncompressed content returned\"\n response.body\n else\n ::NewRelic::Agent.logger.debug \"Decompressing return value\"\n i = Zlib::GzipReader.new(StringIO.new(response.body))\n i.read\n end\n end",
"title": ""
},
{
"docid": "0b230a257112dbc7c61fbf7f45d8342d",
"score": "0.41207606",
"text": "def finalise\n end",
"title": ""
},
{
"docid": "45b56a18f346f468e43716a62b37d909",
"score": "0.41112086",
"text": "def finisher(&ruby_block)\n @finisher_proc = ruby_block\n end",
"title": ""
},
{
"docid": "fa1addc37081de6893b84d379e5ee765",
"score": "0.41036934",
"text": "def uncompressed_size\n @inflater.closed? ? @uncompressed_size : @inflater.total_out\n end",
"title": ""
},
{
"docid": "ffef8698dcf1a60e3b9dfb458c088d4d",
"score": "0.40888914",
"text": "def close_buffer\n return @output_stream if @closed\n\n finalize_current_entry\n update_local_headers\n @cdir.write_to_stream(@output_stream)\n @closed = true\n @output_stream.flush\n @output_stream\n end",
"title": ""
}
] |
1feeac7e0b23cf23f77036318bb8c20d
|
Set the value of the CalendarID input for this Choreo.
|
[
{
"docid": "b0d17a0cc69417e748eba4d0ca39c1cc",
"score": "0.7333203",
"text": "def set_CalendarID(value)\n set_input(\"CalendarID\", value)\n end",
"title": ""
}
] |
[
{
"docid": "8dc00892a5e17d4a687d0cf62fe1f1d2",
"score": "0.65536475",
"text": "def set_calendar\n @calendar = Calendar.find(params[:calendar_id])\n end",
"title": ""
},
{
"docid": "908aee9a5005a4ef6938b87cc61948eb",
"score": "0.64115894",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.6269485",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "ff5a5be5c616dbbd0746dfc75f14f8dd",
"score": "0.61350113",
"text": "def set_calendar\n @calendar = current_user.calendars.find(params[:id])\n end",
"title": ""
},
{
"docid": "ff5a5be5c616dbbd0746dfc75f14f8dd",
"score": "0.61350113",
"text": "def set_calendar\n @calendar = current_user.calendars.find(params[:id])\n end",
"title": ""
},
{
"docid": "4abb96616ac27d58bc83183dd1895582",
"score": "0.6101126",
"text": "def MonthCal_SetCALID(hmc, calid) send_month_calendar_message(hmc, :SETCALID, wparam: calid) end",
"title": ""
},
{
"docid": "91c2e0d348b3021a0b307e64b93396e7",
"score": "0.60450286",
"text": "def set_calendar_event\n @calendar_event = CalendarEvent.find(params[:id])\n end",
"title": ""
},
{
"docid": "4145b70186cc2d5166c16d160cb9548a",
"score": "0.6018661",
"text": "def set_event_calendar\n @event_calendar = EventCalendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "f196e5746bc3317121d1f08a6067cf44",
"score": "0.5885921",
"text": "def calendar=(value)\n @calendar = value\n end",
"title": ""
},
{
"docid": "f196e5746bc3317121d1f08a6067cf44",
"score": "0.5885921",
"text": "def calendar=(value)\n @calendar = value\n end",
"title": ""
},
{
"docid": "f196e5746bc3317121d1f08a6067cf44",
"score": "0.5885921",
"text": "def calendar=(value)\n @calendar = value\n end",
"title": ""
},
{
"docid": "a23d5779a006a9ed1e44cb46ea8e65cd",
"score": "0.58837765",
"text": "def set_service_calendar\n @service_calendar = ServiceCalendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "5a0b3fd460a25a7f332337e27ead6376",
"score": "0.5855919",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "5a0b3fd460a25a7f332337e27ead6376",
"score": "0.5855919",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "4e088478f7db36eb35a792a80c643dec",
"score": "0.5824673",
"text": "def set_calender(id)\n @calender = Calender.find(id)\n end",
"title": ""
},
{
"docid": "d82345e33044cbb7089b3b1fee290cc2",
"score": "0.5757608",
"text": "def set_service_calendar\n @service_calendar = ServiceCalendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "d55547deabbe907143aff2b8acf7e6c9",
"score": "0.5682459",
"text": "def set_calendar_event\n @user_id = current_user.id\n @calendar_event = CalendarEvent.find(params[:id])\n end",
"title": ""
},
{
"docid": "13ff20f670b0f88dec9e04554d0e3810",
"score": "0.56805974",
"text": "def set_calendar_event\n @calendar_event = CalendarEvent.find(params[:id])\n end",
"title": ""
},
{
"docid": "96f994004fc0adc58af890b4429c91f9",
"score": "0.56486017",
"text": "def set_calendar_item\n @calendar_item = CalendarItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "2e0c58da6d9590ef946da1fb206f8858",
"score": "0.5575847",
"text": "def set_calendar_setting\n @calendar_setting = CalendarSetting.find(params[:id])\n end",
"title": ""
},
{
"docid": "781a9d228cc59dbcf0db26ec7c6c7c48",
"score": "0.55194193",
"text": "def set_calendar_task\n @calendar_task = CalendarTask.find(params[:id])\n end",
"title": ""
},
{
"docid": "142890a23c7564e49b1e6f53720461cf",
"score": "0.5505597",
"text": "def set_mcalendar\n @mcalendar = Mcalendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "f67436cd6e52ef12da2aa96d7e3ebdb6",
"score": "0.5458862",
"text": "def set_CalendarName(value)\n set_input(\"CalendarName\", value)\n end",
"title": ""
},
{
"docid": "8268b2023be95dedee8decd12a68030b",
"score": "0.5424609",
"text": "def set_calendar_test\n @calendar_test = CalendarTest.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bf28b4181bc9acc10e2a6c5521932c7",
"score": "0.5411116",
"text": "def set_calender\n @calender = Calender.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bf28b4181bc9acc10e2a6c5521932c7",
"score": "0.5411116",
"text": "def set_calender\n @calender = Calender.find(params[:id])\n end",
"title": ""
},
{
"docid": "07a371d125bd56b097084f8b66c7a645",
"score": "0.5400136",
"text": "def set_calendar_booking\n @calendar_booking = CalendarBooking.find(params[:id])\n end",
"title": ""
},
{
"docid": "48c3ea3ed87801f8375145da0c9b2cec",
"score": "0.5327173",
"text": "def set_travel_calendar\n @travel_calendar = TravelCalendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "38c951de010800bc5067368ffa1344ee",
"score": "0.5316117",
"text": "def set_calendar\n @calendar = Calendar.find_by_name(params[:name])\n end",
"title": ""
},
{
"docid": "e9fe99e79f3aeaed7b79cbdcad9b09e3",
"score": "0.53010803",
"text": "def calendar(calendar_id = :all)\n calendars = if calendar_id.nil? || calendar_id.eql?(:all)\n calendars = decode_response http.get \"/calendar/feeds/default/allcalendars/full\"\n calendars = calendars[\"feed\"][\"entry\"]\n calendars.map{ |calendar| Calendar.build_calendar(calendar, self)}\n elsif calendar_id.eql?(:own)\n calendars = decode_response http.get \"/calendar/feeds/default/owncalendars/full\"\n calendars = calendars[\"feed\"][\"entry\"]\n calendars.map{ |calendar| Calendar.build_calendar(calendar, self)}\n elsif calendar_id.is_a?(String)\n Calendar.new({:id => calendar_id, :user => self}).fetch\n elsif calendar_id.is_a?(Hash)\n # TODO add support to {:title => calendar_title}\n raise ArgumentError.new \"Invalid argument type #{calendar_id.class}\"\n else\n raise ArgumentError.new \"Invalid argument type #{calendar_id.class}\"\n end\n end",
"title": ""
},
{
"docid": "f195ad8db8534c8087e98274fcddc957",
"score": "0.5281634",
"text": "def set_calendario\n @calendario = Calendario.find(params[:id])\n end",
"title": ""
},
{
"docid": "f195ad8db8534c8087e98274fcddc957",
"score": "0.5281634",
"text": "def set_calendario\n @calendario = Calendario.find(params[:id])\n end",
"title": ""
},
{
"docid": "db16912b7bf0ae7e5ac43092996f47c2",
"score": "0.5272906",
"text": "def set_new_calendar\n @new_calendar = NewCalendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "7f5ec314cbf5a2898f95a6acfd3c5933",
"score": "0.5244922",
"text": "def schedule_id=(value)\n @schedule_id = value\n end",
"title": ""
},
{
"docid": "16cdcfe4744e45a014003cf4257a4277",
"score": "0.5239103",
"text": "def initialize(calendar_id)\n raise CalenarIDMissing unless calendar_id\n @events_url = \"#{BASE_URI}/#{CGI::escape calendar_id}/public/full\"\n end",
"title": ""
},
{
"docid": "206994dac4b4a27665075cffd1f942d5",
"score": "0.5203926",
"text": "def set_default_calendar\n @default_calendar = DefaultCalendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "048a17e8d8475095b13d31d18a51cead",
"score": "0.51943964",
"text": "def set_calendar2020\n @calendar2020 = Calendar2020.find(params[:id])\n end",
"title": ""
},
{
"docid": "b6d6a31472571bb964500e6215377a6f",
"score": "0.51395243",
"text": "def set_line_calendar\n @line_calendar = LineCalendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "d727bf774f7f8dfc06de63d26558a545",
"score": "0.5119737",
"text": "def set_calendar\n @calendar = Calendar.find_by(id: params[:id],site_id: @site.id)\n redirect_to admin_errors_url(error_template: '403') unless @calendar\n end",
"title": ""
},
{
"docid": "5bffd412de386990e033c9fc5e901ad8",
"score": "0.50610054",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n @talk = @calendar.talk\n @person = @calendar.person\n end",
"title": ""
},
{
"docid": "0834ac97760b93688de1147e1d4bb436",
"score": "0.5014852",
"text": "def set_calendar\n @calendar = @hairdresser.calendars.find(params[:id])\n end",
"title": ""
},
{
"docid": "ca61af42ea01d3aacfc0b98de05287f6",
"score": "0.50017023",
"text": "def update\n Calendar.find(params[:id]).update_attributes(params[:calendar])\n\n redirect_to events_path\n end",
"title": ""
},
{
"docid": "2e3ce878b0430c54ce9b6651ea8d8b37",
"score": "0.49800116",
"text": "def put(calendar_data)\n calendar_data = calendar_data.read unless calendar_data.is_a?(String)\n\n etag = @caldav_backend.update_calendar_object(@calendar_info['id'], @object_data['uri'], calendar_data)\n @object_data['calendardata'] = calendar_data\n @object_data['etag'] = etag\n\n etag\n end",
"title": ""
},
{
"docid": "938d4da1634c64bb5f308ad625588caa",
"score": "0.49559414",
"text": "def calendars=(value)\n @calendars = value\n end",
"title": ""
},
{
"docid": "938d4da1634c64bb5f308ad625588caa",
"score": "0.49559414",
"text": "def calendars=(value)\n @calendars = value\n end",
"title": ""
},
{
"docid": "5e3d9309ab00a039e1f9456dc3b10f71",
"score": "0.4901576",
"text": "def delete_calendar(calendar_id)\n end",
"title": ""
},
{
"docid": "0bd60df690d83a93fbea4d343ab3d06b",
"score": "0.48566073",
"text": "def valid_calendar?(calendar_id)\n url = gcal_v3_path(\"/calendars/#{calendar_id}\")\n return true if Api.get_with_google_auth(url, @access_token).parse\n\n false\n end",
"title": ""
},
{
"docid": "7c5b5eff8425163a43fc074f848d14a8",
"score": "0.4847726",
"text": "def set_cal\n @cal = Cal.find(params[:id])\n end",
"title": ""
},
{
"docid": "92d89376f79d6794faae084e9e1a8c5f",
"score": "0.48150048",
"text": "def contract_id=(contract_id)\n if contract_id.nil?\n fail ArgumentError, 'contract_id cannot be nil'\n end\n\n if contract_id.to_s.length < 1\n fail ArgumentError, 'invalid value for \"contract_id\", the character length must be great than or equal to 1.'\n end\n\n @contract_id = contract_id\n end",
"title": ""
},
{
"docid": "6ad5c6cfa19ce01b86220326c4da6476",
"score": "0.48078257",
"text": "def set_scheduleid\n @scheduleid = Scheduleid.find(params[:id])\n end",
"title": ""
},
{
"docid": "76d10ce6e032a95c4695a4f0577c8a1f",
"score": "0.47837177",
"text": "def set(schedule_id:)\n worker.job_meta.set(key(:schedule_id), schedule_id.to_s)\n self\n end",
"title": ""
},
{
"docid": "dcca1345cbbbfa98d2770c28739ce1cf",
"score": "0.47704995",
"text": "def save\n if @id.nil?\n data = decode_response connection.post(\"/calendar/feeds/#{calendar}/private/full\", {:data => self.to_hash})\n @id = data[\"data\"][\"id\"]\n else\n # put\n end\n self\n end",
"title": ""
},
{
"docid": "9dc35acbaef66416db36f828716baaa5",
"score": "0.47667673",
"text": "def delete_calendar(calendar_id)\n @calendars.delete_if do |calendar|\n calendar['id'] == calendar_id\n end\n end",
"title": ""
},
{
"docid": "ee5abfe3834f12cf4121094c87a4d4db",
"score": "0.47650018",
"text": "def update\n @event = Calendar.find(params[:id])\n if @event.update_attributes(calendar_params)\n render json: { status: 'Success', message: 'Event Updated!', data: @event }, status: :ok\n else\n render json: { status: 'Error', message: 'Event Not Updated!', data: @event.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "add968074f9f4c8b4eefe8bcf50534fd",
"score": "0.4759578",
"text": "def set_schedule\n @schedule = @user.calendars.find(params[:id])\n end",
"title": ""
},
{
"docid": "d20152dd1f9c37a28b5be656a9ce66d4",
"score": "0.47240064",
"text": "def pbl_events_calendar_id\n '8bo2rpf4joem2kq9q2n940p1ss@group.calendar.google.com'\n end",
"title": ""
},
{
"docid": "98dca0c3bc12d89ac8d439c820ad75ea",
"score": "0.4714101",
"text": "def update_calendar_object(calendar_id, object_uri, calendar_data)\n end",
"title": ""
},
{
"docid": "2b3c7bfd6edbec187f1ff578b82e5bd8",
"score": "0.4712321",
"text": "def update_calendar_event(id,calendar_event__context_code__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :calendar_event__context_code__,\n :calendar_event__title__,\n :calendar_event__description__,\n :calendar_event__start_at__,\n :calendar_event__end_at__,\n :calendar_event__location_name__,\n :calendar_event__location_address__,\n :calendar_event__time_zone_edited__,\n :calendar_event__child_event_data_____x____start_at__,\n :calendar_event__child_event_data_____x____end_at__,\n :calendar_event__child_event_data_____x____context_code__,\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n raise \"calendar_event__context_code__ is required\" if calendar_event__context_code__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id,\n :calendar_event__context_code__ => calendar_event__context_code__\n )\n\n # resource path\n path = path_replace(\"/v1/calendar_events/{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 end",
"title": ""
},
{
"docid": "8bec26d441fbea015bad0fad469a05d6",
"score": "0.46932045",
"text": "def id=(id)\n @id = Event.parse_id(id) unless id.nil?\n end",
"title": ""
},
{
"docid": "6d5fad75254905c5a3a055578d388714",
"score": "0.46784887",
"text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end",
"title": ""
},
{
"docid": "6d5fad75254905c5a3a055578d388714",
"score": "0.46784887",
"text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end",
"title": ""
},
{
"docid": "6d5fad75254905c5a3a055578d388714",
"score": "0.46784887",
"text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end",
"title": ""
},
{
"docid": "6d5fad75254905c5a3a055578d388714",
"score": "0.46784887",
"text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end",
"title": ""
},
{
"docid": "6d5fad75254905c5a3a055578d388714",
"score": "0.46770132",
"text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end",
"title": ""
},
{
"docid": "48f974b9d273d1aba11fc0a80ee7742f",
"score": "0.46601316",
"text": "def set_DeploymentID(value)\n set_input(\"DeploymentID\", value)\n end",
"title": ""
},
{
"docid": "8a7c50f182273dc3eaa6867ad4f5e094",
"score": "0.4636968",
"text": "def event_id=(value)\n @event_id = value\n end",
"title": ""
},
{
"docid": "747ef674dfeb84609e99ae7c7452a488",
"score": "0.4619398",
"text": "def set_calendar_in_settings\n setting = Setting.find_by_user_id(current_user.id)\n if setting.nil?\n setting = Setting.create(user_id: current_user.id, calendar_id: params[:calendar_id])\n else\n setting.calendar_id = params[:calendar_id]\n setting.save\n end\n respond_to do |format|\n if setting.persisted?\n format.json {render json: setting, status: :accepted}\n else\n format.json {render json: setting.error, status: :internal_server_error}\n end\n end\n end",
"title": ""
},
{
"docid": "917aab232d2eb28eeeab7d1d65cf80bb",
"score": "0.46037036",
"text": "def set_OrgID(value)\n set_input(\"OrgID\", value)\n end",
"title": ""
},
{
"docid": "b642c06766e936de78adf061e19ac3cf",
"score": "0.45968983",
"text": "def update\n @calendar = Calendar.find_by_id(params[:id])\n if @calendar.update_attributes(params[:calendar])\n redirect_to request.referer\n else\n flash[:error] = \"Calendar update failed!\" \n redirect_to request.referer\n end\n end",
"title": ""
},
{
"docid": "0315e7504dc2c0a2bef67ebe48629c59",
"score": "0.45933577",
"text": "def update_calendar\n @calendar.selectedDate = start_date\n end",
"title": ""
},
{
"docid": "0cf927bef79678e198f6d99f034c552b",
"score": "0.4572994",
"text": "def update\n update_q(@calendar, calendar_params)\n end",
"title": ""
},
{
"docid": "1df016c96c8346628627373a7788b9bf",
"score": "0.45676327",
"text": "def initialize(calendar_id = \"primary\")\n set_calendar(calendar_id)\n # @calendar\n # @refresh_token = refresh_token\n # @time_zone = time_zone\n\n # client = Google::APIClient.new(\n # :application_name => 'Carpool 2 Server',\n # :application_version => '1.0.0'\n # )\n end",
"title": ""
},
{
"docid": "81964c8d459fac2d463c8e02ded005f8",
"score": "0.4546629",
"text": "def set_OrganizationID(value)\n set_input(\"OrganizationID\", value)\n end",
"title": ""
},
{
"docid": "81964c8d459fac2d463c8e02ded005f8",
"score": "0.4546629",
"text": "def set_OrganizationID(value)\n set_input(\"OrganizationID\", value)\n end",
"title": ""
},
{
"docid": "a71aa45cc236b2e34f736908d58f1a28",
"score": "0.4546531",
"text": "def set_ActivityId(value)\n set_input(\"ActivityId\", value)\n end",
"title": ""
},
{
"docid": "a71aa45cc236b2e34f736908d58f1a28",
"score": "0.4546531",
"text": "def set_ActivityId(value)\n set_input(\"ActivityId\", value)\n end",
"title": ""
},
{
"docid": "a71aa45cc236b2e34f736908d58f1a28",
"score": "0.4546531",
"text": "def set_ActivityId(value)\n set_input(\"ActivityId\", value)\n end",
"title": ""
},
{
"docid": "fdbab9195eb438624fb651c3fedceb0c",
"score": "0.45157892",
"text": "def open_shift_id=(value)\n @open_shift_id = value\n end",
"title": ""
}
] |
76e26e427766da7e7a985535ab6f72e4
|
GET /commitments/1 GET /commitments/1.json
|
[
{
"docid": "80426112a6c5c9795673da4d387785ff",
"score": "0.6941051",
"text": "def show\n @commitment = Commitment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commitment }\n end\n end",
"title": ""
}
] |
[
{
"docid": "2ea176f113be3fa4c64a397fd19ce971",
"score": "0.72465706",
"text": "def index\n @commitments = Commitment.all\n end",
"title": ""
},
{
"docid": "3b40c4da72585348aeedab8d330697d4",
"score": "0.7089743",
"text": "def show\n respond_to do |format|\n format.json { render json: @commit, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "d3a8e2743bc861ecba35ddf751c5bafe",
"score": "0.6678733",
"text": "def committees(options = {})\n get('/committees', options)\n end",
"title": ""
},
{
"docid": "f2e2115fe568828698d2120c0233e3f1",
"score": "0.658784",
"text": "def commit\n read_repo\n if @branches.count < 1\n render :template => 'repositories/commit'\n return\n end\n\n params[:action] = \"commit\"\n\n blank_hash = \"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"\n @commit = @repository.get_commit(@branch)\n @parent = @commit.parent\n @parent = @repository.get_commit(blank_hash) if @parent == nil\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repository }\n end\n end",
"title": ""
},
{
"docid": "e8a2f5fe642d7884da841b2161219a9f",
"score": "0.65107125",
"text": "def set_commitment\n @commitment = Commitment.find(params[:id])\n end",
"title": ""
},
{
"docid": "ea84928e1010e0dde871dfd5e1d79bb0",
"score": "0.64340293",
"text": "def project_commit(project, commit_id)\n get(\"/projects/#{project}/commits/#{commit_id}\")\n end",
"title": ""
},
{
"docid": "492e9995dfee4b7a28d0cab8e3e11d86",
"score": "0.63988656",
"text": "def index\n @commitments = Commitment.all\n @title = \"Commitments\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @commitments }\n end\n end",
"title": ""
},
{
"docid": "8e9c058781950d485d5de13ca6671d52",
"score": "0.63399845",
"text": "def new\n @commitment = Commitment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @commitment }\n end\n end",
"title": ""
},
{
"docid": "5ff8d197cb77350efbd01f331d57fa6e",
"score": "0.6332265",
"text": "def set_commitment\n @commitment = Commitment.find(params[:id])\n end",
"title": ""
},
{
"docid": "f546f70e778bdaedd3fb7f265621c119",
"score": "0.6315635",
"text": "def commits!\n response = @client.get_json(\"#{path}/commits\")\n @commits = response.map do |commit| \n Commit.new(client: @client, user: @user, repo: self, sha: commit['sha']) \n end\n @commits\n end",
"title": ""
},
{
"docid": "fbe7878d46c40c5c7307ff52050558d5",
"score": "0.63132584",
"text": "def get_commits\n raise \"can't get a repo without the repo's full_name (eg. 'fubar/ofxTrickyTrick')\" unless full_name\n\n begin\n response = GithubApi::repository_commits(full_name: full_name)\n rescue => ex\n Rails.logger.debug \"Failed to get recent commit: #{ex.message} (#{ex.class})\"\n return\n end\n\n unless response.success?\n Rails.logger.debug response.inspect.to_s.red\n return\n\tend\n\n @repo_commits_json = response.parsed_response\n end",
"title": ""
},
{
"docid": "305f42298c78d266c46134ed146abc5e",
"score": "0.6294673",
"text": "def destroy\n @commitment = Commitment.find(params[:id])\n @commitment.destroy\n\n respond_to do |format|\n format.html { redirect_to commitments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6747d1f4b8b48976fb6e60d648839b5",
"score": "0.62462795",
"text": "def index\n @commits = Commits.all(params[:branche_id])\n\n respond_to do |format|\n format.json { render json: @commits, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "5895b2d9eda0df62aa3b2f65f0ab393a",
"score": "0.62192506",
"text": "def show\n @commit = Commit.find(params[:id])\n if !@commit || @commit.try(:repo).try(:user) != current_user\n redirect_to commits_path, alert: \"commit not found\"\n end\n end",
"title": ""
},
{
"docid": "22dea0d6391a2abbac1204195f98a4dd",
"score": "0.61590844",
"text": "def index\n @commits = Commit.all\n end",
"title": ""
},
{
"docid": "cd5b74af3086aaa6b02d3e3b56ae3390",
"score": "0.6140639",
"text": "def commits\n read_repo\n if @branches.count < 1\n render :template => 'repositories/newrepo'\n return\n end\n\n @commits = @repository.commits(@branch)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repository }\n end\n end",
"title": ""
},
{
"docid": "21a27b23cfb17552c689717a8824034b",
"score": "0.6123984",
"text": "def index\n @commits = Commit.joins(:developer).select(:commit_hash, :email, :date_created)\n render_json_for_api @commits\n end",
"title": ""
},
{
"docid": "7609e89e0257f9d347c4fc436fa0f688",
"score": "0.60837257",
"text": "def github_commit(owner, repo, sha)\n parent_dir = File.join('commits', \"#{owner}@#{repo}\")\n commit_json = File.join(parent_dir, \"#{sha}.json\")\n FileUtils::mkdir_p(parent_dir)\n\n r = nil\n if File.exists? commit_json\n r = begin\n JSON.parse File.open(commit_json).read\n rescue\n # This means that the retrieval operation resulted in no commit being retrieved\n {}\n end\n return r\n end\n\n url = \"https://api.github.com/repos/#{owner}/#{repo}/commits/#{sha}\"\n log(\"Requesting #{url} (#{@remaining} remaining)\")\n\n contents = nil\n begin\n r = open(url, 'User-Agent' => 'ghtorrent', 'Authorization' => \"token #{token}\")\n @remaining = r.meta['x-ratelimit-remaining'].to_i\n @reset = r.meta['x-ratelimit-reset'].to_i\n contents = r.read\n JSON.parse contents\n rescue OpenURI::HTTPError => e\n @remaining = e.io.meta['x-ratelimit-remaining'].to_i\n @reset = e.io.meta['x-ratelimit-reset'].to_i\n log \"Cannot get #{url}. Error #{e.io.status[0].to_i}\"\n {}\n rescue StandardError => e\n log \"Cannot get #{url}. General error: #{e.message}\"\n {}\n ensure\n File.open(commit_json, 'w') do |f|\n f.write contents unless r.nil?\n f.write '' if r.nil?\n end\n\n if 5000 - @remaining >= REQ_LIMIT\n to_sleep = @reset - Time.now.to_i + 2\n log \"Request limit reached, sleeping for #{to_sleep} secs\"\n sleep(to_sleep)\n end\n end\n end",
"title": ""
},
{
"docid": "48ae177ce9a33fc4d0069e38422e99c5",
"score": "0.6070851",
"text": "def show\n render_json_for_api @commit\n end",
"title": ""
},
{
"docid": "99d621286c0abdf2572994c0a34d96e2",
"score": "0.60255206",
"text": "def new\n @commit = params[:commit]\n @release = @environment.releases.new(\n commit0: @environment.last_commit,\n commit1: @commit)\n if @release.can_read_commits?\n @release.load_commits!\n @release.load_tickets!\n @release.build_changes_from_commits\n end\n if @release.changes.none?\n render :template => \"releases/new_pick_commit\"\n else\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @release }\n end\n end\n end",
"title": ""
},
{
"docid": "4a483baf0b2764aff1729fad593f228e",
"score": "0.60200304",
"text": "def fetch_commit(commit_id)\n found = commits.find do |commit|\n commit[\"sha\"] == commit_id\n end\n if found\n stringify_keys_deep(found.to_hash)\n else\n # cache miss; don't add to @commits because unsure of order.\n check_github_response do\n commit = @client.commit(user_project, commit_id)\n commit = stringify_keys_deep(commit.to_hash)\n commit\n end\n end\n end",
"title": ""
},
{
"docid": "443be523c6a55f2fe72a74493483de74",
"score": "0.60178214",
"text": "def index\n @git_commits = GitHubber.all\n commit_hashes = @git_commits.map { |commit| commit.sha }\n approved_commits = StageCommit.where(\"sha in (?)\", commit_hashes).map{ |reviews| reviews.sha }\n @git_commits.reject!{|git_commit| approved_commits.include?(git_commit.sha) }\n @stage_commit = StageCommit.new\n end",
"title": ""
},
{
"docid": "aa1263c6558ebac6d2af6bc1a595cfa6",
"score": "0.60011494",
"text": "def create\n @commit = Commit.new\n\n #walker = Rugged::Walker.new(@repo)\n #\n #walker.sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE) # optional\n #\n #walker.push('HEAD')\n #walker.each { |c| \n # @commit = Commit.new(sha: c.oid, description:c.message,\n # author: c.author[:name], commit_date: c.author[:time])\n # @commit.save\n #}\n #walker.reset\n\n respond_to do |format|\n format.html { redirect_to @commit, notice: 'Commit was successfully created.' }\n format.json { render :show, status: :created, location: @commit }\n end\n end",
"title": ""
},
{
"docid": "9cbb15767713959105741493687d6faa",
"score": "0.5912361",
"text": "def commits\n @commits ||= ApiFactory.new 'Projects::Commits'\n end",
"title": ""
},
{
"docid": "3a52bb6bcc84ad3c6ce7014f8be11a38",
"score": "0.59071255",
"text": "def set_commit\n @commit = Commit.find(params[:id])\n end",
"title": ""
},
{
"docid": "05c84db3b356aa74b4377790edf1cd9b",
"score": "0.5847389",
"text": "def commit(user,repository,commit)\n url = @base_url + \"/#{user}/#{repository}/commit/#{commit}\"\n GitHub::Commit.new(JSON.parse(open(url).read).merge(:user => user, :repository => repository))\n end",
"title": ""
},
{
"docid": "a3f347b5d6a622eb58822a567cd8d3fa",
"score": "0.58184236",
"text": "def commits_context\n it 'List Repository Prospects' do\n get :repo_commits, params: { id: 'amura-assignment',\n since_date: since_date,\n until_date: until_date }\n expect(response).to have_http_status(200)\n expect(response.headers).to include('Content-Type' =>\n 'application/json; charset=utf-8')\n end\n end",
"title": ""
},
{
"docid": "a2a975ad40db4be3eff8f05c2c7abd44",
"score": "0.5815237",
"text": "def update\n respond_to do |format|\n if @commit.update(commit_params)\n format.html { redirect_to @commit, notice: 'Commit was successfully updated.' }\n format.json { render :show, status: :ok, location: @commit }\n else\n format.html { render :edit }\n format.json { render json: @commit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "929765e1a487f0b0404f32713361b4c2",
"score": "0.5815224",
"text": "def fetch_commit(repo_user,repo_name,sha)\n uri = URI(API_BASE_URL+ \"/repos/#{repo_user}/#{repo_name}/git/commits/#{sha}\")\n body = response_body(uri)\n if body.key?('message') && body['message'].downcase == \"not found\"\n raise \"Unable to fetch #{uri}\" \n else\n body\n end\n end",
"title": ""
},
{
"docid": "c35d8ab9fee0b2d3c9d2410b84b4ec76",
"score": "0.58126247",
"text": "def commits\n @commits ||= ApiFactory.new 'GitData::Commits'\n end",
"title": ""
},
{
"docid": "80ca4a019dfff353c53f29a2735ba84a",
"score": "0.58002394",
"text": "def create\n @commitment = current_user.commitments.new(:event_id => params[:event_id], :status => 'OFFERED')\n\n respond_to do |format|\n if @commitment.save\n format.html { redirect_to root_path, notice: 'Thank you. We will get back with you.' }\n format.json { render json: @commitment, status: :created, location: @commitment }\n else\n end\n end\n end",
"title": ""
},
{
"docid": "6c3e9e2652d92d3a8ad46bc94a87bdfb",
"score": "0.57988375",
"text": "def get(*args)\n arguments(args, required: [:user, :repo, :sha])\n\n get_request(\"/repos/#{arguments.user}/#{arguments.repo}/commits/#{arguments.sha}\", arguments.params)\n end",
"title": ""
},
{
"docid": "9f6a8508ad539ce8820421f658f7182d",
"score": "0.5790739",
"text": "def destroy\n @commit.destroy\n respond_to do |format|\n format.html { redirect_to commits_url, notice: 'Commit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "52acc366b98ceae644f22c77d949d932",
"score": "0.5779256",
"text": "def commits(project, options={})\n get(\"/projects/#{project}/repository/commits\", :query => options)\n end",
"title": ""
},
{
"docid": "52acc366b98ceae644f22c77d949d932",
"score": "0.5779256",
"text": "def commits(project, options={})\n get(\"/projects/#{project}/repository/commits\", :query => options)\n end",
"title": ""
},
{
"docid": "fd914b7ea4b20c1319991ed2877021b6",
"score": "0.57750845",
"text": "def commit\n @commit ||= $repo.log.object(@rev || 'master').path(@name).first\n end",
"title": ""
},
{
"docid": "c4dd5a607ee4b06abd6140c33d439c84",
"score": "0.5771928",
"text": "def repo_commits(repos)\n repos_commits = []\n repos.each do |repo|\n repos_commits << HTTParty.get(repo[\"commits_url\"].gsub(\"{/sha}\", \"\"))[0]\n end\n repos_commits\nend",
"title": ""
},
{
"docid": "256f1e3048b6581910bbf9aa9bc1176d",
"score": "0.5728822",
"text": "def update\n @commitment = Commitment.find(params[:id])\n\n respond_to do |format|\n if @commitment.update_attributes(params[:commitment])\n format.html { redirect_to @commitment, notice: 'Commitment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commitment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3bdb1ae6470e685aca2cfe37df9def82",
"score": "0.57279176",
"text": "def commit_params\n params.require(:commit).permit(:sha, :description, :author, :commit_date)\n end",
"title": ""
},
{
"docid": "c6414fe50a35a037a47fa7c48ed6d947",
"score": "0.5717424",
"text": "def commits\n @commits ||= data[:commits].map { |commit| project.commit(commit[:id]) }.reverse\n end",
"title": ""
},
{
"docid": "0ebd34ef2ec81adc6780359aec42d993",
"score": "0.5711655",
"text": "def index\n @index ||= @repository.rugged.merge_commits(@our_commit, @their_commit)\n end",
"title": ""
},
{
"docid": "eeaf1eb091e271139c996f11a58aa2c4",
"score": "0.57030135",
"text": "def last_commit\n\tresp = github_api(\"commits\")\n\tresp[0]\nend",
"title": ""
},
{
"docid": "a9b1c1370c067cbcf92a9d671025b24a",
"score": "0.56874186",
"text": "def first_commit\n\tcommit = nil\n\tresp = github_api(\"commits\")\n\tsha = resp[-1][\"commit\"][\"sha\"]\n\twhile true\n\t\tr = github_api(\"commits?sha=#{sha}&per_page=100\")\n\t\tif r.count != 1 \n\t\t\tsha = r[-1][\"sha\"]\n\t\t\tnext\n\t\tend\n\t\tcommit = r[0]\n\t\tbreak\n\tend\n\tcommit\nend",
"title": ""
},
{
"docid": "67a63d72be892a7c06fc9cf264fdea98",
"score": "0.56795084",
"text": "def index\n @internship_committees = InternshipCommittee.all\n end",
"title": ""
},
{
"docid": "7d7d45e6719d63c3d82c3b0f74dfd353",
"score": "0.56678927",
"text": "def last_commited_commit\n get_all_commits_in_repo.first\n end",
"title": ""
},
{
"docid": "14f2d6cc7994d236d8f479fc89578285",
"score": "0.5664621",
"text": "def index\n @commits = Commit.joins(:repo).where(\"repos.user_id\" => 1).order(\"created_at\" => :desc)\n end",
"title": ""
},
{
"docid": "e30e8cdafa608014b42f02c19f207175",
"score": "0.5648938",
"text": "def commit\n @commit ||= @repo.commit(@repo.head.commit)\n end",
"title": ""
},
{
"docid": "c52afbf16aa72b0d4fc874e1b35584d5",
"score": "0.5647229",
"text": "def commit_params\n params.require(:commit).permit(:project_id, :branch, :commit)\n end",
"title": ""
},
{
"docid": "8b79fc6843fc945612721132c2faf806",
"score": "0.56330615",
"text": "def show\n respond_with @project do |format|\n format.json do\n render json: @project.as_json.merge(\n commits_url: project_commits_url(@project, format: 'json'),\n commits: @project.commits.order('committed_at DESC').limit(10).map { |commit|\n commit.as_json.merge(\n percent_done: commit.fraction_done.nan? ? 0.0 : commit.fraction_done*100,\n translations_done: commit.translations_done,\n translations_total: commit.translations_total,\n strings_total: commit.strings_total,\n import_url: import_project_commit_url(@project, commit, format: 'json'),\n sync_url: sync_project_commit_url(@project, commit, format: 'json'),\n url: project_commit_url(@project, commit),\n status_url: project_commit_url(@project, commit),\n )\n }\n )\n end\n end\n end",
"title": ""
},
{
"docid": "6d32ff5c9b0dd9648aa94eed726b1029",
"score": "0.56322944",
"text": "def create\n @stage_commit = StageCommit.new(stage_commit_params)\n\n respond_to do |format|\n if @stage_commit.save\n GitHubber.promote_to_prod(@stage_commit.sha)\n old_commits=GitHubber.all_before_hash(@stage_commit.sha)\n logged_commits = StageCommit.where(\"sha in (?)\", old_commits).map{ |reviews| reviews.sha }\n skipped_commits = old_commits - logged_commits\n\n skipped_commits.each do |skipped_sha|\n StageCommit.create(:sha => skipped_sha, :approver => @stage_commit.approver, :comment => \"Auto Approved in Commit #{@stage_commit.sha} and Message #{@stage_commit.comment}\")\n end\n\n format.html { redirect_to @stage_commit, notice: 'Stage commit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @stage_commit }\n else\n format.html { render action: 'new' }\n format.json { render json: @stage_commit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e794e479de761f1cb43296922a2ccfcc",
"score": "0.5627797",
"text": "def commit(id)\n Gitlab::Git::Commit.find(self, id)\n end",
"title": ""
},
{
"docid": "91beccebd611aabee05a8f34acdc212d",
"score": "0.5627674",
"text": "def commitment_params\n params.require(:commitment).permit(:name, :description, :start_date, :end_date, :stakes, :activity_type, :thumbnail)\n end",
"title": ""
},
{
"docid": "108c69c2b1d5dc6a3a4aa7e205009f8f",
"score": "0.56219256",
"text": "def show\n @commit = @repository.commits.where(gitid: params[:commit_gid]).first\n\n respond_to do |format|\n format.html do\n @commit_too_large =\n @commit.total_diff_lines > ConfigVar['max_diff_lines'].to_i\n unless @commit_too_large\n # Pre-fetch all the diff data to avoid O(n) SQL queries in render.\n @commit = @repository.commits.where(gitid: params[:commit_gid]).\n includes(diffs: :hunks).first\n end\n render action: :show # show.html.erb\n end\n format.xml { render xml: @commit }\n end\n end",
"title": ""
},
{
"docid": "290c908be1bd9717c19da6bb1e49755a",
"score": "0.56179714",
"text": "def show\n @commitment = Commitment.find(params[:id])\n @title = \"Commitment for #{@commitment.orderable.product.name}\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @commitment }\n end\n end",
"title": ""
},
{
"docid": "2808025715116c3218d6f939dd828ffc",
"score": "0.5611134",
"text": "def commit_info(params)\n user, repo = params[\"user\"], params[\"repo\"]\n shas = get_last_30_days_commits(user, repo)\n commit_hash = {}\n file_arr = []\n hydra = Typhoeus::Hydra.new\n shas.each do |sha|\n request = Typhoeus::Request.new(\"#{GithubApiConstants::GITHUB_ROOT}/repos/#{user}/#{repo}/commits/#{sha}?access_token=#{GITHUB_ACCESS_TOKEN}\")\n request.on_complete do |response|\n if response.success?\n parsed_sha_info = JSON.parse(response.response_body)\n author = parsed_sha_info[\"commit\"][\"author\"][\"name\"]\n files = parsed_sha_info[\"files\"].collect { |f| f[\"filename\"] }\n commit_hash[files] = author\n file_arr << files\n else\n raise RepoExceptionHandler::GithubAPILimitReached.new(GithubApiConstants::GITHUB_API_LIMIT_REACHED_MESSAGE)\n end\n end\n hydra.queue(request)\n end\n hydra.run\n return commit_hash, file_arr\n end",
"title": ""
},
{
"docid": "7fbed10f4c24ae578b725e3446bf18aa",
"score": "0.5585953",
"text": "def commitment_params\n params.require(:commitment).permit(:title)\n end",
"title": ""
},
{
"docid": "81fd927f8cc93d392344f7c0320a7668",
"score": "0.55806553",
"text": "def set_commit\n @commit = Commit.find_by_sha(params[:sha])\n end",
"title": ""
},
{
"docid": "0a94e94fbffa21eaa3cfa21852c64b75",
"score": "0.55646044",
"text": "def git_commit(repo, sha, options = {})\n get \"#{Repository.path repo}/git/commits/#{sha}\", options\n end",
"title": ""
},
{
"docid": "c710b569a4ef5340b60a7bc073e58bef",
"score": "0.5561425",
"text": "def index\n @pr_committees = PrCommittee.all\n end",
"title": ""
},
{
"docid": "309e98b64240c9bc16f9f72a18929134",
"score": "0.5543276",
"text": "def get_commits(pull_req_id)\n do_request(\"https://api.github.com/repos/#{CONFIG[\"repo\"][\"org\"]}/#{CONFIG[\"repo\"][\"repo\"]}/pulls/#{pull_req_id}/commits\", true)\n end",
"title": ""
},
{
"docid": "4214143e51311eebbc1cfa20f838baac",
"score": "0.5539992",
"text": "def get(user_name, repo_name, sha, params={})\n _update_user_repo_params(user_name, repo_name)\n _validate_user_repo_params(user, repo) unless user? && repo?\n _validate_presence_of sha\n normalize! params\n\n get_request(\"/1.0/repositories/#{user}/#{repo.downcase}/changesets/#{sha}\", params)\n end",
"title": ""
},
{
"docid": "e29321aef2960296b2184d47b5251066",
"score": "0.5536952",
"text": "def latest_commit\n init_commits\n @latest_commit\n end",
"title": ""
},
{
"docid": "eb6c3ab6a3b33242a5d87a1032dff1b6",
"score": "0.55284333",
"text": "def fetch_commit_hash_list()\n `git rev-list --all --reverse`.strip.split(/\\n/)\nend",
"title": ""
},
{
"docid": "9aa3f954584d1b381a8129965bf75937",
"score": "0.5525586",
"text": "def branch_commits\n\tcommits = {}\n\tresp = github_api(\"branches\")\n\tresp.each do |b|\n\t\t#puts b\n\t\tcommit_dates = []\n\t\tsha = b[\"commit\"][\"sha\"]\n\t\twhile true\n\t\t\tr = github_api(\"commits?sha=#{sha}&per_page=100\")\n\t\t\t# puts r\n\t\t\tif r.count != 1 \n\t\t\t\tsha = r[r.count - 1][\"sha\"]\n\t\t\t\tcommit_dates = commit_dates.concat(r[0..-1].map {|c| c[\"commit\"][\"committer\"][\"date\"]})\n\t\t\t\t#puts commit_dates\n\t\t\telse\n\t\t\t\tcommit_dates = commit_dates.concat(r.map {|c| c[\"commit\"][\"committer\"][\"date\"]})\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\t\tcommits[b[\"name\"]] = commit_dates\n\tend\n\tcommits\nend",
"title": ""
},
{
"docid": "a60b2825110b5de7f8060bb6964ad6af",
"score": "0.55255616",
"text": "def get_version_commit\n version = self.peers_version\n if version[\"success\"]\n return version[\"commit\"]\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "535c8b53d48a9977aa6da1a6f3087ce3",
"score": "0.5521997",
"text": "def github_url\n \"https://github.com/rails/rails/commit/#{sha1}\"\n end",
"title": ""
},
{
"docid": "fe2f42de3579c422df3593b0b75bbeb9",
"score": "0.5521548",
"text": "def fetch_commits(repo_user,repo_name, sha, commits_size)\n uri = URI(API_BASE_URL+ \"/repos/#{repo_user}/#{repo_name}/commits?sha=#{sha}&per_page=#{commits_size}\")\n body = response_body(uri)\n if body.instance_of? Array\n body\n elsif body.key?('message') && body['message'].downcase == \"not found\"\n raise \"Unable to fetch #{uri}\" \n else\n puts \"WARNING unexpected body = #{body}\"\n []\n end\n end",
"title": ""
},
{
"docid": "0f6e715eb5a02a32d3f9b4b4979fc022",
"score": "0.5517661",
"text": "def commit_diff(project, sha)\n get(\"/projects/#{project}/repository/commits/#{sha}/diff\") \n end",
"title": ""
},
{
"docid": "883eb33a8b7b32e860a3640ae2e8f3ea",
"score": "0.55171657",
"text": "def show\n @voivodship_committee = VoivodshipCommittee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voivodship_committee }\n end\n end",
"title": ""
},
{
"docid": "1381c5e41144697d80fb7f44cc884909",
"score": "0.55063605",
"text": "def set_commitment\n @commitment = Commitment.where('artist_data_id = ?', current_artist.id)\n end",
"title": ""
},
{
"docid": "cb57b078683562d4afd077fb78a29c94",
"score": "0.5502135",
"text": "def commits(commit=head)\n commits_for(commit)\n end",
"title": ""
},
{
"docid": "6194d9d44172beb52422aa159f785dac",
"score": "0.5501862",
"text": "def show\n @committees_voivodeship = CommitteesVoivodeship.find(params[:id])\n #@committees = Committee.all\n #@voivodeships = Voivodeship.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @committees_voivodeship }\n end\n #redirect_to :list_commi\n end",
"title": ""
},
{
"docid": "09ec34c95746fb6d1839d60d527a75f1",
"score": "0.54926956",
"text": "def index\n if params[:ref_name]\n if ref = @repository.branches.where(name: params[:ref_name]).first\n @branch = ref\n elsif ref = @repository.tags.where(name: params[:ref_name]).first!\n @tag = ref\n end\n else\n @branch = ref = @repository.default_branch\n end\n\n commits_page = (params[:page] || 1).to_i\n commits_page = 1 if commits_page < 1\n parent_commits = ref.commit.walk_parents((commits_page - 1) * 20, 21)\n @commits = parent_commits[0, 20]\n\n @next_page = parent_commits[20] ? commits_page + 1 : nil\n @previous_page = (commits_page > 1) ? commits_page - 1 : nil\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @commits }\n end\n end",
"title": ""
},
{
"docid": "441cf7e3b0ac3c87f40604a575d28bc9",
"score": "0.5491297",
"text": "def new\n @commitment = Commitment.new\n @title = \"New Commitment\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @commitment }\n end\n end",
"title": ""
},
{
"docid": "fdd039d9ef5967ff6de25ec888520c86",
"score": "0.5487231",
"text": "def review_commit\n if @review_commit.nil?\n @review_commit = GitCommit.new(project.review_repository,\n @sha1)\n end\n @review_commit\n end",
"title": ""
},
{
"docid": "e6a9df471be89232307f01f0db826fa9",
"score": "0.54807305",
"text": "def GetCommitInfos\n infos = ::Storage::ListCommitInfo.new()\n @sint.getCommitInfos(infos)\n ret = []\n infos.each do |info|\n m = {\n :destructive => info.destructive,\n :text => info.text\n }\n\tret.push(m)\n end\n ret\n end",
"title": ""
},
{
"docid": "c4775e1fcc13d226ced37c628c75f742",
"score": "0.5479721",
"text": "def github_url\n \"http://github.com/280north/cappuccino/commit/#{sha1}\"\n end",
"title": ""
},
{
"docid": "49d3ac0d3e1ef8e95f07e48b2a7fe822",
"score": "0.5479452",
"text": "def commit(opts = {})\n opts ||= {}\n { commit: opts }.to_json\n end",
"title": ""
},
{
"docid": "be59188fe053fb3c67498b6315cc7ff6",
"score": "0.54787695",
"text": "def project_commits(id)\n begin\n JSON(RestClient.get GITLAB_WS_URL + \"projects/#{id}/repository/commits\", {:private_token => GITLAB_TOKEN}).reverse\n rescue Exception\n return []\n end\n end",
"title": ""
},
{
"docid": "6235c8692377ece1e59c012d06d25542",
"score": "0.5476389",
"text": "def commit(project, sha)\n get(\"/projects/#{project}/repository/commits/#{sha}\")\n end",
"title": ""
},
{
"docid": "9fa28258a2a526b86408f609c15646e8",
"score": "0.546746",
"text": "def load_committees_member(id)\n params = {'member_ids' => id}\n @committees = process('committees', 'committees', params)\n end",
"title": ""
},
{
"docid": "c7a4c1021ee7ca6fa7544a8fa286130d",
"score": "0.5451022",
"text": "def commit\n\t$VP.join('.git/refs/heads/master').read[0..8] rescue nil\nend",
"title": ""
},
{
"docid": "d4a293608aeaaac642a99c6e5854236d",
"score": "0.54431295",
"text": "def id\n @grit_commit.id\n end",
"title": ""
},
{
"docid": "a149936c6bbec7ea1f4005c7fabec395",
"score": "0.54403114",
"text": "def repo1\n addons = Addon.where(\"lower(repos.name) = ?\", params[:repo_name].downcase)\n render json: to_v1_repo_hashes(addons)\n end",
"title": ""
},
{
"docid": "05bde45f04b77977f33aaef7ae476b2a",
"score": "0.54395694",
"text": "def new\n @committees_voivodeship = CommitteesVoivodeship.new\n\t@committees = Committee.all.map do |commi|\n\t\t[commi.id]\n\tend\n\t@voivodeships = Voivodeship.all.map do |voi|\n\t\t[voi.id]\n\tend\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @committees_voivodeship }\n end\n end",
"title": ""
},
{
"docid": "1c16fee190051ef8126f148e3f1cf943",
"score": "0.5436759",
"text": "def total_number_of_commit(repo_id)\n arr = contributors_list repo_id\n arr.first[:contributions]\n end",
"title": ""
},
{
"docid": "2a7c8edca55ca615665bc632fd8f094b",
"score": "0.543443",
"text": "def branches_containing_commit(commit_ref); end",
"title": ""
},
{
"docid": "2a7c8edca55ca615665bc632fd8f094b",
"score": "0.54342324",
"text": "def branches_containing_commit(commit_ref); end",
"title": ""
},
{
"docid": "e04281b4a185f76f6f2cc5f1a9eaea77",
"score": "0.54259676",
"text": "def commits\n object.commits.map { |c| c.id }\n end",
"title": ""
},
{
"docid": "81844a28bf238fdef0b0291e26f260c0",
"score": "0.54251474",
"text": "def create\n @repo = GitRepository.create(path: '/a/path')\n @commit = GitCommit.create(object_hash: params[:hash], git_repository: @repo)\n respond_to do |format|\n format.html { render html: @commit.object_hash }\n format.json { render json: @commit }\n end\n end",
"title": ""
},
{
"docid": "089f9a9285d1b13736c814e15e86ac37",
"score": "0.54211885",
"text": "def read_commit_hash vcs\n commit_hash = \"\"\n\n if vcs.kind_of?(Array)\n vcs.map! { |v| v.to_s }\n elsif !vcs.kind_of?(String)\n vcs = vcs.to_s\n end\n\n vcs.each { |v| raise InvalidVersionControlSystem if !SUPPORTED_VCS.include?(v) }\n\n # Try to get the commit hash for a git repo\n commit_hash = `git log -1 --pretty=format:\"%H\" #{RAILS_ROOT} 2> /dev/null` if vcs.include?(\"git\")\n # Try to get the commit hash for the svn repo\n commit_hash = `svn info #{RAILS_ROOT} 2> /dev/null | awk '/^Revision:/ { print $2 }'` if commit_hash.empty? && vcs.include?(\"svn\")\n \n commit_hash.strip\n end",
"title": ""
},
{
"docid": "96657f2ebb6a4d07f8040eb67cf8e04a",
"score": "0.5416473",
"text": "def commits\n if !@commits\n @commits = []\n x = 0\n loop do\n x += 1\n response = get(\"/commits/list/#{repo.owner.login}/#{repo.name}/#{name}?page=#{x}\")\n break unless response.code == 200\n @commits += response['commits'].map { |c| Commit.new(connection, c.merge(:repo => self)) }\n end\n end\n @commits\n end",
"title": ""
},
{
"docid": "04e85dd493b9d6ca5a0bc8878d6c0f8c",
"score": "0.54039",
"text": "def commitid\n \"#{@project[:id]}-#{currentbranch}-#{currentcommit}\"\n end",
"title": ""
},
{
"docid": "43340a7f387f6081939682124ec91a01",
"score": "0.54008234",
"text": "def test_get_tags\n post '/repos', {:name => GIT_REPO}\n post \"/repos/#{GIT_REPO}.git/branches/master/files\", {:name => \"myfile.txt\", :data => \"Hello There\", :encoding => \"utf-8\", :user => \"Rune Madsen\", :email => \"rune@runemadsen.com\", :message => \"My First Commit\"}\n sha = JSON.parse(last_response.body)[\"commit_sha\"]\n post \"/repos/#{GIT_REPO}.git/tags\", {:tag => \"version1\", :message => \"hello\", :sha => sha, :type => \"commit\", :user => \"Rune Madsen\", :email => \"rune@runemadsen.com\"}\n get \"/repos/#{GIT_REPO}.git/tags\"\n end",
"title": ""
},
{
"docid": "e5a2673d174cc6b6d129c6edfb2c223d",
"score": "0.5393843",
"text": "def index\n @commits = @project.repo.log(10)\n respond_with @commits\n end",
"title": ""
},
{
"docid": "04f393afbfbb424f2371b535bfb21bef",
"score": "0.5390614",
"text": "def pull_requests_for_commit(token, repo, commit_hash)\n query = \"#{commit_hash}+type:pr+repo:#{repo}\"\n say \"Searching github pull requests for #{commit_hash}\"\n response = RestClient::Request.new(:url => \"https://api.github.com/search/issues?q=#{query}\", :method => \"GET\", :headers => {:accept => :json, :content_type => :json, 'Authorization' => \"token #{token}\"}).execute\n JSON.parse response.body\n rescue RestClient::Exception => e\n process_error e\n throw e\n end",
"title": ""
},
{
"docid": "c3669cc7b896417d9b9eb382201780d8",
"score": "0.5380445",
"text": "def parse_commit(an_array)\n commit_id = an_array.first.split().last\n date = extract_date(an_array)\n author = extract_author(an_array)\n merge = is_a_merge(an_array)\n pull_request = merge ? extract_pull_request(an_array) : {}\n pull_request[:date] = date unless pull_request.empty?\n files = extract_files(an_array)\n description = extract_description(an_array)\n jira_tickets = extract_jira_tickets from: [pull_request[:source], description]\n\n return {\n id: commit_id,\n date: date,\n author: author,\n merge: merge,\n pull_request: pull_request,\n files: files,\n description: description,\n jira_tickets: jira_tickets\n }\nend",
"title": ""
},
{
"docid": "c549808be6f0da108a1c725d86b1797c",
"score": "0.53572196",
"text": "def post_commit(commit_obj)\n return if commit_obj.empty?\n uri = URI.parse(\"http://gitsvn.bioconductor.org/git-push-hook\")\n json = commit_obj.to_json\n response = Net::HTTP.post_form(uri, {\"payload\" => json})\nend",
"title": ""
},
{
"docid": "bd58833a5cdb5c0f558adb997f9b0e44",
"score": "0.53560686",
"text": "def last_commit() \n\t return @last_commit if @last_commit.is_a?(Commit)\n\t\t@last_commit = Commit.first(:repo_id => self[:_id])\n\tend",
"title": ""
},
{
"docid": "f9372917409ede57d0eeec74ec295771",
"score": "0.53550303",
"text": "def get_commit(key, id)\n key = key_for(key)\n commit = git.commit(id)\n blob = commit.tree / key\n decode(blob.data) if blob\n end",
"title": ""
}
] |
6821397268faea69c54e94b57b81cd9e
|
Find a way to accumulate the :worldwide_grosses and return that Integer using director_data as input
|
[
{
"docid": "0cc89cfefc3edfd5a1940339d742275b",
"score": "0.71042264",
"text": "def gross_for_director(director_data)\n\n \n col = 0\n value = 0\n \n while col < director_data[:movies].length do\n \n value = value + director_data[:movies][col][:worldwide_gross]\n # puts director_data[row][:movies][col][:worldwide_gross]\n # puts value\n col += 1\n end\n # puts value\n value \nend",
"title": ""
}
] |
[
{
"docid": "78129262a5d48c085cf6cb4e93eafdb3",
"score": "0.8031163",
"text": "def gross_for_director(director_data)\n movie_index = 0\n worldwide_grosses = 0\n while movie_index < director_data[:movies].length\n worldwide_grosses += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\nworldwide_grosses\nend",
"title": ""
},
{
"docid": "ebecc3abd3da97763c661f6fbf861fb4",
"score": "0.797869",
"text": "def gross_for_director(director_data)\n movie_index = 0\n director_total = 0\n while movie_index < director_data[:movies].length\n director_total += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\n director_total\n\n end",
"title": ""
},
{
"docid": "e4e9ba4d9fa3f5bb01336cca7bb1adcf",
"score": "0.7978685",
"text": "def gross_for_director(director_data)\n sum = 0\n\t\n\tdirector_data[:movies].each do |movie|\n\t\tsum += movie[:worldwide_gross]\n\tend\n\t\n\treturn sum\nend",
"title": ""
},
{
"docid": "1873008ef54a7be8deca37b229988d33",
"score": "0.79376084",
"text": "def gross_for_director(director_data)\n index = 0 \n total = 0 \n while index < director_data[:movies].length do\n total+=director_data[:movies][index][:worldwide_gross]\n index+=1\n end\n total\n end",
"title": ""
},
{
"docid": "3b0b8b06234dfbf840d9ccae9c5e6a84",
"score": "0.79261947",
"text": "def gross_for_director(director_data)\n\n result = 0\n movie_idx = 0\n while movie_idx < director_data[:movies].count\n result += director_data[:movies][movie_idx][:worldwide_gross]\n movie_idx += 1\n end\n result\nend",
"title": ""
},
{
"docid": "4095852bd32f7881857c54ccbcf14e19",
"score": "0.78930205",
"text": "def gross_for_director(director_data)\ndirector_gross = 0\n movie_len = director_data[:movies].length\n movie_index = 0\n while movie_index < movie_len do\n director_gross += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\n director_gross\nend",
"title": ""
},
{
"docid": "5e77566817aab24ce81a5977ddc0fd46",
"score": "0.78397584",
"text": "def gross_for_director(director_data)\n total = 0\n movies = director_data[:movies]\n movies.length.times do |movie_idx|\n total+=movies[movie_idx][:worldwide_gross]\n end\n return total\nend",
"title": ""
},
{
"docid": "d682ca8073edecd4d73c73792e644643",
"score": "0.77549934",
"text": "def gross_for_director(director_data)\n m_index = 0\n director_data = 0\n gross = 0\n while m_index < directors_database[director_data][:movies].length do\n gross += directors_database[director_data][:movies][m_index][:worldwide_gross]\n m_index += 1\nend\ngross\nend",
"title": ""
},
{
"docid": "4beec48a186b993d6e5a257a21811847",
"score": "0.7751539",
"text": "def gross_for_director(director_data)\n director_gross = 0\n movie_count = 0\n while movie_count < director_data[:movies].length do\n director_gross += director_data[:movies][movie_count][:worldwide_gross]\n movie_count += 1\n end\n director_gross\nend",
"title": ""
},
{
"docid": "ec49f7fb197aab108dc5386a8c7cac40",
"score": "0.77161163",
"text": "def gross_for_director(director_data)\n gross_for_director=0\n i=0\n while i<director_data[:movies].size\n gross_for_director+=director_data[:movies][i][:worldwide_gross]\n i+=1\n end\n gross_for_director\nend",
"title": ""
},
{
"docid": "90b599c92cfd38519a7b96f8fd0e621b",
"score": "0.7669984",
"text": "def gross_for_director(director_data)\n i = 0\n tot = 0\n while i < director_data[:movies].count do\n tot += director_data[:movies][i][:worldwide_gross]\n i += 1\n end\n return tot\nend",
"title": ""
},
{
"docid": "af35f6c1d6f66b2fdbab7d49ca9b8e85",
"score": "0.7669895",
"text": "def gross_for_director(director_data)\n count = 0\n sum = 0\n while director_data[:movies][count] do\n sum += director_data[:movies][count][:worldwide_gross]\n count += 1\n end\n \n return sum\nend",
"title": ""
},
{
"docid": "59f19f8ab744439cef067521f60d56ab",
"score": "0.76544744",
"text": "def gross_for_director(director_data)\n total_gross = 0\n\n i = 0\n while i < director_data[:movies].length\n worldwide_gross = director_data[:movies][i][:worldwide_gross]\n total_gross += worldwide_gross\n i += 1\n end\n\n total_gross\nend",
"title": ""
},
{
"docid": "eb316bca7dad8695a02da7bfbf0939b4",
"score": "0.7608301",
"text": "def gross_for_director(director_data)\n movie_count = 0\n total_gross = 0\n while movie_count < director_data[:movies].length do\n total_gross += director_data[:movies][movie_count][:worldwide_gross]\n movie_count += 1\n end\n total_gross\nend",
"title": ""
},
{
"docid": "641d6c0915792c2112c6de7dc23d7df1",
"score": "0.7602213",
"text": "def gross_for_director(director_data)\n movie_index = 0 \n inner_result = 0 \n while movie_index < director_data[:movies].length do\n inner_result += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1 \n end\n inner_result\nend",
"title": ""
},
{
"docid": "b0cd8e877a33150868562cb625e6d76a",
"score": "0.7601581",
"text": "def gross_for_director(director_data)\n #dir_name = director_data[:name]\n movie_list = director_data[:movies]\n dir_gross = 0\n movie_index = 0\n while movie_index < movie_list.length do\n dir_gross += movie_list[movie_index][:worldwide_gross]\n movie_index += 1\n end\n dir_gross\nend",
"title": ""
},
{
"docid": "edc1509f243d4e57a859f24688488bd6",
"score": "0.758774",
"text": "def gross_for_director(director_data)\n row_index = 0\n director_total = 0\n\n while row_index < director_data[:movies].length do\n director_total += director_data[:movies][row_index][:worldwide_gross]\n \n row_index += 1\n end\n\n director_total\nend",
"title": ""
},
{
"docid": "b7c41a5d579aefc702838490a2fe7fef",
"score": "0.7581216",
"text": "def gross_for_director(director_data)\n total_director_gross = 0\n director_data[:movies].each do |movie|\n total_director_gross += movie[:worldwide_gross]\n end\n total_director_gross\nend",
"title": ""
},
{
"docid": "471ade014924425c4c273b246d69030f",
"score": "0.75775546",
"text": "def gross_for_director(director_data)\n gross = 0\n director_data[:movies].each do |n|\n gross +=n[:worldwide_gross]\n end\n return gross\nend",
"title": ""
},
{
"docid": "a3c7a0d139e6ae90dc3f4805108334b5",
"score": "0.7556899",
"text": "def gross_for_director(director_data)\n movie_index = 0 \n total_gross = 0\n while director_data[:movies][movie_index] do \n movie_hash = director_data[:movies][movie_index]\n total_gross += movie_hash[:worldwide_gross]\n movie_index += 1\n end \n total_gross\nend",
"title": ""
},
{
"docid": "99db73bfa276d40a1a191ffe1062deab",
"score": "0.75266385",
"text": "def gross_for_director(director_data)\ntotal=0\nm= director_data[:movies]\nrow = 0\nwhile row < m.length \n g= m[row][:worldwide_gross]\n row += 1\n total += g\nend\ntotal\n\nend",
"title": ""
},
{
"docid": "d78ecf28f1e4b5ff1880106af5dde2b1",
"score": "0.7517733",
"text": "def gross_for_director(director_data)\n total=0\n rownum=0\n while rownum< director_data[:movies].length\n total+=director_data[:movies][rownum][:worldwide_gross]\n rownum+=1\nend\nreturn total\nend",
"title": ""
},
{
"docid": "cefde4dd21c5dff0367a017108a13889",
"score": "0.7512561",
"text": "def gross_for_director(director_data)\n sum = 0\n x = 0\n\n while x < director_data[:movies].length do\n sum += director_data[:movies][x][:worldwide_gross]\n x += 1\n end\n\n sum\nend",
"title": ""
},
{
"docid": "c98ced13c5b10a0031c92c45353a72d3",
"score": "0.7506112",
"text": "def gross_for_director(director_data)\n #pp director_data\n\n result = []\n movie_index = 0\n\n while movie_index < director_data[:movies].length do\n total_gross = director_data[:movies][movie_index][:worldwide_gross]\n result.push(total_gross)\n movie_index += 1\n end\n puts result\n return result.sum\n end",
"title": ""
},
{
"docid": "661215a3595d470cef71f0bf685b7112",
"score": "0.7489937",
"text": "def gross_for_director(director_data)\n total = 0\n index = 0\n\n while index < director_data[:movies].length do\n total += director_data[:movies][index][:worldwide_gross]\n index += 1\n end\n\n total\nend",
"title": ""
},
{
"docid": "79cf8c2ba7a1179e7298c9226966878c",
"score": "0.7488092",
"text": "def director_gross(director_data)\n movies_index = 0\n total = 0\n \n while movies_index < director_data[:movies].count do\n total += director_data[:movies][movies_index][:worldwide_gross] \n movies_index += 1\n end\n total\nend",
"title": ""
},
{
"docid": "e5fff58f3104635d3704aa4a1ad0bd08",
"score": "0.7460559",
"text": "def gross_for_director(director_data)\ntotal = 0\nmovie_index = 0\n while movie_index<director_data[:movies].length do\n total+=director_data[:movies][movie_index][:worldwide_gross]\n movie_index+=1\n end\ntotal\nend",
"title": ""
},
{
"docid": "2ae0319144eb2b2f1adc609c01f9dd23",
"score": "0.7456679",
"text": "def gross_for_director(director_data)\n #total gross for director\n director_total = 0\n #movie iterator\n movie_element = 0\n #iterate through movies\n while movie_element < director_data[:movies].length do\n #add movie gross to total for director\n director_total += director_data[:movies][movie_element][:worldwide_gross]\n #increase movie iterator\n movie_element += 1\n end\n return director_total\nend",
"title": ""
},
{
"docid": "3dd9a839cffa52ef0df9659a336744e2",
"score": "0.7455591",
"text": "def gross_for_director(director_data)\n movies_index = 0\n director_gross = 0\n movies_array = director_data[:movies]\n while movies_index < movies_array.length do\n director_gross += movies_array[movies_index][:worldwide_gross]\n movies_index += 1\n end\n p director_gross\nend",
"title": ""
},
{
"docid": "1c750d501c4691b9750f5fd09536d5f7",
"score": "0.7430503",
"text": "def gross_for_director(director_data)\n #p director_data\n i = 0\n total = 0\n while i < director_data[:movies].length do\n total += director_data[:movies][i][:worldwide_gross] \n i += 1\n end\n total\nend",
"title": ""
},
{
"docid": "82f8538ce847d22dd5b5bd68f2c1a950",
"score": "0.74178094",
"text": "def gross_for_director(director_data)\n counter = 0\n #gross = directors_database[:movies].count()\n # len = directors_database[director_data][:movies].length\n# while counter < len do \n# gross = directors_database[0][:movies][0][:worldwide_gross]\n# end\n\n# counter += 1\n # while\n new = 0\n limit = director_data[:movies].size\n while counter < limit do\n new += director_data[:movies][counter][:worldwide_gross]\n \n counter += 1\nend \n \n new\nend",
"title": ""
},
{
"docid": "9fc45a69c3c3611cc850be5dac02c9a6",
"score": "0.7404937",
"text": "def gross_for_director(director_data)\n i = 0 \n total = 0\n while i < director_data[:movies].length do \n total += director_data[:movies][i][:worldwide_gross]\n i += 1 \n end \n total \nend",
"title": ""
},
{
"docid": "393ebc59bd671adec3d421cbe32aa981",
"score": "0.7342946",
"text": "def gross_for_director(director_data)\n \n total = 0\n i = 0 \n while i < director_data[:movies].length do\n total += director_data[:movies][i][:worldwide_gross]\n i += 1\n\n\nend\n\nreturn total\nend",
"title": ""
},
{
"docid": "4d2d491ac240da84595dc79568200ccc",
"score": "0.7337559",
"text": "def gross_for_director(director_data)\n # index = 0\n coordinate_total = 0\n # while index < director_data.length do\n totalindex = 0\n while totalindex < director_data[:movies].length do\n coordinate_total += director_data[:movies][totalindex][:worldwide_gross]\n totalindex += 1\n # end\n # index += 1\n end\n coordinate_total\n\nend",
"title": ""
},
{
"docid": "49f3bf56a6bc416f271498c1317196b1",
"score": "0.7329397",
"text": "def gross_for_director(director_data)\nmovieNum = 0\ntotalGross = 0\nwhile movieNum < director_data[:movies].length do\n totalGross += director_data[:movies][movieNum][:worldwide_gross]\n movieNum += 1\nend\ntotalGross\nend",
"title": ""
},
{
"docid": "718a43ef24f05e71a81de96c580cc507",
"score": "0.7318269",
"text": "def gross_for_director(nds)\n\n sum=0\n idx2 = 0\n while idx2 < nds[:movies].length\n # p director_database[idx1][:movies][idx2][:worldwide_gross]\n sum += nds[:movies][idx2][:worldwide_gross]\n idx2 +=1\n end\n # puts sum\n # puts \"-\"\n sum\nend",
"title": ""
},
{
"docid": "d7423da82ac98994421565b91de0fe06",
"score": "0.73012656",
"text": "def gross_for_director(d)\n total = 0\n index = 0\n while index < d[:movies].length do\n total += d[:movies][index][:worldwide_gross]\n index += 1\n end\n total\nend",
"title": ""
},
{
"docid": "d95de3020be1f3f7afbaa8b347fd555d",
"score": "0.72453207",
"text": "def gross_for_director(director_data)\n grand_total = 0\n row_index = 0\n column_index = 0\n while column_index < directors_database[row_index][:movies].length do\n grand_total += directors_database[row_index][:movies][column_index][:worldwide_gross]\n column_index += 1\n end\n grand_total\nend",
"title": ""
},
{
"docid": "6079e421feb271f9f293c921f05e655d",
"score": "0.7124891",
"text": "def gross_for_director(director_data)\nfilmsMade = director_data[:movies].length\n movies_index = 0 \n gross_index = 0\n\n while gross_index < filmsMade do\n director_gross = director_data[:movies][gross_index][:worldwide_gross]\n movies_index += director_gross \n gross_index += 1\n end \n\n movies_index\nend",
"title": ""
},
{
"docid": "8826c2bb87202e829522381ea7e5ddd9",
"score": "0.71104103",
"text": "def gross_for_director(director_data)\n earnings = 0\n which_mov = 0\n while which_mov < director_data[:movies].length do\n earnings += director_data[:movies][which_mov][:worldwide_gross]\n which_mov += 1\n end\n earnings \nend",
"title": ""
},
{
"docid": "a39a161717afaedb8bc220e49aed4a47",
"score": "0.7101387",
"text": "def gross_for_director(director_data)\ntotal = 0\nindex_movies = 0\nmovie = director_data[:movies]\nwhile index_movies < movie.length do\n puts movie[index_movies][:worldwide_gross]\n total = total + movie[index_movies][:worldwide_gross]\n index_movies += 1\n \nend\ntotal\nend",
"title": ""
},
{
"docid": "30f6a13174f13f3e8fc0b59735d6078c",
"score": "0.70882255",
"text": "def gross_for_director(director_data)\ntotal=0 \ncolumn_index=0\nwhile column_index<director_data[:movies].length do \ntotal+=director_data[:movies][column_index][:worldwide_gross]\ncolumn_index+=1\nend\ntotal\nend",
"title": ""
},
{
"docid": "b9136727225f4cd4862e01cc319a52d4",
"score": "0.70537543",
"text": "def gross_for_director(nds, element_index)\n total = 0\n new_index = 0\n \n #extract numbers\n while new_index < nds[element_index][:movies].length do\n total = total + nds[element_index][:movies][new_index][:worldwide_gross]\n new_index += 1\n end\n total\nend",
"title": ""
},
{
"docid": "c56c27bf41065f70729bd26866477e01",
"score": "0.70346636",
"text": "def gross_for_director(director_data)\n\ntotal = 0 \nindex = 0 \n while index < director_data[:movies].length \n director_gross = director_data[:movies][index][:worldwide_gross]\n total += director_gross\n index += 1 \n end \n\n#binding.pry \n\nreturn total\nend",
"title": ""
},
{
"docid": "b470b53b3bb9f6d07b6fe22afdb877c6",
"score": "0.70102024",
"text": "def gross_for_director(director_data)\n director_total = 0 #intialization\n row_index = 0 # intialization\n\n while row_index < director_data[:movies].length do # \n \n director_total += director_data[:movies][row_index][:worldwide_gross] # adds each movies gross to a value director_total \n \n # puts \" World wide gross for the #{row_index + 1} movie is #{director_total}\" \n row_index += 1 \n end\n return director_total\nend",
"title": ""
},
{
"docid": "35579d9186da7558547f2d248230641f",
"score": "0.700546",
"text": "def gross_for_director(director_data)\n new_array = director_data[:movies]\n i = 0 \n total_gross = 0\n while i < new_array.length do\n anotha_array = new_array[i]\n gross = anotha_array[:worldwide_gross]\n total_gross += gross\n i+=1\n end\n total_gross\nend",
"title": ""
},
{
"docid": "c76ccc5d618b881ca599017f88301945",
"score": "0.6879765",
"text": "def gross_for_director(director_data)\n \n result = {}\n movie_gross = 0\n movie_index = 0\n \n director_movies = director_data[:movies] # this is pointing to an array of hashes\n puts director_movies\n director_name = director_data[:name] # √\n \n while movie_index < director_movies.count do\n movie_gross += director_movies[movie_index][:worldwide_gross]\n movie_index +=1\n end\n \n movie_gross \nend",
"title": ""
},
{
"docid": "c02af6d1c4fc249081e7b82c2f7dcd1b",
"score": "0.679036",
"text": "def gross_for_director(director_data)\n array = director_data[:movies]\n i = 0 \n total = 0\n \n while i < array.length do\n obj = array[i]\n income = obj[:worldwide_gross]\n \n total += income\n i+=1\n end\n \n return total\nend",
"title": ""
},
{
"docid": "9f8ee97617cd5f6a0ea66ff3ae469ee1",
"score": "0.65634155",
"text": "def total_gross(source)\n total =0 \n name_key = list_of_directors(source)\n individual_gross_hash = directors_totals(source)\n dir_index=0\n while dir_index < name_key.length\n total+= individual_gross_hash[name_key[dir_index]]\n dir_index+=1 \n end\n total\nend",
"title": ""
},
{
"docid": "af26b8e38fe424e93e8bc25501c2d85e",
"score": "0.64517367",
"text": "def total_gross(source)\n # Write this implementation\n #\n # Should use methods:\n # 1. directors_totals: returns a Hash of { dir_name => gross }\n # 2. list_of_directors: names provides an Array of directors names (use\n \n total_all_directors = 0\n idx_dir = 0\n # Array de string\n noms_de_dirs = list_of_directors(source)\n # Hash donde las llaves son string y los valores son Integer\n money_dirs = directors_totals(source)\n \n while idx_dir < noms_de_dirs.length\n # Key is a string\n key = noms_de_dirs[idx_dir]\n total_all_directors += money_dirs[key]\n idx_dir += 1 \n end\n \n return total_all_directors\n \n #\n # Visit each key (i.e. director name), look up the value in the hash\n # returned by directors_totals, and add it to a running total. When done,\n # return the total\nend",
"title": ""
},
{
"docid": "b3437ae62e797a541f30d91caefaa3e3",
"score": "0.61717445",
"text": "def gross_for_director(director_data)\nend",
"title": ""
},
{
"docid": "b3437ae62e797a541f30d91caefaa3e3",
"score": "0.61717445",
"text": "def gross_for_director(director_data)\nend",
"title": ""
},
{
"docid": "e6bad6e564c212c6609e8f2d97ed134b",
"score": "0.6170081",
"text": "def directors_totals(nds)\n # Remember, it's always OK to pretty print what you get *in* to make sure\n # that you know what you're starting with!\n #\n #\n # The Hash result be full of things like \"Jean-Pierre Jeunet\" => \"222312123123\"\n\n #\n # Use loops, variables and the accessing method, [], to loop through the NDS\n # and total up all the\n # ...\n # ...\n # ...\n #\n #\n # Be sure to return the result at the end!\n\n result = {}\n\n director_index = 0\n movie_index = 0\n\n while director_index < nds.size do\n director = nds[director_index][:name]\n result[director] = 0\n while movie_index < nds[director_index][:movies].size do\n result[director] += nds[director_index][:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\n director_index += 1\n movie_index = 0\n end\n\n result\nend",
"title": ""
},
{
"docid": "7abea0074e54c1a2337458e2a99f0c19",
"score": "0.6125197",
"text": "def directors_totals(nds)\n result = {} \n directors_index = 0 \n while directors_index < nds.length do \n directors = nds[directors_index][:name]\n result[directors] = 0 \n movie_index = 0\n totalmade = 0 \n while movie_index < nds[directors_index][:movies].length do\n directors_gross = nds[directors_index][:movies][movie_index][:worldwide_gross]\n result[directors] += directors_gross\n movie_index += 1 \n end \n directors_index += 1 \n end \n result\nend",
"title": ""
},
{
"docid": "69b4be63b063ab042105ce7bc847165a",
"score": "0.59798604",
"text": "def directors_totals(nds)\n total = {}\n i = 0\n while i < nds.length do\n director = nds[i][:name]\n total[director] = gross_for_director(nds[i])\n i += 1 \n end\n return total \nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.5976051",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "e184f190aa5fae79a9cf30cd74ec9e33",
"score": "0.59756637",
"text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend",
"title": ""
},
{
"docid": "85941d3fa27654fb3282eeb27aa105c7",
"score": "0.5957676",
"text": "def gross_for_director(director_data)\n\nend",
"title": ""
},
{
"docid": "023094104aa386c40a44130908eaedbe",
"score": "0.5957625",
"text": "def gross_per_studio(collection)\n result = {}\n i = 0\n while i < collection.size do\n studio = collection[i][:studio]\n total_earnings = collection[i][:worldwide_gross]\n if !result[studio]\n result[studio] = total_earnings\n else\n result[studio] += total_earnings\n end\n i += 1\n end\n \n # GOAL: Given an AoH where each Hash is a movie, return a Hash that includes\n # the total worldwide_gross of all the movies from each studio.\n #\n # INPUT: (collection) AoH where each Hash represents a movie\n #\n # RETURN: Hash where the keys are the studios and the values are the sum of\n # all the worldwide_gross numbers for every movie in the input Hash\n \n result\nend",
"title": ""
},
{
"docid": "e25dbd156388c90ccce2704916cb3f88",
"score": "0.59444284",
"text": "def get_gross_for(title, movies)\n movie = movies.find{|movie| movie[:title] == title}\n movie = movie[:gross].gsub(/[$,]/, '').to_i\nend",
"title": ""
},
{
"docid": "25b9f83168ca973aff9ad95f1eca68de",
"score": "0.59028083",
"text": "def directors_totals(nds)\nresult = []\n r_index=0 \n while r_index < nds.length \n i=0 \n total=0 \n\n n= nds[r_index][:name]\n t= nds[r_index][:movies]\n while i < t.length\n \n k= t[i][:worldwide_gross]\n total += k\n \n i += 1\n end\n r_index += 1\n result << [n , total]\n end\n result.to_h\n end",
"title": ""
},
{
"docid": "8718ed9be424608f2b880dde21f9f499",
"score": "0.5853697",
"text": "def directors_totals(source)\n result = {}\n director_index = 0\n while director_index < source.size do\n director = source[director_index]\n result[director[:name]] = gross_for_director(director)\n director_index += 1\n end\n result\nend",
"title": ""
},
{
"docid": "cd28165aba00f1c228594815e57bfe81",
"score": "0.5819995",
"text": "def determine_winner game\n winner = game.max_by {|team| team[:score]}\n team_standings = get_team_by_name(winner)\n team_standings[:winnings] += 3\nend",
"title": ""
},
{
"docid": "1218c9da1aeabbde8b114ed4b4215ed2",
"score": "0.58077127",
"text": "def gross_per_studio(collection)\n new_hash = {}\n counter = 0 \n while counter < collection.length do \n studio_name = collection[counter][:studio]\n ww_gross = collection[counter][:worldwide_gross]\n if !new_hash[studio_name]\n new_hash[studio_name] = ww_gross\n else \n new_hash[studio_name] += ww_gross\n end \n counter += 1 \nend\nreturn new_hash\nend",
"title": ""
},
{
"docid": "d3ab536db19587875b8d852dcc00138e",
"score": "0.57745785",
"text": "def cumulative_gross(array)\n #gave the franchise total of 0\n bond_franchise = 0\n #loop through the array of each movie\n array.each {|movie|\n #get the movie to be an integer and put that as a variable of the gross\n the_gross = movie[:gross].delete('$').split(',').join.to_i\n #the total of the franchise will add the gross of each movie\n #as it loops it will continue adding all the gross together\n bond_franchise = bond_franchise + the_gross\n }\n #this will output the total gross in integer that is converted back into $ with , to read the total $ about better\n puts \"#{bond_franchise.to_s.reverse.scan(/.{1,3}/).join(',').reverse.insert(0,'$')}\"\nend",
"title": ""
},
{
"docid": "53c46c425dcc1358fc8f9004ebb3e001",
"score": "0.5749014",
"text": "def gross(movie_name)\n for m in movies\n if m.title == movie_name\n return m.gross\n end\n end\n return -1\n end",
"title": ""
},
{
"docid": "f88a498375c4e44d45f3bb30f917742e",
"score": "0.5704173",
"text": "def total_medals_per_team(olympic_data)\n\n team_medals_hash = {}\n\n olympic_data.each do |data|\n\n if team_medals_hash.key?(data[\"Team\"])\n if [\"Gold\", \"Silver\", \"Bronze\"].include?(data[\"Medal\"]) #SAME TEAM, MEDAL\n team_medals_hash[data[\"Team\"]] += 1\n end\n else\n\n if [\"Gold\", \"Silver\", \"Bronze\"].include?(data[\"Medal\"]) # NEW TEAM, MEDAL\n team_medals_hash[data[\"Team\"]] = 1\n else\n team_medals_hash[data[\"Team\"]] = 0\n\n end\n end\n end\n return team_medals_hash\nend",
"title": ""
},
{
"docid": "f5032a993cd9ae08dc3b892e3731234d",
"score": "0.5672922",
"text": "def battlers_number\n return @battlers_number.sum\n end",
"title": ""
},
{
"docid": "568d4f8f95531aadbb77f89e4e952814",
"score": "0.55989105",
"text": "def count_contestants_by_hometown(data, hometown)\n home_town = 0\n data.each do |season_iteration, stats|\n stats.each do |town|\n if town[\"hometown\"] == hometown\n home_town = home_town + 1\n end\n end\n end\n return home_town\nend",
"title": ""
},
{
"docid": "ffbd3c08a19c0386f5bac76f611d6f47",
"score": "0.55638856",
"text": "def lift_total_for_gym\n total = 0\n lifters.each do |lifter|\n total += lifter.lift_total\n end\n total\n end",
"title": ""
},
{
"docid": "1c08f9ea804d006cdb7c7a04797c6375",
"score": "0.5512376",
"text": "def week_1_total\n total = 0\n rostered_players.each do |rostered_player|\n total += rostered_player.player.week_1_score\n end\n return total\n end",
"title": ""
},
{
"docid": "c3000a767a7e1648259df6a45fd8e533",
"score": "0.55012816",
"text": "def its_a_tie game\n game.each do |team|\n team_standings = get_team_by_name(team)\n team_standings[:winnings] += 1\n end\nend",
"title": ""
},
{
"docid": "c533178d608ac4ae1faa5b6b0512d0fa",
"score": "0.549848",
"text": "def big_shoe_rebounds\n big_foot = 0\n boards = 0\n\n game_hash.values.each do |roster|\n roster[:players].each do |player|\n if player[:shoe] > big_foot\n big_foot = player[:shoe]\n boards = player[:rebounds]\n end\n end\n end\n return boards\nend",
"title": ""
},
{
"docid": "ce08eb35b1ecce9e39a1ab19a5faad5e",
"score": "0.5489971",
"text": "def total\n wins + losses\n end",
"title": ""
},
{
"docid": "bfec5bf495f55bddecb1835e2ccbd9d3",
"score": "0.54885304",
"text": "def occupation\n occupation_sum = 0\n team_roles.each do |team_role|\n occupation_sum += team_role.occupancy\n end\n return occupation_sum\n end",
"title": ""
},
{
"docid": "ed396542b7cb1d2693917fbdfd740d99",
"score": "0.5486884",
"text": "def determine_possible_num_moves(gm, rd, md)\n puts \"Determining possible total moves...\"\n min = [ md[:max_val], rd[:num_regions] * 2 - 1 ].max\n max = gm[:x] * gm[:y]\n poss_ms = []\n for i in min..max do\n if i % rd[:num_regions] == 0 or (i + 1) % rd[:num_regions] == 0\n poss_ms.push(i)\n end\n end\n puts \"poss_ms = \" + poss_ms.to_s\n return poss_ms\nend",
"title": ""
},
{
"docid": "c35f0a08cf8dfb5f88be68056a500f67",
"score": "0.5472732",
"text": "def moneys_total\n moneys_total = 0\n mini_maps.each do |map|\n moneys_total += map.moneys_total\n end\n return moneys_total\n end",
"title": ""
},
{
"docid": "a305667681190b1185247b335e9844ca",
"score": "0.54665166",
"text": "def num_points_scored(player)\n game_hash.each do |location, team_data| #location returns away, team_data returns hash\n # binding.pry\n team_data.each do |attribute, data|\n # binding.pry\n if attribute == :players\n data.each do |player_name, categories|\n # binding.pry\n if player_name == player\n # binding.pry\n return categories[:points]\n end\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "727c4c3a182775afe692514ae93474a3",
"score": "0.54562795",
"text": "def number( gm )\n num = nil\n gm.players.each_with_index{|pl, i| num = i if (pl == self) }\n (num + 1) if num.is_a? Integer\n end",
"title": ""
},
{
"docid": "03fb3cfdced9fc71271a32ed8fd9cee4",
"score": "0.5452504",
"text": "def num_points_scored(player_name)\npoints_scored = 0\ngame_hash.each do |location, team_data|\n team_data.each do |attribute, data|\n if attribute == :players\n data.each do |player, stats|\n if player == player_name\n points_scored = stats[:points]\n end\n end\n end\n end\nend\npoints_scored\nend",
"title": ""
},
{
"docid": "c79d29572d1a9f97162c2ccbcb6b8d26",
"score": "0.54366505",
"text": "def count_losses\n loss_no = 0\n Battle.where(\"movie_loser\" => self.id).each do\n loss_no += 1 \n end\n return loss_no\n end",
"title": ""
},
{
"docid": "25d7e6fabe45d9932f4b1a22e10d18ca",
"score": "0.5428962",
"text": "def lift_total_for_gym\n total = 0\n self.lifters.each do |lifter|\n total += lifter.lift_total\n end\n total\n end",
"title": ""
},
{
"docid": "e8ecc7135e1ca87142e8e04d91281b10",
"score": "0.54171914",
"text": "def total_medals_per_team(olympic_data)\n counts = olympic_data.group_by{ |x| x[:\"Team\"] }.map{ |x,y| [x,y.count] }\n counts = Hash[counts]\n return counts\nend",
"title": ""
},
{
"docid": "6fe27ac2fa96ccee24ae9d42144a2c55",
"score": "0.5409042",
"text": "def num_points_scored(player_name)\n\ngame_hash.each do |location, team_data|\n team_data.each do |attribute, values|\n if attribute == :players\n values.each do |person, data|\n if person.to_s == player_name\n return game_hash[location][:players][person][:points]\n end\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "6101a5cd8683e101b56830d2204f56a5",
"score": "0.54075295",
"text": "def get_gross_for(title,array)\n #loops the array and locates each hash in the array\n array.each {|movie|\n #if the title of the move matches the symbol title in the hash then\n if title == movie[:title]\n #gives the movie gross by deleting the $ sign and removing the , to join it and return the integer only\n puts \"#{movie[:gross].delete('$').split(',').join.to_i}\"\n end\n }\nend",
"title": ""
},
{
"docid": "89e641805e19e7c12e015fc9888c7512",
"score": "0.5405537",
"text": "def count_contestants_by_hometown(data, hometown)\n all_seasons(data).reduce(0) do |sum, contestant|\n if contestant[\"hometown\"] == hometown \n sum + 1 \n else \n sum \n end\n end\nend",
"title": ""
},
{
"docid": "1b94cc73634469381dfb37e33bfdb94e",
"score": "0.5402391",
"text": "def total_games_by_coach_by_season\n @total_games_by_coach = Hash.new{ |hash, key| hash[key] = 0}\n @by_season_game_team_objects.each do |game_by_season|\n @total_games_by_coach[game_by_season[\"head_coach\"]] += 1\n end\n end",
"title": ""
},
{
"docid": "44e3cf24374d42c5d92233aa30346f1c",
"score": "0.53986984",
"text": "def combined_lift_total\n clt = 0\n Membership.all.select do |membership_instance|\n if membership_instance.gym == self\n clt += membership_instance.member.lift_total\n end\n end\n clt\n end",
"title": ""
},
{
"docid": "2009a9768659f07625b08c8e7993465f",
"score": "0.5395989",
"text": "def winning_team\n final_scores = player_collection.reduce(home: 0, away: 0) { |teams_points, next_player|\n case \n when next_player[:location] === :away\n teams_points[:away] += next_player[:points];\n when next_player[:location] === :home\n teams_points[:home] += next_player[:points];\n end\n teams_points; \n }\n winner = final_scores.reduce { |highest_points, team_points| \n highest_points[1] > team_points[1] ? highest_points : team_points; \n }\n game_hash[winner[0]][:team_name]; \nend",
"title": ""
}
] |
2bd22cd4316b82956f099b43e671b835
|
At this point very limited in it's ability
|
[
{
"docid": "9d8298b3bdc7cee2b86df5c476145330",
"score": "0.0",
"text": "def decode_query_string\n self.split(\"&\").inject({}) { |collector, string|\n pair = string.split('=', 2)\n collector.merge({pair[0] => pair[1]})\n }\n end",
"title": ""
}
] |
[
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.6961394",
"text": "def desired; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6899605",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6899605",
"text": "def used; end",
"title": ""
},
{
"docid": "58e2e07d11b107b6864a328f2187e248",
"score": "0.68137085",
"text": "def apop?; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.68120795",
"text": "def in_use; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.68120795",
"text": "def in_use; end",
"title": ""
},
{
"docid": "5928f8efe9c6c2d408ea21a4cdce83ad",
"score": "0.6558523",
"text": "def preliminary?; end",
"title": ""
},
{
"docid": "d11da73d7a741de16ef5e4fb4157a01a",
"score": "0.6518634",
"text": "def access; end",
"title": ""
},
{
"docid": "d11da73d7a741de16ef5e4fb4157a01a",
"score": "0.6518634",
"text": "def access; end",
"title": ""
},
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.6484678",
"text": "def used?; end",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.64836556",
"text": "def advanced; end",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.64836556",
"text": "def advanced; end",
"title": ""
},
{
"docid": "f0d50116d6d067bd787bf1044910efcb",
"score": "0.64802146",
"text": "def attempt; end",
"title": ""
},
{
"docid": "3ae137b1a40ff3aae4f3cbb2b6082797",
"score": "0.6472195",
"text": "def reaper; end",
"title": ""
},
{
"docid": "950bef128403f02279cc1bb4ef43a028",
"score": "0.64174616",
"text": "def realized?; end",
"title": ""
},
{
"docid": "950bef128403f02279cc1bb4ef43a028",
"score": "0.64174616",
"text": "def realized?; end",
"title": ""
},
{
"docid": "3caf4c824a6d6a4a5616c13fcab418da",
"score": "0.64137906",
"text": "def applied; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.6409464",
"text": "def anchored; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6390575",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6390575",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6390575",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6390575",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6390575",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6390575",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "922ad13267ad637c9292ec039c11884f",
"score": "0.6384239",
"text": "def obscured?; end",
"title": ""
},
{
"docid": "f824c1cb74daa07210ca5a3f564fb258",
"score": "0.6381759",
"text": "def guarded; end",
"title": ""
},
{
"docid": "7ec57c3874853e50086febdbdd3221bf",
"score": "0.6381751",
"text": "def wedding; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.6364571",
"text": "def isolated; end",
"title": ""
},
{
"docid": "6e6891d187cd127b8bc7e632ec0b2d50",
"score": "0.63345623",
"text": "def unitary?; end",
"title": ""
},
{
"docid": "7db0727baf89eb76beac27c515d7fe32",
"score": "0.6332136",
"text": "def support; end",
"title": ""
},
{
"docid": "a9dd648a5d0d2e7d56223e7c753f5e2e",
"score": "0.6325259",
"text": "def telegraphical()\n end",
"title": ""
},
{
"docid": "0212351345358772373f549b97821c62",
"score": "0.6305946",
"text": "def regular?; end",
"title": ""
},
{
"docid": "b7567a2a68cade31f2360723a4c42dc7",
"score": "0.6287751",
"text": "def used_by; end",
"title": ""
},
{
"docid": "7536e17370e568418e1eb8f1fad823fe",
"score": "0.6256027",
"text": "def allow; end",
"title": ""
},
{
"docid": "7536e17370e568418e1eb8f1fad823fe",
"score": "0.6256027",
"text": "def allow; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.6255636",
"text": "def internal; end",
"title": ""
},
{
"docid": "8b608597e4f8cb342968a26900959e68",
"score": "0.625305",
"text": "def extended?; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.62503415",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.62503415",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.62503415",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "d75c7529a52027a3fe78dfdb73b1e57c",
"score": "0.6242474",
"text": "def in_use?; end",
"title": ""
},
{
"docid": "ac376300f000603568c56235135951a3",
"score": "0.6233334",
"text": "def viable?; end",
"title": ""
},
{
"docid": "ac376300f000603568c56235135951a3",
"score": "0.6233334",
"text": "def viable?; end",
"title": ""
},
{
"docid": "baabe5bb658b17a85353fb66fdbbf873",
"score": "0.6225627",
"text": "def extended; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.6211389",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.6211389",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.6211389",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.6211389",
"text": "def preparable; end",
"title": ""
},
{
"docid": "954c5828178f6e4a659c40ef92736547",
"score": "0.6209586",
"text": "def helpful!\n\n\t\tend",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6192907",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6192907",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6192907",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6192907",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6192907",
"text": "def implementation; end",
"title": ""
},
{
"docid": "1acb0e2012761a8bf78cc4d86bc736e7",
"score": "0.6188645",
"text": "def subscopable?; end",
"title": ""
},
{
"docid": "1e7443a943ee7a44cb8ee2e385ff0add",
"score": "0.61849844",
"text": "def on_potential_false_positives; end",
"title": ""
},
{
"docid": "162b63d96fba382f4ac1d354527bb10c",
"score": "0.6180091",
"text": "def protection; end",
"title": ""
},
{
"docid": "162b63d96fba382f4ac1d354527bb10c",
"score": "0.6180091",
"text": "def protection; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.6177996",
"text": "def available; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.6177996",
"text": "def available; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.6177996",
"text": "def available; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.6177996",
"text": "def available; end",
"title": ""
},
{
"docid": "6e37c1e308f058381c565a17b02678f5",
"score": "0.6163386",
"text": "def hermitian?; end",
"title": ""
},
{
"docid": "d71b29a44fcd461c9434bd1543632563",
"score": "0.6161621",
"text": "def craftable?; end",
"title": ""
},
{
"docid": "36b960699a465eead42eac6e263957de",
"score": "0.6153018",
"text": "def sharded?; false; end",
"title": ""
},
{
"docid": "36b960699a465eead42eac6e263957de",
"score": "0.6153018",
"text": "def sharded?; false; end",
"title": ""
},
{
"docid": "005e6fc140cba1f79535dcb415d4bcd9",
"score": "0.615114",
"text": "def strategy; end",
"title": ""
},
{
"docid": "005e6fc140cba1f79535dcb415d4bcd9",
"score": "0.615114",
"text": "def strategy; end",
"title": ""
},
{
"docid": "e44ae2cef169d29f78b2b6306add59da",
"score": "0.61448455",
"text": "def huddlingly()\n end",
"title": ""
},
{
"docid": "4ea6f5c11a3bc16e2394d273e748b292",
"score": "0.61431694",
"text": "def internal?; end",
"title": ""
},
{
"docid": "29a83735da59010f07e1633934837c20",
"score": "0.61364484",
"text": "def underconstruction\n end",
"title": ""
},
{
"docid": "0aa0db9270c5a88c81da713a1ee0e8f8",
"score": "0.61078066",
"text": "def rescued_exception; end",
"title": ""
},
{
"docid": "8a91bfaa4b92b136c5d230a732b0d6e6",
"score": "0.60927546",
"text": "def eod?; end",
"title": ""
},
{
"docid": "2290804b238fc95bfd6b38f87c6d2895",
"score": "0.60750866",
"text": "def override; end",
"title": ""
},
{
"docid": "549cdd4767cacb4029e22f746ccd68b5",
"score": "0.6043757",
"text": "def work; end",
"title": ""
},
{
"docid": "094cae2a77f3def05726eb7961449324",
"score": "0.6041837",
"text": "def allowed; end",
"title": ""
},
{
"docid": "794a198d95cf296afde54486d8c4e262",
"score": "0.60274756",
"text": "def avail_out=(*) end",
"title": ""
},
{
"docid": "9fbbcdddc5a4471c7020f4fa132b535a",
"score": "0.60254204",
"text": "def duplicable?; end",
"title": ""
},
{
"docid": "9fbbcdddc5a4471c7020f4fa132b535a",
"score": "0.60254204",
"text": "def duplicable?; end",
"title": ""
},
{
"docid": "b7cfdec5315b5d3c26b002081b1dbae3",
"score": "0.6015454",
"text": "def coming_soon; end",
"title": ""
},
{
"docid": "4fe655da88e61d28e8b9a9ed964af838",
"score": "0.60125446",
"text": "def imprensa\n\t\t\n\tend",
"title": ""
},
{
"docid": "4fc42415fd675e0641de2682bd412e63",
"score": "0.6011793",
"text": "def sharing; end",
"title": ""
},
{
"docid": "8b79e8f7bbe83880e51794d26cd62a8f",
"score": "0.6010496",
"text": "def try; end",
"title": ""
},
{
"docid": "058945f42c987ac84b7d1f8470315d94",
"score": "0.60101694",
"text": "def sole; end",
"title": ""
},
{
"docid": "ef3cfbc09a2cbc6e86c4d0e23108bea6",
"score": "0.6006789",
"text": "def only; end",
"title": ""
},
{
"docid": "7b3a1c0aa81c879518831c23fd95270f",
"score": "0.5970198",
"text": "def remaining; end",
"title": ""
},
{
"docid": "7b3a1c0aa81c879518831c23fd95270f",
"score": "0.5970198",
"text": "def remaining; end",
"title": ""
},
{
"docid": "7b3a1c0aa81c879518831c23fd95270f",
"score": "0.5970198",
"text": "def remaining; end",
"title": ""
},
{
"docid": "7e082a39938aeae2f38a9ca3823e4d1b",
"score": "0.5962662",
"text": "def used=(_); end",
"title": ""
},
{
"docid": "6f45e4b71e44fc9ae5916c1a9e3e58ab",
"score": "0.5958106",
"text": "def evaporate!()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "6f45e4b71e44fc9ae5916c1a9e3e58ab",
"score": "0.5958106",
"text": "def evaporate!()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "e66c3e6966b775d1799a6b8fed500121",
"score": "0.59547347",
"text": "def check()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "1151221aa9457e5cad317e4fec922758",
"score": "0.5953599",
"text": "def adjugate; end",
"title": ""
},
{
"docid": "a8fd910ed93bc90f94f6a74a6d40c8d1",
"score": "0.59407663",
"text": "def semact?; true; end",
"title": ""
},
{
"docid": "334240d22c3d5bd0b2bbbcd882626810",
"score": "0.59364825",
"text": "def needed?; end",
"title": ""
},
{
"docid": "f6d4a510b1064cdde36cfabb37bc801a",
"score": "0.59345055",
"text": "def threadsafe; end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.59294885",
"text": "def active; end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.59294885",
"text": "def active; end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.59294885",
"text": "def active; end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.59294885",
"text": "def active; end",
"title": ""
},
{
"docid": "abf4063ba21175349965f6ecddefc7d2",
"score": "0.59204286",
"text": "def isolated?; end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "a3b5fd0b8100e1498fd37571bae175d4",
"score": "0.0",
"text": "def testcase_params\n params.require(:testcase).permit(:title, :description)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7493595",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6954758",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69205236",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6891565",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.6783412",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6741766",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.66818774",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6634386",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.6627996",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.6624317",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.6561549",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.648986",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64755446",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6452771",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.639812",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.6379535",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63622755",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.63365924",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.63347775",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.63249147",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.63191724",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.6313892",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.6312876",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.63040864",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.62999487",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.629886",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6294405",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62785035",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.62718505",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6265872",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.62543756",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62532973",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6250798",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6233973",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62272465",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6227004",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6225902",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62246615",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6199634",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.6190174",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.6181904",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61772704",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.6162726",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160626",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6154942",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61526656",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61359465",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61319274",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61170536",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6114007",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.6109575",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61028",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61028",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6085453",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60841954",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.6083834",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076738",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60734737",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.6066163",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065011",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60641026",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6063542",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.60627866",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.60613674",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60602236",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562223",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.6047439",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6047015",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6047015",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.60457283",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.60412854",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6032506",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6029243",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.60251915",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6020472",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.60178447",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6016368",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60133153",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.6007004",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60052776",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60052776",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.60052764",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60026777",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60007924",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000297",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59981924",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5995787",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5995787",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59932935",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.59924304",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.59919494",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.59897816",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.5988952",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
21b76830642cd808d89a208ed28d830e
|
of def initalize }}} The function count goes through the jokes database and counts the jokes according to their source
|
[
{
"docid": "04dad6eeb43ad50ee2bd74ef7dfbc9bc",
"score": "0.82678235",
"text": "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",
"title": ""
}
] |
[
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.6788473",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.6788473",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.6788473",
"text": "def count; end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.66628",
"text": "def count\n end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.66628",
"text": "def count\n end",
"title": ""
},
{
"docid": "7eed1f798b352a8c5c507a7bbcf7efa7",
"score": "0.6477486",
"text": "def count!\n count(nil)\n end",
"title": ""
},
{
"docid": "4155e8f05b27c5274ed0f0c85d3c9f2b",
"score": "0.6430468",
"text": "def count\n @count ||= 0\n end",
"title": ""
},
{
"docid": "4ef936b8d910194aaa2d23383bbd839f",
"score": "0.64076304",
"text": "def food_count()\nreturn @stomach.count()\nend",
"title": ""
},
{
"docid": "3fed6d1c178ac418cb6bc0b3ed026828",
"score": "0.63619083",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "63f1bc2020187cb26dbca0c473e34c90",
"score": "0.63060635",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "63f1bc2020187cb26dbca0c473e34c90",
"score": "0.63060635",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "63f1bc2020187cb26dbca0c473e34c90",
"score": "0.63060635",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "e355152195472260122d3020dc3ea69f",
"score": "0.6272113",
"text": "def count\n # implement in subclasses\n end",
"title": ""
},
{
"docid": "bce2b1ec17413112d58e91019091a6c2",
"score": "0.6268721",
"text": "def count\n @count ||= get_count\n end",
"title": ""
},
{
"docid": "8a9e1aa7023ddd1d9a4dce6a877df271",
"score": "0.6260018",
"text": "def count ; @count ||= table.count end",
"title": ""
},
{
"docid": "91e6e5f8338dfd22e91e6cba323b1b46",
"score": "0.62433934",
"text": "def count\n @count ||= 0\n @count += 1\n end",
"title": ""
},
{
"docid": "d596f1b3c1473a731d0e32e506918069",
"score": "0.62328506",
"text": "def count\n all.count\n end",
"title": ""
},
{
"docid": "6e1ff88a69c3ad7a31cdaf695d2dc097",
"score": "0.6217143",
"text": "def num_of_tickets()\n result = films()\n @number_of_tickets = result.count\n end",
"title": ""
},
{
"docid": "6c0277ba5266d64ef6d2e5eea87e03f9",
"score": "0.6179857",
"text": "def hit_count()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "48f783f80d31c1418a96f1ff64544345",
"score": "0.6161944",
"text": "def KiteCount\n return kites.any? ? kites.count : 0\n end",
"title": ""
},
{
"docid": "bb4013329c17b5229aa777fdc1d2ffd7",
"score": "0.61494255",
"text": "def counts\r\n @counts\r\n end",
"title": ""
},
{
"docid": "2c3836a9504916f23b5549ff4baca579",
"score": "0.61444694",
"text": "def counting\n puts \"hard to do right\"\n end",
"title": ""
},
{
"docid": "f801f11e02a6cdd2f8e5e5a857b9ed23",
"score": "0.61322457",
"text": "def count\n each.count\n end",
"title": ""
},
{
"docid": "0504e6ce660b7e15f89ae2cff93c448d",
"score": "0.61272484",
"text": "def joinees_count\n self.joinees.count\n end",
"title": ""
},
{
"docid": "48f834afb4d4b14d71cf668d010bc6d0",
"score": "0.61205566",
"text": "def count=(_); end",
"title": ""
},
{
"docid": "0b3f9f1e1fbfc5871d74cd6eaa5ea370",
"score": "0.6097792",
"text": "def count_tickets()\n sql = \"SELECT films.* FROM films\n INNER JOIN tickets ON\n tickets.film_id = films.id\n WHERE customer_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n result = films.map{|film| Film.new(film)}\n return result.count\n end",
"title": ""
},
{
"docid": "d42dd4e191e964586d932d3bc3f50cc2",
"score": "0.6086276",
"text": "def count\n load\n @result_count\n end",
"title": ""
},
{
"docid": "2404a67653133d6434d95e8383388a12",
"score": "0.6078094",
"text": "def count\n count = 0\n each do |data|\n count += 1\n end\n count\n end",
"title": ""
},
{
"docid": "56dc4ea4890420a888bfc6b9c671eab1",
"score": "0.60614824",
"text": "def joker_count\n @joker_count ||= DEFAULT_JOKER_COUNT\n end",
"title": ""
},
{
"docid": "b2c039ad790178638b0700e88126d82a",
"score": "0.60401803",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "b2c039ad790178638b0700e88126d82a",
"score": "0.60401803",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "b2c039ad790178638b0700e88126d82a",
"score": "0.60401803",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "0e0c5010434a9732ebf44e4db8d3eac7",
"score": "0.603262",
"text": "def number_of_tickets_bought() # working in terminal - console (eg.: customer1.number_of_tickets_bought)\n return films.count\n end",
"title": ""
},
{
"docid": "f3d7b3b28a1dc044dd5bf71c2186ad6b",
"score": "0.6022537",
"text": "def count!\n if not self.count.nil? then self.count += 1; else self.count = 1; end\n end",
"title": ""
},
{
"docid": "4a367e12652aa67a968de98c22538e53",
"score": "0.6022034",
"text": "def likings_count(force = false)\n if force || @likings_count.nil?\n @likings_count = flaggings.count(:conditions => { :reason => 'like' })\n end\n @likings_count\n end",
"title": ""
},
{
"docid": "f1dcd5f4e8cd4b48339cb3a660329902",
"score": "0.6005454",
"text": "def count\n @monkeys.count\n end",
"title": ""
},
{
"docid": "75b52b2660170ee339c0ca315aa7933a",
"score": "0.5960807",
"text": "def count(category)\n count = 0\n self.votes.each do |v|\n if v.category == category\n count+=1\n end\n end\n count\n end",
"title": ""
},
{
"docid": "80a77c9276872b240b8dd40fd520ddf8",
"score": "0.59501046",
"text": "def count\n self.class.count(self)\n end",
"title": ""
},
{
"docid": "5bca2b2e3e4ec813cb2f08fb76292fb4",
"score": "0.59476066",
"text": "def count\n run.count\n end",
"title": ""
},
{
"docid": "f755beb978c758243d2be7ae98b9cedb",
"score": "0.59405595",
"text": "def count\n @collection.count(Scope.new(@collection, @selector, @opts))\n end",
"title": ""
},
{
"docid": "c3069a195b96f001f8a8897441f5f64d",
"score": "0.59394485",
"text": "def count\n @count ||= 1\n end",
"title": ""
},
{
"docid": "c3069a195b96f001f8a8897441f5f64d",
"score": "0.59394485",
"text": "def count\n @count ||= 1\n end",
"title": ""
},
{
"docid": "0f5744b19d51cde5e602c1df9e6b1ecf",
"score": "0.59373325",
"text": "def count_listings\n listings.count\n end",
"title": ""
},
{
"docid": "9935baba2382e5445a69f22d83fc543e",
"score": "0.59188586",
"text": "def _increment_count metadata, location = nil\n\n con = Mysql2::Client.new(:host => $config['awesomizer']['host'], \n :username => $config['awesomizer']['user'], \n :password => $config['awesomizer']['pass'], \n :database => $config['awesomizer']['database']) \n # TODO: the 'duplicate key' clause of this query\n # is nice, but it means that the code does a\n # Voyager lookup each and every time a code is\n # scanned, even for items already in the database.\n # it would be more efficient to check for the bibid\n # first and only do the voyager lookup if we don't\n # have the metadata yet.\n con.query(\"insert into items (bibid, title, author, oclc_id, votes) values ('#{metadata[:bibid]}', '#{metadata[:title]}', '#{metadata[:author]}', '#{metadata[:oclc_id]}', 1) on duplicate key update votes=votes+1\")\nend",
"title": ""
},
{
"docid": "cc6a147d82474396b9475f6214122716",
"score": "0.59148896",
"text": "def lots_count\t\t\n lots.count\n end",
"title": ""
},
{
"docid": "fdb40afc3f2fe387c6c706bc74a90dcb",
"score": "0.5906781",
"text": "def count(products) #este nome pode ser o que nós quisermos porque só está dentro do método\n products.count\nend",
"title": ""
},
{
"docid": "a3d7989625adc6d659cc74df59e4eba8",
"score": "0.5887262",
"text": "def count\n @count ||= @query.count\n end",
"title": ""
},
{
"docid": "19e6a6c03c6103f520b4b9c2dcca36be",
"score": "0.58623296",
"text": "def NewKiteCount(time_range)\n @newkites = NewKites(time_range)\n return @newkites.any? ? @newkites.count : 0\n end",
"title": ""
},
{
"docid": "28c88bde8d2e683a48b396ee82ece41a",
"score": "0.5859457",
"text": "def count\n\t\t\t\tlist.count\n\t\t\tend",
"title": ""
},
{
"docid": "5d2bfbf525f5a5363030b4ed2fd9bb4e",
"score": "0.5856359",
"text": "def tickets()\n return films().count()\n end",
"title": ""
},
{
"docid": "6012d5c6e9adfc78491df8f0b629227a",
"score": "0.5851244",
"text": "def count_of_customers_watching_film()\n sql = \"SELECT COUNT(*) FROM customers INNER JOIN tickets ON customers.id = tickets.cust_id WHERE tickets.film_id = $1\"\n # sql = \"SELECT COUNT(*) FROM tickets where film_id = $1\"\n values = [@id]\n cust_count = SqlRunner.run(sql, values)\n return cust_count[0]['count'].to_i\n end",
"title": ""
},
{
"docid": "f507ef4cdc7c19338af9df75c2b0f3cf",
"score": "0.58463913",
"text": "def count_tickets\n tickets = self.tickets\n total_tickets = tickets.count\n return total_tickets\n end",
"title": ""
},
{
"docid": "7884bd9089a9ef605e8e8fdf94fbaf97",
"score": "0.5829499",
"text": "def count\n @documents.count\n end",
"title": ""
},
{
"docid": "af78838943eb6fe9cb931fdee69b7777",
"score": "0.58254886",
"text": "def count\n @count ||= documents.size\n end",
"title": ""
},
{
"docid": "bc18358b1eda5b982e6cd47ba5bcfaf0",
"score": "0.58241254",
"text": "def songs_count\n \t@songs.count\n end",
"title": ""
},
{
"docid": "822728d5cbc63ab4fb7851e48db273e7",
"score": "0.5817235",
"text": "def count\n all.size\n end",
"title": ""
},
{
"docid": "8db992bf74eb655da6e0903a2359976c",
"score": "0.5813258",
"text": "def bike_count\n bikes.count\n end",
"title": ""
},
{
"docid": "ecccf199b07326df17a3b474a49809ee",
"score": "0.58036935",
"text": "def count\n self.wordcounts.map(&:count).inject(0, :+)\n end",
"title": ""
},
{
"docid": "dea0fb69be655499aada08f242b8467a",
"score": "0.58014005",
"text": "def songs_count\n value = 0\n packs.each do |pack|\n value += pack.songs.count\n end\n value += songs.count\n end",
"title": ""
},
{
"docid": "9fc17498b36373c2c3b52860a86b48ad",
"score": "0.5790904",
"text": "def occurences_count\n\t\t\t\t\t\tHash.new(0).tap do |result|\n\t\t\t\t\t\t each { |item| result[item] += 1 }\n\t\t\t\t\t\tend\n\t\t\t\tend",
"title": ""
},
{
"docid": "21b0976d9edfa7a88492cde9251a879b",
"score": "0.5790526",
"text": "def count\n size = 0\n core_search.group(\"name.id, #{main_group_by_columns}\").each do |_x|\n size += 1\n end\n size\n end",
"title": ""
},
{
"docid": "a61b12481a8475e940fe159a807f4501",
"score": "0.5775846",
"text": "def offense_counts; end",
"title": ""
},
{
"docid": "a61b12481a8475e940fe159a807f4501",
"score": "0.5775846",
"text": "def offense_counts; end",
"title": ""
},
{
"docid": "727d66bfaf0d2c8fff800f8d0bfea533",
"score": "0.57719254",
"text": "def count\n collection.count\n end",
"title": ""
},
{
"docid": "dc0439bce91b1adba60a773effb4afe9",
"score": "0.5768611",
"text": "def update_kept_request_count\n new_kept_data = kept.map do |kept_data|\n parsed = Hanami::Utils::Json.parse(kept_data)\n parsed['count'] += 1 if is_hash?(parsed) && parsed['count'].is_a?(Integer)\n Hanami::Utils::Json.generate(parsed)\n end\n\n update_kept(new_kept_data)\n end",
"title": ""
},
{
"docid": "99a91551a76442c84aded0ae577d1517",
"score": "0.5764297",
"text": "def counting_recommendation\n count = @shoe.count\n if count <= 1\n @cold\n elsif count <= 10\n @warm\n else\n @hot\n end\n end",
"title": ""
},
{
"docid": "0c4ac735f61e4b5c576236c16c8bea19",
"score": "0.57587194",
"text": "def count\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "ab14bb6c7a6a42fe6ce87125cb827bb9",
"score": "0.57516915",
"text": "def count\n filtered = apply_criteria(@data)\n filtered.count\n end",
"title": ""
},
{
"docid": "9d1883b21863ab4a5004e470594f358b",
"score": "0.57507336",
"text": "def counts\n reply.documents[0][COUNTS]\n end",
"title": ""
},
{
"docid": "a47a5f7cc1530b8afdb0d7e069ccf2f4",
"score": "0.5749713",
"text": "def count\n call_client(:count)\n end",
"title": ""
},
{
"docid": "7f3d7641aea89deb07eb608fa116a28c",
"score": "0.57479435",
"text": "def bike_count\n\t\tbikes.count #+ broken_bikes.count\n\tend",
"title": ""
},
{
"docid": "ccbef308695ec922930ad0f39b4acf49",
"score": "0.57465476",
"text": "def tickets_purchased\n return film().count\n end",
"title": ""
},
{
"docid": "6240a3143fe94e027ebcf3ea5fd7587c",
"score": "0.57436347",
"text": "def count\n @params[:rettype] = 'count'\n self\n end",
"title": ""
},
{
"docid": "00e8b118dfe151df89fbedd70e8b9c15",
"score": "0.57421184",
"text": "def count\n @cards.count\n end",
"title": ""
},
{
"docid": "48b506afe6bbe164a20bd4de444d1f04",
"score": "0.57355326",
"text": "def count\n @cards.count\n end",
"title": ""
},
{
"docid": "48b506afe6bbe164a20bd4de444d1f04",
"score": "0.57355326",
"text": "def count\n @cards.count\n end",
"title": ""
},
{
"docid": "48b506afe6bbe164a20bd4de444d1f04",
"score": "0.57355326",
"text": "def count\n @cards.count\n end",
"title": ""
},
{
"docid": "56ab67a38e1469ea6c692014d14fc21a",
"score": "0.5734027",
"text": "def count\n @all.size\n end",
"title": ""
},
{
"docid": "4169db3051cbf274f0d2f8a7dac2fbe4",
"score": "0.5733382",
"text": "def song_count\n # @artist = self\n # @artist.songs.count\n self.songs.count\n end",
"title": ""
},
{
"docid": "3da99b9b774d8535813a6c43df1fa354",
"score": "0.5726645",
"text": "def count\n @target.count.to_i\n end",
"title": ""
},
{
"docid": "aeabeb2e36531ae9f5b63cf576b0a506",
"score": "0.57233834",
"text": "def customer_pet_count(customers)\n return customers[:pets].count()\nend",
"title": ""
},
{
"docid": "3dc29427dd68b8b47f19dc6a62128954",
"score": "0.57213354",
"text": "def stock_count(count)\n return count[:pets].count\nend",
"title": ""
},
{
"docid": "8571b42c82349f1d804469e789b6e233",
"score": "0.5720788",
"text": "def count\n @count || first[N]\n end",
"title": ""
},
{
"docid": "ad32595e807a0f0e8c6c4a38dc7d6179",
"score": "0.5714931",
"text": "def count\n @tpl[:cnt]\n end",
"title": ""
},
{
"docid": "c7d24eece755e96b95566f74a89d4b88",
"score": "0.57081306",
"text": "def spicy_count\n self.spicies.size\n end",
"title": ""
},
{
"docid": "92fe459296afefa91df2ad55401ad74b",
"score": "0.5708068",
"text": "def count\n @deck.count\n end",
"title": ""
},
{
"docid": "780405e69e9e010bc71dcad6f1c9e6c2",
"score": "0.5706789",
"text": "def customer_count\n sql = \"SELECT c.* FROM customers c INNER JOIN tickets t ON t.customer_id = c.id WHERE t.film_id = #{@id};\"\n customers = SqlRunner.run(sql)\n return customers.count\nend",
"title": ""
},
{
"docid": "86e4a941ca22f959560c1f0fdf31c6b2",
"score": "0.56993026",
"text": "def num_cookmarks\n Rcpref.where([\"recipe_id = ? AND in_collection = ?\", self.id, true]).count\n end",
"title": ""
},
{
"docid": "ef73535777eaf6ac4f4958c422ee8a91",
"score": "0.56958926",
"text": "def stock_count(pet_shop)\n pet_shop[:pets].count()\nend",
"title": ""
},
{
"docid": "d6ac127254035e0d3c8a0adb1cecade9",
"score": "0.5695418",
"text": "def count\n query.count\n end",
"title": ""
},
{
"docid": "d6ac127254035e0d3c8a0adb1cecade9",
"score": "0.5695418",
"text": "def count\n query.count\n end",
"title": ""
},
{
"docid": "2a36a0627475adadf46cd5bfd803f94d",
"score": "0.56954175",
"text": "def count\n Driver.client[coll_name].find.count\n end",
"title": ""
},
{
"docid": "d6d0560b656bf11aad9d0902f49350cf",
"score": "0.56927633",
"text": "def count\n cards.count\n end",
"title": ""
},
{
"docid": "7910bda6fe75978089dad2b57e308abc",
"score": "0.5690642",
"text": "def count\n each.size\n end",
"title": ""
},
{
"docid": "8838825c9c8115b8804e6a4bf63420b4",
"score": "0.56890196",
"text": "def customer_pet_count(number)\n return number[:pets].count\nend",
"title": ""
},
{
"docid": "f18ea2089e122f9eb370b100e2dc792f",
"score": "0.5687373",
"text": "def all_customers_alt() # Read film1.all_customers_alt\n sql = \"SELECT COUNT(id) FROM tickets WHERE film_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)\n count_hash = result[0]\n return count_hash['count']\n end",
"title": ""
},
{
"docid": "61342edde161b0d45027d4040d73e080",
"score": "0.5686106",
"text": "def count\n 1\n end",
"title": ""
},
{
"docid": "5e7a6b4b6902f5e5f43b826f7349b948",
"score": "0.5685375",
"text": "def joinees_count_by_type(type)\n self.joinees.by_type(type).count\n end",
"title": ""
},
{
"docid": "65ecacffab43776060385798535adce1",
"score": "0.56766146",
"text": "def ticket_count()\n sql = \"SELECT * FROM tickets WHERE customer_id = $1\"\n values = [@id]\n SqlRunner.run(sql, values).count\n end",
"title": ""
},
{
"docid": "66c0eccf49e8f92ac54dd60147d0840e",
"score": "0.5676431",
"text": "def count \n trips.length\n end",
"title": ""
}
] |
50a4b8330dccbcbc4ff0b6915414e31b
|
USER_ORG's parent must be USER_ORG
|
[
{
"docid": "fe2f27c0650d5d7a1569da05dec27d97",
"score": "0.0",
"text": "def validate_tree_kind\n if parent_id\n if kind != parent.kind\n err_on(:kind, 'different_kind_from_parent')\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "b8b3ffc2582948ceafdcf1e8ff04e4da",
"score": "0.6967765",
"text": "def parent\n raise \"undefined parent Organization\" unless organization?\n organization\n end",
"title": ""
},
{
"docid": "d74103c329cce07145068d0fab6c4429",
"score": "0.6644833",
"text": "def parent_id_attr\n 'end_user_login'\n end",
"title": ""
},
{
"docid": "6a944db91129e0ca03cdac6941d5c766",
"score": "0.6396665",
"text": "def org\n user_id.present? ? User.includes(:org).find_by(id: user_id).org : nil\n end",
"title": ""
},
{
"docid": "4f10a253dd83a5225c39aae6876f039a",
"score": "0.63866174",
"text": "def org\n object.user.org&.handle\n end",
"title": ""
},
{
"docid": "bf6b9951e09062894f80da0baeba3876",
"score": "0.628037",
"text": "def parent_class_name\n options[:parent] || \"Umanage::User\"\n end",
"title": ""
},
{
"docid": "1a6f41b14bcb8336c235a4be5644e771",
"score": "0.6198959",
"text": "def user_or_org\n self.is_user? ? 'user' : 'organization'\n end",
"title": ""
},
{
"docid": "5337d423e60d26de074f79950ef81d03",
"score": "0.6152079",
"text": "def current_user\n current_parent\n end",
"title": ""
},
{
"docid": "f5ef71769d3b6ff369c1769ca7f8f687",
"score": "0.6142184",
"text": "def validate_shared_parent\n end",
"title": ""
},
{
"docid": "2fc4ba27b077154bb031ff9aceafe3fe",
"score": "0.6089128",
"text": "def requestor; organization; end",
"title": ""
},
{
"docid": "ff8cf469999440e82510c9073ee4551d",
"score": "0.6074699",
"text": "def parent\n User.find(self.user_id)\n end",
"title": ""
},
{
"docid": "ca6503991ca85f0a6f68d51c4ebea17a",
"score": "0.6046992",
"text": "def owner\n self.company.present? ? self.company.owner : self\n end",
"title": ""
},
{
"docid": "cc5724142dd0fc0f93cb166c17d43271",
"score": "0.60370773",
"text": "def set_parent\n @parent_obligation = ParentObligation.where(user_id: params[:id], school_class_id: params[:school_class_id]).take\n end",
"title": ""
},
{
"docid": "a34041105ba3b11619ead6754e6bda55",
"score": "0.6023216",
"text": "def _parent; end",
"title": ""
},
{
"docid": "f80ef5271ff34c25d147aaf929e03219",
"score": "0.5984576",
"text": "def org_node\n @org_node ||= UCB::LDAP::Org.find_by_ou(deptid)\n end",
"title": ""
},
{
"docid": "f10a44cb0204fe4a777a88ea65605aaf",
"score": "0.5959459",
"text": "def parent_profile\n @parent_profile ||= Profile.where(\"parent_type.email\"=> email).first #if has_role?(:parent)\n end",
"title": ""
},
{
"docid": "e47e992fa1ae44c0652b479037156213",
"score": "0.5951717",
"text": "def check_parent_info\n if self.mparent_id\n p = parent_message\n # force correct root id\n self.mroot_id = p.mroot_id || p.id\n #byebug\n # force correct dest (?)\n self.dest_id = p.user_id\n # force coherent visibility !\n self.is_public = p.is_public?\n end\n end",
"title": ""
},
{
"docid": "ed7e6087946ae04bd23ae3a27a33ec63",
"score": "0.59422797",
"text": "def root_relation?; !parent end",
"title": ""
},
{
"docid": "35f59bd113d5bdb95c21aad6dd8b0145",
"score": "0.5924987",
"text": "def changing_location_parent?(owner)\n\t params[:location_type] == \"parent_location\" && !owner.location.parent_id.nil? && owner.location.parent_id != params[:referenced_venue_id]\n\t end",
"title": ""
},
{
"docid": "b67e4a0a81c6790a4385597c7936d1dd",
"score": "0.5923451",
"text": "def owner() self['owner'] || 'root' ; end",
"title": ""
},
{
"docid": "5e7afb6590619cb282b39d731923b06e",
"score": "0.5917498",
"text": "def authenticate_user!(options={})\n super(options)\n @organisation ||= current_user.organisation\n Organisation.current_id = @organisation.present? ? @organisation.subtree.map(&:id) : nil\n end",
"title": ""
},
{
"docid": "d38131b39dfc05dbb80fa840c530ba88",
"score": "0.5899435",
"text": "def check_parent\n self.errors.add('Parent Task', 'can\\'t be blank') if (self.assoc_as.eql?('1') && self.parent_id.blank?)\n end",
"title": ""
},
{
"docid": "5dc317998c7f07e4f41d938bf54cfbb1",
"score": "0.5894124",
"text": "def is_organization_admin?\n #self.is_head?\n level >= USER_LEVELS[\"organization_admin\"] && level <= USER_LEVELS[\"system_admin\"]\n end",
"title": ""
},
{
"docid": "1ccfef4a208887f1d781a222979d32ac",
"score": "0.5877353",
"text": "def autonomous_system_organization; end",
"title": ""
},
{
"docid": "1ccfef4a208887f1d781a222979d32ac",
"score": "0.5877353",
"text": "def autonomous_system_organization; end",
"title": ""
},
{
"docid": "1ccfef4a208887f1d781a222979d32ac",
"score": "0.5877353",
"text": "def autonomous_system_organization; end",
"title": ""
},
{
"docid": "c299b9e1a92788cf689237ccbd7b08fa",
"score": "0.5853519",
"text": "def organization\n self[:O]\n end",
"title": ""
},
{
"docid": "829d5eebd9e475850c8818bb401f6b05",
"score": "0.5852082",
"text": "def parent(user)\n BolFile.find_by(parent_recognizing_condition) || user.bol_files.create(parent_recognizing_condition)\n end",
"title": ""
},
{
"docid": "85aba204b4ed9f0f5c2bf57879bac101",
"score": "0.58380765",
"text": "def current_org\n current_user&.org\n end",
"title": ""
},
{
"docid": "0ef46f9bacd61eee962c3bb6d31ddf09",
"score": "0.5834998",
"text": "def current_user_from_payable_to_org?\n\t\tself.current_user.organization.id.to_s == self.payable_to_organization_id\n\tend",
"title": ""
},
{
"docid": "2ddab74795571040f77a90404a4185bb",
"score": "0.5831246",
"text": "def creatable_by?(user, parent = nil)\n raise \"#{self}.creatable_by?(user, parent = nil) must be overridden\"\n end",
"title": ""
},
{
"docid": "43b5a21e87162ea941f7f8dfb106c6d0",
"score": "0.5805689",
"text": "def roots_global_or_owned_by(user)\n find(:all, :conditions => ['property_types.parent_id = 1 AND (property_types.is_global = 1 OR property_types.user_id = ?)', user.id], :order => 'property_types.created_at ASC')\n end",
"title": ""
},
{
"docid": "67b532a63e4f9762c2516e31118c0579",
"score": "0.5804669",
"text": "def non_conflicting_parent_and_project\n if parent && parent.project != project\n errors.add(:parent, \"parent comment project doesn't match project\")\n end\n end",
"title": ""
},
{
"docid": "fdbb56d49311cb06cb381e1d2ca5cdd9",
"score": "0.57975143",
"text": "def get_parent_object\n nil\n end",
"title": ""
},
{
"docid": "176f635dc88904b5699da676878e3eb6",
"score": "0.5794056",
"text": "def parent\n owner\n end",
"title": ""
},
{
"docid": "191f410b166272559a00fc32165f6ced",
"score": "0.5776282",
"text": "def organization\n if documentable.respond_to? :organization\n documentable.organization\n else\n creator.organization\n end\n end",
"title": ""
},
{
"docid": "e19e1682eabe82704534522f663c1ad8",
"score": "0.57740057",
"text": "def add_parent_to_org_unit(parent_ou_id, child_ou_id)\n # Must follow structure of data\n # (course <-- semester <== org -->custom dept--> dept -->templates--> courses)\n # Refer to valence documentation for further structural understanding..\n path = \"/d2l/api/lp/#{$lp_ver}/orgstructure/#{child_ou_id}/parents/\"\n _post(path, parent_ou_id)\nend",
"title": ""
},
{
"docid": "bb2926f9daa13762423335bd92077dec",
"score": "0.57738084",
"text": "def organization; end",
"title": ""
},
{
"docid": "bb2926f9daa13762423335bd92077dec",
"score": "0.57738084",
"text": "def organization; end",
"title": ""
},
{
"docid": "bb2926f9daa13762423335bd92077dec",
"score": "0.57738084",
"text": "def organization; end",
"title": ""
},
{
"docid": "510b54ec79b04de61042fecb2042d02c",
"score": "0.5747768",
"text": "def user_company_root\n Company.find_by_client_id(current_user.client_id) unless Company.find_by_client_id(current_user.client_id).nil?\n end",
"title": ""
},
{
"docid": "c377825b1b5c1f4ef8b25c1e1d098bcd",
"score": "0.57357377",
"text": "def test_parent\n @usergroups.each do |x|\n next if x.parentusergroupid == 0\n assert_not_nil x.parent, \"#{x.id} has no parent\"\n end\n end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "2d0d2049946e506b583f998f8cdd4ed9",
"score": "0.5725158",
"text": "def parent; end",
"title": ""
},
{
"docid": "e26e1f0ea31fd9589724d6cfb6dc1a6f",
"score": "0.57119334",
"text": "def valid_parent?\n self.class.exists?(self.parent_id.to_i)\n end",
"title": ""
},
{
"docid": "c3d04b8c7b62f30f7d2de109847f7d92",
"score": "0.57056636",
"text": "def base_org\n if self.customization_of.present?\n return Template.where(family_id: self.customization_of).first.org\n else\n return self.org\n end\n end",
"title": ""
},
{
"docid": "7bfa75d3c30daf2a69a11aa492d5eb7e",
"score": "0.5699985",
"text": "def org_name\n self.org.try(:name).to_s\n end",
"title": ""
},
{
"docid": "6f8e8b2645f704a2feb085a6916bd82a",
"score": "0.5695799",
"text": "def parent_object\n @site\n end",
"title": ""
},
{
"docid": "6714a188b58a3662083f60c5a7886f1f",
"score": "0.5693059",
"text": "def org_tree_node(o = nil)\n orgs = {}\n @org_ids ||= {}\n (o ? o.children : Organization.find(Organization.find(organization_id).parent).children).order('name').each do |org|\n # collect roles associated with each org\n @org_ids[org.id] ||= {}\n orgs[org.id] = org_tree_node(org)\n end\n orgs\n end",
"title": ""
},
{
"docid": "8cb4d8d74d504f9d0efcf691939bbede",
"score": "0.56739783",
"text": "def recursive_owner\n recursive_owner_context.owner\n end",
"title": ""
},
{
"docid": "deef18242de1a0286f5f051fe03b8c8f",
"score": "0.5671334",
"text": "def org\n self.check.org\n end",
"title": ""
},
{
"docid": "deef18242de1a0286f5f051fe03b8c8f",
"score": "0.5671334",
"text": "def org\n self.check.org\n end",
"title": ""
},
{
"docid": "4d367c9e2d27c13336ce6d65dca24b61",
"score": "0.56619996",
"text": "def parent_registration_alert(user)\n\t\t@user = user\n\t\tsendgrid_category 'Parent Registration Alert'\n\t\tmail subject: \"Parent \\\"#{user.email}\\\" has registered\", to: ADMIN_EMAIL\n\tend",
"title": ""
},
{
"docid": "c1ae626ce1f188fb19ac0e613dd7d19f",
"score": "0.5656575",
"text": "def set_by_user(editor = nil)\n editor ||= self.user\n return false if editor.nil?\n if ( !REQUIRES_PARENT_APPROVAL || editor.parent_of?(self.user) )\n set_to_activate\n\n else\n self.status = (REQUIRES_PARENT_APPROVAL || status.blank?) ? Status::PENDING : Status::OPEN\n end\n true\n end",
"title": ""
},
{
"docid": "c560f2aac723bbcb324661147beae699",
"score": "0.5647741",
"text": "def associated_organization\n user_sports.first.user.organization \n end",
"title": ""
},
{
"docid": "8f6a3df400724c4d33f327068815807a",
"score": "0.56368774",
"text": "def get_parent_id()\n self.account_id\n end",
"title": ""
},
{
"docid": "1d58f95cc042dc008125bb0cbe343df3",
"score": "0.56368667",
"text": "def presence_of_user_xor_organization\n unless user_id.nil? ^ organization_id.nil?\n errors.add(:base, \"User or organization needs to be associated to this profile.\")\n end\n end",
"title": ""
},
{
"docid": "823d2f8af0d0268fe6e25a305fe92bbc",
"score": "0.56356955",
"text": "def parent\n nil\n end",
"title": ""
},
{
"docid": "e9b718167c01cfa4bd03726e287106b4",
"score": "0.5634863",
"text": "def get_parent\n return nil\n end",
"title": ""
},
{
"docid": "08b89109932a6032cab78a267b4bddfa",
"score": "0.5633275",
"text": "def orgadmin_user\n unless current_user.orgadmin?\n flash_org_admin_rights\n redirect_to(root_path)\n end\n end",
"title": ""
},
{
"docid": "1f5bcc39eeaa896f5cabf0406861ed48",
"score": "0.5620196",
"text": "def parent; @options[:parent]; end",
"title": ""
},
{
"docid": "9130b550761f4be562ba298c6af358e9",
"score": "0.5618698",
"text": "def org_name\n (org = self.organization) && org.name\n end",
"title": ""
},
{
"docid": "c0ddf2a8f43309292160424277411d7a",
"score": "0.56135666",
"text": "def nesting_owner_class\n nesting_owner.classify\n end",
"title": ""
},
{
"docid": "e503a1efe7fd78fc8c9c1bc20f266656",
"score": "0.5607545",
"text": "def group_owner?\n super\n end",
"title": ""
},
{
"docid": "e503a1efe7fd78fc8c9c1bc20f266656",
"score": "0.5607545",
"text": "def group_owner?\n super\n end",
"title": ""
},
{
"docid": "61656e202ede14d912bd5e8a937d45b8",
"score": "0.5596697",
"text": "def parent?\n false\n end",
"title": ""
},
{
"docid": "9ecc7abb6428d4dc848f813227e74831",
"score": "0.55942124",
"text": "def set_parent_view\n\n if current_user.role_id == 1\n \n else \n redirect_to unauthorised_path()\n end\n end",
"title": ""
},
{
"docid": "cfc61409292be800ad73691ac76fcc4d",
"score": "0.55930096",
"text": "def ignore_parent_exclusion?; end",
"title": ""
},
{
"docid": "2de9a29ab4f52613faee56f4b6132ab7",
"score": "0.5592574",
"text": "def parent?\n true \n end",
"title": ""
},
{
"docid": "818399efcaf44c29f32fb321c7d9236d",
"score": "0.5586143",
"text": "def owns_parent?(parent)\n parent.student.teacher == current_user\n end",
"title": ""
},
{
"docid": "3f147a45e821328fa4df47c48567ce41",
"score": "0.5581353",
"text": "def make_owner(user, org)\n associate_in_groups(user, org, [\"admins\", \"billing-admins\", \"users\"])\n end",
"title": ""
},
{
"docid": "0d28d14e7f6571dc2aea73de9d7ee24d",
"score": "0.5577187",
"text": "def process_org!(user: nil, managed_only: false, namespace: nil)\n name = name_from_params(namespace: namespace)\n return nil if name.blank?\n\n # check the Orgs table first\n org = Org.where('LOWER(name) = ?', name.downcase).first\n # If we are expecting managed_only do not return it if it is not managed!\n return org if org.present? && (!managed_only || (managed_only && org.managed?))\n\n # Skip if restrict_orgs is set to true! (unless its a Super Admin)\n if (user.present? && user.can_super_admin?) || !Rails.configuration.x.application.restrict_orgs\n # fetch from the ror table\n registry_org = RegistryOrg.where('LOWER(name) = ?', name.downcase).first\n\n # If managed_only make sure the org is managed!\n return nil if managed_only &&\n (registry_org.nil? || registry_org&.org&.nil? || !registry_org&.org&.managed?)\n\n # Convert the RegistryOrg to an Org, save it and then update the RegistryOrg if its ok\n org = ::Org.from_registry_org!(registry_org: registry_org)\n return org if org.present?\n end\n\n # We only want to create it if the user provided a custom name\n return nil if in_list?(namespace: namespace)\n\n # otherwise initialize a new org\n create_org!(name: name)\n end",
"title": ""
},
{
"docid": "9f1a9d1602eaf631e470f9347ed04554",
"score": "0.55762166",
"text": "def is_owner? (opportunity)\n \topportunity.user_id == self.id\n end",
"title": ""
},
{
"docid": "3f797766a07f2eb15e34543e7d1bc9a4",
"score": "0.55705667",
"text": "def show\n if(@user.parent_id !=0 && @user.parent_id)\n @manager = User.find(@user.parent_id)\n end\n end",
"title": ""
},
{
"docid": "b4688b4c0028f3c1b99591e201c41c83",
"score": "0.5558407",
"text": "def owner\n\t\tself.project_groups.find_by_project_creator(true).try(:user)\n\tend",
"title": ""
},
{
"docid": "4824bf24868a513649ee0b92bbd4eec3",
"score": "0.5535434",
"text": "def updatable_by?(user, parent = nil)\n raise \"#{self.class}#updatable_by?(user, parent = nil) must be overridden\"\n end",
"title": ""
},
{
"docid": "585e2d05d6076e5f6589c6d463dc9ffa",
"score": "0.5533028",
"text": "def parent\n end",
"title": ""
},
{
"docid": "585e2d05d6076e5f6589c6d463dc9ffa",
"score": "0.5533028",
"text": "def parent\n end",
"title": ""
},
{
"docid": "585e2d05d6076e5f6589c6d463dc9ffa",
"score": "0.5533028",
"text": "def parent\n end",
"title": ""
},
{
"docid": "585e2d05d6076e5f6589c6d463dc9ffa",
"score": "0.5533028",
"text": "def parent\n end",
"title": ""
},
{
"docid": "6be39c98bd1d4242fb61d1f6ffbab8e5",
"score": "0.55267835",
"text": "def owner_cant_back_own_project\n if user == project.user\n errors.add(:name, message: \"cant pledge to own project\")\n end\n#if owners is is in project\n#return error\n\n\nend",
"title": ""
},
{
"docid": "050c848c760624c0ff20ecd199ab8a72",
"score": "0.55258465",
"text": "def require_org\n # If no working org is set, just use the first one in the visible list.\n # For non-admins this will be their one and only org.\n if working_org.nil?\n self.working_org = @visible_orgs[0]\n end\n true\n end",
"title": ""
},
{
"docid": "45981bb43b5d5ebee98114efa6416478",
"score": "0.5517862",
"text": "def owner_only\n unless current_user == @organism.owner\n flash[:alert] = \"Vous ne pouvez executer cette action car vous n'êtes pas le propriétaire de la base\"\n redirect_to admin_organisms_url\n end\n end",
"title": ""
},
{
"docid": "0b3caae01e6a3050551d8a74a0894910",
"score": "0.551738",
"text": "def ignore_parent_exclusion=(_arg0); end",
"title": ""
},
{
"docid": "2a26ab17280a14a41d58c2ea3093f499",
"score": "0.5514646",
"text": "def check_owner\n\n return if params[:id].blank? \\\n or (params[:id] == TreeElement::ROOT_ID.to_s) \\\n or @login_user.nil?\n\n begin\n owner_id = MailFolder.find(params[:id]).user_id\n rescue\n owner_id = -1\n end\n if !@login_user.admin?(User::AUTH_MAIL) and owner_id != @login_user.id\n Log.add_check(request, '[check_owner]'+request.to_s)\n\n flash[:notice] = t('msg.need_to_be_owner')\n redirect_to(:controller => 'desktop', :action => 'show')\n end\n end",
"title": ""
},
{
"docid": "6ad395a89fe680f407d248277e702887",
"score": "0.55074364",
"text": "def organization_id\n self.organization.id if self.organization && self.organization.is_a?(Organization)\n end",
"title": ""
},
{
"docid": "b841147e47910c729605028ad843dc8b",
"score": "0.55038345",
"text": "def ensure_organization\n if self.item.is_a?(Organization)\n self.organization = self.item\n else\n self.organization = self.item.organization unless self.item.try(:organization).nil?\n end\n #self.organization_id = self.organization.id unless self.organization.try(:id).nil?\n end",
"title": ""
},
{
"docid": "f1e579f30f9a3cb3e6c2d1dae58055a0",
"score": "0.55025655",
"text": "def owner_only\n unless current_user == @organism.owner\n flash[:alert] = \"Vous ne pouvez executer cette action car vous n'êtes pas le propriétaire de la base\"\n redirect_to admin_organisms_url\n end\n\n end",
"title": ""
},
{
"docid": "ddaa98557b5a71466b9068679c5e72be",
"score": "0.55010074",
"text": "def requires_parent_approval?\n requires_parent_approval.nil? ? REQUIRES_PARENT_APPROVAL : requires_parent_approval\n end",
"title": ""
},
{
"docid": "ea94e139c23b4eb555afc4363ce942b8",
"score": "0.5482377",
"text": "def parent\n nil\n end",
"title": ""
},
{
"docid": "236c6d2839c25bb9838d1dbaaffa4673",
"score": "0.5478453",
"text": "def is_or_belongs_to?(arg)\n if arg.is_a?(User)\n self == arg\n elsif arg.is_a?(Group)\n arg.users.include?(self)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "c381bc8a26eb38e64b862100b1271b62",
"score": "0.54778945",
"text": "def parentable?\n false\n end",
"title": ""
}
] |
af5e266db29a1f23a5a22d544b040a3e
|
link to a page new elem
|
[
{
"docid": "d2833dd9dad06b29f22bff12db7ba461",
"score": "0.0",
"text": "def new_elem\n @type_name = params[:type]\n @name =eval(@type_name).to_p_name\n @parent_id = params[:parent_id]\n end",
"title": ""
}
] |
[
{
"docid": "e5c8fa9cde9681187bc24ccc22acb4fc",
"score": "0.6787122",
"text": "def new_for_page\n id = params[\"page_id\"]\n owner = Page.find(id)\n new_text_element = owner.text_elements.new\n new_text_element.page = owner\n hobo_new_for :page, new_text_element\n end",
"title": ""
},
{
"docid": "02e0667c615ff2f13bf701ab6ba76a5e",
"score": "0.662073",
"text": "def click(link); end",
"title": ""
},
{
"docid": "302509c02a237f37424427dbec1d46bb",
"score": "0.65729994",
"text": "def render_new_content_link(element)\n\t\t\t\tlink_to_overlay_window(\n\t\t\t\t\trender_icon('create') + t('add new content'),\n\t\t\t\t\talchemy.new_admin_element_content_path(element),\n\t\t\t\t\t{\n\t\t\t\t\t\t:size => '335x70',\n\t\t\t\t\t\t:title => t('Select an content'),\n\t\t\t\t\t\t:overflow => true\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t:id => \"add_content_for_element_#{element.id}\",\n\t\t\t\t\t\t:class => 'small button with_icon new_content_link'\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\tend",
"title": ""
},
{
"docid": "65515542f9b63f98a8a20f8e5706126a",
"score": "0.64793855",
"text": "def goto newPage\n unless friends[newPage.to_sym].nil?\n uri = friends[newPage.to_sym].uri\n end\n uri ||= newPage\n uri = @page.uri+uri unless uri.to_s =~ /^http/u\n @page = @agent.get uri\n @page\n end",
"title": ""
},
{
"docid": "fa954a156719096a7b114fd9c554adad",
"score": "0.6377069",
"text": "def link_to_add_entry page\n url = new_admin_page_path parent_id: @page.id, type: page_set_type(page)\n raw link_to 'Add Entry', url, class: 'button add', id: 'add-entry'\n end",
"title": ""
},
{
"docid": "a5384ae21754d045d05c258cff6ff47d",
"score": "0.63699126",
"text": "def associate_page(page); end",
"title": ""
},
{
"docid": "34288fd5e3f3cf8a8e5888621e0683d5",
"score": "0.6318704",
"text": "def click_add_new\n add_new = $browser.element(@selector).link(text: 'Add New')\n add_new.click\n end",
"title": ""
},
{
"docid": "5938c19e53f1c118dcdf4c92b2fc1839",
"score": "0.628944",
"text": "def new_mech_link(node)\n return Mechanize::Page::Link.new(node, $agent, $agent.page)\nend",
"title": ""
},
{
"docid": "96330f01beb01bba58972b7ed02f88dd",
"score": "0.62632066",
"text": "def guides_newpages_link\n $tracer.trace(__method__)\n return ToolTag.new(div.className(\"sort-options\").a(\"/New Pages/\"), __method__)\n end",
"title": ""
},
{
"docid": "23f83f324da042730e7a1aea309c218b",
"score": "0.6252359",
"text": "def navigate_to(link)\n\t $driver.get link\nend",
"title": ""
},
{
"docid": "0fa347bd8a75e3643ab59f6e9c93ed97",
"score": "0.617541",
"text": "def get_da_detail_page(page, da_container)\n\n tds = da_container.search('td')\n\n href = tds[0].at('a')['href']\n\n detail_page = page.link_with(:href => \"#{href}\").click\n\n \n\n return detail_page\n\nend",
"title": ""
},
{
"docid": "0fa347bd8a75e3643ab59f6e9c93ed97",
"score": "0.617541",
"text": "def get_da_detail_page(page, da_container)\n\n tds = da_container.search('td')\n\n href = tds[0].at('a')['href']\n\n detail_page = page.link_with(:href => \"#{href}\").click\n\n \n\n return detail_page\n\nend",
"title": ""
},
{
"docid": "50618bdc6e40ab7f850179c101766729",
"score": "0.61016804",
"text": "def open_page(name)\n name_link(name).click \n wait_for_ajax\n self.window(:title=>\"rSmart | Content Profile\").use\n ContentDetailsPage.new @browser\n end",
"title": ""
},
{
"docid": "4370c539f6408fa6ed8e58b43626d8df",
"score": "0.6101388",
"text": "def nexia_link # :doc:\n content_box.a(:text => \"nexiahome.com\")\n end",
"title": ""
},
{
"docid": "6cbdca78bee3b6dbd8eaf38048f59b9e",
"score": "0.60985386",
"text": "def link_to_add_entry(page)\n url = new_admin_page_path parent_id: page.id, type: page_set_type(page)\n raw link_to 'Add Entry', url, class: 'button add-child'\n end",
"title": ""
},
{
"docid": "376516c83719e186628a526d912d1f82",
"score": "0.6075065",
"text": "def new_page(options={})\n close_page\n open_page(options)\n end",
"title": ""
},
{
"docid": "9e9a6a3be54e52e1ed92faf7795a232d",
"score": "0.60714066",
"text": "def new\n @page = Page.find_by_title('Huren bij Xposers')\n end",
"title": ""
},
{
"docid": "7336774909ad6644f742a406447c39db",
"score": "0.60682964",
"text": "def page_link1(page, text, attributes = {})\n @template.link_to_remote(text, { \n :url => url_for(page).sub(/(\\w+)\\/[^\\?]+\\?/, \"\\\\1?\"),\n :method => :get,\n :loading => \"$('paging').show()\",\n :success => \"$('paging').hide()\"\n }.merge(@remote))\n end",
"title": ""
},
{
"docid": "17d3f49470d2c3e3356a93f05a86b9ce",
"score": "0.6068048",
"text": "def uses_page page # only works with IE\n new_url = self.class.html_root + page\n browser.goto new_url unless browser.url == new_url\n end",
"title": ""
},
{
"docid": "d7ac416d0270ba64130874af151c9b99",
"score": "0.605932",
"text": "def link_click(ele)\n ref=$array[\"#{ele}\"]\n path=ele.split(\"_\").last\n $log.info \"verifying the #{ele} present or not \"\n if $browser.link(:\"#{path}\", \"#{ref}\").exists?\n $log.info \"#{ele} is prsented on the webpage\"\n $browser.link(:\"#{path}\", \"#{ref}\").click\n $log.info \"clicked the #{ele} link\"\n\n elsif $browser.span(:\"#{path}\", \"#{ref}\").exists?\n $log.info \"{ele} is presented on the webpage\"\n $browser..span(:\"#{path}\", \"#{ref}\").click\n $log.info \"clicked the #{ele}\"\n else\n $log.info \"failed to find the #{ele} link\"\n raise(\"failed to find the #{ele} link\") \n end\n \n \nend",
"title": ""
},
{
"docid": "5681e6187e9771cd860f77796e027a00",
"score": "0.6044411",
"text": "def visit_new_page(model, **opt, &block)\n visit_action_page(model, :new, **opt, &block)\n end",
"title": ""
},
{
"docid": "72d40cc434fdb5f052dc8efb13e4ab87",
"score": "0.6032284",
"text": "def link_to_page(name)\n page = StaticPage.find_by_name(name)\n page = StaticPage.create!(:name => name) unless page\n static_page_path(page)\n end",
"title": ""
},
{
"docid": "971f4b359289936a44ed9a7e8f7363f1",
"score": "0.60305864",
"text": "def open_page(name)\n name_link(name).click\n self.wait_for_ajax\n self.window(:title=>\"rSmart | Content Profile\").use\n ContentDetailsPage.new @browser\n end",
"title": ""
},
{
"docid": "e6531bc735b128dcd8769538bf0aabc9",
"score": "0.6029916",
"text": "def link_to_new_file(name)\n link_to_function name, js_add_new_file(ArticleFile.new)\n end",
"title": ""
},
{
"docid": "9fce9caf9c4837e54506e6514996f1db",
"score": "0.6026229",
"text": "def click_new_post\n click NEW_POST_BUTTON\n end",
"title": ""
},
{
"docid": "cafa7e93bbb99062665e4f57649e0649",
"score": "0.5984397",
"text": "def next_page; link 'next' end",
"title": ""
},
{
"docid": "59cbb880fb4fc474859c2a32408272ac",
"score": "0.5958834",
"text": "def page!\n save_and_open_page\n end",
"title": ""
},
{
"docid": "59cbb880fb4fc474859c2a32408272ac",
"score": "0.5958834",
"text": "def page!\n save_and_open_page\n end",
"title": ""
},
{
"docid": "d7aba3691c7c0073d05aef65fd044786",
"score": "0.5943317",
"text": "def remote_link_to_new(text = \"新規追加\", options = {}, html_options = {})\n if registered? && (at_present? || simulation_mode?) && allow_to_add_new_entity?(options)\n options[:controller] ||= controller_name\n options[:url] = {:controller => options[:controller], :action => \"new\"}\n options[:params] = options[:params].to_h.merge( :background_params => @background_params )\n html_options[:class] ||= \"op-control\"\n link_to_remote_with_params( text, options, html_options ) \n end\n end",
"title": ""
},
{
"docid": "bc8b3f6464606ceb31705090bc07a24c",
"score": "0.5938558",
"text": "def add\n if page.url && !Ink.config['docs_mode']\n Ink.site.pages << page unless Helpers::Path.find_page(page)\n end\n end",
"title": ""
},
{
"docid": "8720ec4b60a69e8bc8546d3fc70fd359",
"score": "0.59293365",
"text": "def navigate_to(link)\n $driver.get link\nend",
"title": ""
},
{
"docid": "4c8ce43a8d30bde55af42c132301e130",
"score": "0.5925406",
"text": "def add_page(text)\n self.back_to_top\n add_page_button\n wait_for_ajax\n self.send_keys text + \"\\n\"\n end",
"title": ""
},
{
"docid": "9c433ccd2bdf3fcbb7bf9540f8aeb4d8",
"score": "0.59122014",
"text": "def click_new_profile\n click_link('Create a profile')\n end",
"title": ""
},
{
"docid": "37e850865e12a8b672f4e5278cfc7b9d",
"score": "0.5903209",
"text": "def link_new(text = t(\"admin.common.new_link\"), url = new_resource_url)\n link_to text, url, :class => 'new'\n end",
"title": ""
},
{
"docid": "0fbba1f23ef53fc8d819cf099a47c610",
"score": "0.5900204",
"text": "def new_page\n page = Page.new\n page.url = params[:id] if Page.url?(params[:id]) && params[:id] != 'new-page'\n page\n end",
"title": ""
},
{
"docid": "e1e81376dbdc052139e54dcb4ed524e2",
"score": "0.5866729",
"text": "def link_to_page_with_label(label)\n return (\"<a href='/chefs/\" + self.id.to_s + \"'>\" + label + \"</a>\").html_safe\n end",
"title": ""
},
{
"docid": "fefd3c713af576d49d1e3c3af3602842",
"score": "0.58665466",
"text": "def homeandnewuser(driver)\n #Open page\n loggEr(\"Log: Open page #{URL_HOME}\")\n driver.get(URL_HOME)\n matchUrl(URL_HOME, driver)\n\n #Choose create a new user button and\n loggEr(\"Log: Click on the Create a new user button\")\n driver.find_element(:link, \"Create a new user\").click\nend",
"title": ""
},
{
"docid": "401e46a642fdb504c17b0ce098cb3325",
"score": "0.5864051",
"text": "def add_part\n frm.link(:text=>\"Add Part\").click\n AddEditAssessmentPart.new(@browser)\n end",
"title": ""
},
{
"docid": "4c0797a32fb6db6dbdb60a2d6737a99c",
"score": "0.5859297",
"text": "def next_page\n @page.link_with(:text => /Next/)\n end",
"title": ""
},
{
"docid": "e21aeb0d53df1af41d260812f141ec31",
"score": "0.5853979",
"text": "def handle_new\n obj = model.new(request.params[model.link], request)\n model.hook(:before_new, request, obj)\n new_page(obj)\n end",
"title": ""
},
{
"docid": "8737c6df3603d9e73f6c94be36301dea",
"score": "0.58421767",
"text": "def add\n frm.link(:text=>\"Add\").click\n AssignmentAdd.new(@browser)\n end",
"title": ""
},
{
"docid": "bf48eb57e88868b33c125c5c9801d028",
"score": "0.58220965",
"text": "def link_to_add_child(page)\n url = new_admin_page_path parent_id: page.id\n raw link_to 'Add Child', url, class: 'button add-child'\n end",
"title": ""
},
{
"docid": "3e6a102b1a3550d5f44ae38a296641ec",
"score": "0.58107245",
"text": "def href; end",
"title": ""
},
{
"docid": "6e408ac3e7104ca53082e24394a72a42",
"score": "0.58081466",
"text": "def new_page(obj, opts={})\n page do\n form_attr = form_attributes(:action=>url_for(\"create\"))\n Forme.form(obj, form_attr, form_opts(form_attr[:action])) do |f|\n model.columns_for(:new, request).each do |column|\n col_opts = column_options_for(:new, request, obj, column)\n if html = model.edit_html_for(obj, column, :new, request)\n col_opts = col_opts.merge(:html=>html)\n end\n f.input(column, col_opts)\n end\n f.button(:value=>'Create', :class=>'btn btn-primary')\n end\n end\n end",
"title": ""
},
{
"docid": "e7a0f6bb06aef5c7756f43617b063cc0",
"score": "0.5780761",
"text": "def link *a; app.link *a end",
"title": ""
},
{
"docid": "fbcedd3c35edc41868fb020ad00f7f13",
"score": "0.5778822",
"text": "def add_link(name, form, obj_name)\n field = ''\n form.fields_for obj_name, obj_name.to_s.classify.constantize.new do |f|\n field = render :partial => 'people/' + obj_name.to_s.singularize, :object => f\n end\n link_to_function name, :class => 'add' do |page|\n page << %{\n var new_id = \"new_\" + new Date().getTime();\n $('fieldset_#{obj_name}').insert({ bottom: \"#{ escape_javascript field }\"\\.replace(/new_\\\\d+/g, new_id) });\n }\n end\n end",
"title": ""
},
{
"docid": "ae5aa69cec609382faa0a3ba2696f9d8",
"score": "0.5770378",
"text": "def add_content\n self.link(:id=>\"navigation_create_and_add_link\").fire_event(\"onmouseover\")\n self.link(:text=>\"Add content\").click\n self.wait_until { @browser.text.include? \"Collected items\" }\n self.class.class_eval { include AddContentContainer }\n end",
"title": ""
},
{
"docid": "fea33128071275c665aa911203c16f99",
"score": "0.576679",
"text": "def link() url; end",
"title": ""
},
{
"docid": "fea33128071275c665aa911203c16f99",
"score": "0.576679",
"text": "def link() url; end",
"title": ""
},
{
"docid": "7c45d83ed5fa5c9b506823d1faff8337",
"score": "0.5740759",
"text": "def set_page\n end",
"title": ""
},
{
"docid": "813ffda73f32913a6bc26e619f3ab636",
"score": "0.5729895",
"text": "def add_salesperson_link\n self.get_element(@browser, '//a[contains(@href, \"/insertion_orders_persons_salespersons/create?insertion_orders.id=\")]')\n end",
"title": ""
},
{
"docid": "783364161738020b52b2b78004f8f083",
"score": "0.5721686",
"text": "def wikilink(a)\n return if a.attr('class') == 'new'\n a['title']\nend",
"title": ""
},
{
"docid": "c7d24d08e3dd6e665f06ad73a8f018c8",
"score": "0.5714675",
"text": "def render_create_content_link(element, options = {})\n\t\t\t\tdefaults = {\n\t\t\t\t\t:label => t('add new content')\n\t\t\t\t}\n\t\t\t\toptions = defaults.merge(options)\n\t\t\t\tlink_to(\n\t\t\t\t\toptions[:label],\n\t\t\t\t\talchemy.admin_contents_path(\n\t\t\t\t\t\t:content => {\n\t\t\t\t\t\t\t:name => options[:content_name],\n\t\t\t\t\t\t\t:element_id => element.id\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\t:method => 'post',\n\t\t\t\t\t:remote => true,\n\t\t\t\t\t:id => \"add_content_for_element_#{element.id}\",\n\t\t\t\t\t:class => 'button new_content_link'\n\t\t\t\t)\n\t\t\tend",
"title": ""
},
{
"docid": "6217c8f59b894c25950941fc63534dcc",
"score": "0.57074916",
"text": "def create_link(item_nr)\n \"<a href=\\'/item/#{item_nr}\\'>#{self}</a>\"\n end",
"title": ""
},
{
"docid": "be4476fd042feb04cc815a106f1db08d",
"score": "0.5693292",
"text": "def sub_navigate\n page(FeedDetailsPage).touch_row\n page(MorePage).page_handler(\"Submission\")\n end",
"title": ""
},
{
"docid": "9bf392c014b0a9fb9c76cb416d64d1cb",
"score": "0.56891745",
"text": "def add_link(el, href, title, alt_text = T.unsafe(nil), ial = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "c2f070d8196d3720beeaf0826e698db3",
"score": "0.5679305",
"text": "def add_element\n @inner_page = Embeddable::InnerPage.find(params['id'])\n @page = Page.find(params['page_id'])\n @container = params['container'] || 'elements_container'\n\n # dynamically instantiate the component based on its type.\n component_class = params['class_name'].constantize\n if component_class == Embeddable::DataCollector\n if probe_type_id = session[:last_saved_probe_type_id]\n probe_type = Probe::ProbeType.find(probe_type_id)\n @component = Embeddable::DataCollector.new\n @component.probe_type = probe_type\n @component.save\n else\n @component = Embeddable::DataCollector.create\n end\n session[:last_saved_probe_type_id] = @component.probe_type_id\n else\n @component = component_class.create\n end\n @component.pages << @page\n @component.user = current_visitor\n @component.save\n @element = @page.element_for(@component)\n @element.user = current_visitor\n @element.save\n # @element.update_investigation_timestamp\n @page.reload\n if params['static']\n render :partial => \"static_page\", :locals => {:page => @page, :inner_page => @inner_page}\n else\n render :partial => \"page\", :locals => {:page => @page, :inner_page => @inner_page}\n end\n end",
"title": ""
},
{
"docid": "e4c5002f9f84f846aacb7281a23515b8",
"score": "0.5678271",
"text": "def set_page_element\n @page_element = PageElement.find(params[:id]) \n end",
"title": ""
},
{
"docid": "784a549e02fa1127cd8ebf6350d8806c",
"score": "0.56737053",
"text": "def page_link(page, text, attributes = {})\n if @options[:remote].blank?\n @template.link_to(text, url_for(page), attributes)\n else\n @template.link_to_remote(text, {:url => url_for(page), :method => :get}.merge(@options[:remote]), attributes)\n end\n end",
"title": ""
},
{
"docid": "5f686a102560fe355f7e4541eea82aca",
"score": "0.5668624",
"text": "def go\n require 'pashua'\n pagetmp = wikipage_selector(\"Jump to which page?\")\n exit unless pagetmp\n @chrome.windows[1].get.tabs[@chrome.windows[1].get.active_tab_index.get].get.URL.set(\"http://localhost/wiki/#{pagetmp}\")\nend",
"title": ""
},
{
"docid": "37152cefbd4d2bcc7e5542bfc6e76a6c",
"score": "0.5653703",
"text": "def link_to_page name, page_name, options={}\n\tlink_to name, root_url+Page.find_by_name(page_name.to_s).url, options\n rescue\n\twarning(\"no such page with ID '#{page_name}'\")\n end",
"title": ""
},
{
"docid": "05b73fd6ee4f9c563293087b2792b49c",
"score": "0.56434804",
"text": "def Link(x, y, w, h, link)\n\t\t#Put a link on the page\n @page_links ||= Array.new\n @page_links[@page] ||= Array.new\n @page_links[@page].push([x * @k, @h_pt - y * @k, w * @k, h*@k, link]);\n\tend",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721",
"score": "0.56432664",
"text": "def page; end",
"title": ""
},
{
"docid": "f3cf50d131b52a06e2a05a36a5c3c82d",
"score": "0.5625061",
"text": "def learn_more_button\n $tracer.trace(__method__)\n # unit_test_no_generate: learn_more_button, area.href(\"/[/]about$/\")\n return ToolTag.new(area.href(\"/[/]about$/\"), __method__, self)\n end",
"title": ""
},
{
"docid": "22cea110c6542c788f7b56708179a01e",
"score": "0.56224936",
"text": "def build_page(sha, ref)\n # implement inside child\n end",
"title": ""
},
{
"docid": "17e432e53b2b753e3d9fd2b983060ac5",
"score": "0.56195754",
"text": "def publication_link\n h.link_to \"Read Now\" , object.publication_url , title: 'Read Now' , class: 'btn waves-effect waves-light btn-primary custom-btn' , target: '_blank'\n end",
"title": ""
},
{
"docid": "459acc4ca4c9c101cb623262dce8f1fd",
"score": "0.56178063",
"text": "def add_line_items_link\n self.get_element(@browser, '//a[contains(@href, \"/line_items/create?insertion_orders.id=\")]')\n end",
"title": ""
},
{
"docid": "3f6849088d70cde3c0caa84e8bb67b74",
"score": "0.56172526",
"text": "def new\n @page = Page.new\n @document = \"\"\n @title = \"\"\n if !params[:url].nil? then\n #load openwiki page using Hpricot (http://code.whytheluckystiff.net/hpricot/)\n @document = open(params[:url]) { |f| Hpricot f, :fixup_tags => true }\n\n #find the title of the OpenWiki page and populate the field for the editor\n title = (@document/\"h1 a.same\")\n @title = title[0].inner_html unless title[0].nil?\n\n #fix anchors in the html before extracting the body portion\n (@document/\"a\").each do |a|\n if !a.attributes[\"href\"].nil?\n #sometimes the link already has the correct url host and protocol\n a.attributes[\"href\"] = \"http://dcapp01/openwiki/\" + a.attributes[\"href\"] if a.attributes[\"href\"].index( \"http\" ).nil?\n end\n end\n\n #now we should be ready to slice out the relevant body text\n @document = (@document/\"#TeamPortal\").inner_html\n end\n\t\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "f1fab4d1b34ab6880bc0c54abac14f36",
"score": "0.56109333",
"text": "def page; self end",
"title": ""
},
{
"docid": "15cc11a202633148741d25f63a6b9053",
"score": "0.56030947",
"text": "def anchor\n \"p#{id}\"\n end",
"title": ""
},
{
"docid": "5a26f2df6e893a4c9a89442c35e00afd",
"score": "0.56020576",
"text": "def click_add_agency_link\n add_agency_link.click\n end",
"title": ""
},
{
"docid": "44036e2af226c782c3532964643e5a82",
"score": "0.5597588",
"text": "def show_other_sites\n frm.link(:text=>\"Show other sites\").click\n end",
"title": ""
},
{
"docid": "aabcdd77abbf8b4a60b347efaa6a3d70",
"score": "0.5596249",
"text": "def new\n @page = Page.new\n # render new.html.erb\n end",
"title": ""
},
{
"docid": "aabcdd77abbf8b4a60b347efaa6a3d70",
"score": "0.5596249",
"text": "def new\n @page = Page.new\n # render new.html.erb\n end",
"title": ""
},
{
"docid": "c7f8328e844630e2f4360532ce4051ce",
"score": "0.55935895",
"text": "def get_da_detail_page(page, da_container)\n tds = da_container.search('td')\n href = tds[0].at('a')['href']\n detail_page = page.link_with(:href => \"#{href}\").click\n \n return detail_page\nend",
"title": ""
},
{
"docid": "c7f8328e844630e2f4360532ce4051ce",
"score": "0.55935895",
"text": "def get_da_detail_page(page, da_container)\n tds = da_container.search('td')\n href = tds[0].at('a')['href']\n detail_page = page.link_with(:href => \"#{href}\").click\n \n return detail_page\nend",
"title": ""
},
{
"docid": "230ce97ba745bd05b6b0f16d879f65dc",
"score": "0.5586034",
"text": "def new\n @page = @offering.pages.new\n session[:breadcrumbs].add \"New\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "7eed91c20720bbe83959f015b9dba1e8",
"score": "0.55834776",
"text": "def new_link\n @link = Link.new\n end",
"title": ""
},
{
"docid": "e8c5af3972e637a202ed7d75a2888da2",
"score": "0.55764157",
"text": "def add_agency_link\n self.get_element(@browser, '//a[contains(@href, \"/insertion_orders_organizations_agencies/create?insertion_orders.id=\")]')\n end",
"title": ""
},
{
"docid": "4379d5c7eb527c525c67b885508109ca",
"score": "0.5564827",
"text": "def sign_up\n link(:id=>\"navigation_anon_signup_link\").click\n CreateNewAccount.new @browser\n end",
"title": ""
},
{
"docid": "8e2d85e4178557fa365055e5fe229db0",
"score": "0.55617285",
"text": "def click_add_salesperson_link\n add_salesperson_link.click\n end",
"title": ""
},
{
"docid": "680fb4bd5b0ba6feb47a0a945356eb65",
"score": "0.55595297",
"text": "def update; @doc = get(link('self')); nil; end",
"title": ""
},
{
"docid": "680fb4bd5b0ba6feb47a0a945356eb65",
"score": "0.55595297",
"text": "def update; @doc = get(link('self')); nil; end",
"title": ""
},
{
"docid": "7ba3811e68d10ac5796c72e9660ee17a",
"score": "0.5553591",
"text": "def link\n\t\tpage_id.present? ? short_page_path(Page.find(page_id)) : href\n\tend",
"title": ""
},
{
"docid": "ea91ed7f0daca6ba44d4e4fb6d01fcb1",
"score": "0.5544072",
"text": "def add_widget(name)\n @browser.div(:id=>\"add_goodies_body\").li(:text=>/#{Regexp.escape(name)}/).button.click\n end",
"title": ""
},
{
"docid": "4ef975971b910d06aab4f909d5dd7c3f",
"score": "0.55438954",
"text": "def add_to_history(page); end",
"title": ""
},
{
"docid": "7fb08b5eb50e42d51b73150b4c810a0b",
"score": "0.5542686",
"text": "def next_page\n return unless @next_page\n \"<a class='btn' href=\\\"#{modify_page(1)}\\\">Next Page</a>\"\n end",
"title": ""
},
{
"docid": "76ad4d6b9bbffecb5e72f71fb4fbae44",
"score": "0.55272925",
"text": "def goto_page(path)\r\n @browser.navigate.to(site_url + path)\r\n end",
"title": ""
},
{
"docid": "9456d5be4567efcacbf58ff206baba3f",
"score": "0.55244195",
"text": "def add_iform_link(name, id, obj, locals={})\n link_to_function name do |page|\n page.insert_html :bottom, id, :partial => 'iform', :object => obj, :locals => locals\n end\n end",
"title": ""
},
{
"docid": "c95022477b4fc744e0a73d3af79b0859",
"score": "0.55212015",
"text": "def hyperlink(url, class_name)\n hyper_a = @doc.at_css \"div[@class='row title #{class_name}']//a\"\n hyper_a['href'] = url\n end",
"title": ""
}
] |
02eb9d17789c087b00373b36c00d3591
|
PATCH/PUT /data/1 PATCH/PUT /data/1.json
|
[
{
"docid": "9462b322678af1c6044d5521d5238b31",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @datum.update(datum_params)\n format.html { redirect_to @datum, notice: 'Datum was successfully updated.' }\n format.json { render :show, status: :ok, location: @datum }\n else\n format.html { render :edit }\n format.json { render json: @datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "05c1bed948daa058e70016e863c7cd96",
"score": "0.7088323",
"text": "def update_request(data)\n client.create_request('PATCH', url_path, 'data' => data)\n end",
"title": ""
},
{
"docid": "5fd5f00640bdb0c785bcac4689a46f3c",
"score": "0.7049579",
"text": "def patch(data, options={})\n raise NotImplementedError, \"We only patchs to singular resources.\" if count > 1\n first.patch(data, options)\n end",
"title": ""
},
{
"docid": "af9aedd4f428a2c26c3fd57798526020",
"score": "0.7048506",
"text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end",
"title": ""
},
{
"docid": "dbb28b78ebd14a35895337cf6eecee2a",
"score": "0.69450295",
"text": "def patch(path, data = nil)\n request(:patch, path, data)\n end",
"title": ""
},
{
"docid": "63686b23d548d352954518c736c25119",
"score": "0.6833371",
"text": "def patch(path, data, headers = {})\n request(:patch, path, data, headers)\n end",
"title": ""
},
{
"docid": "ff5b557acb5b43e5f35cd12653dc85b1",
"score": "0.6808039",
"text": "def patch(path, data = {}, headers = {})\n exec_request(:patch, path, data, headers)\n end",
"title": ""
},
{
"docid": "ae4d0aa8335fe571a4fcc90ded621164",
"score": "0.67672765",
"text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end",
"title": ""
},
{
"docid": "ae4d0aa8335fe571a4fcc90ded621164",
"score": "0.67672765",
"text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end",
"title": ""
},
{
"docid": "fdb6fd1ad90795d4091f430832940fd5",
"score": "0.67336047",
"text": "def patch(path, data = nil, headers = nil)\n req = Net::HTTP::Patch.new(path, (headers || {}).merge(@request_headers))\n req.basic_auth(@api_key, 'x')\n req.body = data.to_json unless data.nil?\n res = @http.start { |session| session.request(req) }\n\n handle_response(res)\n end",
"title": ""
},
{
"docid": "cb1cca99ea20526015e43e253e7aa4cf",
"score": "0.6630682",
"text": "def _update(data, id=nil)\n # a hash holding HTTP headers\n headers = { \"Content-Type\" => \"application/json\", \"Accept\"=>\"application/json\" }\n\n # if we're given an ID use it, otherwise see if there's one in the data object\n if id==nil\n id = data['_id']\n end\n\n # do the HTTP POST request, passing the data object as JSON and the HTTP headers\n response = Net::HTTP.start(@host, @port) do |http|\n http.send_request('PUT', \"/documents/#{id}\", data.to_json, headers)\n end\n\n # show response body\n p response['content-type']\n p response.body\n\n # response should be JSON\n assert response['content-type'].match( /application\\/json/ )\n end",
"title": ""
},
{
"docid": "4b9b35c9afd5685c3cbb2133b1139093",
"score": "0.6611008",
"text": "def api_patch(endpoint:, data:)\n begin\n resp = self.http.patch([self.url, endpoint].join('/'), data.to_json, {'Content-Type' => 'application/json', 'Accept' => 'application/json'})\n begin\n data = JSON.parse(resp.body) unless resp.body.empty?\n rescue JSON::ParserError\n raise Exception, \"Failed to decode response message\"\n end\n if resp.status != 200\n error = data.include?('error') ? data['error'] : data.inspect if data\n raise Exception, \"Query returned a non successful HTTP code (Status: #{resp.status}, Reason: #{resp.reason}#{\", Error: #{error}\" if error}\"\n end\n rescue\n raise Exception, \"Failed to execute PATCH request to Kapacitor REST API (#{$!})\"\n end\n\n data\n end",
"title": ""
},
{
"docid": "ca05caf24165523ad1175692f618ac09",
"score": "0.65511966",
"text": "def patch(url, data)\n response = request('PATCH', url, data)\n response['data'] = response['Error'] unless response['Error'].nil?\n return response['data']\n end",
"title": ""
},
{
"docid": "f18a5ea789bdc704a911f19c7b8d281d",
"score": "0.6538742",
"text": "def edit(url, data)\n\t\tresponse = self.request('PATCH', url, data)\n\t\treturn response['data']\n\tend",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.6495645",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "c3c751dfdfd69cb47f061dfc175c4bbe",
"score": "0.6477137",
"text": "def patch(path, data = {}, headers = {})\n connection.patch(merged_path(path), data, merged_headers(headers))\n end",
"title": ""
},
{
"docid": "a9a7bf63fffdaf43ed4c76593ebe2674",
"score": "0.64738315",
"text": "def patch(url, data, options={})\n default_client.patch(url, data, options)\n end",
"title": ""
},
{
"docid": "439be614630bf74acaefcb4a5806b14f",
"score": "0.64528334",
"text": "def update\n do_patch { return } # check if patch and do operation, then return early if it is a patch\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s, user: @user) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end",
"title": ""
},
{
"docid": "03b14059c43d89ea05d1fc496754ac14",
"score": "0.6421692",
"text": "def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user)\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6389501",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6389501",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "5c898d619d8b3ec491b85205f483d62f",
"score": "0.63622326",
"text": "def update(model_name, model_id, data, options = {})\n url = rest_url(model_name, model_id)\n options[\"data\"] = data\n result = Rest.rest_call(url, \"put\", options)\n result\n end",
"title": ""
},
{
"docid": "28fbd8e089e8dc397fff00099e4c93e1",
"score": "0.63457036",
"text": "def patch_resource(path, data)\n check_string(path)\n uri = return_uri(path)\n req = Net::HTTP::Patch.new(uri.path)\n if @customer_id == \"Bearer \"\n req.add_field(\"Authorization\", @customer_id+@customer_key)\n else\n req.basic_auth @customer_id, @customer_key\n end\n req.body = data\n res = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) {|http|\n http.request(req)\n }\n parse_response(res)['data']\n end",
"title": ""
},
{
"docid": "5013fdcb0de3eaf0c28fec9734b540f0",
"score": "0.6338366",
"text": "def patch(url, data)\n Typhoeus::Request.patch(\n base_url + url,\n body: data,\n userpwd: authentication\n )\n end",
"title": ""
},
{
"docid": "d20d3ebbfcfa913c2138a9f3745fb7d8",
"score": "0.63359654",
"text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @json_data = args[:json_data] if args.key?(:json_data)\n @name = args[:name] if args.key?(:name)\n @parent_document_id = args[:parent_document_id] if args.key?(:parent_document_id)\n @schema_id = args[:schema_id] if args.key?(:schema_id)\n @struct_data = args[:struct_data] if args.key?(:struct_data)\n end",
"title": ""
},
{
"docid": "d5abc3101486a7064a30dcb398ae7ffa",
"score": "0.6331627",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @kind = args[:kind] if args.key?(:kind)\n @request_id = args[:request_id] if args.key?(:request_id)\n @trip_option = args[:trip_option] if args.key?(:trip_option)\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.63212705",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "516293bd7a60059a7be7a5ac1a725e64",
"score": "0.6294156",
"text": "def put(path, data)\n request(:put, path, JSON.dump(data))\n end",
"title": ""
},
{
"docid": "4bc4d29128ffcb5e1ab2bde2966d12eb",
"score": "0.6270174",
"text": "def patch(uri, data)\n get_response(Net::HTTP::Patch.new(\"#{API}/#{uri}\", HEADER), data)\n end",
"title": ""
},
{
"docid": "20d4b250d18e97d55879a70728d0e5be",
"score": "0.6260853",
"text": "def api_put(path, data = {})\n api_request(:put, path, :data => data).parsed\n end",
"title": ""
},
{
"docid": "e8ffb008aad98ad63d835a4c4d547c50",
"score": "0.6221232",
"text": "def put(path, data)\r\n fetch(:path => path, :method => 'PUT', :data => data)\r\n end",
"title": ""
},
{
"docid": "6b3d6af3e1ade5f41124866b57a6b326",
"score": "0.6202851",
"text": "def patch(path, **args); end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.6152749",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.6152749",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "d32eeb2786beeb7d69cb4777abc3b659",
"score": "0.6140077",
"text": "def update(object_url, id, data)\n response = patch(\"/#{object_url}/#{id}\", data)\n handle_error(response)\n process(response)\n end",
"title": ""
},
{
"docid": "0a565cef00d6874eb6d07052cd70dfab",
"score": "0.61181736",
"text": "def update(json_resource)\n jsonapi_request(:patch, \"#{@route}/#{json_resource['id']}\", \"data\"=> json_resource)\n end",
"title": ""
},
{
"docid": "ed0826bfec77d499b10e6b0e6ded59c9",
"score": "0.606717",
"text": "def patch?; request_method == \"PATCH\" end",
"title": ""
},
{
"docid": "d7fbbc9a0d04c0541f03a1529d531d25",
"score": "0.60542303",
"text": "def update(data, params={})\n send_request('/update', map_params(params), data)\n end",
"title": ""
},
{
"docid": "2c5497f059ab1d7457ffc834ecb8f6a2",
"score": "0.604279",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "d55964b62eb8f1334d6fd09c1ea0f9ee",
"score": "0.6018304",
"text": "def update(data)\n # XXX: Check if the client is allowed to call the method\n\n params = data[:params] || {}\n\n record = data[:model].find(params[:id]) rescue nil\n\n error = nil\n\n if record.present?\n begin\n record.update(params[:fields])\n rescue Exception => e\n error = e.message\n end\n else\n error = \"There is no record with id: #{params[:id]}\"\n end\n\n if error\n response = {\n collection: data[:model].model_name.collection,\n msg: 'error',\n command: data[:command],\n error: error || record.errors.full_messages\n }\n\n # Send error notification to the client\n transmit_packet response\n end\n\n end",
"title": ""
},
{
"docid": "0f5823036d6e8389120aa9e430317381",
"score": "0.6014776",
"text": "def update(data, params={}, &blk)\n send_request('/update', map_params(params), data, &blk)\n end",
"title": ""
},
{
"docid": "bb718fcffc69403217628eebd3f177d1",
"score": "0.60125095",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @version_to_update = args[:version_to_update] if args.key?(:version_to_update)\n end",
"title": ""
},
{
"docid": "29180f648f67370c1fa5bcbc7ae78761",
"score": "0.6000319",
"text": "def replace_request(data)\n client.create_request('PUT', url_path, 'data' => data)\n end",
"title": ""
},
{
"docid": "e228f8d94cd4f3ebc14a671e25d9a803",
"score": "0.5985977",
"text": "def update\n data_set = DataSet.find(params[:data_set_id])\n\t\t\n\t\t#if data are send in batch\n\t\tif params[:_json].kind_of?(Array)\n\t\t\tdata_arr = params[:_json]\n\t\t\tdata = Array.new\n\t\t\tall_valid = true\n\t\t\n\t\t\t#update all data in one transaction\n\t\t\tDatum.transaction do\n\t\t\t\tdata_arr.each do |item|\n\t\t\t\t\tdata.push(data_set.data.find(item[:id]))\n\t\t\t\t\tdata.last.update_attributes(item)\n\t\t\t\t\tif !data.last.valid?\n\t\t\t\t\t\tall_valid = false\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\trespond_with(data) do |format|\n \tif all_valid\n \tformat.json { render json: { success: true, data: data } }\n \telse\n \tformat.json { render json: { success: false, errors: 'Date werent updated' } }\n \tend\n \tend\n \t\n\t\t#if there is only one datum\n\t\telse\n\t\t\tdatum = data_set.data.find(params[:id])\n \t\tdatum.update_attributes(params[:datum])\n\n \trespond_with(datum) do |format|\n \tif datum.valid?\n \tformat.json { render json: { success: true, data: datum } }\n \telse\n \tformat.json { render json: { success: false, errors: datum.errors } }\n \tend\n \tend\n\t\tend\n end",
"title": ""
},
{
"docid": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.5978273",
"text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end",
"title": ""
},
{
"docid": "6f60a7d40f9aec7d95ffec0ab28bdaa4",
"score": "0.5975735",
"text": "def update( *data )\n\t\treturn nil # no-op\n\tend",
"title": ""
},
{
"docid": "43fdecba17efc7932ab9d9d4f0786094",
"score": "0.5960663",
"text": "def put(path, data = nil, model = 'raw')\n request(:put, path, data, model)\n end",
"title": ""
},
{
"docid": "1d36733685026e3b89c250cfc33f46e6",
"score": "0.5948276",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @kind = args[:kind] if args.key?(:kind)\n end",
"title": ""
},
{
"docid": "1d36733685026e3b89c250cfc33f46e6",
"score": "0.5948276",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @kind = args[:kind] if args.key?(:kind)\n end",
"title": ""
},
{
"docid": "2b936ab29ecb5e59b06e1f182724115c",
"score": "0.5945851",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n end",
"title": ""
},
{
"docid": "2b936ab29ecb5e59b06e1f182724115c",
"score": "0.5945851",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n end",
"title": ""
},
{
"docid": "2b936ab29ecb5e59b06e1f182724115c",
"score": "0.5945851",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n end",
"title": ""
},
{
"docid": "edca1e6081642d467f430e2bfeac44b2",
"score": "0.5932785",
"text": "def patch(operation, path, value)\n ensure_client && ensure_uri\n response = @client.rest_patch(@data['uri'], 'body' => [{ op: operation, path: path, value: value }])\n patched_data = @client.response_handler(response)\n set_all(patched_data)\n end",
"title": ""
},
{
"docid": "44cc40eca9683c318fe735c545edbe20",
"score": "0.59221053",
"text": "def attributes_to_update\n tmp_data = {}\n data.each do |key, value|\n tmp_data[key] = { action: 'PUT', value: value } unless key == 'id'\n end\n tmp_data\n end",
"title": ""
},
{
"docid": "3551a93e8829fecafd58bf691a860eeb",
"score": "0.5917339",
"text": "def update_object(path, id, info)\n json_parse_reply(*json_put(@target, \"#{path}/#{URI.encode(id)}\", info,\n @auth_header, if_match: info[:meta][:version]))\n end",
"title": ""
},
{
"docid": "6606fe2a54e816a24177fba301eedf64",
"score": "0.5912856",
"text": "def patch(path, params = nil, headers = nil)\n process(:patch, path, params, headers)\n end",
"title": ""
},
{
"docid": "6606fe2a54e816a24177fba301eedf64",
"score": "0.5912856",
"text": "def patch(path, params = nil, headers = nil)\n process(:patch, path, params, headers)\n end",
"title": ""
},
{
"docid": "1372856b45a7a924dc31b72a27db0324",
"score": "0.5911537",
"text": "def patch(path, params: {}, body: {})\n request(:patch, path, params: params, body: body)\n end",
"title": ""
},
{
"docid": "4eba30b7eeec9de84122a3ea194b409c",
"score": "0.59113455",
"text": "def patch(end_point_url, data = nil)\n uri = URI(@api_url + end_point_url)\n request = Net::HTTP::Patch.new uri\n @headers.each_with_index do |(k, v)|\n request[k] = v\n end\n request.basic_auth(@auth.credentials[0], @auth.credentials[1])\n request['Content-Type'] = 'application/json'\n request.body = data.to_json if data\n start_response(request, uri)\n end",
"title": ""
},
{
"docid": "bfffefb2433840a4115fb73071c37b9b",
"score": "0.59069896",
"text": "def update(model_name, model_id, data, options = {})\n url = get_brpm_url(model_name, model_id)\n options[\"data\"] = data\n result = Rest.put(url, options)\n result\n end",
"title": ""
},
{
"docid": "65ed998bf60b8cc3dcc85259114e4416",
"score": "0.5892955",
"text": "def patch(data, options={})\n hal_client.patch(href, data, options).tap do\n stale!\n end\n end",
"title": ""
},
{
"docid": "f2138ebde5face34bbb161efcf10416e",
"score": "0.58758914",
"text": "def put_request(_context, endpoint, data)\n Puppet.runtime[:http].put(\n build_uri(endpoint),\n Puppet::Util::Json.dump(data),\n headers: {\n 'Content-Type' => 'application/json'\n },\n options: build_options,\n )\n end",
"title": ""
},
{
"docid": "766986887b72dcdba5ac45cc797979a3",
"score": "0.5874861",
"text": "def put(path, data=nil, params=nil)\n request('PUT', path, params, data)\n end",
"title": ""
},
{
"docid": "d4d0cc8b89214197252b319a37c7b4b6",
"score": "0.58723134",
"text": "def update_one(id, patch)\n if id.nil? || id.empty?\n raise IdNotProvided\n end\n\n if patch.nil? || !patch.any?\n raise PatchNotProvided\n end\n\n if patch.key?(META_LABEL_ID)\n raise PatchIdSet, \"patch: #{patch}\"\n end\n\n if patch.key?(META_LABEL_TYPE) && patch[META_LABEL_TYPE] != @entity_type\n raise EntityTypeMismatch, \"only valid type is '#{@entity_type}', but \" +\n \"patch has type '#{patch[META_LABEL_TYPE]}'\"\n end\n\n begin\n resp = etre_put(\"/entity/#{@entity_type}/#{id}\", patch)\n rescue RestClient::ExceptionWithResponse => e\n raise RequestFailed, e.response\n end\n\n if ![200, 201].include?(resp.code)\n raise UnexpectedResponseCode, \"expected 200 or 201, got #{resp.code}\"\n end\n\n return JSON.parse(resp.body)\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.58712596",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "77ce27989a6eb1263af612ecffa00850",
"score": "0.58574593",
"text": "def update\n update! do |success, failure|\n success.json { render :json => resource }\n end\n end",
"title": ""
},
{
"docid": "85f533646c09e2d1b1d8ab4a7b4e4c6e",
"score": "0.5845457",
"text": "def patch_object(path, id, info, attributes_to_delete = nil)\n info = info.merge(meta: { attributes: Util.arglist(attributes_to_delete) }) if attributes_to_delete\n json_parse_reply(*json_patch(@target, \"#{path}/#{URI.encode(id)}\", info, @auth_header))\n end",
"title": ""
},
{
"docid": "63d85f7d2ded43c80e5ce520fbf1a163",
"score": "0.58417165",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @data_available = args[:data_available] if args.key?(:data_available)\n @kind = args[:kind] if args.key?(:kind)\n end",
"title": ""
},
{
"docid": "f65193bb16c1dc7da0f094dbbb9e8f9d",
"score": "0.58382374",
"text": "def restHttpPut(id, data, format = @format, sessionId = @sessionId)\n sessionId.should_not be_nil\n\n puts \"\\n--------------------------START OF DATA--------------:\\n#{data}\\n--------------------END OF DATA---------------\" if $SLI_DEBUG\n urlHeader = makeUrlAndHeaders('put',id,sessionId,format)\n @res = RestClient.put(urlHeader[:url], data, urlHeader[:headers]){|response, request, result| response }\n puts(@res.code,@res.body,@res.raw_headers) if $SLI_DEBUG\nend",
"title": ""
},
{
"docid": "308cbdafb3dc155c61409a4efd850d4b",
"score": "0.5832882",
"text": "def patch(parameters={}, type='json')\n perform_request Net::HTTP::Patch, parameters, type\n end",
"title": ""
},
{
"docid": "be49f0c2469db2e369cfda130ca78912",
"score": "0.5831692",
"text": "def update\n respond_to do |format|\n if @data_file.update(data_file_params)\n format.html { redirect_to @data_file, notice: 'Data file was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @data_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b3bc2e0d74c93ee2ff8108048927902",
"score": "0.58309054",
"text": "def update!(data = nil, **options)\n @data.update!(data) if data\n options!(options)\n self\n end",
"title": ""
},
{
"docid": "8f7f417647db7cec92f2670ab59e4c88",
"score": "0.58255976",
"text": "def patch(path, options = {}, &block)\n perform_request Net::HTTP::Patch, path, options, &block\n end",
"title": ""
},
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.58246386",
"text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "6b5dab8a348badce65944b61ba5ea3fa",
"score": "0.5813793",
"text": "def patch(path, **args)\n process(:patch, path, **args)\n end",
"title": ""
},
{
"docid": "3527698628d32da57b7104a88226815c",
"score": "0.58120775",
"text": "def patch(resource_url, body = nil, &block)\n http_patch = Net::HTTP::Patch.new resource_url, {'Content-Type' =>'application/json'}\n http_patch.body = json_body(body) if body\n call_http_server http_patch, &block\n end",
"title": ""
},
{
"docid": "792c4caee1825f820108e87ca469579f",
"score": "0.58067966",
"text": "def patch?\n method == :put || method == :patch\n end",
"title": ""
},
{
"docid": "792c4caee1825f820108e87ca469579f",
"score": "0.58067966",
"text": "def patch?\n method == :put || method == :patch\n end",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.5800077",
"text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end",
"title": ""
},
{
"docid": "ab14b0265d435b1bcb148eb08859c8de",
"score": "0.5799121",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @signature = args[:signature] if args.key?(:signature)\n end",
"title": ""
},
{
"docid": "b55d0cc07c38e3eaafd2af5f91b054cf",
"score": "0.5793074",
"text": "def update(data = {})\n open(url(data)) do |f|\n # TODO: check the response\n \n end\n end",
"title": ""
},
{
"docid": "d61c0aeb123e4c5cfcb2ba019dd903a0",
"score": "0.5792398",
"text": "def patch(options = {})\n request :patch, options\n end",
"title": ""
},
{
"docid": "3b96fff625d278f3de0432ef5785d7c3",
"score": "0.57771164",
"text": "def update(*args)\n respond_to do |format|\n if @object.update_attributes(params[@model_path.gsub('-', '_')]) #NOTE may be use just write on id without find before?\n format.html { redirect_to ooorest.index_path, notice: \"successfully update\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @object.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d66ef818a3c0596f38f73692cac06bc7",
"score": "0.57770973",
"text": "def update(data={})\n set_data = {}\n set_data[:data] = data\n set_data = api_key_hash.merge(set_data)\n set_data[:timestamp] = time_to_unix(data[:timestamp]) if data[:timestamp]\n post(set_data)\n end",
"title": ""
},
{
"docid": "ab859b8b780dca24926d05a11251dc32",
"score": "0.5769972",
"text": "def api_json_put(uri, data)\n unsigned = Net::HTTP::Put.new(uri)\n unsigned.content_type = 'application/json'\n unsigned.body = Oj.dump(data)\n\n req = authenticate_request(unsigned, uri)\n\n api_request(uri, req)\n end",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.57663524",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
},
{
"docid": "bd5ec771f0781d215c3f5ffb5dca498f",
"score": "0.5766169",
"text": "def patch(data = T.unsafe(nil), options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f75d93a6193607c67f9a385bce0e6584",
"score": "0.5761427",
"text": "def patch(path, body = T.unsafe(nil), headers = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "060999c1db21e676e3aa2aa396590037",
"score": "0.57525754",
"text": "def put(path, data, options = {})\n request(:put, path, options, data)\n end",
"title": ""
},
{
"docid": "768551b9da9f81e8323fb282843c3c6f",
"score": "0.5752242",
"text": "def update\n @json = Json.find(params[:id])\n\n if @json.update(json_params)\n head :no_content\n else\n render json: @json.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "295107bec887fbc2845e84ac5ab4527b",
"score": "0.5749739",
"text": "def update\n @data_file = DataFile.find(params[:id])\n\n respond_to do |format|\n if @data_file.update_attributes(params[:data_file])\n format.html { redirect_to @data_file, notice: 'Data file was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @data_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cca65a791b0393c8830b16df8109ac37",
"score": "0.57470274",
"text": "def update\n @datafile = Datafile.find(params[:id])\n\n respond_to do |format|\n if @datafile.update_attributes(params[:datafile])\n format.html { redirect_to @datafile, notice: 'Datafile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @datafile.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b094d2d9e05d560edfc9226aa941ad22",
"score": "0.57418424",
"text": "def patch(path, options={})\n send_request(:patch, path, options)\n end",
"title": ""
},
{
"docid": "686c4018bc74e99e8458d2dbe68e7920",
"score": "0.5733163",
"text": "def patch(path, options={}, authenticate=true, raw=false, version=api_version, force_urlencoded=false)\n request(:patch, path, options, authenticate, raw, version, force_urlencoded)\n end",
"title": ""
},
{
"docid": "391fd2b1bcbb03c06b88cc37aaff69cf",
"score": "0.5718982",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @kind = args[:kind] if args.key?(:kind)\n @match_version = args[:match_version] if args.key?(:match_version)\n @pending_participant_id = args[:pending_participant_id] if args.key?(:pending_participant_id)\n @results = args[:results] if args.key?(:results)\n end",
"title": ""
},
{
"docid": "e57f5b9c5833e0cb54a23cab3e686753",
"score": "0.5714018",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @mime_type = args[:mime_type] if args.key?(:mime_type)\n end",
"title": ""
},
{
"docid": "e57f5b9c5833e0cb54a23cab3e686753",
"score": "0.5714018",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @mime_type = args[:mime_type] if args.key?(:mime_type)\n end",
"title": ""
},
{
"docid": "71099385c51273cd99c47a75580ee1cd",
"score": "0.5711719",
"text": "def update!(**args)\n @data = args[:data] if args.key?(:data)\n @name = args[:name] if args.key?(:name)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "765d7164cee41701ef01fb20d8645882",
"score": "0.5706106",
"text": "def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end",
"title": ""
},
{
"docid": "2939b1bcca53cbeafc3af7dadfbc4d7f",
"score": "0.5703381",
"text": "def update\n @data_doc = DataDoc.find(params[:id])\n\n respond_to do |format|\n if @data_doc.update_attributes(params[:data_doc])\n format.html { redirect_to @data_doc, notice: 'Data doc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @data_doc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b8d9d95614c32acd801ddd5ade727a5",
"score": "0.5703321",
"text": "def update\n if request.request_method_symbol == :put\n update_put\n elsif request.request_method_symbol == :patch\n update_patch\n else\n render partial: 'api/v1/error', locals: {:@error => {code: 501, message: 'Not Implemented'}}, status: 501\n end\n\n\n=begin\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n=end\n end",
"title": ""
},
{
"docid": "2bd0f8437d690524e73d4e5ae5481fa0",
"score": "0.5700278",
"text": "def patch(path, params: {}, body: {})\n request(:patch, URI.parse(api_endpoint).merge(path), params: params, body: body)\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "aa00700496b3b51158ccc3d0c55a75f9",
"score": "0.0",
"text": "def set_app_variable\n @app_variable = AppVariable.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60310465",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60152966",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.5920606",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5912896",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5912896",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.5898134",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5887081",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.5876557",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\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 else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5860066",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.5807812",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57404715",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57310694",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.5715928",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5701527",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.569245",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.5669733",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.56503016",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648064",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5636733",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5623887",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56089544",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.559635",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5595486",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.55868655",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55584484",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55584484",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.5507632",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.55033326",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5466339",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.54640555",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54472816",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455507",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.54398936",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.5415934",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.54",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394463",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394463",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5391065",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5388469",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5376582",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5355932",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5348422",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53466004",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53451854",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5343858",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5339292",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.532725",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53038853",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.52850133",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.52815986",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.5257178",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.5257024",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.5248709",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244428",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5239302",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.5230717",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52270764",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.5222752",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.5222485",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.52205867",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.52127427",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.52127236",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.520801",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.5204501",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.5204178",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.52039874",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.52032334",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5198697",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51944995",
"text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51944995",
"text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.51913106",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178707",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51781213",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5163576",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5152934",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5142308",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51392764",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51391184",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51387095",
"text": "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",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51351416",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115222",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.51131564",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.51114494",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.51055247",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5102995",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.50979155",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50949734",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5091706",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
f970c489cfe048e72672ed014a7fc38e
|
Appends a comment node at the current position in the document
|
[
{
"docid": "c8e497d786ac7ea2a1d5def95288fa37",
"score": "0.64976627",
"text": "def comment!(string)\n comment = XOM::Comment.new string\n @target.append_child(comment)\n self\n end",
"title": ""
}
] |
[
{
"docid": "6ed6bf0e4b0c02b4fb81c31d77a70c0e",
"score": "0.7182936",
"text": "def add_comment(comment); end",
"title": ""
},
{
"docid": "aec815b8d3307106c93408ca1760d13b",
"score": "0.7089156",
"text": "def add_comment(comment)\n return if ! comment\n if @comment \n @comment << \" / \"\n else\n @comment = ''\n end\n @comment << comment\n end",
"title": ""
},
{
"docid": "eba5b4ce54008360289170f400a3b24e",
"score": "0.7083518",
"text": "def append_comment(text)\n text = '# ' + text.gsub(\"\\r\\n\", \"\\n\").gsub(\"\\n\", \"\\n# \") + \"\\n\"\n unless @content[-1] == \"\\n\"\n @content += \"\\n\"\n end\n @content += text\n end",
"title": ""
},
{
"docid": "dadf214a84d65749c4728e4e7f01a509",
"score": "0.69876605",
"text": "def comment(*args)\n @node << Comment.new(*args)\n end",
"title": ""
},
{
"docid": "e4c7519bbaf855c73afee8a5f3859c1c",
"score": "0.69777185",
"text": "def add_comment(comment)\n @comment += comment + \"\\n\"\n end",
"title": ""
},
{
"docid": "c6d146cde5d231ba602fd1fb5aff654e",
"score": "0.68771946",
"text": "def add_comment(comment)\n \"\\n###### #{comment} ######\\n\"\n end",
"title": ""
},
{
"docid": "c6d146cde5d231ba602fd1fb5aff654e",
"score": "0.68771946",
"text": "def add_comment(comment)\n \"\\n###### #{comment} ######\\n\"\n end",
"title": ""
},
{
"docid": "def1691e988164bf969efa1855ea85a9",
"score": "0.6873028",
"text": "def visit_comment(node); end",
"title": ""
},
{
"docid": "def1691e988164bf969efa1855ea85a9",
"score": "0.6873028",
"text": "def visit_comment(node); end",
"title": ""
},
{
"docid": "ae068ca454d82090cba90bf330e2a1c0",
"score": "0.6852481",
"text": "def add_comment comment\n \"\\n###### #{comment} ######\\n\"\n end",
"title": ""
},
{
"docid": "37f8c99e11094f4a858c1bd8895a0e43",
"score": "0.68516666",
"text": "def insert_comment(text)\n text = '# ' + text.gsub(\"\\r\\n\", \"\\n\").gsub(\"\\n\", \"\\n# \") + \"\\n\"\n @content = @content.insert(0, text)\n end",
"title": ""
},
{
"docid": "dd727c22be660c198569e345c793c00a",
"score": "0.68245703",
"text": "def add_comment\n raise(\"Not implemented!\")\n end",
"title": ""
},
{
"docid": "b7404bf5e06b103612b5e35b6728bc59",
"score": "0.6824417",
"text": "def add_comment(comment)\n if @full_comment\n @full_comment << \" / \"\n else\n @full_comment = ''\n end\n @full_comment << comment\n if @full_comment =~ /\\A([^.]+?\\.)( |$)/\n @comment = $1\n else\n @comment = @full_comment\n end\n end",
"title": ""
},
{
"docid": "507e7efca5170be0668c91f338778a74",
"score": "0.681477",
"text": "def add_comment(comment)\n\t\t@comments << comment\n\tend",
"title": ""
},
{
"docid": "580b16b3b75d7203222bc51770bbadbb",
"score": "0.6775059",
"text": "def add_comment(comment)\n comments << comment\n end",
"title": ""
},
{
"docid": "580b16b3b75d7203222bc51770bbadbb",
"score": "0.6775059",
"text": "def add_comment(comment)\n comments << comment\n end",
"title": ""
},
{
"docid": "580b16b3b75d7203222bc51770bbadbb",
"score": "0.6775059",
"text": "def add_comment(comment)\n comments << comment\n end",
"title": ""
},
{
"docid": "cf19150e71a1e3e29a09439fe5edc1fe",
"score": "0.6774794",
"text": "def add(comment)\r\n fail \"Comment should not be nil\" if (comment.nil?)\r\n\r\n @comments.push(comment)\r\n comment.depth = self.depth+1\r\n end",
"title": ""
},
{
"docid": "b53aeedccf1174651ff487925f8d169c",
"score": "0.6766112",
"text": "def write_comment(text)\n (@graph || @trix) << create_comment(text)\n end",
"title": ""
},
{
"docid": "71f62d2df5ff3b0fb564fe341c24c57d",
"score": "0.6737847",
"text": "def add(comment)\r\n fail \"Comment should not be nil\" if (comment.nil?)\r\n\r\n @comments.push(comment)\r\n comment.depth = self.depth+1\r\n end",
"title": ""
},
{
"docid": "9ee5be9b706f442340f0e37728ed0aef",
"score": "0.6737664",
"text": "def add_comment( line )\n self << CommentBlock.new unless last.is_a? CommentBlock\n last << line\n end",
"title": ""
},
{
"docid": "dd9b327446129c5a1b27d25927be0cfb",
"score": "0.6732394",
"text": "def add_comment\n section.comment_line(@ln, @line)\n end",
"title": ""
},
{
"docid": "cd4e773dc7d4dfef45cc4e7a1c1e2787",
"score": "0.67271715",
"text": "def add_comment(comment)\n comments << comment\n end",
"title": ""
},
{
"docid": "cd4e773dc7d4dfef45cc4e7a1c1e2787",
"score": "0.67271715",
"text": "def add_comment(comment)\n comments << comment\n end",
"title": ""
},
{
"docid": "cd4e773dc7d4dfef45cc4e7a1c1e2787",
"score": "0.67271715",
"text": "def add_comment(comment)\n comments << comment\n end",
"title": ""
},
{
"docid": "3445b9b9b03aa4091538326f8629f249",
"score": "0.6700079",
"text": "def add_comment(comment)\n @@comment_list << comment\n end",
"title": ""
},
{
"docid": "18959e7560bd0cdfe44770db9fa0b2e9",
"score": "0.6681526",
"text": "def add_comment(comment)\n self.comments << comment\n end",
"title": ""
},
{
"docid": "161378da0a109d2f92f330d270f56b44",
"score": "0.66759574",
"text": "def add_comment(comment)\n comments << comment\n end",
"title": ""
},
{
"docid": "161378da0a109d2f92f330d270f56b44",
"score": "0.66759574",
"text": "def add_comment(comment)\n comments << comment\n end",
"title": ""
},
{
"docid": "127fecadde47055e691cffb00e2ac92d",
"score": "0.66708195",
"text": "def comment(comment)\n @lines << \"### #{comment} ###\"\n end",
"title": ""
},
{
"docid": "b41c9708d4129a7beee8c1cd330b0dcd",
"score": "0.66590744",
"text": "def add_comment(comment)\n self.all_comments << comment\n end",
"title": ""
},
{
"docid": "33ca0a6eafe1ca26e80a9d5ef04c5434",
"score": "0.66339403",
"text": "def add_comment(comment, args)\n \n @comments[get_comment_idx(args)] #<< comment\n end",
"title": ""
},
{
"docid": "6aa568b2e77a465d7583113435615cc5",
"score": "0.662881",
"text": "def add_comment\n end",
"title": ""
},
{
"docid": "935eb1ad3c1678ccd6786d8e512e0956",
"score": "0.6609164",
"text": "def write_comment(comment)\n end",
"title": ""
},
{
"docid": "8bb5e1004ffa8b3f6145dd3b745e5063",
"score": "0.658311",
"text": "def add_comment(comment)\n add_text(\"Comment\", comment)\n end",
"title": ""
},
{
"docid": "566aa4072a8a25b9a39d80e3b8d4a85d",
"score": "0.6563032",
"text": "def comment(path, doc, str); end",
"title": ""
},
{
"docid": "48d8154b8f6fe283343371250b1d2ff8",
"score": "0.6541231",
"text": "def add_comment\n puts Comment.new('Wils', '28 days ago', 'Wubbalubba dub dub').inspect\n end",
"title": ""
},
{
"docid": "d3fc3185363371680187b817ab7fb278",
"score": "0.6535582",
"text": "def add_comment(repo, number, comment, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "926fa7d499b9cdd5a4e06f2b245c8455",
"score": "0.6523757",
"text": "def add_comment(comment)\n @comment_list << comment\n end",
"title": ""
},
{
"docid": "554bc4d4a808da3b358dc7d70da63925",
"score": "0.65177315",
"text": "def on_comment(text)\n if comments[lineno]\n text = [comments.delete(lineno), text].join\n end\n comments[lineno + 1] = text\n end",
"title": ""
},
{
"docid": "8bd0cbcf82d6eb64f36f0b79afd55b7d",
"score": "0.6515126",
"text": "def visit_comment(node)\n node.copy\n end",
"title": ""
},
{
"docid": "12dab3891efd36b93fdf2b3a430b2ebb",
"score": "0.65128523",
"text": "def comment(comment)\n node.comment = comment\n end",
"title": ""
},
{
"docid": "12dab3891efd36b93fdf2b3a430b2ebb",
"score": "0.65128523",
"text": "def comment(comment)\n node.comment = comment\n end",
"title": ""
},
{
"docid": "339adf59aa3a2a126916692cdb488dad",
"score": "0.65019304",
"text": "def add_comment(comment)\n self.comments << comment\n end",
"title": ""
},
{
"docid": "7dfab00b2dbebe059d359e15093373f2",
"score": "0.6471657",
"text": "def comment(text)\n return unless @commentify\n set!(:\"_comment_#{@comment_index}\", text)\n @comment_index += 1\n end",
"title": ""
},
{
"docid": "bee5de96d38d52e6b7cb80cae0f9e873",
"score": "0.6460065",
"text": "def append_node node, comments, filename = nil\r\n @file_comments[filename] = associate_comments(node, comments)\r\n mapified = reduce(node, @file_comments[filename])\r\n root = AST::Node.new(:begin, [filename])\r\n root = root.append mapified\r\n @file_nodes[filename] = root\r\n @required.uniq!\r\n process_maps\r\n root\r\n end",
"title": ""
},
{
"docid": "a6baf6d2a44b73ed9c7c314599549285",
"score": "0.6448894",
"text": "def handle_comment(node); end",
"title": ""
},
{
"docid": "ff4dbd5f4be70f107ff2a1d09e51fac9",
"score": "0.64311194",
"text": "def comment= comment\n comment = extract_comment comment\n\n return if comment.empty?\n\n if @comment then\n # HACK should section comments get joined?\n @comment.text += \"\\n# ---\\n#{comment.text}\"\n else\n @comment = comment\n end\n end",
"title": ""
},
{
"docid": "461473a3e6f9af63c061301856e74f5a",
"score": "0.6424114",
"text": "def create_comment(text)\n ::Nokogiri::XML::Comment.new(@xml, text.to_s)\n end",
"title": ""
},
{
"docid": "d40d72da1463fe0da81539afd33ae11b",
"score": "0.6389824",
"text": "def add_comment str\n @comment = '' unless @comment\n @comment += str + '<br>'\n end",
"title": ""
},
{
"docid": "1ab046d4f4d47eec3049ed10e68ff9e2",
"score": "0.63892007",
"text": "def update_comments(comment)\r\n self.comments << comment\r\n end",
"title": ""
},
{
"docid": "5c4dc1188788a137c38c1430a9e653d2",
"score": "0.63834774",
"text": "def add_comment(text, user_name)\n c = Comment.new(:text => text, :user_name => user_name)\n comments << c\n recalc_comment_count()\n \n c\n end",
"title": ""
},
{
"docid": "8cfaaa34b2e368f8c44527c92f01d681",
"score": "0.6382098",
"text": "def append(slide, line, comment_mode)\n current_element(slide, comment_mode).append(line.string)\n end",
"title": ""
},
{
"docid": "5d179fec301e1894a47a340bcef25630",
"score": "0.63715065",
"text": "def on_comment_start\n add_token(:T_COMMENT_START)\n end",
"title": ""
},
{
"docid": "d886e19fde6cdf2de1c31de38fb78d2d",
"score": "0.63498664",
"text": "def comment(text)\n @out << \"<!-- #{text} -->\"\n nil\n end",
"title": ""
},
{
"docid": "1ecd7ca08d421fb5f3beadb231c693a1",
"score": "0.63265425",
"text": "def parse_comment\n token = match(:COMMENT)\n\n AST::Comment.new(\n token.value,\n with_default_options({location: token.location.dup})\n ).tap do |ast_node|\n @stack.last << ast_node unless @stack.empty?\n end\n end",
"title": ""
},
{
"docid": "74f1149f776a8dd0e57befbb8cb9536a",
"score": "0.63247544",
"text": "def addComment(comment) \n @Comments.push(comment) \n end",
"title": ""
},
{
"docid": "be8d99d961969e0dd591a5adf54a8fb0",
"score": "0.6321858",
"text": "def write_comment cell, comment\n cell.elements.delete \"office:annotation\"\n write_xml cell, {TAG => \"office:annotation\",\n \"svg:x\" => \"4.119cm\",\n \"draw:caption-point-x\" => \"-0.61cm\",\n \"svg:y\" => \"0cm\",\n \"draw:caption-point-y\" => \"0.011cm\",\n \"draw:text-style-name\" => \"comment_paragraph_style\",\n \"svg:height\" => \"0.596cm\",\n \"draw:style-name\" => \"comment_graphics_style\",\n \"svg:width\" => \"2.899cm\",\n \"child1\" => {TAG => \"dc:date\",\n TEXT => \"2010-01-01T00:00:00\"\n },\n \"child2\" => {TAG => \"text:p\",\n \"text:style-name\" => \"comment_paragraph_style\",\n TEXT => comment\n }\n }\n end",
"title": ""
},
{
"docid": "ac991348b1733865aeb42d0f9ab19623",
"score": "0.63192123",
"text": "def add_comment(comment)\n @comments << comment unless comment.nil?\n end",
"title": ""
},
{
"docid": "9e15b09105ce3b8db95c789673bd8890",
"score": "0.63027376",
"text": "def create_comment(text)\n ::REXML::Comment.new(text.to_s)\n end",
"title": ""
},
{
"docid": "508fd812ad542a114c88f99e6ef213cc",
"score": "0.6294218",
"text": "def writeComment(cell,comment)\n die(\"writeComment: cell #{cell} is not a REXML::Element\") unless (cell.class.to_s == \"REXML::Element\")\n die(\"writeComment: comment #{comment} is not a string\") unless (comment.class.to_s == \"String\")\n #--------------------------------------------\n # Ggf. alten Kommentar loeschen\n #--------------------------------------------\n cell.elements.delete(\"office:annotation\")\n write_xml(cell,{TAG => \"office:annotation\",\n \"svg:x\" => \"4.119cm\",\n \"draw:caption-point-x\" => \"-0.61cm\",\n \"svg:y\" => \"0cm\",\n \"draw:caption-point-y\" => \"0.011cm\",\n \"draw:text-style-name\" => \"comment_paragraph_style\",\n \"svg:height\" => \"0.596cm\",\n \"draw:style-name\" => \"comment_graphics_style\",\n \"svg:width\" => \"2.899cm\",\n \"child1\" => {TAG => \"dc:date\",\n TEXT => \"2010-01-01T00:00:00\"\n }, \n \"child2\" => {TAG => \"text:p\",\n \"text:style-name\" => \"comment_paragraph_style\",\n TEXT => comment\n }\n })\n end",
"title": ""
},
{
"docid": "f2e3f3622fcc9fd7ea7347598e1a9baa",
"score": "0.6259382",
"text": "def attach_comments(parser, start_char, end_char); end",
"title": ""
},
{
"docid": "07edbf6ed4ce12ac0f183099057d0287",
"score": "0.6256258",
"text": "def comment!(comment_text)\r\n @target << \"/* #{comment_text} */\\n\"\r\n end",
"title": ""
},
{
"docid": "c02459e4caa96d1d05981d7234bc0893",
"score": "0.6254756",
"text": "def add_comment_to_next_child(comment)\n if comment.is_a?(String)\n @next_comments << comment\n elsif comment.is_a?(Array)\n @next_comments.concat(comment)\n end\n end",
"title": ""
},
{
"docid": "c02459e4caa96d1d05981d7234bc0893",
"score": "0.6254756",
"text": "def add_comment_to_next_child(comment)\n if comment.is_a?(String)\n @next_comments << comment\n elsif comment.is_a?(Array)\n @next_comments.concat(comment)\n end\n end",
"title": ""
},
{
"docid": "6d2888d30ce3a822934c2cd45d6c2fb7",
"score": "0.62427527",
"text": "def comment(content)\n append! \"<!-- #{content.to_s.gsub(/-(?=-)/, '- ')} -->\"\n end",
"title": ""
},
{
"docid": "839f524fead418c00167b4fd5debec77",
"score": "0.6238791",
"text": "def writeComment(cell,comment)\n die(\"writeComment: cell #{cell} is not a REXML::Element\") unless (cell.class.to_s == \"REXML::Element\")\n die(\"writeComment: comment #{comment} is not a string\") unless (comment.class.to_s == \"String\")\n #--------------------------------------------\n # Ggf. alten Kommentar loeschen\n #--------------------------------------------\n cell.elements.delete(\"office:annotation\")\n writeXml(cell,{TAG => \"office:annotation\",\n \"svg:x\" => \"4.119cm\",\n \"draw:caption-point-x\" => \"-0.61cm\",\n \"svg:y\" => \"0cm\",\n \"draw:caption-point-y\" => \"0.011cm\",\n \"draw:text-style-name\" => \"myCommentParagraph\",\n \"svg:height\" => \"0.596cm\",\n \"draw:style-name\" => \"myCommentGraphics\",\n \"svg:width\" => \"2.899cm\",\n \"child1\" => {TAG => \"dc:date\",\n TEXT => \"2010-01-01T00:00:00\"\n }, \n \"child2\" => {TAG => \"text:p\",\n \"text:style-name\" => \"myCommentParagraph\",\n TEXT => comment\n }\n })\n end",
"title": ""
},
{
"docid": "de2b0a678193692db0e4bc61fa157180",
"score": "0.62339044",
"text": "def on_comment(value)\n # char is the index of the # character in the source.\n char = char_pos\n location =\n Location.token(\n line: lineno,\n char: char,\n column: current_column,\n size: value.size - 1\n )\n\n # Loop backward in the source string, starting from the beginning of the\n # comment, and find the first character that is not a space or a tab. If\n # index is -1, this indicates that we've checked all of the characters\n # back to the start of the source, so this comment must be at the\n # beginning of the file.\n #\n # We are purposefully not using rindex or regular expressions here because\n # they check if there are invalid characters, which is actually possible\n # with the use of __END__ syntax.\n index = char - 1\n while index > -1 && (source[index] == \"\\t\" || source[index] == \" \")\n index -= 1\n end\n\n # If we found a character that was not a space or a tab before the comment\n # and it's a newline, then this comment is inline. Otherwise, it stands on\n # its own and can be attached as its own node in the tree.\n inline = index != -1 && source[index] != \"\\n\"\n comment =\n Comment.new(value: value.chomp, inline: inline, location: location)\n\n @comments << comment\n comment\n end",
"title": ""
},
{
"docid": "a6071c25e38426620ec849d07eb01dc3",
"score": "0.62279624",
"text": "def addComment(type, value, start, end1, loc) \n assert(start.instance_of? Fixnum, 'Comment must have valid position')\n\n # Because the way the actual token is scanned, often the comments\n # (if any) are skipped twice during the lexical analysis.\n # Thus, we need to skip adding a comment if the comment array already\n # handled it.\n if (@extra[:comments].length > 0) \n if (@extra[:comments][@extra[:comments].length - 1][:range][1] > start) \n return\n end\n end\n\n @extra[:comments].push({\n type: type,\n value: value,\n range: [start, end1],\n loc: loc\n })\n end",
"title": ""
},
{
"docid": "5028580c95c264458f72d3a22d4c0248",
"score": "0.62118053",
"text": "def comments(doc)\n doc.xpath('//comment').each do |node|\n node.replace(\"<!-- #{node.inner_html} -->\")\n end\n end",
"title": ""
},
{
"docid": "1b91f0bb09a3d241acb6e747c7542e87",
"score": "0.6206451",
"text": "def document_add_comment(document_id, comment_data, query_params = nil)\n put(\"/documents/#{document_id}/comments\", nil, comment_data)\n end",
"title": ""
},
{
"docid": "c9f7a61a99db00be7f4d860ab6e5fb04",
"score": "0.61929846",
"text": "def comment(string)\n insert(doc.create_comment(string))\n end",
"title": ""
},
{
"docid": "89c9bd7d8c1b81078bd22d3ef89a0cf4",
"score": "0.6188087",
"text": "def add_comment(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "7c9c6bfa62aa809feec04c820628d8f7",
"score": "0.6187586",
"text": "def comment!(comment_text)\n @target << \"/* #{comment_text} */\\n\"\n end",
"title": ""
},
{
"docid": "0e7389c9c853f3055254ac9f581babfa",
"score": "0.61842215",
"text": "def comment(comment, opts = {})\n @context.lines << Lines::Comment.new(\n line_options(opts.merge(:comment => comment))\n )\n end",
"title": ""
},
{
"docid": "557db3837b2b6a33b472eda7958270f5",
"score": "0.6152712",
"text": "def createComment(data)\n ret = Comment.new(data)\n ret.ownerDocument = self\n ret\n end",
"title": ""
},
{
"docid": "a24c3b59aca7cc8d856a72d3b959adf8",
"score": "0.61414564",
"text": "def comment(comment)\r\n end",
"title": ""
},
{
"docid": "dc26b19e4f2fed1212cb8267868e1bfc",
"score": "0.61157715",
"text": "def comment(text); end",
"title": ""
},
{
"docid": "6b2a489ba9e3f9a1beddd3343628a57b",
"score": "0.61129993",
"text": "def comment\n if request.post?\n begin\n @node = Node.find(params[:id])\n @comment = Comment.new(params[:comment])\n @comment.user_id = session[:user]\n \n @node.comments<< @comment\n @comment.save!\n\n redirect_to :action => 'read', :id => @node\n rescue ActiveRecord::RecordInvalid\n STDERR.puts @comment.errors.inspect\n render_error(@comment)\n end\n end\n end",
"title": ""
},
{
"docid": "d3e9437a511ddbe0219a324843d9ebd9",
"score": "0.607626",
"text": "def comment(message)\n self << \"/* #{message} */\"\n end",
"title": ""
},
{
"docid": "c05215e92a9ef45ea2c0ea7a4d53c330",
"score": "0.60579985",
"text": "def add_comment(params = {})\n if self.comments.length > 0\n thread = self.comments.last.next_thread\n else\n thread = \"01/\"\n end\n c = DrupalComment.new({\n :pid => 0,\n :nid => self.nid,\n :uid => params[:uid],\n :subject => \"\",\n :hostname => \"\",\n :comment => params[:body],\n :status => 0,\n :format => 1,\n :thread => thread,\n :timestamp => DateTime.now.to_i\n })\n c.save\n c\n end",
"title": ""
},
{
"docid": "d67d1422a37bf576227bc8a95711b88f",
"score": "0.6042973",
"text": "def add_comment(path, position, message, severity)\n stripped_path = path.strip\n\n raise GergichError, \"invalid position `#{position}`\" unless valid_position?(position)\n\n position = position.to_json if position.is_a?(Hash)\n raise GergichError, \"invalid severity `#{severity}`\" unless SEVERITY_MAP.key?(severity)\n raise GergichError, \"no message specified\" unless message.is_a?(String) && !message.empty?\n\n db.execute \"INSERT INTO comments (path, position, message, severity) VALUES (?, ?, ?, ?)\",\n [stripped_path, position, message, severity]\n end",
"title": ""
},
{
"docid": "1d182d64288945f3af94aca3403f7b8f",
"score": "0.6013634",
"text": "def comment comment\n end",
"title": ""
},
{
"docid": "fea9041373137e948440354a05079403",
"score": "0.60092163",
"text": "def add_comment(c, user)\n unless c.nil?\n comment = Comment.new\n comment.comment = c\n comment.user = user\n comments << comment\n end\n end",
"title": ""
},
{
"docid": "49038d598e89002acd9462972e53f6cc",
"score": "0.5979193",
"text": "def insert_commment *splat\n\t\tsplat.each { |c| @comments << c }\n\tend",
"title": ""
},
{
"docid": "03289610234d5ad96886c37705034901",
"score": "0.59741867",
"text": "def write_comment\n pull_request.write_comment comment_body\n end",
"title": ""
},
{
"docid": "9cdc73e8adba180488018f9953e15128",
"score": "0.5973153",
"text": "def on_comment(value)\n @comments << {\n type: :@comment,\n value: value[1..-1].chomp.force_encoding('UTF-8'),\n inline: value.strip != lines[lineno - 1],\n sl: lineno,\n el: lineno,\n sc: char_pos,\n ec: char_pos + value.length - 1\n }\n end",
"title": ""
},
{
"docid": "7962f2ce8e451c13177d4071a97cbe47",
"score": "0.59663844",
"text": "def add_comments(comment)\n case comment\n when Comment then @all_comments << comment\n else\n @all_comments << Comment.new(comment.to_s)\n end\n end",
"title": ""
},
{
"docid": "678120a2523c1347dcc60758e6602cf8",
"score": "0.59660155",
"text": "def comment!(text)\n @elements.push(Framecurve::Comment.new(text.strip))\n end",
"title": ""
},
{
"docid": "fa6c80d1bc8a328ff811b6266a485d7d",
"score": "0.5959267",
"text": "def add_comment(owner_id, comment, field=nil)\n\n end",
"title": ""
},
{
"docid": "6aa9b380c303395e451cf7a03a27c9e9",
"score": "0.5941752",
"text": "def add_comment(user, text)\n @comments_list << Comment.new(user, text)\n end",
"title": ""
},
{
"docid": "ac5d9d96b903f2c546a4b7207823a50e",
"score": "0.59273607",
"text": "def add_comment(user, text)\n new_comment = Comment.new(user.login, text)\n new_comment.is_new = true\n @comments << new_comment\n end",
"title": ""
},
{
"docid": "0cb933e3ffc7227d3a79150639eaac02",
"score": "0.59230983",
"text": "def add_comment(connection, *args)\n commit(connection, 'addComment', *args)\n end",
"title": ""
},
{
"docid": "921183a48517dacf12dd9a6501c92bed",
"score": "0.58978856",
"text": "def comment(text)\n end",
"title": ""
},
{
"docid": "5c300b79210b39294af692660fec130e",
"score": "0.5895201",
"text": "def handle_comment(node)\n if node.type == :erb && node.children.size == 4 &&\n node.children[0]&.type == :indicator && node.children[0].children[0] == '#' &&\n node.children[2]&.type == :code\n\n # Do not continue parsing this node\n comment = node.children[2]\n @comments << ::Parser::Source::Comment.new(comment.location.expression)\n return\n end\n\n node\n end",
"title": ""
},
{
"docid": "fc0b458d81e4c19d87ab46f93de819d1",
"score": "0.5893108",
"text": "def comment\n \"#{ @comment_sep }#{ @comment_prefix }#{ @comment }\"\n end",
"title": ""
},
{
"docid": "dd0f5ec8bd8c5c4907cfdb89b4aaeb9a",
"score": "0.58912265",
"text": "def on_comment_end\n add_token(:T_COMMENT_END)\n end",
"title": ""
},
{
"docid": "8d2ff913a59ebeb688c2f90690fbc2b8",
"score": "0.5886578",
"text": "def add_comment(log_file, comment)\n open(log_file, 'ab') { |f| f.puts \"# #{comment}\" }\nend",
"title": ""
},
{
"docid": "d5d0fb4d7aa15f4ee9b58904d8fd41e5",
"score": "0.58833057",
"text": "def add_comment(key, comment, options={})\n options[:body] = comment if options[:body].nil?\n \n @soap.addComment(@token, key, options)\n end",
"title": ""
},
{
"docid": "8330ef62f90dce8921ae64ab176133b2",
"score": "0.5879408",
"text": "def position_comment(tk)\n TkCOMMENT.new(tk.line_no, 1, \"# File #{@top_level.absolute_name}, line #{tk.line_no}\")\n end",
"title": ""
}
] |
392d0aeb86500ede0dd905cd43aa8f94
|
PUT /leaveforstudents/1 PUT /leaveforstudents/1.xml
|
[
{
"docid": "a59240960ee9c45bfb714ceff4c62750",
"score": "0.6824307",
"text": "def update\n @leaveforstudent = Leaveforstudent.find(params[:id])\n\n respond_to do |format|\n if @leaveforstudent.update_attributes(params[:leaveforstudent])\n flash[:notice] = 'Leaveforstudent was successfully updated.'\n format.html { redirect_to(@leaveforstudent) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @leaveforstudent.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "6a8b169abeba6cb604ea0f0152128a5b",
"score": "0.6750721",
"text": "def update\n @leaveforstudent = Leaveforstudent.find(params[:id])\n\n respond_to do |format|\n if @leaveforstudent.update_attributes(params[:leaveforstudent])\n flash[:notice] = t('leaveforstudent.title2')+\" \"+t('updated')\n format.html { redirect_to(@leaveforstudent) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @leaveforstudent.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "571e76caa4341b65abd2296b635b079b",
"score": "0.6677685",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to student_url(@student) }\n format.xml { render :nothing => true }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "cc2bc8a3d8bf17298d7df48be053e3a0",
"score": "0.6532304",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(students_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "162558d2da358d634a5553e65e038147",
"score": "0.6524795",
"text": "def update_students(params)\n action = \"UPDATE\"\n kids_api_array = build_kids_api_array(action, params)\n return kids_api_array if kids_api_array.empty?\n\n options = { body: { students: { student: kids_api_array } }.to_json }\n answer = api(:post, \"/ws/v1/student\", options)\n return answer.parsed_response if answer.code.to_s.eql? \"200\"\n return {\"errorMessage\"=>\"#{answer.response}\"}\n end",
"title": ""
},
{
"docid": "4e4a0c7340a0870d368fafff42c941ac",
"score": "0.6492463",
"text": "def update\n @student = Student.find(params[:id])\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2be6f1ad91483b2857097b6c8af106aa",
"score": "0.6491755",
"text": "def update\n @student = Portal::Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Portal::Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76a71846b26669118f6e65e8b6d5c624",
"score": "0.64812726",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76a71846b26669118f6e65e8b6d5c624",
"score": "0.64812726",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76a71846b26669118f6e65e8b6d5c624",
"score": "0.64812726",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76a71846b26669118f6e65e8b6d5c624",
"score": "0.64812726",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e47a3255838d8fd656005587f5d3d0f",
"score": "0.6461418",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to(@student, :notice => 'Student was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e47a3255838d8fd656005587f5d3d0f",
"score": "0.6461418",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to(@student, :notice => 'Student was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e47a3255838d8fd656005587f5d3d0f",
"score": "0.6461418",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to(@student, :notice => 'Student was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e47a3255838d8fd656005587f5d3d0f",
"score": "0.6461418",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to(@student, :notice => 'Student was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cf5b83752c5bc096738b2380582718d",
"score": "0.64294577",
"text": "def edit_student\n @student = Student.find(params[:id])\n \n #respond_to do |format|\n # format.html # show.html.erb\n #format.xml { render :xml => @student }\n #end\n end",
"title": ""
},
{
"docid": "43251b0303af03e8493ee68dcc4b90e8",
"score": "0.64175874",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = t('student.title')+\" \"+t('updated')\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3876eb10027969cbe9d002b968f8a3e",
"score": "0.639226",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = I18n.t('flash.student.update_successful') \n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d728bc1f4ed2b0f4c04fc256ce205397",
"score": "0.63826287",
"text": "def update\n @studenten = Studenten.find(params[:id])\n\n respond_to do |format|\n if @studenten.update_attributes(params[:studenten])\n format.html { redirect_to(@studenten, :notice => 'De student is succesvol aangepast.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @studenten.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "863602a84ab1b9f281218381fcdcfcc1",
"score": "0.63136166",
"text": "def update \n \n respond_to do |format|\n if StudentAssignments.update(params[:id], :data => params[:data] )\n format.xml { head :ok }\n else\n format.xml { render :xml => @student_assignments.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71c6bdce2446ce2844d49e1734f157da",
"score": "0.6268798",
"text": "def update\n #remove program field in params\n if !params[:student][:enrollments_attributes].nil?\n params[:student] ||= {}\n params[:student][:enrollments_attributes] ||= []\n params[:student][:enrollments_attributes].each { |key, value| value.shift}\n end\n puts params[:student]\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93c8a7ad045e14cc57b9d8881f4d784e",
"score": "0.62523484",
"text": "def update\n respond_to do |format|\n if @studente.update(studente_params)\n format.html { redirect_to @studente, notice: 'Studente was successfully updated.' }\n format.xml { render :show, status: :ok, location: @studente }\n format.json { render :show, status: :ok, location: @studente }\n else\n format.html { render :edit }\n format.xml { render xml: @studente.errors, status: :unprocessable_entity }\n format.json { render json: @studente.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d12824464ab9274e821c6bf1325a652d",
"score": "0.62285155",
"text": "def update\n student_respond @student.update(student_params), :edit\n end",
"title": ""
},
{
"docid": "c82332d2d792f99420676f73a833f964",
"score": "0.62207115",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to(@student, :notice => 'Student was successfully updated.') }\n format.xml { head :ok }\n else\n generate_cp_map\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a823d9654342827493ca9b53fd7c3881",
"score": "0.61940706",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n format.json { render :text => '{status: \"success\", message: \"成功更新新生!\"}'}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n format.json { render :text => \"{status: 'failed', error:#{@student.errors.full_messages.to_json}}\"}\n end\n end\n end",
"title": ""
},
{
"docid": "3aeeb9f1f1a16f569c789f94612b380c",
"score": "0.6188473",
"text": "def edit_student\n\n @result = HTTParty.get(\"http://127.0.0.1:3000/students/#{params['id'].to_i}\",\n :headers => {\n 'Content-type' => \"application/json\",\n 'Accept' => 'application/json'\n } )\n @student = @result.parsed_response\n render 'edit'\n end",
"title": ""
},
{
"docid": "8420b830e2fe1f389f4909495792c548",
"score": "0.6185078",
"text": "def update\n @studentuser = Studentuser.find(params[:id])\n\n respond_to do |format|\n if @studentuser.update_attributes(params[:studentuser])\n format.html { redirect_to(@studentuser, :notice => 'Studentuser was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @studentuser.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad618e9b3ccaff157c54d642ee227093",
"score": "0.61804074",
"text": "def update\n @msstudent = Msstudent.find(params[:id])\n respond_to do |format|\n if @msstudent.update_attributes(params[:msstudent])\n format.html { redirect_to @msstudent, notice: ' Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @msstudent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a34caecfcd5b3ed7478c58f6ccbb991",
"score": "0.617797",
"text": "def update\n @student_attendance = StudentAttendance.find(params[:id])\n\n respond_to do |format|\n if @student_attendance.update_attributes(params[:student_attendance])\n format.html { redirect_to(@student_attendance, :notice => t('student_attendance.title')+\" \"+t('updated')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_attendance.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c01dbb754c41824c6db04a4692cb23cf",
"score": "0.6170142",
"text": "def update\n # params[:tudentattendance][:student_ids] ||= []\n @studentattendance = Studentattendance.find(params[:id])\n\n respond_to do |format|\n if @studentattendance.update_attributes(params[:studentattendance])\n flash[:notice] = 'Studentattendance was successfully updated.'\n format.html { redirect_to(@studentattendance) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @studentattendance.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad8b799409b3addf8c139975f3d48bd0",
"score": "0.61319554",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, :notice => 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad8b799409b3addf8c139975f3d48bd0",
"score": "0.61319554",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, :notice => 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57926f26c09142a09d9bd90047feaff1",
"score": "0.6119078",
"text": "def update\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b664a6797cb700632412474c810f27c",
"score": "0.61180425",
"text": "def update\n @studentinfo = Studentinfo.find(params[:id]) \n\n respond_to do |format|\n if @studentinfo.update_attributes(params[:studentinfo])\n format.html { redirect_to(@studentinfo, :notice => 'Studentinfo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @studentinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3af962eced8fce73d9125502fe1de0ab",
"score": "0.61178917",
"text": "def update\n @student = Student.find(params[:id])\n @student.hours = get_hours\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5804189584950869b1432444c3b76e58",
"score": "0.6115822",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b6d4185b566e9ad5d67617854104d740",
"score": "0.61156154",
"text": "def update\n @student_mostneedship = StudentMostneedship.find(params[:id])\n\n respond_to do |format|\n if @student_mostneedship.update_attributes(params[:student_mostneedship])\n format.html { redirect_to(@student_mostneedship, :notice => 'Student mostneedship was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_mostneedship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e7740bf50cd05b7f14361f925b8f1c",
"score": "0.6113643",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "628fe99c9514f7dc66aa49582fcc8afc",
"score": "0.61029",
"text": "def update\n @studentattendance = Studentattendance.find(params[:id])\n\n respond_to do |format|\n if @studentattendance.update_attributes(params[:studentattendance])\n flash[:notice] = 'Studentattendance was successfully updated.'\n format.html { redirect_to(@studentattendance) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @studentattendance.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7dd009aa3a56228261521891ead230a",
"score": "0.60885096",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to students_path, notice: 'Student was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a784538e76d69e87b95cd45f37857ad",
"score": "0.60819674",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student,\n notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors,\n status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aff4f7b72bac2342188b4c14c7f5c648",
"score": "0.6077145",
"text": "def update\n @student_attendance = StudentAttendance.find(params[:id])\n\n respond_to do |format|\n if @student_attendance.update_attributes(params[:student_attendance])\n flash[:notice] = 'StudentAttendance was successfully updated.'\n format.html { redirect_to(@student_attendance) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_attendance.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f1183f9ba31d51b610c36bc2539409a",
"score": "0.60751486",
"text": "def update\n if @student.empty?()\n json_response({success: false, message: Message.not_found('Student record')}, :unprocessable_entity)\n else\n @student.update(student_params)\n json_response({success: true, message: Message.updated_successfuly('Student record')}, :ok)\n end\n end",
"title": ""
},
{
"docid": "2d7dc4147e3e37c6fef34290d7b8d9d1",
"score": "0.6072077",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: \"El Alumno fue actualizado exitosamente.\" }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d39ac61808d49fead20f49a2c526390a",
"score": "0.6060258",
"text": "def update\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f46f08e4ce6351098cbbdd01935aa88d",
"score": "0.60601014",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1c4fa0f5214ff748bdb4ec692d4bf1d",
"score": "0.60427934",
"text": "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to [:admin, @student], :notice => 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ee832f83a9d0dd5008e0e696fbc8fdbb",
"score": "0.6030753",
"text": "def update_student\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = \"Student #{@student.name} was successfully updated.\"\n format.html { redirect_to(:action => :index) }\n else\n format.html { render :action => \"edit_student\" }\n end\n end\n end",
"title": ""
},
{
"docid": "dba74b2bf0877018f401355a917dd261",
"score": "0.60301256",
"text": "def update\n @student_check = StudentCheck.find(params[:id])\n\n respond_to do |format|\n if @student_check.update_attributes(params[:student_check])\n flash[:notice] = 'StudentCheck was successfully updated.'\n format.html { redirect_to(next_dest) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_check.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd623c4d217cf883f090f27b9499b24e",
"score": "0.60096717",
"text": "def update\n student_params.each_pair do |property,value|\n @student.send(property+'=',value)if @student.respond_to?(property+'=')\n end\n if @student.save\n set_student\n #respond_with @student\n render json: @student, status: :ok\n else\n ##render json: @student.errors, status: :unprocessable_entity\n respond_with @student.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "05fa746e1c641b476ee67d3854257172",
"score": "0.6009222",
"text": "def update\n @student = Student.find(params[:id])\n begin\n if @student.update_attributes(params[:student])\n respond_with(@student) do |format|\n format.json{render json: @student}\n end\n else\n respond_with @student, status: :unprocessable_entity\n end\n rescue Errno::EACCES\n render status: :internal_server_error, json: {\n errors: {\n dummy_attr: ['The user running the Rails process can\\'t write to the uploads directory.']\n }\n }\n end\n end",
"title": ""
},
{
"docid": "0e1cc287d7e66ecf4cf576baea9ea2fc",
"score": "0.5998485",
"text": "def update\n @student_experience = StudentExperience.find(params[:id])\n\n respond_to do |format|\n if @student_experience.update_attributes(params[:student_experience])\n format.html { redirect_to(@student_experience, :notice => 'Student experience was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_experience.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0b7e609d65565a321b357a98710c957",
"score": "0.5994584",
"text": "def update\n @student = Student.find(params[:id])\n respond_to do |format|\n if @student.update(validate_params)\n # format.html { redirect_to dojo_student_url, notice: 'Student was successfully updated.' }\n format.html { redirect_to \"/dojo/#{params[:dojo_id]}/students/#{params[:id]}\", notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b58ca1f7777a3fe64261f0eee4f2ed1f",
"score": "0.59766525",
"text": "def update\n if(current_user.role == \"guest\")\n redirect_to login_url and return\n end\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53483e4da331393e3bfcdd2b299cfc98",
"score": "0.597031",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Estudando atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9153234011d8d2e0401a88418eaffb9a",
"score": "0.5963877",
"text": "def update\n @leave_request = LeaveRequest.find(params[:id])\n\n respond_to do |format|\n if @leave_request.update_attributes(params[:leave_request])\n flash[:notice] = 'LeaveRequest was successfully updated.'\n format.html { redirect_to(@leave_request) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @leave_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "381651904a5fa489858378460a96383b",
"score": "0.59594786",
"text": "def update\n @student.update(student_params)\n end",
"title": ""
},
{
"docid": "c0c7b9f1d65cfb351ab6d2678a430f9f",
"score": "0.5953902",
"text": "def update\n \n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d460fb7b35c6f0a932808fb17851b9f",
"score": "0.59521705",
"text": "def update\n respond_to do |format|\n if committee.save\n format.html { redirect_to(committee, flash: { success: \"Committee updated.\" }) }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: committee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73030ee489e4ba493e427005e8c858f5",
"score": "0.59457725",
"text": "def update\n @studentorg = Studentorg.find(params[:id])\n\n respond_to do |format|\n if @studentorg.update_attributes(params[:studentorg])\n format.html { redirect_to @studentorg, notice: 'Studentorg was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @studentorg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21219d8b2585965d72df2f8d54065423",
"score": "0.5944962",
"text": "def update\r\n unless ( params[:students].blank? ) \r\n @course.students_ids = params[:students]\r\n end\r\n respond_to do |format|\r\n if @course.update(course_params)\r\n format.html { redirect_to @course}\r\n format.json { render :show, status: :ok, location: @course}\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @course.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "9b0204dbf2d0c2a65983e97ed55a14bc",
"score": "0.5942766",
"text": "def update\n respond_to do |format|\n if @stay_has_student.update(stay_has_student_params)\n format.html { redirect_to @stay_has_student, notice: 'Stay has student was successfully updated.' }\n format.json { render :show, status: :ok, location: @stay_has_student }\n else\n format.html { render :edit }\n format.json { render json: @stay_has_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f0e2b984545641f1ede1b209b766e67",
"score": "0.5939849",
"text": "def update\n\t\t@student = Student.find(params[:id])\n @student.update(student_params)\n redirect_to '/students'\n\tend",
"title": ""
},
{
"docid": "762277a91c595ee5814d6cd7ccc7cb1d",
"score": "0.5939373",
"text": "def update\n \n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to students_url, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4bf39fdc6fa2869c3361d11f7e03fce",
"score": "0.5936242",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4bf39fdc6fa2869c3361d11f7e03fce",
"score": "0.5936242",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4bf39fdc6fa2869c3361d11f7e03fce",
"score": "0.5936242",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4bf39fdc6fa2869c3361d11f7e03fce",
"score": "0.5936242",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4bf39fdc6fa2869c3361d11f7e03fce",
"score": "0.5936242",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2a8630129890a80e84e11afe8d9ec89",
"score": "0.5934657",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Estudiante actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1988f2ef1f51512708ce4e71d723fb42",
"score": "0.5926696",
"text": "def update\n @stes_e = StesE.find(params[:id])\n\n respond_to do |format|\n if @stes_e.update_attributes(params[:stes_e])\n format.html { redirect_to :controller => :edit, :action => :index }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stes_e.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f73675ba2b1cf796a5164358c58b1264",
"score": "0.59265244",
"text": "def update\n respond_to do |format|\n if @sw_dev_has_student.update(sw_dev_has_student_params)\n format.html { redirect_to @sw_dev_has_student, notice: 'Sw dev has student was successfully updated.' }\n format.json { render :show, status: :ok, location: @sw_dev_has_student }\n else\n format.html { render :edit }\n format.json { render json: @sw_dev_has_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93a59a5fb183574295a1e567ad1c5170",
"score": "0.59238577",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: \"Student was successfully updated.\" }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93a59a5fb183574295a1e567ad1c5170",
"score": "0.59238577",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: \"Student was successfully updated.\" }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93a59a5fb183574295a1e567ad1c5170",
"score": "0.59238577",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: \"Student was successfully updated.\" }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52760f231ee8ba3c2d5733abe3f94527",
"score": "0.59236854",
"text": "def update\n @student_been2othership = StudentBeen2othership.find(params[:id])\n\n respond_to do |format|\n if @student_been2othership.update_attributes(params[:student_been2othership])\n format.html { redirect_to(@student_been2othership, :notice => 'Student been2othership was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_been2othership.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "389d063af45ca4ad77f82d7283ef27da",
"score": "0.592188",
"text": "def update\n @student_schedule = StudentSchedule.find(params[:id])\n\n respond_to do |format|\n if @student_schedule.update_attributes(params[:student_schedule])\n flash[:notice] = 'StudentSchedule was successfully updated.'\n format.html { redirect_to(@student_schedule) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "45b29e0dd401b4067e8afbe893709a01",
"score": "0.5919677",
"text": "def update\n #remove program field in params\n if !params[:student][:registrations_attributes].nil?\n params[:student] ||= {}\n params[:student][:registrations_attributes] ||= []\n params[:student][:registrations_attributes].each { |key, value| value.shift}\n end\n puts params[:student]\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e65c5213263a899751acd2afd60ec70d",
"score": "0.59174",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to action: :index, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "542c318d516901d856618591035b0af6",
"score": "0.59155047",
"text": "def update\n # @student_parent_occupation = StudentParentOccupation.find(params[:id])\n\n respond_to do |format|\n if @student_parent_occupation.update_attributes(params[:student_parent_occupation])\n format.html { redirect_to @student_parent_occupation, notice: 'Student parent occupation was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_parent_occupation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04c62e364ca1def39c6ba4e7cc27cf5",
"score": "0.5914594",
"text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
c4736d8d29e543cd4bbb1e1058cb6a83
|
strong parameters is mandatory in rails4 see for details
|
[
{
"docid": "715aea41acd7a1f06ead4623c1e6ee88",
"score": "0.0",
"text": "def configure_permitted_parameters\n sign_up_vars = [:email, :password, :password_confirmation, :current_password, :address, :name,\n :address, :phone, :skype, :aim, :yim, :jabber, :latitude, :longitude]\n\n devise_parameter_sanitizer.for(:account_update) {|u| u.permit(sign_up_vars) }\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(sign_up_vars) }\n\n end",
"title": ""
}
] |
[
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.7918364",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.74791867",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.72640216",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "28bd714f0d790bda0a4b0777c5bfce0c",
"score": "0.72617716",
"text": "def user_params\n params.require(:user).permit(STRONG_PARAMETERS)\n end",
"title": ""
},
{
"docid": "4cb6b420ccf4e2f2027b7370cfbc6e3e",
"score": "0.7085793",
"text": "def basic_form_params\n params.require(:basic_form).permit!\n end",
"title": ""
},
{
"docid": "8bbb609f383b5c67c72a664691cafcff",
"score": "0.70476246",
"text": "def model_params\n\t\tparams.require(:volunteer).permit(\n\t\t\t:msu_id,\n :first_name,\n :last_name,\n :email,\n :phone,\n \t\t:ref_instructor,\n :task_id\n\t\t\t)\n\tend",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.701473",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "c7ce57355080ceab91e908069284b3a0",
"score": "0.7010704",
"text": "def user_strong_params\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n end",
"title": ""
},
{
"docid": "e46d6b90d1d0200ce0605e3d9b9215ba",
"score": "0.6968217",
"text": "def student_params\n #params.require(:student).permit(:firstName, :lastName, :emailId, :emergencyContact, :mailingAddress)\n #params.require(:student).permit(:firstName, :lastName, :emailId, :mailingAddress, \n #:emergencyContact, :password_digest, :middleName, :mobileNo, :)\n params.require(:student).permit!\n end",
"title": ""
},
{
"docid": "9be9fde6b8502bcb79d4172b205b7114",
"score": "0.69583315",
"text": "def book_params\n\t\t\t\tparams[:book].permit!\n\t\t\tend",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.6940981",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "c0844301e56cb25428d0d295bfa7023d",
"score": "0.69025797",
"text": "def transaction_params\n params.require(:transaction).permit()\n end",
"title": ""
},
{
"docid": "c7b1dfb09e7688ad840523cd982d42a7",
"score": "0.68949914",
"text": "def transaction_params\n params.require(:transaction).permit!\n end",
"title": ""
},
{
"docid": "032773b3a12aee5407b5bbe968819b3e",
"score": "0.68912506",
"text": "def user_parameters\n params.require(:user).permit(:name,:email)\nend",
"title": ""
},
{
"docid": "bd86a1cd04b7030021df8036b13a672b",
"score": "0.6866664",
"text": "def backend_news_params\n params.require(:backend_news).permit!\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.68605465",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "9ceae3892a8ff0961a65fc980069d473",
"score": "0.685525",
"text": "def company_params\n\t params.permit(\n\t \t:user_id,\n\t \t:company_notes, \n\t \t:twitter_handle, \n\t \t:phone_number,\n\t \t:address,\n\t \t:name, \n\t \t)\n\t end",
"title": ""
},
{
"docid": "592649062aae68c20158a7b7a2c90b4c",
"score": "0.68550503",
"text": "def article_params\n\t\t\t\tparams.require(:article).permit(:title, :text,:user_id)\n\t\tend",
"title": ""
},
{
"docid": "e948caab1f2a27578a47bb4229545548",
"score": "0.6840769",
"text": "def student_params\n params.require(:student).permit( :student_id, :student_classroom, :teacher_of_student, :student_name, :alergy )\n end",
"title": ""
},
{
"docid": "06b954bfafd8ff54a81c3c0f94b83858",
"score": "0.68357754",
"text": "def stud_params\r\n\t\t# the parameters require obj student to exist and allowing all which are written to be save to the obj later on\r\n\t\tparams.require(:student).permit(:name, :email, :password, :password_confirmation)\r\n\tend",
"title": ""
},
{
"docid": "cfd33eebddc64500b944557414449fe9",
"score": "0.6825641",
"text": "def user_params\n #params.fetch(:user, {})\n params.require(:user).permit!\n end",
"title": ""
},
{
"docid": "1f387e53ad2094b715162fd09b07184c",
"score": "0.6822608",
"text": "def basic_params\n p 'got to params fxn'\n params.require(:basic).permit(:name, :age, :sex, :classs, :race, :height)\n end",
"title": ""
},
{
"docid": "ea00b668336826b5d4c3eb0c5a33cb4a",
"score": "0.68179727",
"text": "def transferencia_params \n #params.require(:transferencia).permit(:fecha, :area_id, :deposito_id)\n params.require(:transferencia).permit! \n end",
"title": ""
},
{
"docid": "c8a354b3213fd1102429964c133f9f88",
"score": "0.6817919",
"text": "def booking_transaction_params\n \nparams.require(:booking_transaction).permit(:booking_id,:amount,:details)\n end",
"title": ""
},
{
"docid": "8c24addb7d1357e7f8344dac68428204",
"score": "0.6812755",
"text": "def user_params\n #params.require(:user).permit(:email, :password)\n params.require(:user).permit(:name, :password)\n end",
"title": ""
},
{
"docid": "2e73865da9580253de1f86491bee2403",
"score": "0.6803827",
"text": "def hr_ent_talent_params\n params.require(:hr_ent_talent).permit! if params[:hr_ent_talent]\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.68023837",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "4a90afe21414f2d495bd2e0c8a1698ab",
"score": "0.6801683",
"text": "def article_params\n\t\t\tparams.require(:article).permit(:title, :text,:user_id)\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6796874",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6796874",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "ca6419335e0def563dcffd6184ca1e7b",
"score": "0.6795528",
"text": "def user_params # we want to require a strong params hash to have :user attribute, and to permit name, email, password, password_confirmation\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n end",
"title": ""
},
{
"docid": "fed6e5f6581fc3a6bc945330c40b3526",
"score": "0.67934734",
"text": "def strong_params(*args)\n #byebug\n params.require(controller_name.singularize.to_sym).permit(*args)\n end",
"title": ""
},
{
"docid": "93a76f8dedab1009b762fc108221f885",
"score": "0.67930645",
"text": "def user_attributes\n params.require(:user).permit! \n end",
"title": ""
},
{
"docid": "19ae929435b5eeccd5854386e02098e0",
"score": "0.6791328",
"text": "def user_params\n \tparams.require(:user).permit(:name,:dob,:avatar,:role,:password,:password_confirmation,:university_id,:email,hobbies_attributes:[:hobby,:_destroy,:id],qualifications_attributes:[:stream,:subject,:completed,:_destroy,:id])\n end",
"title": ""
},
{
"docid": "5c019fc2762bcdf0e87a0c8045e251e3",
"score": "0.67880094",
"text": "def generic_model_params\n params.require(:generic_model).permit(:user_id)\n end",
"title": ""
},
{
"docid": "f9f35655e2606c78be5beb4e7c128a53",
"score": "0.67845136",
"text": "def article_params\n\t\tparams.require(:article).permit(:title, :body) #only these parameters are allowed to be submitted by user.\n\tend",
"title": ""
},
{
"docid": "c429c6dca45292d9f38f8565ede8c9eb",
"score": "0.6783078",
"text": "def user_params\n \tparams.require(:user).permit(:id)\n end",
"title": ""
},
{
"docid": "5e4f170c38a054d903894c61551687a3",
"score": "0.678236",
"text": "def student_params\n params.require(:student).permit!\n end",
"title": ""
},
{
"docid": "855c1be29f9da660a1bd7c52cef6e51a",
"score": "0.6779479",
"text": "def legacy_params\n params.require(:legacy).permit(:age,:gender, :relationship_status, :smoker, :coverage_amount, :insurance_years,:monthly_amount,owner_attributes: [:id, :name, :dob,:snn,:adress,:lisence,:exp,:government,:job_title,:salary,:date_of_hire,:legacy_id,:_destroy,beneficiaries_attributes: [:id, :name,:dob,:relation,:owner_id,:_destroy]])\n end",
"title": ""
},
{
"docid": "6e3e07fd1cd8f619336139cf93e15561",
"score": "0.67794085",
"text": "def user_params\n params.required(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.6776635",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6774975",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "d1f08247e6a64d4a30c228e93e7d42ab",
"score": "0.6773803",
"text": "def user_params\n params.permit(:name, :lastname,:phone_number, :carrer, :is_professor, :email,:user,:password, :id )\n end",
"title": ""
},
{
"docid": "0071ad5c765d1ab16bfe44a278f15fdd",
"score": "0.6771096",
"text": "def student_params\n # TODO: change!\n # params.require(:person).permit(:title_id, :first_name, :last_name, :birth_name, :complete_name, :birth_date)\n params.require(:student).permit!\n end",
"title": ""
},
{
"docid": "8e54eaded22dd280d836e96375fed9a4",
"score": "0.6770287",
"text": "def paramun_params\n params.require(:parametre).permit!\n end",
"title": ""
},
{
"docid": "733ebd3068a573c4e07bfbde475582a9",
"score": "0.67693174",
"text": "def activity_strong_params\n params.require(:activity).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "36175c820060d06ff1142c31b3dd05ac",
"score": "0.6758654",
"text": "def get_params\r\n #params.require(:symptom).permit(:name, :part_id, :feel_id)\r\n params.require(:symptom).permit!\r\n end",
"title": ""
},
{
"docid": "ce187fa6dece125b48b43dd64397cdb6",
"score": "0.6756956",
"text": "def field_params\n params.permit(:id, :name, :data_type, :default_value, :auto_increment, :allow_null, :table_id, \n :validate_on,\n :acceptance,\n :format,\n :format_type,\n :presence,\n :uniqueness,\n :case_sensitive,\n :confirmation,\n :length,\n :length_min,\n :length_max,\n :length_is,\n )\n end",
"title": ""
},
{
"docid": "1332c2aa3168bbdee5dbfece6b633e87",
"score": "0.67541003",
"text": "def article_params #often factored out into its own method so it can be reused by multiple actions in same controller (e.g. create/update)\n\t\t\tparams.require(:article).permit(:title, :text) #we want to both allow and require title and text parameters for valid use of create\n\t\tend",
"title": ""
},
{
"docid": "c3c8a2e0adecbd6731a5fa3799486d7b",
"score": "0.67511964",
"text": "def book_params\n params.require(:book).permit(:book_id, :book_name,:book_desc, :book_category, :book_avail_in_lib,:book_damaged,:from_edit)\n end",
"title": ""
},
{
"docid": "64ea65f903dbe0c9c0cc0e9a20ed2e7f",
"score": "0.67459244",
"text": "def good_option_params\n permit_params\n end",
"title": ""
},
{
"docid": "d5d8978170975b7a78691a23053b4237",
"score": "0.6745104",
"text": "def user_params\n #params.require(:user).permit(:stuid, :email, :password, :password_confirmation, :name, :gender_id, :contact, :society_id, :proverb, :avatar)\n params.require(:user).permit!\n\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6743699",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "69e58fdee13b0a02a6f7cde0d9a0d257",
"score": "0.67400855",
"text": "def user_params_validator\n \t\tparams.require(:user).permit(:name, :email,:password,:password_confirmation)\n \tend",
"title": ""
},
{
"docid": "2707862d7adddbb19d513e93a6daf28d",
"score": "0.67388195",
"text": "def user_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "371f1b76a5914e73e913359620e13aed",
"score": "0.67383635",
"text": "def Person_params\n params.require(:Person).permit(:name, :age, :birthdate)\nend",
"title": ""
},
{
"docid": "fb5a8c51668834d75ca65f4d425a949f",
"score": "0.6736764",
"text": "def book_params\n params.require(:book).permit(:book_name, :company_id)\n end",
"title": ""
},
{
"docid": "c8c77859df9e3d2e0f69df8eb3a82191",
"score": "0.6734179",
"text": "def user_params\n params.require(:user).permit(:id)\n end",
"title": ""
},
{
"docid": "ff6f55caa994e4876f1d0797af27a8a4",
"score": "0.67337954",
"text": "def user_params\n \n #Note:This code returns a version of the params \n #hash with only the permitted attributes (while raising \n #an error if the :user attribute is missing).\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.6732587",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "2f3ae517611130e77cfc59be153bf71e",
"score": "0.6731452",
"text": "def student_params\n params.require(:student).permit!\n end",
"title": ""
},
{
"docid": "4a73627488883aa48695d4d53a3aabb9",
"score": "0.6729955",
"text": "def user_basic_params()\n return params.require(:User).permit(:firstName, :lastName, :email)\n end",
"title": ""
},
{
"docid": "e8c016b06b0b461a5abbdbd98f7029a2",
"score": "0.67282146",
"text": "def user_params\n params.require(:user).permit(:username,\n \t\t\t\t\t\t\t :password,\n \t\t\t\t\t\t\t :email)\n end",
"title": ""
},
{
"docid": "adfc4cd05d0e5fe84e0bb5e377325cc6",
"score": "0.6725907",
"text": "def user_params\n \tparams.require(:user).permit(:first_name,:last_name,:email, :date_of_birth,:active, :phone_no, :mobile_no)\n end",
"title": ""
},
{
"docid": "5799e8878295d794b2cf055dce08b4e7",
"score": "0.6723223",
"text": "def entertainment_params\n params.require(:entertainment).permit(:title, :description, :black, :photo, :title2, :description2)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.6720254",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "6427d1780ca090f416b60a9b18261b3c",
"score": "0.67182696",
"text": "def model_basic_params\n params.require(:model_basic).permit(:title, :post, :date)\n end",
"title": ""
},
{
"docid": "f2d51c7b280d77e0158d6f28ddd71ee9",
"score": "0.67128706",
"text": "def user_params\n params.require(:user).permit(:name, :lastname, :age, :phone)\n end",
"title": ""
},
{
"docid": "8155e3d9f10e71dabcc279d628b03d1f",
"score": "0.6708889",
"text": "def standard_params\r\n params.require(:standard).permit(:name, :phone)\r\n end",
"title": ""
},
{
"docid": "d0e5a71c845ff5be429b4b40ae1ede65",
"score": "0.67068744",
"text": "def user_params \n params.require(:user).permit(:id, :name, :email, :password)\n end",
"title": ""
},
{
"docid": "cf90576a76562b8e627267fcf4d3cef9",
"score": "0.6703978",
"text": "def overseas_student_params\n params.permit(:code, :name, :phone,:relationship, :contact_name, :contact_phone,:background,:student_status,:comment, :fllow_up_status)\n end",
"title": ""
},
{
"docid": "d8f79764f04fbe2398c18f286942505a",
"score": "0.67008746",
"text": "def simple_params\n params.require(:simple).permit(:title, :body)\n end",
"title": ""
},
{
"docid": "3bae1eb5069a45b475f211c2eba16030",
"score": "0.6700449",
"text": "def application_form_params\n params.require(:application_form).permit(:name, :contact_no, :email, :message, :are_you_nit_rourkela_student, :opening_id)\n end",
"title": ""
},
{
"docid": "3309a73a0b0ec536f40f518fda40030c",
"score": "0.6699733",
"text": "def some_model_params\n params.require(:some_model).permit(:name)\n end",
"title": ""
},
{
"docid": "bc98eebd04c043a4da694ce6780b146c",
"score": "0.6695454",
"text": "def other_model_params\n params.require(:other_model).permit(:name)\n end",
"title": ""
},
{
"docid": "956f84d357486e1aafda24a9b65f389d",
"score": "0.66937304",
"text": "def article_params \n #params.require(:MODEL).permit(:WHITELISTED_MODEL_ATTRIBUTES)\n params.require(:article).permit(:title, :author, :text)\n end",
"title": ""
},
{
"docid": "d7b4753824806eca76b548a30e3351b6",
"score": "0.6692619",
"text": "def model_params\n params.require(variable_symbol).permit(*permitted_parameters)\n end",
"title": ""
},
{
"docid": "eb4803d0064674013da639a7b0f72ac6",
"score": "0.6687502",
"text": "def user_params\n\t params.require(:user).permit(:name)\n\t end",
"title": ""
},
{
"docid": "da9e84ee4071beec19d875eaa146f6f5",
"score": "0.66871107",
"text": "def model_params\n params.require(model).permit(:username, :fname, :lname, :email, :password)\n end",
"title": ""
},
{
"docid": "819ce8887b507ca56b787826ab6b2f94",
"score": "0.6686848",
"text": "def good_params\n params.require(:good).permit(:receiver_name, :receiver_address, :receiver_phone, :sender_name, :sender_address, :sender_phone, :mass, :pay_id, :pay_type, :who_pay,:status)\n end",
"title": ""
},
{
"docid": "76dd1bcfce0faf36b59ced55cb11be04",
"score": "0.66867346",
"text": "def book_params\n params.require(:book).permit(:title, :author)\n end",
"title": ""
},
{
"docid": "759376db2cd5e69316fec96523e4b755",
"score": "0.66864675",
"text": "def student_params\n params.require(:student).permit(:name, :age, :gender)\n end",
"title": ""
},
{
"docid": "ab76ba841b5611b7c2fe3803fce59ce6",
"score": "0.66839576",
"text": "def person_params\n\t params.require(:person).permit(:name, :age)\n\t end",
"title": ""
},
{
"docid": "95d8574403f65a90fc33a42e6c17ac7d",
"score": "0.667964",
"text": "def required_params\n\t\t\t@required_params ||= {}\n\t\tend",
"title": ""
},
{
"docid": "d4a56d2e9918198739d0ee0a186a35c1",
"score": "0.6677126",
"text": "def user_params\n permitted_params = [:email, :password, :password_confirmation, :first_name, :last_name, :username, :document_type, :document_number, :phone, :address, :image, :remove_image]\n permitted_params += [:role, :supplier_id] unless is_me? and !god?\n params.require(:user).permit(*permitted_params)\n end",
"title": ""
},
{
"docid": "42f7ba2c9a02af3536e48bda85614bae",
"score": "0.66766834",
"text": "def user_params\n\t\t\t#Strong Params\n\t\t\t#Require de una table user con un nombre, nombre de usuario y el email\n\t\t\t#No hay mas parametros en el formulario rechaza la custom_sign_up\n\t\t\tparams.require(:user).permit(:name,:username,:email)\n\t\tend",
"title": ""
},
{
"docid": "137bc7a745df1e2cba29ef3a0a0b2b24",
"score": "0.66706115",
"text": "def model_params\n params.require(:model).permit(\n :ref,\n :name,\n :category_id,\n :description,\n :is_deal,\n :discount,\n :price,\n :deal_price,\n :enabled,\n )\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.66672236",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.66672236",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "be409cbb47f313fc062da421d0cb87b5",
"score": "0.66662335",
"text": "def book_params \n\t\t\tparams.require(:book).permit(:title, :author, :synopsis, :year)\n\t\tend",
"title": ""
},
{
"docid": "65ad69116a60707b8dfde5a20e7af888",
"score": "0.6664279",
"text": "def book_params\n params.require(:book).permit(:title, :price,:user_id)\n end",
"title": ""
},
{
"docid": "72a2722e4f1c007566e58059864c41f3",
"score": "0.66642153",
"text": "def permit_params\n params.require(:permit).permit(:permit_number, :permit_expiration_date, :training_completion_date, :status, :valid, :beacon_id)\n end",
"title": ""
},
{
"docid": "72a2722e4f1c007566e58059864c41f3",
"score": "0.66642153",
"text": "def permit_params\n params.require(:permit).permit(:permit_number, :permit_expiration_date, :training_completion_date, :status, :valid, :beacon_id)\n end",
"title": ""
},
{
"docid": "8e935216f7c763601cd5538c3ce1a6c6",
"score": "0.6662835",
"text": "def usuario_params\n #params.require(:usuario)\n #params.require(:nombre)\n params.permit(:usuario, :nombre, :apellido, :twitter)\n end",
"title": ""
},
{
"docid": "559ee65b32248612b8ce462342aed10a",
"score": "0.666243",
"text": "def primary_model_params\n params.require(:primary_model).permit(:name)\n end",
"title": ""
},
{
"docid": "c19c8590e8de75ff62aab439ed306a11",
"score": "0.6662104",
"text": "def book_params\n params.require(:book).permit(:title, :author)\n end",
"title": ""
},
{
"docid": "8ba2ffc0dca89a6daa3b5704c34f1685",
"score": "0.66615397",
"text": "def student_params\n params.permit(:first_name, :last_name, :andrew_id, :active)\n end",
"title": ""
},
{
"docid": "8c5dc7d54f4c2078a8d64afead3c16cf",
"score": "0.66600674",
"text": "def user_params\r\n nested_keys_info = params.require(:user).fetch(:user_information_attributes, {}).keys\r\n nested_keys_assets = params.require(:user).fetch(:assets_attributes, {}).keys\r\n params.require(:user).permit(:name,:user_information_attributes => nested_keys_info,:assets_attributes => nested_keys_assets)\r\n end",
"title": ""
},
{
"docid": "a3897d1b80be782ad268908d50ade450",
"score": "0.66595006",
"text": "def hr_ent_car_params\n params.require(:hr_ent_car).permit! if params[:hr_ent_car]\n end",
"title": ""
},
{
"docid": "57e278a2057fd632c5233b55dde1188e",
"score": "0.6659328",
"text": "def student_params\n params.require(:student).permit(:name)\n end",
"title": ""
},
{
"docid": "091c25f60da405806f48bf7b9325ede0",
"score": "0.6658846",
"text": "def student_information_params\n params.require(:student_information).permit(:first_name, :last_name, :dob)\n\n # params.permit(:first_name, :last_name, :dob, :course_choice_id)\n end",
"title": ""
}
] |
2cdc2f7a2a3bac815283c7583a59e3f3
|
PATCH/PUT /career_fields/1 PATCH/PUT /career_fields/1.json
|
[
{
"docid": "c43fa13c2da891555ec7045f5df75a5b",
"score": "0.71157354",
"text": "def update\n respond_to do |format|\n if @career_field.update(career_field_params)\n format.html { redirect_to @career_field, notice: 'Career field was successfully updated.' }\n format.json { render :show, status: :ok, location: @career_field }\n else\n format.html { render :edit }\n format.json { render json: @career_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "a5c71b42de2d9c2b2c5159a57bd20dd2",
"score": "0.6784346",
"text": "def update\n @career.update(career_params)\n head :no_content\n end",
"title": ""
},
{
"docid": "fe8feac8d1f0ebcc4841d02e9c8de2fc",
"score": "0.65630776",
"text": "def UpdateField params = {}\n \n APICall(path: 'ticket_fields.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "70bd60c2eeba51ce1e37d67485abe579",
"score": "0.6447032",
"text": "def update\n @office_career.update(office_career_params)\n head :no_content\n end",
"title": ""
},
{
"docid": "0a436c6144a388f9f1fd84317da30c9c",
"score": "0.6422079",
"text": "def update\n respond_to do |format|\n if @career.update(career_params)\n format.html { redirect_to university_career_path(@university, @career), notice: 'Career was successfully updated.' }\n format.json { respond_with_bip(@career) }\n else\n format.html { render :edit }\n format.json { respond_with_bip(@career) }\n end\n end\n end",
"title": ""
},
{
"docid": "58b14f58aa079fb568524d4c02041972",
"score": "0.6415041",
"text": "def update\n respond_to do |format|\n if @api_v1_initiative_field.update(api_v1_initiative_field_params)\n format.html { redirect_to @api_v1_initiative_field, notice: 'Initiative field was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_field }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f7695554316cd28127c2a028c409b62",
"score": "0.6254508",
"text": "def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "130ebf080298cc1c727a1bcf4a9f0420",
"score": "0.6248528",
"text": "def update\n puts field_params\n respond_to do |format|\n if @field.update(field_params)\n format.html { redirect_to fields_path, notice: 'Field was successfully updated.' }\n format.json { render :show, status: :ok, location: @field }\n else\n format.html { render :edit }\n format.json { render json: @field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60148e679a498ae8bccfb8e7414fc7c6",
"score": "0.6239225",
"text": "def update\n respond_to do |format|\n if @field.update(field_params)\n format.html { redirect_to [@magazine,@issue, @field], notice: 'Field was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f60ef9a5d31c29e433181925527f6de9",
"score": "0.6193265",
"text": "def update\n @field = Field.find(params[:id])\n\n respond_to do |format|\n if @field.update_attributes(params[:field])\n format.html { redirect_to @field, notice: 'Field was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6d32184b4857ebc02aee53648a6f47a",
"score": "0.6173607",
"text": "def update\n respond_to do |format|\n if @field.update(form_field_params)\n format.html { redirect_to [@company, @form, @group, @field], notice: 'Form field was successfully updated.' }\n format.json { render :show, status: :ok, location: [@company, @form, @group, @field] }\n else\n format.html { render :edit }\n format.json { render json: @field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd065ddb12067a3cd2276b70e9448a86",
"score": "0.6155918",
"text": "def update\n respond_to do |format|\n if @filed.update(field_params)\n format.html { redirect_to @field, notice: 'Successfully updated.' }\n format.json { render :show, status: :ok, location: @field }\n else\n format.html { render :edit }\n format.json { render json: @field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74deb93c71e4cd3ec8d929ef8a9512a6",
"score": "0.6155397",
"text": "def update\n respond_to do |format|\n if @career.update(career_params)\n format.html { redirect_to @career, notice: 'La Facultad ha sido actualizada satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @career }\n else\n format.html { render :edit }\n format.json { render json: @career.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6773fde81b647767ce22668905487d4",
"score": "0.6153817",
"text": "def update\n respond_to do |format|\n if @career.update(career_params)\n format.html { redirect_to careers_path, notice: 'Career was successfully updated.' }\n format.json { render :show, status: :ok, location: @career }\n else\n format.html { render :edit }\n format.json { render json: @career.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b177337829b653b54a55abfe7b0052f",
"score": "0.6112492",
"text": "def update\n respond_to do |format|\n if @career.update(params[:career].permit!)\n flash[:success] = \"更新成功!\"\n format.html { redirect_to admin_careers_url }\n else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "d96412644ae165c16ea066b6fcb5367f",
"score": "0.61095214",
"text": "def update\n respond_to do |format|\n if @resource_type.update_attributes(params[:resource_type])\n if params[:fields]\n params[:fields].each do |param|\n if param[:id]\n @field = Field.find(param[:id])\n @field.update_attributes(\n :name => param[:name], \n :field_type_id => param[:field_type_id],\n :resource_type_id => params[:id],\n :resource_type_reference_id => param[:resource_type_reference_id]\n )\n else\n @field = Field.create(\n :name => param[:name],\n :field_type_id => param[:field_type_id],\n :resource_type_id => params[:id],\n :resource_type_reference_id => param[:resource_type_reference_id]\n )\n end\n if @field.field_validations.any?\n @field.field_validations.each { |v| v.destroy }\n end\n if param[:validator_ids]\n param[:validator_ids].each do |index|\n next if index == \"multiselect-all\"\n @field.field_validations.build(validator_id: index.to_i)\n end\n end \n @field.save\n end\n end \n format.html { redirect_to @resource_type, notice: 'Resource type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4db08db7bd111f5fbda9fa36805f96e7",
"score": "0.6107663",
"text": "def update\n set_field\n # byebug\n if @field.update(fields_params)\n render :json => {}\n else\n render :json => @subject.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "91e82577dfbd820fe3d8772a9446bd49",
"score": "0.6068947",
"text": "def update\n @career_specialty = CareerSpecialty.find(params[:id])\n\n respond_to do |format|\n if @career_specialty.update_attributes(params[:career_specialty])\n format.html { redirect_to @career_specialty, notice: 'Career specialty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @career_specialty.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c2ccce1e28036e5137986728cfca669",
"score": "0.6057687",
"text": "def update\n respond_to do |format|\n if @palliative_care.update(palliative_care_params)\n format.html { redirect_to @palliative_care, notice: 'Palliative care was successfully updated.' }\n format.json { render :show, status: :ok, location: @palliative_care }\n else\n format.html { render :edit }\n format.json { render json: @palliative_care.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5dc32012fac4ff57172add3a79a93941",
"score": "0.60461223",
"text": "def update\n respond_to do |format|\n if @company_field.update(company_field_params)\n format.html { redirect_to @company_field, notice: 'Company field was successfully updated.' }\n format.json { render :show, status: :ok, location: @company_field }\n else\n format.html { render :edit }\n format.json { render json: @company_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95cda3d49b5d9c5f20743412a4575740",
"score": "0.6034771",
"text": "def update\n respond_to do |format|\n if @applicant_field_of_study.update(applicant_field_of_study_params)\n format.html { redirect_to applicant_field_of_studies_url, notice: 'Applicant field of study was successfully updated.' }\n format.json { render :show, status: :ok, location: @applicant_field_of_study }\n else\n format.html { render :edit }\n format.json { render json: @applicant_field_of_study.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47ce8a98158d6262d2ea4a83890fbe07",
"score": "0.60326064",
"text": "def update\n respond_to do |format|\n if @caregiver.update(caregiver_params)\n format.html { redirect_to @caregiver, notice: 'Caregiver was successfully updated.' }\n format.json { render :show, status: :ok, location: @caregiver }\n else\n format.html { render :edit }\n format.json { render json: @caregiver.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a24f8c2f244eda7b01d0f185db1c38f4",
"score": "0.6029166",
"text": "def update\n if field_params[:as] =~ /pair/\n @field = CustomFieldPair.update_pair(params).first\n else\n @field = Field.find(params[:id])\n @field.update_attributes(field_params)\n end\n\n respond_with(@field)\n end",
"title": ""
},
{
"docid": "7917ab5df69a9ead810e83b07fc1f415",
"score": "0.60073966",
"text": "def update\n respond_to do |format|\n if @info_self_care.update(info_self_care_params)\n format.html { redirect_to @info_self_care, notice: 'Info self care was successfully updated.' }\n format.json { render :show, status: :ok, location: @info_self_care }\n else\n format.html { render :edit }\n format.json { render json: @info_self_care.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8edb584e7860edade5f6c2c794a01a9",
"score": "0.5970079",
"text": "def update\n @patient = Patient.find(params[:patient_id]) \n @managed_care = ManagedCare.find(params[:id])\n @managed_care.updated_user = current_user.login_name\n @subscriber = @patient.subscribers.all\n @providers = @patient.providers\n @groups = @patient.groups \n \n respond_to do |format|\n if @managed_care.update_attributes(params[:managed_care])\n format.html { redirect_back_or_default patient_managed_cares_path(:patient_id =>params[:patient_id]), notice: 'Managed care was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @managed_care.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8635c5a817e54f0268ce79ea3728880d",
"score": "0.59664357",
"text": "def update\n if @care_plan.update(care_plan_params)\n render json: @care_plan, status: :ok, location: @care_plan\n else\n render json: @care_plan.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "13beabbf57e5b2039078984571c4b5bf",
"score": "0.5958162",
"text": "def update\n @schema_field = SchemaField.find(params[:id])\n\n respond_to do |format|\n if @schema_field.update_attributes(params[:schema_field])\n format.html { redirect_to @schema_field, :notice => 'Schema field was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @schema_field.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.59515125",
"text": "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"title": ""
},
{
"docid": "2a130d19eef11b16673723667ceda44e",
"score": "0.5931481",
"text": "def update\n respond_to do |format|\n if @formulary.update(formulary_params)\n format.html { redirect_to formularies_url, alert: I18n.t('activerecord.models.formulary') + I18n.t('helpers_locale.models.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @formulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "edb4a6fc7862f3870cc269b8bf601076",
"score": "0.5926034",
"text": "def update_api_fields\n service_response = ClientManagement::UpdateApiFields.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "aa39beffdeb203f0de232cf8a0c68d9c",
"score": "0.59253657",
"text": "def update\n respond_to do |format|\n if @form_field.update(form_field_params)\n format.html { redirect_to @form_field, notice: 'Form field was successfully updated.' }\n format.json { render :show, status: :ok, location: @form_field }\n else\n format.html { render :edit }\n format.json { render json: @form_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ddcf3d3737227da166a93240f0c04ba",
"score": "0.5918065",
"text": "def update\n @field = Field.find(params[:id])\n\n respond_to do |format|\n if @field.update_attributes(field_params)\n format.html { redirect_to location_fields_location_path(session[:location_id]), notice: 'Field was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf7b60d82c00d28d18033c5ac8ffd4f0",
"score": "0.5898211",
"text": "def update\n @field = Field.find(params[:id])\n @field.update_attributes(params[:field])\n respond_with :admin, @field\n end",
"title": ""
},
{
"docid": "85206c34444d84405c2cf510ff48a1b3",
"score": "0.5886946",
"text": "def set_career_field\n @career_field = CareerField.find(params[:id])\n end",
"title": ""
},
{
"docid": "0a588539df2ed55dcbe522fdcaf09447",
"score": "0.58751637",
"text": "def update\n respond_to do |format|\n if @extra_field.update(extra_field_params)\n format.html { redirect_to @extra_field, notice: 'Extra field was successfully updated.' }\n format.json { render :show, status: :ok, location: @extra_field }\n else\n format.html { render :edit }\n format.json { render json: @extra_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5349e1a8cb1ad9b618789c21dae05f2",
"score": "0.5869683",
"text": "def update\n @question_field = QuestionField.find(params[:id])\n\n respond_to do |format|\n if @question_field.update_attributes(params[:question_field])\n format.html { redirect_to @question_field, notice: 'Question field was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd62b54a76940bbf1ca63efbe6fc753f",
"score": "0.5864612",
"text": "def update\n @request_for_change.set_manager(force: true)\n @request_for_change.set_security_officer(force: true)\n\n respond_to do |format|\n if @request_for_change.update(request_for_change_params)\n format.html { redirect_to edit_request_for_change_path(@request_for_change), notice: 'Request for change was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_for_change.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "faf095b6bc3ec2059bab81d6906411d7",
"score": "0.58565986",
"text": "def update\n @application_form_field = ApplicationFormField.find(params[:id])\n\n respond_to do |format|\n if @application_form_field.update_attributes(params[:application_form_field])\n format.html { redirect_to @application_form_field, notice: 'Application form field was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application_form_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d85b0e4c12782951a5941a8fbe67ba9a",
"score": "0.5850944",
"text": "def update\n \n respond_to do |format|\n if @cage.update_attributes(params[:cage])\n format.json { head :no_content }\n else\n format.json { render json: @cage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2258e66528ca4a8c6212c08b55883ae",
"score": "0.5844771",
"text": "def update\n respond_to do |format|\n if @company_dei_field.update(company_dei_field_params)\n format.html { redirect_to @company_dei_field, notice: \"Company dei field was successfully updated.\" }\n format.json { render :show, status: :ok, location: @company_dei_field }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @company_dei_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f490f3f777e6505b66faf786c7fd35c9",
"score": "0.5833699",
"text": "def update\n @invoicefield = Invoicefield.find(params[:id])\n\n respond_to do |format|\n if @invoicefield.update_attributes(params[:invoicefield])\n format.html { redirect_to @invoicefield, notice: 'Invoicefield was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoicefield.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0347e6637a1e33f581d9e62b72cc42e0",
"score": "0.58332264",
"text": "def update\n respond_to do |format|\n if @care_circle.update(care_circle_params)\n format.html { redirect_to @care_circle, notice: 'Care circle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @care_circle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e79a76746a6eb109b0d030072082ea16",
"score": "0.5817616",
"text": "def update\n respond_to do |format|\n if @custom_field.update(custom_field_params)\n format.html { redirect_to @custom_field, notice: 'Custom field was successfully updated.' }\n format.json { render :show, status: :ok, location: @custom_field }\n else\n format.html { render :edit }\n format.json { render json: @custom_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "416da3fed5ce790195c66d39931f5b77",
"score": "0.58131146",
"text": "def update\n respond_to do |format|\n if @care_group.update(care_group_params)\n format.html { redirect_to @care_group, notice: 'Care group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @care_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a050c39da9663e744dd4d79a91a1d5a",
"score": "0.5799011",
"text": "def update\n @all_field_type = AllFieldType.find(params[:id])\n\n respond_to do |format|\n if @all_field_type.update_attributes(params[:all_field_type])\n format.html { redirect_to @all_field_type, notice: 'All field type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @all_field_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "55dc679e8ae9ab08f7fe5756be21b439",
"score": "0.5794386",
"text": "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"title": ""
},
{
"docid": "ef5596bc99388d9e48e198060cdd0fef",
"score": "0.5793852",
"text": "def update\n respond_to do |format|\n if @care_provider.update(care_provider_params)\n format.html { redirect_to @care_provider, notice: 'Care provider was successfully updated.' }\n format.json { render :show, status: :ok, location: @care_provider }\n else\n format.html { render :edit }\n format.json { render json: @care_provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9959dd521059a2b90c39a05f03258c4c",
"score": "0.57828516",
"text": "def update\n if @farm_field.update(farm_field_params)\n render :show, status: :ok, location: api_farm_field_url(@farm_field)\n else\n render json: @farm_field.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f7c3afa6e1938279d15bb137fe33fd32",
"score": "0.57795525",
"text": "def update\n respond_to do |format|\n if @apple_care.update(apple_care_params)\n format.html { redirect_to @apple_care, notice: 'Apple care was successfully updated.' }\n format.json { render :show, status: :ok, location: @apple_care }\n else\n format.html { render :edit }\n format.json { render json: @apple_care.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2c12b6a5fa93c26c7964fe93f9334af",
"score": "0.577805",
"text": "def update\n @field = Field.find(params[:id])\n\n respond_to do |format|\n if @field.update_attributes(params[:field])\n format.html { redirect_to([@kind, @field], :notice => t(:field_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @field.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ad22846097488ca2078afae2052ce16",
"score": "0.5771488",
"text": "def update\n @fieldtype = Fieldtype.find(params[:id])\n\n respond_to do |format|\n if @fieldtype.update_attributes(params[:fieldtype])\n format.html { redirect_to @fieldtype, notice: 'Fieldtype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fieldtype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3465d02106fc3701dfeb48ef16a1018",
"score": "0.57694286",
"text": "def update\n @early_pregnancy = EarlyPregnancy.find(params[:id])\n\n respond_to do |format|\n if @early_pregnancy.update_attributes(params[:early_pregnancy])\n format.html { redirect_to @early_pregnancy, notice: 'Early pregnancy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @early_pregnancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9ef16a0fbdf45f55fd45ba2fdbe9676",
"score": "0.575776",
"text": "def update\n @spoofer = Spoofer.find(params[:id])\n\n respond_to do |format|\n if @spoofer.update_attributes(params[:spoofer])\n format.html { redirect_to @spoofer, notice: 'Spoofer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spoofer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d876994028fcdda78a5732aa36efb710",
"score": "0.575526",
"text": "def update\n respond_to do |format|\n if @tbl_form_field.update(tbl_form_field_params)\n format.html { redirect_to @tbl_form_field, notice: 'Tbl form field was successfully updated.' }\n format.json { render :show, status: :ok, location: @tbl_form_field }\n else\n format.html { render :edit }\n format.json { render json: @tbl_form_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab4a75e828cea9e6035301f62fe025dc",
"score": "0.5738167",
"text": "def update_primary_contact(matter, params)\n new_contact_id = (params[:matter][:contact_id] ||matter.contact_id).to_i\n # Check if the primary matter contact was changed during matter edit.\n if new_contact_id != matter.contact_id.to_i\n old_primary_matter_contact = matter.primary_matter_contact\n new_primary_matter_contact = matter.matter_peoples.find(:first, :conditions => [\"people_type = 'client_contact' AND contact_id = ?\", new_contact_id])\n # To avoid invalid data - Milind/Pratik\n # Used obj.save to avoid the callback relatd to phone and email\n # because here we are only updating the people_type and member_role_id\n # Update their respective roles.\n new_primary_matter_contact.people_type = \"matter_client\"\n new_primary_matter_contact.can_access_matter =params[:matter][:client_access] unless params[:matter][:client_access].nil?\n unless old_primary_matter_contact.blank?\n new_primary_matter_contact.matter_team_role_id = old_primary_matter_contact.matter_team_role_id.nil? ? @matter.company.client_roles.find_by_lvalue('Matter Client').id : old_primary_matter_contact.matter_team_role_id\n else\n new_primary_matter_contact.matter_team_role_id = @matter.company.client_roles.find_by_lvalue('Matter Client').id\n end\n new_primary_matter_contact.save(false)\n old_primary_matter_contact.people_type = \"client_contact\"\n old_primary_matter_contact.matter_team_role_id = nil\n old_primary_matter_contact.save(false)\n else\n unless matter.primary_matter_contact.blank?\n old_primary_matter_contact = matter.primary_matter_contact\n old_primary_matter_contact.can_access_matter = params[:matter][:client_access] unless params[:matter][:client_access].nil?\n old_primary_matter_contact.save(false)\n end\n end\n end",
"title": ""
},
{
"docid": "d748aafc372a4405d42d51893babc0f2",
"score": "0.57381564",
"text": "def update_field\n begin\n load_resource\n\n param_permits.each do |k,v|\n @grid.get_column(k).set(@resource, v)\n end\n\n if @resource.save\n render :json => @grid.get_hash(prepare_collection_query.where(id: @resource.id).first)\n else\n render :json => {status: \"ERROR\", errors: @resource.errors.messages }, status: :unprocessable_entity\n end\n rescue ActiveRecord::RecordNotSaved, ActiveRecord::RecordInvalid\n #This case can occurs when one field is a compound field and call \"save!\" method for example.\n render :json => {status: \"ERRORS\", errors: @resource.errors.messages }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "349e1db6dff2a9fbe50b6ebdb9a7c1ab",
"score": "0.57330984",
"text": "def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'Foaf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bfc7e367f07d8fa4e10686cbcf7392ca",
"score": "0.57327014",
"text": "def update\n respond_to do |format|\n if @health_care.update(health_care_params)\n format.html { redirect_to @health_care, notice: 'Health care was successfully updated.' }\n format.json { render :show, status: :ok, location: @health_care }\n else\n format.html { render :edit }\n format.json { render json: @health_care.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "576f27e4c99d0868b0454fedc7deba0c",
"score": "0.5729032",
"text": "def update # PATCH\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "74d0603ee45c0197c02f573f1e663b83",
"score": "0.5712732",
"text": "def update\n respond_to do |format|\n if @field_definition.update(field_definition_params)\n format.html { redirect_to @field_definition, notice: 'Field definition was successfully updated.' }\n format.json { render :show, status: :ok, location: @field_definition }\n else\n format.html { render :edit }\n format.json { render json: @field_definition.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcee7b684109698d22df390c51c189ea",
"score": "0.5708053",
"text": "def update\n respond_to do |format|\n if @healthcare.update(healthcare_params)\n format.html { redirect_to @healthcare, notice: 'Healthcare was successfully updated.' }\n format.json { render :show, status: :ok, location: @healthcare }\n else\n format.html { render :edit }\n format.json { render json: @healthcare.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec3970cc2ecee47d9db21d1ed947900d",
"score": "0.57079816",
"text": "def update_field\n res = {\n :success => false,\n :msg => '',\n :data => {}\n }\n\n if (params[\"model\"] == nil)\n res[:msg] = 'order/update_field -- no model specified'\n else\n peer = nil\n case params[\"model\"]\n when \"entity\"\n peer = OrderEntity\n when \"company\"\n peer = Company\n when \"order\"\n peer = Order\n when \"order_revenu\"\n peer = OrderRevenu\n else\n res[:msg] = 'Could not locate that model'\n end\n if (peer != nil)\n obj = peer.new # <-- create a dummy instance of peer to check if method exists.\n if (!obj.respond_to?(params[\"field\"].to_a[0][0])) #<-- check the first key of hash only.\n res[:msg] = 'Error: Invalid field'\n else\n model = peer.update(params[:id], params[\"field\"])\n if (!model.errors.empty?)\n res = self.process_error(model.errors, res)\n else\n field = params[\"field\"].to_a\n res[:msg] = 'Updated field'\n res[:data][:field] = field[0][0]\n res[:data][:value] = field[0][1]\n res[:success] = true\n end\n end\n end\n end\n render :json => res, :layout => false\n end",
"title": ""
},
{
"docid": "2dec0be6d5a306bcd3244fced1be6e6b",
"score": "0.5706426",
"text": "def update\n respond_to do |format|\n if @camp.update(camp_params)\n format.html { redirect_to @camp, notice: \"#{@camp.name} was revised in the system.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.jdson { render json: @camp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b277ebecb605324bc9ab7a6196e6a55e",
"score": "0.5705279",
"text": "def update!(**args)\n @include_form_in_response = args[:include_form_in_response] if args.key?(:include_form_in_response)\n @requests = args[:requests] if args.key?(:requests)\n @write_control = args[:write_control] if args.key?(:write_control)\n end",
"title": ""
},
{
"docid": "d062aac9f069f4c5ca675cabc910153a",
"score": "0.57042927",
"text": "def edit_resource(type, id, data)\n bad_attrs = data_includes_invalid_attrs(data)\n\n if bad_attrs.present?\n msg = \"Attribute(s) '#{bad_attrs}' should not be specified for updating a server resource\"\n raise BadRequestError, msg\n end\n\n super\n end",
"title": ""
},
{
"docid": "c4c62fa77ede67d16814be9de96af02c",
"score": "0.57040834",
"text": "def update\n respond_to do |format|\n if @claim.update(claim_params)\n format.html { redirect_to @claim, notice: 'Claim was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @claim.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "550e4d1ee1dd642ec22a88c12a586be5",
"score": "0.5702827",
"text": "def update_person_field(id:, **args)\n params = parameters(args) do\n required_params :name\n optional_params :name, :options\n end\n request(:put, \"personFields/#{id}\", params)\n end",
"title": ""
},
{
"docid": "572c8e26452471c57796ae56acaa7d36",
"score": "0.5698107",
"text": "def update\n @hospital[params[:id]] = params[:field]\n respond_to do |format|\n if @hospital.save\n format.html { redirect_to admin_hospital_field_path(@hospital, params[:id]), notice: t('field_update') }\n format.json { render :show, status: :ok, location: admin_hospital_fields_path(@hospital, params[:id]) }\n else\n format.html { render :edit }\n format.json { render json: @hospital.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6242e185be97966cd5b1a33f616f17b",
"score": "0.569614",
"text": "def update\n respond_to do |format|\n if @thirtyfife.update(thirtyfife_params)\n format.html { redirect_to @thirtyfife, notice: 'Thirtyfive was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thirtyfife.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f136e3b7cde2fcbcac4d0e6788571ef",
"score": "0.56940246",
"text": "def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'FOAF was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30cd01877eccf1d000b807b23c66c0b5",
"score": "0.56917095",
"text": "def update\n @preceed = Preceed.find(params[:id])\n\n respond_to do |format|\n if @preceed.update_attributes(params[:preceed])\n format.html { redirect_to @preceed, notice: 'Preceed was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @preceed.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "032a89046fabdcd124b8e1a8d5befd6a",
"score": "0.56863123",
"text": "def update\n respond_to :json\n\n if @expense_claim.update(expense_claim_params)\n head :ok\n else\n render partial: 'expense_claim_key_data', layout: false, status: :ok, locals: { expense_claim: @expense_claim }\n end\n end",
"title": ""
},
{
"docid": "1e55a28562b039e48b9d402fa4b8b8d3",
"score": "0.5684491",
"text": "def update_field(id, params = {})\n put(\"/fields/#{id}\", params)\n end",
"title": ""
},
{
"docid": "a37e251085658effad9bed5723c6011b",
"score": "0.5683287",
"text": "def update\n respond_to do |format|\n if @technical.update(technical_params)\n format.html { redirect_to @technical, notice: 'Alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @technical.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "237eeb97a8880ac43e4178e0f1bfe343",
"score": "0.5679559",
"text": "def update\n respond_to do |format|\n if @api_v1_group_field.update(api_v1_group_field_params)\n format.html { redirect_to @api_v1_group_field, notice: 'Group field was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group_field }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e97d5e24f2e0de696e3f64408480a4f",
"score": "0.5674813",
"text": "def update\n respond_to do |format|\n if @template_form_field.update(template_form_field_params)\n format.html { redirect_to @template_form_field, notice: 'Template form field was successfully updated.' }\n format.json { render :show, status: :ok, location: @template_form_field }\n else\n format.html { render :edit }\n format.json { render json: @template_form_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57149db678fa8e585ddb45c5edfa6f90",
"score": "0.56700927",
"text": "def update\n respond_to do |format|\n if @magnetic_field.update(magnetic_field_params)\n format.html { redirect_to @magnetic_field, notice: 'Magnetic field was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @magnetic_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "debb235ec61df327a9fda5c6d583762b",
"score": "0.56628",
"text": "def update\n @contact = Contact.find(params[:id])\n @contact.person_id = nil if params[:contact][:person_name].present?\n respond_to do |format|\n if @contact.update_attributes(params[:contact].merge(:updated_by => current_user.id))\n format.html { redirect_to client_contacts_path(@firm), :notice => \"#{ Contact.model_name.human } успешно изменен.\"}\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contact.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aaa53a5c120c23c441cb5ffdaf2db9f6",
"score": "0.565863",
"text": "def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "99844361c51b5fd3c8ccc05821edf5a9",
"score": "0.5656524",
"text": "def update\n @field = FormulaField.find(params[:id])\n\n respond_to do |format|\n if can_edit?(@field) && @field.update_attributes(field_params)\n format.html { redirect_to @field.project, notice: 'Field was successfully updated.' }\n format.json { render json: {}, status: :ok }\n else\n @field.errors[:base] << ('Permission denied') unless can_edit?(@field)\n logger.error \"Errors: #{@field.errors.inspect}\"\n format.html { redirect_to FormulaField.find(params[:id]), alert: 'Field was not updated.' }\n format.json { render json: @field.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e9b681db3f439bba83215cd2864f897",
"score": "0.5653446",
"text": "def update\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n if @employ.update_attributes(params[:employ])\n format.html { redirect_to @employ, notice: 'Employ was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employ.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "129813f878bdb65e40141aa72a205f4e",
"score": "0.56531125",
"text": "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"title": ""
},
{
"docid": "96fadb1c4d93b2b68bb4b789ccd16c49",
"score": "0.5652571",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient].except(:person_attributes))\n format.html { redirect_to people_url, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42df8ba024ce54dab184f02761621ecd",
"score": "0.5646363",
"text": "def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "79278d3090b603ef43300d20e48887e0",
"score": "0.5646179",
"text": "def edit_pro\n customer_id = params[\"customer_id\"]\n siret = params[\"siret\"]\n cip = params[\"cip\"]\n raison_sociale = params[\"raison_sociale\"]\n puts params\n puts \"----------------------------------------MAKES NO SENSE\"\n puts params[\"raison_sociale\"]\n puts customer_id\n puts cip\n puts siret\n puts raison_sociale\n puts \"I am in edit pro\"\n\n metafields = ShopifyAPI::Customer.find(customer_id).metafields\n puts metafields[0].key\n puts metafields[0].value\n puts metafields[1].key\n puts metafields[1].value\n puts metafields[2].key\n puts metafields[2].value\n\n metafields[0].value = siret\n metafields[1].value = cip\n metafields[2].value = raison_sociale\n\n puts metafields[0].key\n puts metafields[0].value\n puts metafields[1].key\n puts metafields[1].value\n puts metafields[2].key\n puts metafields[2].value\n\n p metafields[0].save\n p metafields[1].save\n p metafields[2].save\n\n p metafields[0].errors\n p metafields[1].errors\n p metafields[2].errors\n\n puts \"editing tag\"\n\n cus = ShopifyAPI::Customer.find(customer_id)\n p cus\n p cus.tags\n\n cus.tags = \"cip- #{metafields[1].value}, PRO\"\n\n p cus.save\n\n\n\n render json: { metafields: metafields }\n end",
"title": ""
},
{
"docid": "388cee9cff9a98e96d01d2be1233170c",
"score": "0.5642242",
"text": "def update\n respond_to do |format|\n if @field_rent.update(field_rent_params)\n format.html { redirect_to @field_rent, notice: 'Field rent was successfully updated.' }\n format.json { render :show, status: :ok, location: @field_rent }\n else\n format.html { render :edit }\n format.json { render json: @field_rent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2003204a0c897bdc8568e9e5bf866877",
"score": "0.5642146",
"text": "def update\n @conferencerm = Conferencerm.find(params[:id])\n\n respond_to do |format|\n if @conferencerm.update_attributes(params[:conferencerm])\n format.html { redirect_to @conferencerm, notice: 'Conferencerm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conferencerm.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6ed5e4df2838a3e0f982da1aa26b0be",
"score": "0.56408566",
"text": "def update\n @patient = @client.patients.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.5637976",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "5792e54efe231bd6b10c9e859fc7688c",
"score": "0.56373674",
"text": "def update\n @filled_form = FilledForm.find(params[:id])\n @form_template = FormTemplate.find(@filled_form.form_template_id)\n\n respond_to do |format|\n if @filled_form.update_attributes(params[:filled_form])\n format.html { redirect_to form_template_filled_form_path(@filled_form.form_template_id, params[:id]), notice: 'Filled form was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @filled_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0201423041290b27e353cf4ae99b885",
"score": "0.56355864",
"text": "def update\n @my_studio_client = MyStudio::Client.find(params[:id])\n\n respond_to do |format|\n if @my_studio_client.update_attributes(params[:my_studio_client])\n format.html { redirect_to @my_studio_client, notice: 'Client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_studio_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3f7854351ecdbea98ab36f4c809ac58",
"score": "0.56353396",
"text": "def update\n @referee = Referee.find(params[:id])\n\n respond_to do |format|\n if @referee.update_attributes(params[:referee])\n format.html { redirect_to @referee, notice: 'Referee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @referee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aee5834556b0ddaf71fb3286635e13bd",
"score": "0.5632472",
"text": "def update\n @my_prayer_request = PrayerRequest.find(params[:id])\n\n respond_to do |format|\n if @my_prayer_request.update_attributes(params[:my_prayer_request])\n format.html { redirect_to @my_prayer_request, notice: 'My prayer request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_prayer_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4307d789fe7aae049cdb7dcba9bc771e",
"score": "0.56323546",
"text": "def update_fields(fields)\n attributes[:name] = fields['name']\n attributes[:id] = fields['id']\n self\n end",
"title": ""
},
{
"docid": "b6ef14bb2d35d6c777b08d7294ad4168",
"score": "0.56293285",
"text": "def update\n respond_to do |format|\n if @major.update(major_params)\n format.html { redirect_to @major, notice: 'Major was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @major.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d2517f8c023e89de5429d1d9a9d252e",
"score": "0.562608",
"text": "def update\n @arrest_record_and_conduct = ArrestRecordAndConduct.find(params[:id])\n\n respond_to do |format|\n if @arrest_record_and_conduct.update_attributes(params[:arrest_record_and_conduct])\n format.html { redirect_to @arrest_record_and_conduct.personal_detail, notice: 'Arrest record and conduct was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @arrest_record_and_conduct.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6da303c9b5add1b6ea5cdb599700a7b9",
"score": "0.56200284",
"text": "def update\n @college_fee = CollegeFee.find(params[:id])\n\n respond_to do |format|\n if @college_fee.update_attributes(params[:college_fee])\n format.html { redirect_to @college_fee, notice: 'College fee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @college_fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ee61bec20cc0c2bf9f2665e57e02f1ba",
"score": "0.56194586",
"text": "def update\n @sobject_field = SobjectField.find(params[:id])\n \n respond_to do |format|\n if @sobject_field.update_attributes(params[:sobject_field])\n format.html { redirect_to @sobject_field, notice: 'Sobject field was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sobject_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a39436bbebb9d678e42783172292cc53",
"score": "0.5617626",
"text": "def update\r\n @theoretical_part = TheoreticalPart.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @theoretical_part.update_attributes(params[:theoretical_part])\r\n format.html { redirect_to @theoretical_part, notice: 'Theoretical part was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @theoretical_part.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "c7f7fcf629e4bb87a4cb8a219a84aafa",
"score": "0.5615313",
"text": "def update\n\n step_attributes = step_params\n fields_attributes = step_attributes.delete(\"fields\")\n\n Field.updateFields(fields_attributes)\n\n respond_to do |format|\n if @step.update(step_attributes)\n format.html { redirect_to @step, notice: 'Step was successfully updated.' }\n format.json { render :show, status: :ok, location: @step }\n else\n format.html { render :edit }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8facd679acfdfb767c825b959c865775",
"score": "0.56151396",
"text": "def update\n @pec_form = PecForm.find(params[:id])\n\n respond_to do |format|\n if @pec_form.update_attributes(params[:pec_form])\n format.html { redirect_to @pec_form, notice: I18n.t('pec_form.notice.update') }\n format.json { head :ok }\n else\n\t\t\t\tgon.edit_pec_form = true\n\t\t\t\tgon.registration_time = @pec_form.registration_time.strftime('%m/%d/%Y %H:%M') if @pec_form.registration_time\n format.html { render action: \"edit\" }\n format.json { render json: @pec_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
bfc31d7ec49c287c97d10f3780091370
|
DELETE /services/1 DELETE /services/1.json
|
[
{
"docid": "cbab7808ecd4a80dae94ac519587c98c",
"score": "0.6891541",
"text": "def destroy\n\n @service.destroy\n\n redirect_to services_url\n\n end",
"title": ""
}
] |
[
{
"docid": "f771df7d19346fc235fe7bb3807d51c9",
"score": "0.7445268",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0f189701a29081c00f588657e73e392b",
"score": "0.7405554",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0f189701a29081c00f588657e73e392b",
"score": "0.7405554",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0f189701a29081c00f588657e73e392b",
"score": "0.7405554",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "157e50b32931267ef464386412ff83fb",
"score": "0.74017256",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to manage_services_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "75b5498d8dbcc2393dfbc14aea3b1b94",
"score": "0.736012",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "138dd18c8b4f8bd5f1dc5f670975b5f4",
"score": "0.7339786",
"text": "def destroy\n #@service is already loaded and authorized\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9d12aa70d051fe651ebd5ec3d0ac68da",
"score": "0.73383987",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to admin_services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "17c9e3b4efe6e2de9019e6f5fbd6a0d9",
"score": "0.7177263",
"text": "def delete\n svc = Service.find_by_label(params[:label])\n raise CloudError.new(CloudError::SERVICE_NOT_FOUND) unless svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n\n svc.destroy\n\n render :json => {}\n end",
"title": ""
},
{
"docid": "6785361f232d351c337cd1539cbf63cf",
"score": "0.71209097",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_services_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69f4558726a787cdb384f35c523b9d1b",
"score": "0.7111978",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "736c4c2c312e5838c6b3673abafb1488",
"score": "0.71108484",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: \"Service was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a783df814746e0dd1f7b9df7707e16c1",
"score": "0.70887095",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a783df814746e0dd1f7b9df7707e16c1",
"score": "0.70887095",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a783df814746e0dd1f7b9df7707e16c1",
"score": "0.70887095",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b23e1694c57fd24889cbc4bb4bc8efb7",
"score": "0.7086057",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'El servicio ha sido eliminado.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "51204ef279eb393da6199226c85ecd5f",
"score": "0.7078496",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to service_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7049c0eccfe19237370c0ecdeac188c",
"score": "0.70752597",
"text": "def destroy\n @service.destroy\n \n respond_to do |format|\n format.html { redirect_to services_url(@page) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fd3c9eb237e2d8d0e9d3b15d8d4ba8d5",
"score": "0.70579374",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'El servicio ha sido destruido satisfactoriamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "147c056e2344c71b3c0577327a537183",
"score": "0.70109344",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to user_services_url(@user), notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ae1b21aca5feba0092fbc2eac7b2b95",
"score": "0.7001801",
"text": "def destroy\r\n authorize! :destroy, @service\r\n @service.destroy\r\n respond_to do |format|\r\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.69754815",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "043004a6dbbdc5242b457640ecc5e584",
"score": "0.6973993",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Serviço cadastrado com sucesso!' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cbbed2d668f1f286d51c229112bfbc95",
"score": "0.69392407",
"text": "def destroy\n @idti_service.destroy\n respond_to do |format|\n format.html { redirect_to idti_services_url, notice: 'Idti service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0c4865e3a11ea403b0fe045bbf960b2e",
"score": "0.6921095",
"text": "def delete(id)\n @service.delete(id)\n end",
"title": ""
},
{
"docid": "4f4bdb26f2a22f7334436b8174ae07f6",
"score": "0.6917091",
"text": "def destroy\n @additional_service.destroy\n respond_to do |format|\n format.html { redirect_to additional_services_url, notice: 'Additional service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "500169eec7dcf763fea7d53a9543a9b2",
"score": "0.69066",
"text": "def destroy\n @additional_service = AdditionalService.find(params[:id])\n @additional_service.destroy\n\n respond_to do |format|\n format.html { redirect_to additional_services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f26c505b7a9a901d700886baba5b4d3e",
"score": "0.68938875",
"text": "def destroy\n #@service_request = ServiceRequest.find(params[:id])\n @service_request.destroy\n\n respond_to do |format|\n format.html { redirect_to service_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a1a0dea7fe50941446d7b39a6274e89e",
"score": "0.6893659",
"text": "def destroy\n @service_item.destroy\n respond_to do |format|\n format.html { redirect_to service_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0855e72d027c793361ef102ba9cd9b2f",
"score": "0.6889161",
"text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to request.referer, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "27283786fd89f61aaa8ed869373e008d",
"score": "0.68737227",
"text": "def destroy\n @service_dependance = ServiceDependance.find(params[:id])\n @service_dependance.destroy\n\n respond_to do |format|\n format.html { redirect_to service_dependances_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b713c9e8023ebd518d1f6584471541a6",
"score": "0.68702435",
"text": "def destroy\n @emt_service.destroy\n respond_to do |format|\n format.html { redirect_to emt_services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2e2c6f823d34d6bb591e0d0a25e6065c",
"score": "0.68583316",
"text": "def destroy\n @request_service.destroy\n respond_to do |format|\n format.html { redirect_to request_services_url, notice: 'Request service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e7009620569c3c27a639b40cdc487526",
"score": "0.6852923",
"text": "def destroy\n @complex_service = ComplexService.find(params[:id])\n @complex_service.destroy\n\n respond_to do |format|\n format.html { redirect_to(complex_services_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dd6e7728e786b204d82a74e6ca0995e5",
"score": "0.6850263",
"text": "def destroy\n #@service = Service.find(params[:id])\n @service = current_user.pro.services.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n #format.html { redirect_to services_url }\n format.html { redirect_to(pros_services_path, :notice => 'Service mis à jour avec succès.')}\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2052540d24f48161c1bfa8175bf04135",
"score": "0.68443996",
"text": "def destroy\n @serviceordemservice.destroy\n respond_to do |format|\n format.html { redirect_to serviceordemservices_url, notice: 'Serviceordemservice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "be9a696a4fa7125dd762f47756602180",
"score": "0.6831156",
"text": "def destroy\n @service_type = ServiceType.find(params[:id])\n @service_type.destroy\n\n respond_to do |format|\n format.html { redirect_to service_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a5a24fbaa9c1ae1908dc0342cee85e91",
"score": "0.68153065",
"text": "def destroy\n @service.destroy\n end",
"title": ""
},
{
"docid": "a5a24fbaa9c1ae1908dc0342cee85e91",
"score": "0.68153065",
"text": "def destroy\n @service.destroy\n end",
"title": ""
},
{
"docid": "a5a24fbaa9c1ae1908dc0342cee85e91",
"score": "0.68153065",
"text": "def destroy\n @service.destroy\n end",
"title": ""
},
{
"docid": "588b2c16043d352eb01df0aaa21d60ba",
"score": "0.6812881",
"text": "def destroy\n @event_service.destroy\n respond_to do |format|\n format.html { redirect_to event_services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89574220fda3784ca1a02e8c543cca24",
"score": "0.68072045",
"text": "def destroy\r\n @service.destroy\r\n respond_to do |format|\r\n format.html { redirect_to request.referer, notice: 'Service was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "fb3d6f2867dd89cc7cf961ad41e4f1e7",
"score": "0.680702",
"text": "def delete_service(service_id)\n response = @client.delete(\"/api/v1/services/#{service_id}\")\n return JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "3fe1dcc1a18ef4cae5a97fe1e351fb07",
"score": "0.68051344",
"text": "def destroy\n @service_particular.destroy\n respond_to do |format|\n format.html { redirect_to service_particulars_url, notice: 'Service particular was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e7e7035dadf9f05bdc5bd7506c556e2b",
"score": "0.67935485",
"text": "def destroy\n @service.update_column(:deleted, true)\n respond_to do |format|\n format.html { redirect_to admin_services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7fe848e93709b98b64a74c94a9c3343c",
"score": "0.6781068",
"text": "def destroy\n @online_service = OnlineService.find(params[:id])\n @online_service.destroy\n\n respond_to do |format|\n format.html { redirect_to online_services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3ce7b8757c2539d1b43d86b6c377be3e",
"score": "0.678066",
"text": "def destroy\n @additionalservice.destroy\n respond_to do |format|\n format.html { redirect_to additionalservices_url, notice: 'Additionalservice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aba5a827c96bf32f0b646f84394cccba",
"score": "0.67792505",
"text": "def destroy\n @contract_service.destroy\n respond_to do |format|\n format.html { redirect_to contract_services_url, notice: 'Contract service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6660f8f62027412929d7b78d182281c",
"score": "0.67737967",
"text": "def delete endpoint\n do_request :delete, endpoint\n end",
"title": ""
},
{
"docid": "e207d9314eb968a539584d3b665c6c3a",
"score": "0.67707354",
"text": "def destroy\n @servicio = Servicio.find(params[:id])\n @servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to servicios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0357ad2b5c7215c58795cdbbf3d1504a",
"score": "0.6738811",
"text": "def destroy\n @multi_agent_service.destroy\n respond_to do |format|\n format.html { redirect_to multi_agent_services_url, notice: 'Entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bca5f430d02b82f5c26baef82a5b3ff",
"score": "0.67381984",
"text": "def destroy_service(id, service_id=nil, params={}, payload={})\n url = nil\n if service_id.is_a?(Array)\n url = \"#{base_path}/#{id}/services\"\n params['serviceId'] = service_id\n elsif service_id.is_a?(Numeric) || service_id.is_a?(String)\n url = \"#{base_path}/#{id}/services/#{service_id}\"\n else\n raise \"passed a bad volume_id: #{service_id || '(none)'}\" # lazy\n end\n headers = { :params => params, :authorization => \"Bearer #{@access_token}\", 'Content-Type' => 'application/json' }\n execute(method: :delete, url: url, headers: headers, payload: payload.to_json)\n end",
"title": ""
},
{
"docid": "888c4dcb3845bbcd5add8a30bcf31b03",
"score": "0.67210436",
"text": "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "888c4dcb3845bbcd5add8a30bcf31b03",
"score": "0.67210436",
"text": "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2419b4db86355dc8706d2ecb12f572f3",
"score": "0.6691806",
"text": "def destroy\n @counter_service.destroy\n respond_to do |format|\n format.html { redirect_to counter_services_url, notice: 'Counter service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e7d37e23f3bbc86888fc35dd2fac9930",
"score": "0.6690857",
"text": "def destroy\n @service_request.destroy\n respond_to do |format|\n format.html { redirect_to service_requests_url, notice: 'Service request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e7d37e23f3bbc86888fc35dd2fac9930",
"score": "0.6690857",
"text": "def destroy\n @service_request.destroy\n respond_to do |format|\n format.html { redirect_to service_requests_url, notice: 'Service request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e7d37e23f3bbc86888fc35dd2fac9930",
"score": "0.6690857",
"text": "def destroy\n @service_request.destroy\n respond_to do |format|\n format.html { redirect_to service_requests_url, notice: 'Service request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e95693f50e1918c9510139b77efb59db",
"score": "0.6687165",
"text": "def destroy\n @invoice_service.destroy\n respond_to do |format|\n format.html { redirect_to invoice_services_url, notice: 'Invoice service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1928f04af448458a8e8e6b4957a37cef",
"score": "0.66762114",
"text": "def destroy\n @servicerequest.destroy\n respond_to do |format|\n format.html { redirect_to servicerequests_url, notice: 'Service request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c880eb366432d5afb4bffbc43184e52d",
"score": "0.6666241",
"text": "def destroy\n authorize!(:destroy, service) if current_user\n service.mark_as_deleted!\n\n respond_with(service)\n end",
"title": ""
},
{
"docid": "c880eb366432d5afb4bffbc43184e52d",
"score": "0.6666241",
"text": "def destroy\n authorize!(:destroy, service) if current_user\n service.mark_as_deleted!\n\n respond_with(service)\n end",
"title": ""
},
{
"docid": "f446b8bb9bc97c6c5239f798b146c767",
"score": "0.66578424",
"text": "def destroy\n @customer_service.destroy\n respond_to do |format|\n format.html { redirect_to customer_services_url, notice: 'Customer service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1ad9ac0ac7e9ffe339a21d0033e22a2",
"score": "0.66551554",
"text": "def destroy\n @port_service.destroy\n respond_to do |format|\n format.html { redirect_to port_services_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2abe7e20e59b694ee72e9cf7ea4e04b1",
"score": "0.6635286",
"text": "def destroy\n @service = Service.find(params[:id])\n \n if checkServiceAdmin(@service)\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n else\n redirect_to services_path, alert: \"You do not have the privileges required to delete this team.\"\n end\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.663295",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "8b19d04f64311ec8627d594669536a30",
"score": "0.6598225",
"text": "def destroy\n @service_status.destroy\n respond_to do |format|\n format.html { redirect_to service_statuses_url, notice: 'Service status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "12de52310527680c0c2f22e8b2bf9f89",
"score": "0.65864503",
"text": "def destroy\n @em_service.destroy\n respond_to do |format|\n format.html { redirect_to em_services_url, notice: 'Em service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "96fbbb50d10373543cec70477fd7daa0",
"score": "0.6582218",
"text": "def destroy\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n @solicitud_servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to solicitudes_servicios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cc9e8d444a8c72f6f83a550349234675",
"score": "0.65782106",
"text": "def destroy\n @sevice.destroy\n respond_to do |format|\n format.html { redirect_to sevices_url, notice: 'Sevice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a650b2a296365d07977774750f2a4374",
"score": "0.6559754",
"text": "def destroy\n @clientes_servico.destroy\n respond_to do |format|\n format.html { redirect_to clientes_servicos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b277201b7498b1af9db5884e1318af6",
"score": "0.6555423",
"text": "def destroy\n @call_service.destroy\n respond_to do |format|\n format.html { redirect_to call_services_url, notice: 'Call service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0de16917cbd4d55c4b7d312970f4ee58",
"score": "0.65551305",
"text": "def destroy\n @service.destroy\n redirect_to [@client, @place], notice: 'Service was successfully destroyed.'\n end",
"title": ""
},
{
"docid": "10782923649bd25e4deae1302cd6abad",
"score": "0.65529454",
"text": "def destroy\n\n # remove prices on service remove\n prices = Price.where(:service_id => @service.id)\n prices.each do |price|\n price.destroy\n end\n\n @service.destroy\n \n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.65510494",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "59eb9d1fec3a5d513ff6aed6b0ddc0b1",
"score": "0.65430975",
"text": "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6540671",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6540671",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6540671",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6540671",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "fbe99f243c6ece881f70a346d33a158e",
"score": "0.65364784",
"text": "def destroy\n @approximate_service = ApproximateService.find(params[:id])\n @approximate_service.destroy\n\n respond_to do |format|\n format.html { redirect_to(approximate_services_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "84df41f928e05dd034ce7fde0426f64d",
"score": "0.65255374",
"text": "def destroy\n @service_start.destroy\n respond_to do |format|\n format.html { redirect_to :delete, flash: { message: 'Service start was successfully deleted.' } }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942afceb041579c05ca6981310c96d24",
"score": "0.6522618",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n flash[:notice] = \"This service profile was successfully deleted!\"\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "979dae95c0489438e473b829abd41692",
"score": "0.65220094",
"text": "def delete\n supprimer = SondageService.instance.supprimerSondage(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\nend",
"title": ""
},
{
"docid": "e37908230b688ce73578790154eaca31",
"score": "0.65200925",
"text": "def destroy\n respond_to do |format|\n if @service.destroy\n flash[:notice] = \"Service '#{@service.name}' has been deleted\"\n format.html { redirect_to services_url }\n format.xml { head :ok }\n else\n flash[:error] = \"Failed to delete service '#{@service.name}'\"\n format.html { redirect_to service_url(@service) }\n end\n end\n end",
"title": ""
},
{
"docid": "1c5aa31b5864de4c140f0a68a09cf8c4",
"score": "0.6516149",
"text": "def destroy\n @grooming_service.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Grooming service was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8d213c5d6b6725b34431ce894a4e6bc",
"score": "0.6515148",
"text": "def destroy\n @masterservice.destroy\n respond_to do |format|\n format.html { redirect_to masterservices_url, notice: 'Masterservice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "39286a8430737db7b0f683a3ccf1d714",
"score": "0.6511044",
"text": "def destroy\n @service_request = ServiceRequest.find(params[:id])\n @service_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(service_requests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "c80cc2ba6b4746f961748d8f5545a0db",
"score": "0.0",
"text": "def postcard_params\n params.require(:postcard).permit(:title, :desc, :ix, :src)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69225836",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.68929327",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67848456",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.674347",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6682223",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6636527",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66291976",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.66258276",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65625846",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491194",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64526874",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64001405",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.63810205",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63634825",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.633783",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336759",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6325718",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.631947",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63146484",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63137317",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6306224",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6301168",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.63000035",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.629581",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.6280713",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6271388",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6266194",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256044",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62550515",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62525266",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6234781",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62278074",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6226693",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.6226605",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6226114",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6200643",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.61913997",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61835426",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6179986",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61630195",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160931",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6155551",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61542404",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61356604",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61342114",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61188847",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61140966",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61107725",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.60860336",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60855556",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.608446",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076753",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60742563",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60677326",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60666215",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065763",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60655254",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6064794",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.6062697",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562736",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60491294",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6046521",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.6041768",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60346854",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6030552",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6024842",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6021606",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.6019679",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6017253",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60145336",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60074294",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006753",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60048765",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60009843",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000161",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.599852",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59947807",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5993962",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5992739",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.59911275",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59906775",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
a973780d75348cd744e3204d4f95b3a3
|
Updates a Task Link
|
[
{
"docid": "07c7c44d30fabd342d0b10fa629e447f",
"score": "0.75102526",
"text": "def update_task_link(id, api_link, opts = {})\n data, status_code, headers = update_task_link_with_http_info(id, api_link, opts)\n return data\n end",
"title": ""
}
] |
[
{
"docid": "b38857a05c886cd1a6b89a6e00cb68a5",
"score": "0.75547445",
"text": "def set_task_link\n @task_link = TaskLink.find(params[:id])\n end",
"title": ""
},
{
"docid": "1cdfd6691a031cc7c2cb4fd16ae43420",
"score": "0.7482302",
"text": "def update\n @tasklink = Tasklink.find(params[:id])\n\n respond_to do |format|\n if @tasklink.update_attributes(params[:tasklink])\n format.html { redirect_to @tasklink, notice: 'Tasklink was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tasklink.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8b303d6cfa3f485ebf0df235ce624aa",
"score": "0.7022119",
"text": "def update_task_link_with_http_info(id, api_link, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TasksApi#update_task_link ...\"\n end\n \n # verify the required parameter 'id' is set\n fail \"Missing the required parameter 'id' when calling update_task_link\" if id.nil?\n \n # verify the required parameter 'api_link' is set\n fail \"Missing the required parameter 'api_link' when calling update_task_link\" if api_link.nil?\n \n # resource path\n path = \"/Tasks/{id}/TaskLinks\".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'text/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(api_link)\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 :return_type => 'APITaskLink')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TasksApi#update_task_link\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "28cae9d5361e7f522d02627e0922eb45",
"score": "0.6962079",
"text": "def update!(**args)\n @link = args[:link] if args.key?(:link)\n end",
"title": ""
},
{
"docid": "f3f809a0e3b53d74963f79e8846c1a29",
"score": "0.6665098",
"text": "def update\n update_and_respond(@link, link_params)\n end",
"title": ""
},
{
"docid": "d7f002965f5276c5e284682ad37f60d1",
"score": "0.63141143",
"text": "def update \n\t logger.debug \"Params --------------------------------------- #{params}\"\n\n\t logger.debug \"task params --------------------------------------#{task_params}\"\n\t format_task_attributes(task_params)\n\t \n\t logger.debug \"-------------------------------------------------------------\"\n\t logger.debug \"Updated Params #{@updated_params}\"\n\t @updated_params[:id]=params[:id]\n\t @task = Task.find(@updated_params[:id])\n\t logger.debug \"#########################\"\n\t logger.debug \"Task found \"\n\t \n\t @task.assign_attributes(@updated_params)\n\t authorize! :update, @task\n\t @task.is_completed=false\n\t save_task\n\tend",
"title": ""
},
{
"docid": "559964289dfec96cbbb24aa4d38f16f8",
"score": "0.6282831",
"text": "def update!(**args)\n @link_url = args[:link_url] if args.key?(:link_url)\n @notification_text = args[:notification_text] if args.key?(:notification_text)\n end",
"title": ""
},
{
"docid": "6a6b164dcede16f06192a7bf9877cd20",
"score": "0.62588584",
"text": "def update\n\t\tupdated_info = params.require(:rlink).permit(:link, :random_string)\n\t\trlink = Rlink.find(params[:id])\n\t\trlink.update_attributes(updated_info)\n\t\tredirect_to rlink\n\tend",
"title": ""
},
{
"docid": "94441a1c34a124388e4fd8f46876e62a",
"score": "0.62567574",
"text": "def update\n task = @task_list.tasks.find(params[:id])\n task.update_attributes(task_params)\n render nothing: true\n end",
"title": ""
},
{
"docid": "cc49214534f110ef7a8da9db8c5b31ac",
"score": "0.6250699",
"text": "def update!\n open(link)\n end",
"title": ""
},
{
"docid": "5403063f59e6a1b288da26dd5b143752",
"score": "0.62334156",
"text": "def update!(**args)\n @self_link = args[:self_link] if args.key?(:self_link)\n end",
"title": ""
},
{
"docid": "de3ebf482d006888e9090b5b1f5560b0",
"score": "0.6190209",
"text": "def update\n @task = Task.find(params[:id])\n @task.update(task_params)\n\n redirect_to tasks_path(@task)\n end",
"title": ""
},
{
"docid": "791515f3a5d8167fb6a23c186a40a213",
"score": "0.6183258",
"text": "def update\n @task.update(task_params)\n end",
"title": ""
},
{
"docid": "94bb351d891fc6c45f45533e9305763b",
"score": "0.6182882",
"text": "def update(options = {})\n self.merge!(Vermonster::Client.connection.put(\"tasks/#{self[\"id\"]}\", \"{\\\"task\\\": #{options.to_json}}\").body)\n end",
"title": ""
},
{
"docid": "eff54e2aae0a6b964ba178e65e4e95c2",
"score": "0.61755824",
"text": "def save\n CONNECTION.execute(\"UPDATE links SET link = '#{self.link}', relative_assignment = '#{self.relative_assignment}' WHERE id = #{self.id};\")\n end",
"title": ""
},
{
"docid": "a226b5507afdf5397667930f8e5bdc82",
"score": "0.6172569",
"text": "def update!(**args)\n @direct_target_link = args[:direct_target_link] if args.key?(:direct_target_link)\n @indirect_target_link = args[:indirect_target_link] if args.key?(:indirect_target_link)\n end",
"title": ""
},
{
"docid": "a87c9bbf5970b32c72838a63e5b87b2b",
"score": "0.6156729",
"text": "def update!(**args)\n @alternate_link = args[:alternate_link] if args.key?(:alternate_link)\n @id = args[:id] if args.key?(:id)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "47e9c977337300bece77a8b20bfd6ff5",
"score": "0.61324555",
"text": "def update\n @task = Task.find(params[:id])\n @task.update(task_params)\n #@task.save\n redirect_to tasks_path(@task)\n end",
"title": ""
},
{
"docid": "093bce1b53c874cc3a36cea5900ed933",
"score": "0.6130252",
"text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @tasks = args[:tasks] if args.key?(:tasks)\n end",
"title": ""
},
{
"docid": "a03e7174cd4af5a044c8519479afe3f5",
"score": "0.61273795",
"text": "def update_lti_link(lti_link_id, create_lti_link_data)\n path = \"/d2l/api/le/#{$le_ver}/lti/link/#{lti_link_id}\"\n payload = {\n 'Title' => '',\n 'Url' => '',\n 'Description' => '',\n 'Key' => '',\n 'PlainSecret' => '',\n 'IsVisible' => false,\n 'SignMessage' => false,\n 'SignWithTc' => false,\n 'SendTcInfo' => false,\n 'SendContextInfo' => false,\n 'SendUserId' => false,\n 'SendUserName' => false,\n 'SendUserEmail' => false,\n 'SendLinkTitle' => false,\n 'SendLinkDescription' => false,\n 'SendD2LUserName' => false,\n 'SendD2LOrgDefinedId' => false,\n 'SendD2LOrgRoleId' => false,\n 'UseToolProviderSecuritySettings' => false,\n 'CustomParameters' => nil # or Array of CustomParameter\n # e.g. [{\"Name\" => \"\", \"Value\" => \"\"},{\"Name\" => \"\", \"Value\" => \"\"}]\n }.merge!(create_lti_link_data)\n check_create_lti_link_data_validity(payload)\n _put(path, payload)\nend",
"title": ""
},
{
"docid": "8bf2aff237ef3f36ee973e86811fc6ce",
"score": "0.61256254",
"text": "def update\n @useful_link = UsefulLink.find(params[:id])\n\n respond_to do |format|\n if @useful_link.update_attributes(params[:useful_link])\n format.html { redirect_to @useful_link, notice: 'Useful link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @useful_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e403dd6e74de98d0d5ff63f109f9271",
"score": "0.6105696",
"text": "def update\n @link = @entity.links.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n flash[:notice] = 'Link was successfully updated.'\n format.html { redirect_to link_url(@link) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "29df2d2941ada815959d0b9f7311688c",
"score": "0.60996014",
"text": "def update!(**args)\n @link = args[:link] if args.key?(:link)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "ebe9d469240a5e13579f5b89b6d45fd8",
"score": "0.6097755",
"text": "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to @link, :notice => 'Ссылка была успешно обновлена' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cfda236dde42a82b8ef800c3f6e84c23",
"score": "0.60868454",
"text": "def update\n @task.update(task_params)\n redirect_to task_path(@task)\n end",
"title": ""
},
{
"docid": "e4965cd59a490c467b263ca27955772f",
"score": "0.60841125",
"text": "def setTaskURL(taskUrl)\r\n\t\t\t\t\t@taskUrl = taskUrl\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "884bb71e33a8cf4b00281226263722c8",
"score": "0.6070913",
"text": "def update\n\t\tlink = current_user.links.find(params[:id])\n\n\t\trespond_to do | format |\n\t\t\tif link.update_attributes(link_params)\n\t\t\t\tformat.html{\n\t\t\t\t\tredirect_to link\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tformat.html{\n\t\t\t\t\trender action: \"edit\"\n\t\t\t\t}\n\t\t\tend\n\n\t\tend \n\tend",
"title": ""
},
{
"docid": "ad2de4daf5dcfb3e5db4467dad990830",
"score": "0.60665417",
"text": "def update(task_number, task) # Update task based on task number\n all_tasks[task_number -1] = task # Updates task\n end",
"title": ""
},
{
"docid": "82ce218b5b43d4395c0bc4d7c1d6f686",
"score": "0.60661256",
"text": "def update\n @postit_task = PostitTask.find_by_id(params[:id])\n if @postit_task.update_attributes(params[:postit_task])\n flash[:notice] = 'Cette tâche a été correctement modifiée.'.trn\n redirect_to :controller => (@postit_task.postit_list ? 'postit_lists' : 'postit_tasks') ,:action => (@postit_task.postit_list ? 'link_task' : 'list'), :id => @postit_task.postit_list_id\n else\n render :action => 'edit'\n end\n end",
"title": ""
},
{
"docid": "49998503ba83b658af7c9c0376b2324f",
"score": "0.6061867",
"text": "def update!(**args)\n @self_link = args[:self_link] if args.key?(:self_link)\n @total_items = args[:total_items] if args.key?(:total_items)\n end",
"title": ""
},
{
"docid": "2c64be851be313f4deb2c82614373814",
"score": "0.60520893",
"text": "def update_task(id, title, description)\n task = Task.find(id)\n task.title = title\n task.description = description\n task.save\nend",
"title": ""
},
{
"docid": "74a173f2c44c4ff4efb967a45f32ecbb",
"score": "0.6042514",
"text": "def update\n Task.associate_task(params:params, task: @task)\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8cb40ceb5209cb77a2914a00836a1443",
"score": "0.6024083",
"text": "def update!(**args)\n @outlink_info = args[:outlink_info] if args.key?(:outlink_info)\n end",
"title": ""
},
{
"docid": "5b5b8565785bf85be7977fb8d002bad6",
"score": "0.60054564",
"text": "def update\n @mytask = Task.find(params[:id])\n if @mytask.update({title: params[:task][:title], description: params[:task][:description], completed_at: params[:task][:completed_at], status: params[:task][:status]})\n # redirect_to(@mytask)}\n redirect_to tasks_path\n else\n render \"edit\"\n end\n end",
"title": ""
},
{
"docid": "954aa1792afdc2c82c8bbdf434a01b53",
"score": "0.6000552",
"text": "def create\n @task_link = TaskLink.new(task_link_params)\n #Make sure user has access\n Task.editable_tasks(current_user).find(@task_link.from_task_id)\n Task.editable_tasks(current_user).find(@task_link.to_task_id)\n\n respond_to do |format|\n if @task_link.save\n format.html { redirect_to @task_link, notice: 'Task link was successfully created.' }\n format.json { render :show, status: :created, location: @task_link }\n else\n format.html { render :new }\n format.json { render json: @task_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "fdcaac8595e3ae87e69797700b5be785",
"score": "0.59871006",
"text": "def set_ThreadLink(value)\n set_input(\"ThreadLink\", value)\n end",
"title": ""
},
{
"docid": "5b04f9865370ce1fac28713614c12f67",
"score": "0.59830123",
"text": "def update!(**args)\n @link = args[:link] if args.key?(:link)\n @video = args[:video] if args.key?(:video)\n end",
"title": ""
},
{
"docid": "271d440fe9ab4bd8b4f9333985a15693",
"score": "0.5967615",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n\n format.html { redirect_to link_admin_path(@link.admin_id), notice: \"Link was successfully updated.\" }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbb101e218d4398ae42403b2e3861f92",
"score": "0.59659266",
"text": "def update\n @task = Task.find(params[:id])\n oldtaskname = @task.name\n if @task\n if request.referrer && URI(request.referrer).path == edit_task_path(@task) && (task_params[:name] == nil|| task_params[:name] == \"\")\n flash[:error] = \"You must enter a name for a task\"\n redirect_to edit_task_path(@task.id)\n else\n oldcomplete = @task.complete\n oldassignee = @task.assignedto\n users = Project.find_by_id(@task.projectid).allshares.split(\",\")\n found = false\n if @task.assignedto == nil\n @task.assignedto = \"None\"\n end\n if task_params[:assignedto] == nil || task_params[:assignedto] == \"\"\n task_params[:assignedto] = @task.assignedto\n end\n if !(users.include? task_params[:assignedto])\n task_params[:assignedto] = @task.assignedto\n end\n # if task_params[:label] == nil || task_params[:label] == \"\"\n # @task.label = 0\n # end\n @task.update(task_params)\n @task.save!\n if @task.assignedto != oldassignee\n if @task.assignedto != \"None\"\n assignemail = \"\"\n users.each do |user|\n us = User.find_by_id(user)\n if us\n if (us.firstname + \" \" + us.lastname) == @task.assignedto\n if us.noemail != true\n assignemail = us.name\n end\n end\n end\n end\n send_assignment(@task, assignemail)\n\n end\n end\n\n if @task.complete == true && @task.complete != oldcomplete\n mark_complete(@task)\n elsif @task.complete == false\n mark_incomplete(@task)\n end\n\n respond_to do |format|\n if @task\n if oldcomplete == false && @task.complete == true\n @task.datecomplete = @task.updated_at\n elsif oldcomplete == true && @task.complete == false\n @task.datecomplete = nil\n end\n @task.save!\n flash[:alert] = 'Task was successfully updated.'\n if request.referrer && URI(request.referrer).path != edit_task_path(@task)\n format.html { redirect_to request.referrer }\n format.mobile { redirect_to request.referrer, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n elsif request.referrer && URI(request.referrer).path == edit_task_path(@task)\n format.html { redirect_to project_path(@task.projectid), notice: 'Task was successfully updated.' }\n format.mobile { redirect_to project_path(@task.projectid), notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to task_path(@task.id), notice: 'Task was successfully updated.' }\n format.mobile { redirect_to task_path(@task.id), notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n end\n else\n format.html { render action: 'edit' }\n format.mobile { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end\n else\n flash[:error] = \"You must enter a name for a task\"\n redirect_to edit_task_path(@task.id)\n end\n end",
"title": ""
},
{
"docid": "f562610519cef6d9aee2daa19c45fc02",
"score": "0.5955616",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link.pot, flash: {success: 'Link wurde aktualisiert.'} }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42e7121b7790cf464fc47c6b7453256f",
"score": "0.59469384",
"text": "def update\n if @test_link.update(test_link_params)\n render :show, status: :ok, location: @test_link\n else\n render json: @test_link.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b2f1758bd608f8966eaf998bcd411fd9",
"score": "0.5938859",
"text": "def update\n if @task.update(task_params)\n success_task_show\n else\n error_task_save\n end\n end",
"title": ""
},
{
"docid": "95271143231365056b44f30b48d7c6be",
"score": "0.59363747",
"text": "def update!(**args)\n @alternate_link = args[:alternate_link] if args.key?(:alternate_link)\n @id = args[:id] if args.key?(:id)\n @thumbnail_url = args[:thumbnail_url] if args.key?(:thumbnail_url)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "95271143231365056b44f30b48d7c6be",
"score": "0.59363747",
"text": "def update!(**args)\n @alternate_link = args[:alternate_link] if args.key?(:alternate_link)\n @id = args[:id] if args.key?(:id)\n @thumbnail_url = args[:thumbnail_url] if args.key?(:thumbnail_url)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "2705b8d2cc9ec92373bbf0cef913bcbb",
"score": "0.59210503",
"text": "def update\n @link = Link.find(params[:id])\n \n respond_to do |format|\n if @link.update_attributes(params[:link])\n flash[:notice] = 'Link was successfully updated.'\n format.html { redirect_to(@link) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33aecb1de70f5f90e85721f6eeaaadb6",
"score": "0.5913965",
"text": "def save\n CONNECTION.execute(\"UPDATE links SET assignment_id = '#{self.assignment_id}', link = '#{self.link}', type = '#{self.type}', WHERE id = #{self.id};\")\n end",
"title": ""
},
{
"docid": "6c20f961b4a2545f7e511176b87b8a64",
"score": "0.59119105",
"text": "def update_link!(link)\n key = link.key\n val = link.val\n @store.remove(key)\n link = @store.append(key,val) #this is where you move the link to end of list\n @map[key] = link\n end",
"title": ""
},
{
"docid": "9053118fe181534cb2850566466e106c",
"score": "0.59043187",
"text": "def update\n @pending_recommended_link = PendingRecommendedLink.find(params[:id])\n\n if @pending_recommended_link.update(pending_recommended_link_params)\n head :no_content\n else\n render json: @pending_recommended_link.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f130b52ee795854daca7b5ee8cf257db",
"score": "0.5903851",
"text": "def update\n @link = Link.find_by_slug(params[:id])\n\n respond_to do |format|\n if @link.user != @current_user\n flash[:error] = 'Unable to update links owned by other users.'\n format.html { render action: \"show\" }\n format.json { head :no_content }\n elsif @link.update_attributes(params[:link])\n format.html { redirect_to link_comments_url(@link), notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ef1d749d242920bd51d43f06112aba7",
"score": "0.5894272",
"text": "def update\n @link = Link.find(params[:id])\n paginate_all_links\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to root_url+\"#show-links\", notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8dfc3b08f5add5496d87b78a3cd63887",
"score": "0.5893937",
"text": "def update\n\n if request.referer.present? && request.referer.include?('edit')\n @task.update(title: params[:patch][:title], description: params[:patch][:description])\n redirect_to action: \"show\", id: params[:id]\n else\n @task.update(completed_at: DateTime.now)\n\n if request.referer.present? && request.referer.include?('show')\n redirect_to action: \"show\", id: params[:id]\n else\n redirect_to action: \"index\"\n end\n end\n\n end",
"title": ""
},
{
"docid": "ce8e79da43dd7451e2a0f72db12cab9c",
"score": "0.58931446",
"text": "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce8e79da43dd7451e2a0f72db12cab9c",
"score": "0.58931446",
"text": "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a259631f79daa0c671befee6930751b8",
"score": "0.5886532",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to links_path}\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce3aeb0f3d74aa2f8723abc3b54a5da9",
"score": "0.5885956",
"text": "def update\n\n \tif @link.update(link_params)\n \t\tflash[:success] = \"Link updated\"\n \t\tredirect_to category_path(@category)\n \telse\n \t\trender :edit\n\n end\n\n end",
"title": ""
},
{
"docid": "c65cbc15b511d5bfc765e7fdb20f4990",
"score": "0.58743614",
"text": "def update\n command = Tasks::Update.call(@task, params: task_params)\n respond_to do |format|\n if command.success?\n format.html { redirect_to @task, notice: \"Task was successfully updated.\" }\n else\n format.html { render :edit, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21ac87f25707a61b06b44dc952ee304f",
"score": "0.5867951",
"text": "def add_task_link_with_http_info(id, api_link, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TasksApi#add_task_link ...\"\n end\n \n # verify the required parameter 'id' is set\n fail \"Missing the required parameter 'id' when calling add_task_link\" if id.nil?\n \n # verify the required parameter 'api_link' is set\n fail \"Missing the required parameter 'api_link' when calling add_task_link\" if api_link.nil?\n \n # resource path\n path = \"/Tasks/{id}/TaskLinks\".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'text/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(api_link)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'APITaskLink')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TasksApi#add_task_link\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "d4e9d6b8bd3ffd7d36f8194187ba70e6",
"score": "0.5861825",
"text": "def update_attributes(id, name, task, status)\n\t\tDB.execute(\"UPDATE tasks SET task=\\\"#{task}\\\", name=\\\"#{name}\\\", status=\\\"#{status}\\\" WHERE id=\\\"#{id}\\\"\")\n\t\t@task = task\n\t\t@name = name\n\t\t@status = status\n\tend",
"title": ""
},
{
"docid": "e0a253ee29310ae097dd83fa97930d0d",
"score": "0.58616096",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6c5ebc1354dbf90e39d3a4bf716f56d",
"score": "0.5837592",
"text": "def update\n @task = Task.find(params[:id])\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Tarefa was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n \tformat.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\nend",
"title": ""
},
{
"docid": "7fcc6b90b4083c2b681740aeaa162f8d",
"score": "0.58323306",
"text": "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to(@link, :notice => 'Link was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7fcc6b90b4083c2b681740aeaa162f8d",
"score": "0.58323306",
"text": "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to(@link, :notice => 'Link was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7fcc6b90b4083c2b681740aeaa162f8d",
"score": "0.58323306",
"text": "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to(@link, :notice => 'Link was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7fcc6b90b4083c2b681740aeaa162f8d",
"score": "0.58323306",
"text": "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to(@link, :notice => 'Link was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65a6a2d430bf872129f6f44b34070450",
"score": "0.5831914",
"text": "def update(options: {}, **data)\n\n refresh_with(parse(client.put(\"/tasks/#{gid}\", body: data, options: options)).first)\n end",
"title": ""
},
{
"docid": "3a79b58be0266d686b650cbe10d82d69",
"score": "0.58309597",
"text": "def update_task(id, pid, priority, description, status)\n x = []\n data.each_pair do|k, v|\n x << \"#{k} = #{v}\"\n end\n\n str = x.join(\",\")\n\n command = @db.exec(%Q[\n UPDATE tasks\n SET #{str}\n WHERE id = #{data[\"id\"]};\n ])\n TM::Task.new(command)\n end",
"title": ""
},
{
"docid": "e0a59142d72991b77b2473ff18052e00",
"score": "0.5821884",
"text": "def update\n respond_to do |format|\n if @url_link.update(url_link_params)\n format.html { redirect_to @url_link, notice: 'Url link was successfully updated.' }\n format.json { render :show, status: :ok, location: @url_link }\n else\n format.html { render :edit }\n format.json { render json: @url_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51610728aab2f82e02573c8224ab3d0b",
"score": "0.5821061",
"text": "def update!(**args)\n @tasks = args[:tasks] if args.key?(:tasks)\n end",
"title": ""
},
{
"docid": "24741bb931fe8c8dbde013523ab804c9",
"score": "0.581934",
"text": "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n flash[:notice] = 'Link was successfully updated.'\n format.html { redirect_to(@link) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24741bb931fe8c8dbde013523ab804c9",
"score": "0.581934",
"text": "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n flash[:notice] = 'Link was successfully updated.'\n format.html { redirect_to(@link) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ba5e5aeac84adb1e9b96417dca81534",
"score": "0.5818859",
"text": "def clicks_put_link(link_text)\n clicks_link_with_method(link_text, :put)\n end",
"title": ""
},
{
"docid": "898eceac5df428193eeaac9c641bda10",
"score": "0.58175904",
"text": "def update!(**args)\n @meeting_url = args[:meeting_url] if args.key?(:meeting_url)\n end",
"title": ""
},
{
"docid": "09013b070f385438f59dea935926371d",
"score": "0.5815328",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09013b070f385438f59dea935926371d",
"score": "0.5815328",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09013b070f385438f59dea935926371d",
"score": "0.5815328",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09013b070f385438f59dea935926371d",
"score": "0.5815328",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09013b070f385438f59dea935926371d",
"score": "0.5815328",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9db1ead34ecc736db6a70849695d438",
"score": "0.5814",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: \"Link was successfully updated.\" }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76d5b307679f6deec14a6a75b47504fa",
"score": "0.58082956",
"text": "def update\n puts link_params\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a837350d2a007ae33f0981f1ecb3dfe9",
"score": "0.57994753",
"text": "def set_link\n @link = Link.find(params[:id])\n end",
"title": ""
},
{
"docid": "a837350d2a007ae33f0981f1ecb3dfe9",
"score": "0.57994753",
"text": "def set_link\n @link = Link.find(params[:id])\n end",
"title": ""
},
{
"docid": "ded846259785de8b3dacdd79ccc470a5",
"score": "0.5795837",
"text": "def task_link_params\n params.require(:task_link).permit(:link_type, :from_task_id, :to_task_id)\n end",
"title": ""
},
{
"docid": "f4d1c1c2af585baf6480a8c5ed2c2af5",
"score": "0.57934606",
"text": "def update\n @task = current_user.tasks.find(params[:id])\n # Tasks may not change job, so no assigment like the Create action\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n flash[:notice] = 'Task was successfully updated.'\n format.html { redirect_to job_url(@task.job) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @task.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "01a40cb9533f35a2af92887dcf7db22c",
"score": "0.57923985",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: '투표안건이 성공적으로 수정되었습니다.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "319f282a0f1e34f8a2d0f2468d9deb22",
"score": "0.5788148",
"text": "def update\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff377673320d4598689e7eea8380dd40",
"score": "0.57838416",
"text": "def update!(**args)\n @metadata = args[:metadata] if args.key?(:metadata)\n @link = args[:link] if args.key?(:link)\n end",
"title": ""
},
{
"docid": "52b6b9b32da945d58069f213d9dda787",
"score": "0.5779751",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html do\n redirect_to new_link_path,\n notice: \"Link was successfully updated\"\n end\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea6de8ca9f3e32aac35c767627087eec",
"score": "0.57791543",
"text": "def update!(**args)\n @runnable = args[:runnable] if args.key?(:runnable)\n @task_id = args[:task_id] if args.key?(:task_id)\n @task_status = args[:task_status] if args.key?(:task_status)\n end",
"title": ""
},
{
"docid": "a6184da934486115dea332ac3a7cfffb",
"score": "0.57765347",
"text": "def set_link\n @link = Link.find(params[:id])\n end",
"title": ""
},
{
"docid": "a6184da934486115dea332ac3a7cfffb",
"score": "0.57765347",
"text": "def set_link\n @link = Link.find(params[:id])\n end",
"title": ""
},
{
"docid": "a6184da934486115dea332ac3a7cfffb",
"score": "0.57765347",
"text": "def set_link\n @link = Link.find(params[:id])\n end",
"title": ""
}
] |
12be30c28e9c7c17aa4a2a3189b6ade6
|
Finds a post based on the +post_type+ and +post_id+
|
[
{
"docid": "6e328859942397c71eb21b03dcad08e9",
"score": "0.59301585",
"text": "def post\n \"Stacked::#{post_type.classify}\".constantize.find(post_id)\n end",
"title": ""
}
] |
[
{
"docid": "34bcbcae5585c2cb3cba34170096013c",
"score": "0.7177188",
"text": "def find_post #(18): remove repetition on show, update, edit, destroy methods\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "d2b78a70bc6cac5260568801e398d944",
"score": "0.70391655",
"text": "def find_post\n @post = Post.find(params[:post_id])\n end",
"title": ""
},
{
"docid": "03e1d9bc74275e009b05414ebc5600ae",
"score": "0.7014241",
"text": "def find_post\n @post = Post.find(params[:post_id])\n end",
"title": ""
},
{
"docid": "603200c78209c0c1f59ad0b230ddea02",
"score": "0.7005241",
"text": "def find_post\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "fb208f14695578e50aa9bc2e399abdaa",
"score": "0.70040846",
"text": "def find_post\n\t\t\t@post = Post.find(params[:id])\n\t\tend",
"title": ""
},
{
"docid": "cf63d70c4e028c22123a3e6837c78ce9",
"score": "0.6987363",
"text": "def find_post\n @post = Post.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "a8a072668af591112d1e58c940f41856",
"score": "0.6949922",
"text": "def find_post\n\t\t@post = Post.find(params[:post_id])\n\tend",
"title": ""
},
{
"docid": "a8a072668af591112d1e58c940f41856",
"score": "0.6949922",
"text": "def find_post\n\t\t@post = Post.find(params[:post_id])\n\tend",
"title": ""
},
{
"docid": "ff081a68e945f32b377b5ab5a6e57d22",
"score": "0.6901147",
"text": "def find_post\n\t\t@post = Post.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "936cd32acafe185c5e497f204b52f1a8",
"score": "0.6857428",
"text": "def find_post\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "936cd32acafe185c5e497f204b52f1a8",
"score": "0.6857428",
"text": "def find_post\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "936cd32acafe185c5e497f204b52f1a8",
"score": "0.6857428",
"text": "def find_post\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "936cd32acafe185c5e497f204b52f1a8",
"score": "0.6857428",
"text": "def find_post\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "fda5d77b5f60f5199efc004cb2b08190",
"score": "0.68479675",
"text": "def find_post\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "fda5d77b5f60f5199efc004cb2b08190",
"score": "0.68479675",
"text": "def find_post\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "6eb537185afce390f27719c4b3ee8f39",
"score": "0.6665539",
"text": "def find_post_by_id(id)\n sql = \"SELECT * FROM user_post_infor WHERE id = $1;\"\n run_sql(sql, [id])[0]\n end",
"title": ""
},
{
"docid": "2912833ad2a304b2c59099ca512571f0",
"score": "0.6657836",
"text": "def post(id:)\n Post.find(id)\n end",
"title": ""
},
{
"docid": "2912833ad2a304b2c59099ca512571f0",
"score": "0.6657836",
"text": "def post(id:)\n Post.find(id)\n end",
"title": ""
},
{
"docid": "d87cdff96cf54de26a704270ab6839f8",
"score": "0.6628674",
"text": "def post(id:)\n Post.find(id)\n end",
"title": ""
},
{
"docid": "0709332e96bfcbd7ab5893e78d3b3097",
"score": "0.6595896",
"text": "def post(id)\n Post.find_by_id(id)\n end",
"title": ""
},
{
"docid": "49e161508ac4d34ef3a3a748d66c0657",
"score": "0.6574288",
"text": "def find_post\n @post = Post.find_by_id_and_topic_id(params[:id], params[:topic_id]) || raise(ActiveRecord::RecordNotFound)\n end",
"title": ""
},
{
"docid": "cec1e191783ee391dc430fb0c08b0a22",
"score": "0.65608823",
"text": "def findPost(discipline_id, topic_id, post_id)\n @topic = findTopic(discipline_id, topic_id)\n @post = @topic.posts.find(post_id)\n end",
"title": ""
},
{
"docid": "22d1551f7331b48f1aa43efa2075e52c",
"score": "0.6441075",
"text": "def posts\n if !current_user then redirect_to \"/signin\", :alert => \"You are not signed in!\" end\n if params[:type] then\n @posts = Post.all.where('post_type = ?', params[:type].capitalize)\n else\n @posts = Post.all\n end\n end",
"title": ""
},
{
"docid": "c013dc1c3788ee1f2084cb4b339a2483",
"score": "0.64225143",
"text": "def set_post\n\t\t\t@post = post_type_class.find(params[:id])\n\t\tend",
"title": ""
},
{
"docid": "173a27e8a5a455e5becccd8a730cdfd0",
"score": "0.64079595",
"text": "def set_post_type\n @post_type = PostType.find(params[:id])\n end",
"title": ""
},
{
"docid": "173a27e8a5a455e5becccd8a730cdfd0",
"score": "0.64079595",
"text": "def set_post_type\n @post_type = PostType.find(params[:id])\n end",
"title": ""
},
{
"docid": "186d0a4887a3fbe949bf5571318c0bbd",
"score": "0.6323824",
"text": "def find_post\n @posts_public = Post.where(public: true)\n @posts_draft = Post.where(public: false)\n end",
"title": ""
},
{
"docid": "aa7fcdfe5f69399bc316b1b07b666702",
"score": "0.6208126",
"text": "def find_by_id(posts, id)\n posts.each { |value|\n return value if value['id'] == id\n }\n end",
"title": ""
},
{
"docid": "26e357cf3766966d63390de4920e0000",
"score": "0.6204855",
"text": "def find_type_object(page); type_class.find_by(field_id: id, page_id: page.id) end",
"title": ""
},
{
"docid": "0dfe1028779bd6da27090bf5539a8e75",
"score": "0.61956286",
"text": "def get_post\n @post = Post.find(params[:post_id])\n end",
"title": ""
},
{
"docid": "70f52378cc45b7c629560d926dcae403",
"score": "0.61904085",
"text": "def list_by_post_type\n list :conditions => ['post_type = ?', params[:type]]\n end",
"title": ""
},
{
"docid": "7ebdaf20a371040f627688910b57e09f",
"score": "0.6181803",
"text": "def get_post(post_id)\n get_posts(nil, :post_id => post_id)\n end",
"title": ""
},
{
"docid": "11b11e72a4b13d7e610d495a7febf554",
"score": "0.6164279",
"text": "def get_post\n @post ||= Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "5440b58032772e1787cb7c0781572f3c",
"score": "0.6153152",
"text": "def post_type\n if post_id?\n \"repost\"\n else\n \"post\"\n end\n end",
"title": ""
},
{
"docid": "2ba3100c5cb91c10931b4c8a7e18d7db",
"score": "0.6130274",
"text": "def find_post\r\n\t\t\t@post = Post.find_by id: params[:id]\r\n\t\t\treturn if @post\r\n\t\t\tflash[:danger] = \"Post Does Not Exist\"\r\n\t\t\tredirect_to root_path\r\n\t\tend",
"title": ""
},
{
"docid": "331fc131bad668256f6034e82db54f8c",
"score": "0.6110208",
"text": "def get_post_by_permalink(permalink)\n @posts.find_one({'permalink' => permalink})\n end",
"title": ""
},
{
"docid": "134bb58574f5678044a5f08be1382eaf",
"score": "0.6103767",
"text": "def get_post\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "f51b71db782254f8d996b53acf4163cb",
"score": "0.60920185",
"text": "def find_post(postId)\n if postId == \"sf4\"\n \"Street Fighter 4\"\n elsif postId == \"mk9\"\n \"Mortal Kombat 9\"\n end\nend",
"title": ""
},
{
"docid": "39f426aadbbcb1e8ea77d25a3026307b",
"score": "0.6084799",
"text": "def existing_post\n post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "dc9a55b914b0f52ccdc0dac99e8f3c8f",
"score": "0.6083232",
"text": "def find_post\n @post = Post.friendly.find(params[:post_id]) \n end",
"title": ""
},
{
"docid": "277ddb7540f64a2da253ab183194730b",
"score": "0.6069142",
"text": "def find_post\n @post = Post.find_by_permalink(params[:id])\n @page_title = @post.title\n end",
"title": ""
},
{
"docid": "99490d83319995a0e5d5e55940234a08",
"score": "0.60234255",
"text": "def post(slug_id)\n\t\treturn self.posts.where(:slug => slug_id).first\n\tend",
"title": ""
},
{
"docid": "ca3c0fa320ffa89e2100145d02c1e204",
"score": "0.60199136",
"text": "def find_post_for_show\n\t\t\tbegin\n\t\t\t\t@post = Post.find(params[:id])\n\t\t\t\tif !@post.published?\n\t\t\t\t\t#chua chung thuc\n\t\t\t\t\tif !user_signed_in?\n\t\t\t\t\t\trender nothing: true, status: :not_found, content_type: 'application/json'\n\t\t\t\t\telse\n\t\t\t\t\t\t#chung thuc rui ma ko phai bai viet cua nguoi do\n\t\t\t\t\t\tif @post.user != current_user\n\t\t\t\t\t\t\trender nothing: true, status: :not_found, content_type: 'application/json'\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\trescue Mongoid::Errors::DocumentNotFound\n\t\t\t\trender nothing: true, status: :not_found, content_type: 'application/json'\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "3521854ea0a309d1b57bf1385498e47c",
"score": "0.6012142",
"text": "def post\n @post ||= Post.friendly.find params[:post_id]\n end",
"title": ""
},
{
"docid": "f562ddae706c88744f829843328d6cd0",
"score": "0.5969808",
"text": "def postable\n postable_klass.find(post_params[:postable_id]) rescue nil\n end",
"title": ""
},
{
"docid": "d2088d21d7c262b1ba6bf722231d1619",
"score": "0.59322214",
"text": "def find_post(board, title, cookie = nil)\n get_board(board, cookie).each do |post|\n if post[\"title\"] == title\n return post\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "694236845e7cdea5c1e14d0dbf7dbac7",
"score": "0.59193456",
"text": "def post(id)\n entries.find_by_id(id)\n end",
"title": ""
},
{
"docid": "6633226e0069f717cadf71f2f2373315",
"score": "0.5899172",
"text": "def set_post\n @post = @current_user.posts.includes(:challenges, user: [:profile]).find(params[:id])\n rescue ActiveRecord::RecordNotFound\n head :not_found\n end",
"title": ""
},
{
"docid": "0347aae8a4c57ae0ce5912cbafde1749",
"score": "0.5890673",
"text": "def show\n # As we already have our “before_action” filter set on the “show” action, it does the job for us to find into the\n # Post model database the one with the “:id” provided in the URL params\n # To be clear : this action looks empty, but it’s not, because of the before_action.\n end",
"title": ""
},
{
"docid": "35b366873aa4b9f2e313e518e27a4e97",
"score": "0.5889727",
"text": "def find_by_slug slug\n (Post.all :conditions => { :slug => slug }).first\n end",
"title": ""
},
{
"docid": "71fde87308db01140a96e197ae5d65aa",
"score": "0.5877125",
"text": "def post\n return false unless post_id\n post = Post.get_from_cache(post_id)\n post ||= Comment.get_from_cache(post_id)\n post ||= Post.find({:id => post_id})\n post ||= Comment.find({:id => post_id})\n end",
"title": ""
},
{
"docid": "11a331bfb3da5c200a1ac68d088d9918",
"score": "0.5846563",
"text": "def set_post\n #if (!params[:id])\n @post = Post.find(params[:id])\n #else\n # @post = Post.where('title'=>params[:id])\n\n # end\n end",
"title": ""
},
{
"docid": "3a55495d705b25868f5f0788779557d2",
"score": "0.5846112",
"text": "def find_by_slug(slug)\n self.slugs_to_posts[slug]\n end",
"title": ""
},
{
"docid": "e6515aa97014c17933932d471576006b",
"score": "0.58390146",
"text": "def show\n @post = post_type.find_by_slug(params[:id])\n\n if @post.blank?\n redirect_to(root_path(), :notice => \"Sorry, we couldn't find what you were looking for \" + params[:id]) and return\n end\n\n #TODO; refactor\n @commentable = @post\n if @post.is_a?(Kata)\n @comments = @post.survived_reviews.desc(:vote_score, :last_update)\n @comment = Review.new\n else\n @comments = @post.survived_comments.desc(:vote_score, :last_update)\n @comment = Comment.new\n end\n\n if post_type != Kata\n @likes = @post.listLikes\n @dislikes = @post.listDislikes\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "e6515aa97014c17933932d471576006b",
"score": "0.58390146",
"text": "def show\n @post = post_type.find_by_slug(params[:id])\n\n if @post.blank?\n redirect_to(root_path(), :notice => \"Sorry, we couldn't find what you were looking for \" + params[:id]) and return\n end\n\n #TODO; refactor\n @commentable = @post\n if @post.is_a?(Kata)\n @comments = @post.survived_reviews.desc(:vote_score, :last_update)\n @comment = Review.new\n else\n @comments = @post.survived_comments.desc(:vote_score, :last_update)\n @comment = Comment.new\n end\n\n if post_type != Kata\n @likes = @post.listLikes\n @dislikes = @post.listDislikes\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "79e044f0f7f898f14da515b0a5d6e4bc",
"score": "0.5833692",
"text": "def post\n Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "5a489b57c58a3c69240faf578ea13e10",
"score": "0.5821285",
"text": "def find_by_type(type)\n find { |r| r.type == type }\n end",
"title": ""
},
{
"docid": "b8471c6531f8730abf5b7a6dae8c9309",
"score": "0.5817201",
"text": "def load_post\n @post = Post.find(params[:post_id])\n end",
"title": ""
},
{
"docid": "8967cb32eda66028ec69c07a68011709",
"score": "0.58088887",
"text": "def find_by_permalink(year, month, day, slug, options = {}) \n begin\n day = Time.parse([year, month, day].collect(&:to_i).join(\"-\")).midnight\n post = find_all_by_slug(slug, options).detect do |post|\n [:year, :month, :day].all? { |time|\n post.published_at.send(time) == day.send(time)\n }\n end\n rescue ArgumentError # Invalid time\n post = nil \n end \n post || raise(ActiveRecord::RecordNotFound)\n end",
"title": ""
},
{
"docid": "77aaf0d2f775089b6d33e39c95dcb9d6",
"score": "0.58001053",
"text": "def find_post\n @post = current_user.posts.find_by_id(params[:post_id])\n redirect_to root_path, alert: 'You not authenticate for this blog.' if @post.blank?\n end",
"title": ""
},
{
"docid": "0b08ec58a716335be76126e848212991",
"score": "0.5790376",
"text": "def set_post\n @post = Post.published.find_by!(date_slug: \"#{params[:id]}\")\n end",
"title": ""
},
{
"docid": "6509e48a664d97dd77f9cebaf3a2d123",
"score": "0.57866156",
"text": "def set_post\n @post =\n case\n when id = params[:id]\n Post.find(id)\n when id = params[:post_id]\n Post.find(id)\n end\n\n end",
"title": ""
},
{
"docid": "66bba553645fe8237e62065873734034",
"score": "0.57822627",
"text": "def show\n @post = Post.find_by(id: params[:id])\n \n end",
"title": ""
},
{
"docid": "723785189a75f1c6914b0231bfc59ce9",
"score": "0.57522374",
"text": "def show\n @post = Post.find_by_id(params[:post_id])\n end",
"title": ""
},
{
"docid": "dce483669f424a9ab7d9ae2ec9aadfc1",
"score": "0.57442325",
"text": "def set_post\n @post = Post::Base.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "3a20a0bf26333c83309c1db90a042b74",
"score": "0.5734315",
"text": "def search\n @posts = Post.where(plant_id: Plant.find_by_name(params[:name]))\n end",
"title": ""
},
{
"docid": "b3c368a43a2fbadd7cc322ee40d09933",
"score": "0.57290334",
"text": "def find(type, options = {})\n if type == :all\n find_all options\n elsif type == :first\n find_one options.merge(:limit => 1) \n else\n find_by_id(type, options)\n end\n end",
"title": ""
},
{
"docid": "a0d98bb34175863f6c2192a8a228579a",
"score": "0.57096153",
"text": "def show_post\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "804ef1339ccf5e029f17a4567315fd6c",
"score": "0.57079935",
"text": "def get_post(source, post)\n\t\tposts = WordPress.query_load_json(source, \"posts/#{post}\", params = nil)\n\tend",
"title": ""
},
{
"docid": "1ddaf9e59ab829c8a9d6371f9ae87888",
"score": "0.5707118",
"text": "def post\n @post ||= Post[post_id]\n end",
"title": ""
},
{
"docid": "702e7edd9cdb1a2eccc697ca14862515",
"score": "0.57057065",
"text": "def show\n @post = Post.find(params[:id])\n #find the post that corresponds to the id in the params that was passed to show &\n #assign it to @post. Unlike in the index method, in the show method,\n #populate an instance variable with a single post, rather than a collection of posts.\n end",
"title": ""
},
{
"docid": "b1d15ba00755776005f39edcb8f29b07",
"score": "0.57049006",
"text": "def post\n case mode\n when :single ; @posts[@page_index]\n when :statics ; @statics[@page_index]\n end\n end",
"title": ""
},
{
"docid": "59fa18bd6b5a26a9ee1d22042317e5d1",
"score": "0.5698364",
"text": "def search_post(search)\n if search.blank?\n self.posts\n else\n self.posts.where(\"title LIKE ?\", \"%#{search}%\")\n end\n end",
"title": ""
},
{
"docid": "4187adbfea32577250b729f5fc625abb",
"score": "0.56836003",
"text": "def find(type)\n children.find { |c| c.try(:type) == type }\n end",
"title": ""
},
{
"docid": "a9c126b1c6cf53a883ba9557300c6886",
"score": "0.56779486",
"text": "def set_posting_type\n @posting_type = PostingType.find(params[:id])\n end",
"title": ""
},
{
"docid": "39f70b0640967852f696bf60e30ba203",
"score": "0.56550276",
"text": "def show\n #find post by id and show\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "f477a57a0504e31853197bc19d9c936c",
"score": "0.5651643",
"text": "def posts\n Post.find(:flow_id => id)\n end",
"title": ""
},
{
"docid": "d497a30aa5f84e8ea7f0ccdbf916c7b2",
"score": "0.5648112",
"text": "def get_admin_post\n @admin_post = Admin::Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "2af87a629b0a8a28c6a5f5c8af225f42",
"score": "0.56478125",
"text": "def find_by_param!(value, args={})\n param = permalink_options[:param]\n obj = find_by_param(value, args)\n raise ::ActiveRecord::RecordNotFound unless obj\n obj\n end",
"title": ""
},
{
"docid": "60b70e197fdeaf6d8c059a966c65e6f9",
"score": "0.5647016",
"text": "def posts\n if !current_user then redirect_to \"/signin\", :alert => \"You are not signed in!\" end\n @groups = current_user.groups.split(',')\n if params[:type] then\n @posts = Post.all.where('post_type = ?', params[:type].capitalize)\n else\n @posts = Post.all\n end\n end",
"title": ""
},
{
"docid": "099d75cf586417c10e76ead3a8d675ec",
"score": "0.5632139",
"text": "def show\n @post = post_type.find_by_slug(params[:id])\n\n #TODO; refactor\n @commentable = @post\n if @post.is_a?(Kata)\n @comments = @post.survived_reviews\n @comment = Review.new\n else\n @comments = @post.survived_comments\n @comment = Comment.new\n end\n\n if post_type != Kata\n @likes = @post.listLikes\n @dislikes = @post.listDislikes\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "15b3f1c0b418ebcc320e54fcaf60dfb9",
"score": "0.5607829",
"text": "def find(*types)\n children.find { |c| types.include?(c.try(:type)) }\n end",
"title": ""
},
{
"docid": "15b3f1c0b418ebcc320e54fcaf60dfb9",
"score": "0.5607829",
"text": "def find(*types)\n children.find { |c| types.include?(c.try(:type)) }\n end",
"title": ""
},
{
"docid": "e2258d8cec5d57a9b373fd59206bcc72",
"score": "0.5602211",
"text": "def set_post\n @post = Post.includes(:images, :user).find(params[:id])\n end",
"title": ""
},
{
"docid": "a46b1c1a251d1a1217d725f7b98e135b",
"score": "0.5595923",
"text": "def given_a_published_post_exists\n post_1\n end",
"title": ""
},
{
"docid": "570b7c75b35fa1365385182a836ddba6",
"score": "0.5565327",
"text": "def load_post(post_id = nil)\n @post = Post.find_by_id(post_id)\n return !@post.nil?\n end",
"title": ""
},
{
"docid": "fff49bead433f00a490b8a3e9a0d3748",
"score": "0.55596805",
"text": "def find_blog_post\n @blog_categories = BlogCategory.all\n unless (@blog_post = BlogPost.find(params[:id])).try(:live?)\n #if refinery_user? and current_user.authorized_plugins.include?(\"refinerycms_blog\")\n @blog_post = BlogPost.find(params[:id])\n #else\n # error_404\n #end\n end\n end",
"title": ""
},
{
"docid": "5d7f0a29b355dc5121e1aae6882821e7",
"score": "0.5549869",
"text": "def show\n @post = Post.find(params[:id])\n @type_is = params[:type_is]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "496c9ea35b273bed9fd339420074451f",
"score": "0.5541809",
"text": "def search(search)\n if search && search.size > 0\n ids = self.posts.where(\"title ILIKE ?\", \"%#{search}%\").ids\n by_post_body = self.posts.where(\"body ILIKE ?\", \"%#{search}%\").ids\n by_post_body.each do |post_id|\n ids << post_id\n end\n ids.compact! if ids.include?(nil)\n final = Post.where(id: ids)\n else\n self.posts\n end\n end",
"title": ""
},
{
"docid": "243c70698dfd78067452d1ec17c2e833",
"score": "0.5539762",
"text": "def show\n @post = Post.find_by id: params[:id]\n @posts = Post.all\n end",
"title": ""
},
{
"docid": "e240692a511992ea5e7a41dd96a462f7",
"score": "0.55361897",
"text": "def set_post\n @post = Post.find_by(date_slug: \"#{params[:id]}\")\n end",
"title": ""
},
{
"docid": "e33e4efffb071fc6aa6b69bc4fb06c64",
"score": "0.5535567",
"text": "def set_post\n @post = Post.find_by_param(params[:id])\n end",
"title": ""
},
{
"docid": "6356236e3620280ec710a824ab967374",
"score": "0.5535397",
"text": "def find_by_param(value,args={})\n if permalink_options[:prepend_id]\n param = \"id\"\n value = value.to_i\n else\n param = permalink_options[:param]\n end\n self.send(\"find_by_#{param}\".to_sym, value, args)\n end",
"title": ""
},
{
"docid": "4616db3d9031bc025c34f4f3859e8f0d",
"score": "0.55311614",
"text": "def find_resource\n parent.posts.find(params[:id])\n end",
"title": ""
},
{
"docid": "9fc58933e22a18185a349593dc6d7f0c",
"score": "0.55306107",
"text": "def set_post\n @post = Post.find_by_post_name(params[:id]) || @post = Post.find(params[:id]) # TODO Может надо отключить в будущем поиск поста по его ID в базе?\n rescue\n render file: 'public/404', status: 404\n end",
"title": ""
},
{
"docid": "747dbc0fdd58a9f306069cc050d38cdd",
"score": "0.55201626",
"text": "def show\n @posts = Post.all\n\tif params[:id] != nil\n\t @post =Post.find_by(id:params[:id])\n\t elsif params[:heading] == nil\n\t\t if Post.find_by(id:1) == nil\n firstCreate\n end\t\t\t\n\t @post =Post.first\n\tend\n end",
"title": ""
},
{
"docid": "4e7b7fced2edc98e671dfa4d4f6cace4",
"score": "0.55135787",
"text": "def set_post\n categories = [\"CSS Tricks\", \"Things I've learned\", \"How I stay sharp\", \"all\"];\n if params[:id].in?(categories)\n expandedCategory = '';\n cat = params[:id]\n\n case when cat ==\"csstricks\" then expandedCategory='CSS Tricks' end\n case when cat==\"thingsivelearned\" then expandedCategory=\"Things I've learned\" end\n case when cat==\"howistaysharp\" then expandedCategory=\"How I stay sharp\" end\n\n @posts = Post.where category: expandedCategory; #raise Exception #if @post != Post.all;\n render template: 'posts/index', variable: @posts\n return @posts\n else\n @post = Post.find(params[:id])\n end\n end",
"title": ""
},
{
"docid": "03998170905a64c8966e031d5e1ecc48",
"score": "0.55046684",
"text": "def set_post\n @post = Post.full.find(params[:id])\n end",
"title": ""
},
{
"docid": "01402adcfb934edf1857f9858551d8cd",
"score": "0.5501955",
"text": "def set_post\n @post = Post.includes(:comments).find(params[:id])\n end",
"title": ""
}
] |
9be4f76c5d06179bd3b64538a2e9517a
|
Set tempo in terms of Quarter Notes per Minute (aka BPM)
|
[
{
"docid": "f13125872aa78a67c222190448d83e5e",
"score": "0.77403736",
"text": "def tempo(bpm)\n # if @parent then this is a child sequence and we should respect\n # the parent tempo and adjust the qnpm accordingly\n @tempo = bpm\n ms_per_quarter_note = MIDI::Tempo.bpm_to_mpq(bpm)\n event = MIDI::Tempo.new(ms_per_quarter_note)\n @meta_track.insert(event, @time)\n end",
"title": ""
}
] |
[
{
"docid": "b1e536927abae1d5a559d44da05bcb4d",
"score": "0.7528274",
"text": "def tempo(beats_per_second)\n\t\tbeats_per_minute = beats_per_second * 60 \n\tend",
"title": ""
},
{
"docid": "cb2f314ce73a82edd0f23729b7f8a264",
"score": "0.63498175",
"text": "def tempo_min\n @tempo_min ||= data[:tempo_min].to_i\n end",
"title": ""
},
{
"docid": "dbe9c8c84707b1e1a884a100ec57f3f4",
"score": "0.6303169",
"text": "def beats_per_minute\n return DEFAULT_TEMPO if @tracks.nil? || @tracks.empty?\n event = @tracks.first.events.detect { |e| e.kind_of?(MIDI::Tempo) }\n return event ? (Tempo.mpq_to_bpm(event.tempo)) : DEFAULT_TEMPO\n end",
"title": ""
},
{
"docid": "ddc83a4d5c2d5a645072d2a7da90b7e8",
"score": "0.62178725",
"text": "def tempo(microsecs)\n\t@track.events << Tempo.new(microsecs, @curr_ticks)\n end",
"title": ""
},
{
"docid": "5c484a57b88b4dcff6b44b1dafea7fe6",
"score": "0.6216645",
"text": "def tempo\n @tempo ||= data[:tempo].to_i\n end",
"title": ""
},
{
"docid": "15c281a34d6a6bc0b8a0372ab9e25ace",
"score": "0.58898985",
"text": "def set_clocks(mtime=1)\n @m = mtime\n @t = 4*mtime\n nil\n end",
"title": ""
},
{
"docid": "7f04a6e54118c347c8cbbb4d31ecd45e",
"score": "0.5709246",
"text": "def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end",
"title": ""
},
{
"docid": "29e5666cd8883581407ac0fe1190a353",
"score": "0.56353086",
"text": "def settime(h, m)\t\t\t\t\n\t\t@t = Time.new(2016, 10, 12, h, m, 0)\t# set time class\n\t\t@hour = @t.strftime(\"%I\")\t\t# set hour\n\t\t@min = @t.strftime(\"%M\")\t\t# set minute\n\t\t\n\tend",
"title": ""
},
{
"docid": "8d7593d039827148a5a4428f36944662",
"score": "0.5602666",
"text": "def in_tempo\n self\n end",
"title": ""
},
{
"docid": "03ec46a6dc6c593addfacd49e35b95ff",
"score": "0.5559446",
"text": "def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = 23\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "23e158c16c6abfa9127adb1379e7c889",
"score": "0.5466252",
"text": "def set_time(hr, min)\n time = self.current_time.split(\":\")\n time[0] = hr\n time[1] = min\n self.current_time = time.join(\":\")\n end",
"title": ""
},
{
"docid": "e8b1e76d8c905b49ca983cf74c790db3",
"score": "0.5440889",
"text": "def bpm(value)\n @ole.BPM = value\n nil\n end",
"title": ""
},
{
"docid": "80c3a0c24dcbec28df16514d2f9a08d8",
"score": "0.5439548",
"text": "def mpm\n mph = self.mph\n return nil unless mph and mph.is_a?(Float)\n div = 60.0 / mph\n min = div.floor\n sec = ( ( div - min ) * 60.0 )\n \"#{ sprintf(\"%.2d\", min ) }:#{ sprintf(\"%.2d\", sec ) }\"\n end",
"title": ""
},
{
"docid": "4c3122e91be6073c0d6df43c23d9c8d8",
"score": "0.54380053",
"text": "def initialize(bpm) \n @bpm = bpm\n @interval = 60.0/bpm\n @base = Time.now.to_f\n @seq = MIDI::Sequence.new\n header_track = MIDI::Track.new(@seq)\n @seq.tracks << header_track\n header_track.events << MIDI::Tempo.new(MIDI::Tempo.bpm_to_mpq(@bpm))\n @tracks = []\n @last = []\n end",
"title": ""
},
{
"docid": "9a74c25c79e7313f318a10ba2fe19c06",
"score": "0.5437346",
"text": "def set_time_frame time, time_slot = 30.minutes\n Time.at(((time.to_i / time_slot).round * time_slot) + time_slot).to_i\n end",
"title": ""
},
{
"docid": "5f2bbeffc8de5b4572d67e268db50e47",
"score": "0.5401778",
"text": "def timescale\n put('l^')\n get.strip.to_i\n end",
"title": ""
},
{
"docid": "4cf8560b6b94d85ff5533b1da0a1afc0",
"score": "0.5378898",
"text": "def tempo_max\n @tempo_max ||= data[:tempo_max].to_i\n end",
"title": ""
},
{
"docid": "97e5f3ebdbde39fa4ff488d4144c0724",
"score": "0.5361333",
"text": "def mph\n \"#{(self * 1.15077945).round(1)} mph\"\n end",
"title": ""
},
{
"docid": "7b652e4fbaa5020d3bf456168dc4f2a9",
"score": "0.53475386",
"text": "def tock\n @minute += 1\n end",
"title": ""
},
{
"docid": "74a00dc631a4c2987d21459d24cde16e",
"score": "0.5335058",
"text": "def minutes; self * MINUTE; end",
"title": ""
},
{
"docid": "74a00dc631a4c2987d21459d24cde16e",
"score": "0.5335058",
"text": "def minutes; self * MINUTE; end",
"title": ""
},
{
"docid": "82e9db131dea3bffa4f7d85cbd956249",
"score": "0.5316475",
"text": "def qset(newrate, tag=nil)\n song_change(\".\", \"rt=#{newrate}\")\n if tag\n song_change(\".\", \"tag=#{tag}\")\n end\n next_song\n sleep(2)\n seek(\"60\")\n end",
"title": ""
},
{
"docid": "305a14299a2845f4ced98d312eb45781",
"score": "0.5252699",
"text": "def mettrePause()\n @chrono.mettreEnPause()\n end",
"title": ""
},
{
"docid": "87ebb1da9f96e27fb3af97c124ab7bf5",
"score": "0.5251459",
"text": "def set_cms_chapter_meeting_minute\n @cms_chapter_meeting_minute = Cms::ChapterMeetingMinute.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a265cfbe85f49003abf49dd38fc5eca",
"score": "0.5207799",
"text": "def minutes\n self * SECONDS_IN_MINUTES\n end",
"title": ""
},
{
"docid": "9cf2257538281566e6350c1e0a6a312a",
"score": "0.51999",
"text": "def minutos(seg)\n return seg.to_f / 60\nend",
"title": ""
},
{
"docid": "e6787aab105d315002536943da3cbab2",
"score": "0.51680595",
"text": "def min=(newmin)\n newmin = newmin.to_i\n raise ArgumentError, \"Invalid minute: '#{newmin}'.\" if newmin < 0 or newmin > 60\n @t_min = newmin\n end",
"title": ""
},
{
"docid": "149ab4e1009a3b9825dd834f7d8d9efd",
"score": "0.5137087",
"text": "def set_current_time(option)\n @hour = option[:hour]\n @min = option[:min]\n @sec = option[:sec] || 0\n end",
"title": ""
},
{
"docid": "af818bc8e196704a24d0bc748c1dccfa",
"score": "0.5118341",
"text": "def mpk\n kmh = self.kmh\n return nil unless kmh and kmh.is_a?(Float)\n div = 60.0 / kmh\n min = div.floor\n sec = ( ( div - min ) * 60.0 ).round \n \"#{ sprintf(\"%.2d\", min ) }:#{ sprintf(\"%.2d\", sec ) }\"\n end",
"title": ""
},
{
"docid": "e0be1d062c5de4bef39d073b1e45cc59",
"score": "0.5100594",
"text": "def today_minutes_playing\n self[:min_play]\n end",
"title": ""
},
{
"docid": "c2d7587be19dfe7a62996f0c2dae9dbd",
"score": "0.5083027",
"text": "def ampm\n if @t_hour <= 12\n return \"am\"\n else\n return \"pm\"\n end\n end",
"title": ""
},
{
"docid": "21d7ff71090f52e52d39e91460ebb7a6",
"score": "0.5082531",
"text": "def tenure_mth\n self.tenure*12\n end",
"title": ""
},
{
"docid": "3a6ddb564bb61919825676bd3b5aa000",
"score": "0.50812435",
"text": "def minute\n set_function_and_argument(:minute, nil)\n end",
"title": ""
},
{
"docid": "38606901e526803cebd7e4c096a10c63",
"score": "0.5054494",
"text": "def set_mtimes(times)\n pm = false\n _24hr = true\n\n times_24 = []\n now = Time.now\n \n #convert to '24hr' for consistency\n #start backwards to make sure its am or pm\n times.reverse_each do |t|\n\n hr, min = t[0].to_s.split(':', 2)\n\n #change to pm\n if (min.include?(\"pm\"))\n pm = true\n _24hr = false\n end\n\n #change from pm to am\n if (min.include?(\"am\") && !_24hr)\n pm = false\n end\n\n #only am start - hackish\n if (min.include?(\"am\") && times.length < 3)\n _24hr = false\n end\n\n if (_24hr)\n augment =0\n if (hr.to_i == 12)\n augment = 12\n end\n\n t = Time.new(now.year, now.month, now.day,\n hr.to_i - augment, min[/[0-9]+/]) + 24*60*60 #add a day\n elsif (pm)\n augment = 0\n if hr.to_i != 12\n augment = 12\n end\n t = Time.new(now.year, now.month, now.day,\n hr.to_i + augment, min[/[0-9]+/])\n\n elsif (!pm & !_24hr)\n t = Time.new(now.year, now.month, now.day,\n hr.to_i, min[/[0-9]+/])\n end\n\n=begin\n #midnight seems to be latest\n if ((!pm && min.include?(\"am\") && hr.to_i == 12) ||\n ((!pm && hr.to_i == 12)))\n \n t = Time.new(now.year, now.month, now.day,\n hr.to_i - 12, min[/[0-9]+/]) + 24*60*60 #add a day\n\n elsif (!pm && min.include?(\"am\"))\n pm = false\n\n t = Time.new(now.year, now.month, now.day,\n hr.to_i, min[/[0-9]+/])\n\n elsif (pm || min.include?(\"pm\"))\n pm = true\n augment = 0\n if (hr.to_i != 12)\n augment = 12\n end\n\n t = Time.new(now.year, now.month, now.day,\n hr.to_i + augment, min[/[0-9]+/])\n\n end\n=end\n times_24.push t\n end\n\n self.mtimes = times_24\n\n end",
"title": ""
},
{
"docid": "ac904b5f9d258750617c9d2896c8ad47",
"score": "0.5052089",
"text": "def seconds ; return aseconds % SPM ; end",
"title": ""
},
{
"docid": "837d89ab36fc91210b5decde7d7747e6",
"score": "0.50437576",
"text": "def set_minutes_minute\n @minutes_minute = Minutes::Minute.includes(items: [motions: [:mover]]).find(params[:id])\n end",
"title": ""
},
{
"docid": "d96078b421fa077310aea250ca80bf9a",
"score": "0.50432986",
"text": "def set_moon_clocks\n now = set_clocks\n \n # Has new or full moon expired?\n if now > $tnew1 || now > $tfull1\n $tnew0, $tnew1, $tfull0, $tfull1 = LunarYear.date_of_moons(now)\n end\n \n $last_new_moon.value = format_days(now - $tnew0)\n $next_new_moon.value = format_days($tnew1 - now)\n $last_full_moon.value = format_days(now - $tfull0)\n $next_full_moon.value = format_days($tfull1 - now)\nend",
"title": ""
},
{
"docid": "c38544c8667a5a1eb238830766c0ff4d",
"score": "0.5025514",
"text": "def increment_time\n @now += 1.minute\n end",
"title": ""
},
{
"docid": "2660d3328aef6c72b5615f32d1912027",
"score": "0.50190616",
"text": "def rhythm=(rhythm)\n @rhythm = rhythm.delete(BARLINE)\n beats = []\n \n beat_length = 0\n #rhythm.each_char{|ch|\n @rhythm.each_byte do |ch|\n ch = ch.chr\n if ch == BEAT\n beats << beat_length\n beat_length = 1\n elsif ch == REST\n beat_length += 1\n else\n raise InvalidRhythmError, \"Track #{@name} has an invalid rhythm: '#{rhythm}'. Can only contain 'X' or '.'\"\n end\n end\n \n if beat_length > 0\n beats << beat_length\n end\n if beats == []\n beats = [0]\n end\n @beats = beats\n \n # Remove any cached sample data\n @sample_data = nil\n @overflow = nil\n end",
"title": ""
},
{
"docid": "db1cfdf1ed9c8c6274e5b4ef212f69b0",
"score": "0.5009354",
"text": "def refresh\n time = Time.new#(2015,01,01,0,0,0)\n h = ((time.hour + (time.min / 60.0)) / 12.0) * @size;\n m = ((time.min + (time.sec / 60.0))/ 60.0) * @size;\n s = ((time.sec + (time.nsec/1000000000.0) ) / 60.0) * @size;\n @hms={ :h => h, :m => m, :s => s }\n end",
"title": ""
},
{
"docid": "db1cfdf1ed9c8c6274e5b4ef212f69b0",
"score": "0.5009354",
"text": "def refresh\n time = Time.new#(2015,01,01,0,0,0)\n h = ((time.hour + (time.min / 60.0)) / 12.0) * @size;\n m = ((time.min + (time.sec / 60.0))/ 60.0) * @size;\n s = ((time.sec + (time.nsec/1000000000.0) ) / 60.0) * @size;\n @hms={ :h => h, :m => m, :s => s }\n end",
"title": ""
},
{
"docid": "0a88af6cbeb9cdbb1f3606cb10933ac5",
"score": "0.5009255",
"text": "def mHz\n (self * 1000_000).Hz\n end",
"title": ""
},
{
"docid": "c91c242ef85db69d45e43380de2da3bf",
"score": "0.50085473",
"text": "def qnow quantum=10.minutes, now=Familia.now\n rounded = now - (now % quantum)\n Time.at(rounded).utc.to_i\n end",
"title": ""
},
{
"docid": "5e632a51f80bb9f44f5cfb40acb55f8f",
"score": "0.5005834",
"text": "def minutes() 60 * seconds end",
"title": ""
},
{
"docid": "5275222d90025e829e31831451141404",
"score": "0.49999493",
"text": "def setTime(hour, min, sec)\n setSec(sec) ;\n addMin(min) ;\n addHour(hour) ;\n end",
"title": ""
},
{
"docid": "5f73c8752ceae19160121bf55909566a",
"score": "0.49949765",
"text": "def minutes ; self * 60 ; end",
"title": ""
},
{
"docid": "40da0102e736b5d7cfae9b24c43c4d60",
"score": "0.49842927",
"text": "def test_minute_set\n clock = Clock.new 0, -1\n alarm = AlarmClock.new 0, -1\n puts 'Wrong hour set' if clock.get_minute != 0\n puts 'Wrong hour set' if alarm.get_alarm_minute != 0\n clock.set_time 26, 0\n alarm.set_alarm 26, 0\n puts 'Wrong hour set' if clock.get_minute != 23\n puts 'Wrong hour set' if alarm.get_alarm_minute != 23\n end",
"title": ""
},
{
"docid": "e86f80f064ff42e4af54dba05e1e282e",
"score": "0.49797013",
"text": "def cron_timer(minutes_from_now,time_object, script)\n raw_time = time_object + (minutes_from_now.to_i*60)\n cron_string = cron_converter(raw_time)\n end",
"title": ""
},
{
"docid": "7482211639600b0645aa24a835e38af5",
"score": "0.49750906",
"text": "def ms_to_min(ms)\n tempo = (ms.to_f / 1000) / 60\n return tempo\nend",
"title": ""
},
{
"docid": "fac330901d855e2df2bacc20b8de8d67",
"score": "0.49345437",
"text": "def period; end",
"title": ""
},
{
"docid": "fac330901d855e2df2bacc20b8de8d67",
"score": "0.49345437",
"text": "def period; end",
"title": ""
},
{
"docid": "fac330901d855e2df2bacc20b8de8d67",
"score": "0.49345437",
"text": "def period; end",
"title": ""
},
{
"docid": "ed9d98613e2790b211587e11e3a11ac4",
"score": "0.4934133",
"text": "def time_unit\n @time_unit ||= PERIOD_MAPPING[@name]\n end",
"title": ""
},
{
"docid": "31f60b19301b48da6baf81c58e991cfa",
"score": "0.48969954",
"text": "def grace_period_in_minutes=(value)\n @grace_period_in_minutes = value\n end",
"title": ""
},
{
"docid": "8f200f460057f26a3b2b87b3f46b690e",
"score": "0.48941",
"text": "def set_time(hour, minute)\n hour = 0 if hour.negative?\n hour = 23 if hour > 23\n minute = 0 if minute.negative?\n minute = 59 if minute > 59\n time = Time.new(0, nil, nil, hour, minute, nil, nil)\n @hour = time.hour\n @minutes = time.min\n end",
"title": ""
},
{
"docid": "4f6aa6ffe66377a825de85bc35dd59f4",
"score": "0.4892642",
"text": "def ppm_to_mgqm(ppm, molecular_mass, temp)\n molar_volume_of_air = (273.0 + temp) / 273.0 * 22.4\n return 0.0 if molar_volume_of_air == 0\n\n # ppm * 1000.0 * molecular_mass / molar_volume_of_air\n ppm * molecular_mass / molar_volume_of_air\n end",
"title": ""
},
{
"docid": "361bf78657c5d4fe9257883da71af13d",
"score": "0.48772094",
"text": "def mins\n Thread.current[:datet_mode] = :mins\n return self\n end",
"title": ""
},
{
"docid": "05439f2594dc75a03def34c15e1ba9e8",
"score": "0.48700732",
"text": "def setMinutes(minutes)\r\n\t\t\t\t\t@minutes = minutes\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "c2b71140abf81f898f20324b8ff66dd8",
"score": "0.48691756",
"text": "def set_time\n \ttime = Time.now\n \tset_session\n if session[:month_number] then\n if(session[:month_number] < 0) then\n @time_now = time.months_ago(-(session[:month_number]))\n elsif (session[:month_number] > 0) then\n @time_now = time.months_since(session[:month_number])\n # if session is not yet set time is actual time\n else\n @time_now = time\n end\n end\n end",
"title": ""
},
{
"docid": "b71a43c92b73bb260f01d7adf47dbd9a",
"score": "0.48677015",
"text": "def inizio_minuto\n Time.new(self.year, self.month, self.day, self.hour, self.min)\n end",
"title": ""
},
{
"docid": "683d144ff921ef7bacb402795c2b51e0",
"score": "0.48660865",
"text": "def chronometerWithTemporizer(seconds, to)\n\n last_tick = Time.now\n stop = Time.now + to\n yield\n while Time.now < stop\n sleep 0.1\n if Time.now - last_tick >= seconds\n last_tick += seconds\n yield\n end\n end\n end",
"title": ""
},
{
"docid": "fd938a806ef11c51229cd9f9b87d8a3f",
"score": "0.48578656",
"text": "def time=(time)\n `#{@sound}.currentTime = #{time}`\n end",
"title": ""
},
{
"docid": "bac11be05207cc17b149b5910f094475",
"score": "0.4856706",
"text": "def lazy_min=(newmin)\n newmin = newmin.to_f\n \n #Add hours for every 60 minutes given.\n if newmin > 60 or newmin < 0\n hours = (newmin.to_f / 60.0).floor\n newmin -= (hours.to_f * 60.0)\n self.add_hours(hours)\n end\n \n #Convert any decimals to setting the second.\n diff = newmin - newmin.floor\n self.lazy_sec = diff * 60 if diff > 0.0\n \n #Set the actual minute.\n @t_min = newmin.floor\n \n self\n end",
"title": ""
},
{
"docid": "4eb81d4ebb4e5c0c1a1f9ff28ef4ebaa",
"score": "0.48539034",
"text": "def fine_minuto\n Time.new(self.year, self.month, self.day, self.hour, self.min, 59)\n end",
"title": ""
},
{
"docid": "a992580b5ae7bb3a508f098e6b996314",
"score": "0.48505118",
"text": "def volume_ramp_seconds=(f)\n raise ArgumentError, \"Volume ramp time must be 0.0 or greater\" unless f.to_f >= 0.0\n set_audio_queue_param KAudioQueueParam_VolumeRampTime, f.to_f\n self\n end",
"title": ""
},
{
"docid": "47ccef9b4b486656fc6a49026555f050",
"score": "0.48365045",
"text": "def melbCal(x)\n x = x / 60\n x = x / 60\n return x\n end",
"title": ""
},
{
"docid": "d6b503637bc9b79ea417bad1aad94666",
"score": "0.48340926",
"text": "def minutes ; Duration[self * 60] ; end",
"title": ""
},
{
"docid": "2f6b9dd227682a43fae21f31f28c7857",
"score": "0.48271468",
"text": "def script=(seconds); end",
"title": ""
},
{
"docid": "3e2d8ca2800d4a92cdb1ddf0e082032a",
"score": "0.48077708",
"text": "def milliseconds() Float(self * (10 ** -3)) end",
"title": ""
},
{
"docid": "ea79c7eb3607a5f1179d47a3628b8e9b",
"score": "0.48077404",
"text": "def beginning_minute=(string)\n frm.select(:id=>\"release_minute\").select(string)\n end",
"title": ""
},
{
"docid": "562b597ac2c70f15190f1f4dfc0b3490",
"score": "0.48069265",
"text": "def set_period_position_delta\n @period_offset = @freq / @sample_rate\n end",
"title": ""
},
{
"docid": "b589c44a667280c41eab140e1fe3089c",
"score": "0.48057565",
"text": "def frames_per_second=(a); motion.frames_per_second = a; end",
"title": ""
},
{
"docid": "5abf26463c57637eceda66a6d351f82e",
"score": "0.4801566",
"text": "def time_unit\n return \"1sec\"\n end",
"title": ""
},
{
"docid": "2f3015f5ed20ce5bbde17cfa19ba0e60",
"score": "0.48001283",
"text": "def tt(time, format=:short); '13:37'; end",
"title": ""
},
{
"docid": "599c5bf3b2fbe28d7157a3f80216ad29",
"score": "0.47973192",
"text": "def set_volume_cuft\n self.volume_cuft = (self.length_ins/12) * (self.width_ins/12) * (self.height_ins/12)\n end",
"title": ""
},
{
"docid": "359b50b3409de673e3ca4b83003cf36c",
"score": "0.47879502",
"text": "def set_start_time\n @start_time = Time.now.to_f\n end",
"title": ""
},
{
"docid": "359b50b3409de673e3ca4b83003cf36c",
"score": "0.47879502",
"text": "def set_start_time\n @start_time = Time.now.to_f\n end",
"title": ""
},
{
"docid": "8d1b67491cc79c35addefef3c462aab6",
"score": "0.47778702",
"text": "def format_time\n hours = format_hour @hour\n minutes = format_minute @minutes\n ampm = @hour < 12 ? @@ampm_hash['a'] : @@ampm_hash['p']\n time = ''\n time += hours[0] + minutes[0] + ' ' + ampm[0] + \"\\n\"\n time += hours[1] + minutes[1] + ' ' + ampm[1] + \"\\n\"\n time += hours[2] + minutes[2] + ' ' + ampm[2] + \"\\n\"\n time\n end",
"title": ""
},
{
"docid": "48926e5f79ddf890ad5c4d6a3ad19259",
"score": "0.47720096",
"text": "def minT_c=(value)\n @min_t = { value: Float(value), unit: :celsius }\n end",
"title": ""
},
{
"docid": "467ac8d4955e4a5222a25abf48b0e86a",
"score": "0.47698247",
"text": "def period\n 4/frequency\n end",
"title": ""
},
{
"docid": "19916762d7a9dde2d0bfa218796a5dc3",
"score": "0.47673514",
"text": "def time_conversion(minutes)\nend",
"title": ""
},
{
"docid": "33bb46ed5b3ad4d8439ff0a300e420ae",
"score": "0.47654992",
"text": "def set_current_time\n current_time = Time.zone.now.strftime(\"%B %e at %I:%M %p\")\n self.start_time = current_time\n end",
"title": ""
},
{
"docid": "44724fa18a4070879649ac49d844f278",
"score": "0.47620735",
"text": "def initialize(bpm, data, sample, effects)\n @beat = 60.0 / bpm\n @data = data\n @sample = sample\n @effects = effects\n end",
"title": ""
},
{
"docid": "7147f489feaded3f65ac3778cb7581ff",
"score": "0.47571066",
"text": "def set_periodo\n self.periodo = \"#{self.fecha_medicion.month}/#{self.fecha_medicion.year}\"\n end",
"title": ""
},
{
"docid": "5893c2c01cf2f188c2789128a1c8a931",
"score": "0.47520548",
"text": "def end_of_minute\n change(sec: 59.999)\n end",
"title": ""
},
{
"docid": "f30b4c6db4a379029df8a03cf2b9ed72",
"score": "0.4748549",
"text": "def end_of_minute\n change(\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end",
"title": ""
},
{
"docid": "6d31775149f2277c3148a5c58e8849ae",
"score": "0.4741241",
"text": "def tick\n\t\t#method does what the superclass method does....\n\t\tsuper\n\t\t\n\t\t#...method also sounds the alarm\t\n\t\tif @hours == @alarm_hours && @mins == @alarm_mins && @secs == @alarm_secs\n\t\t\tthen\n\t\t\tputs \"Beep Beep Beep!\\nThe time is #{@hours}:#{@mins}:#{@secs}\"\n\t\t\t@alarmsound = :ALARM #return ALARM for unit testing\n\t\tend\n\tend",
"title": ""
},
{
"docid": "96898b28da9b512155484dc3bdb51ac3",
"score": "0.4740324",
"text": "def durationInMinutes=( value)\r\n @duration = (value * 60).to_i\r\n end",
"title": ""
},
{
"docid": "ad4a6cbbfc09bf1d79fef056c07663bf",
"score": "0.47318864",
"text": "def min_to_formatted_time(mnt)\n\t\t(Time.now.midnight + mnt.minutes).to_s(:hr12)\n\tend",
"title": ""
},
{
"docid": "b57e4cbbd7229c41dd2a0741807cfe9f",
"score": "0.47284916",
"text": "def minutely(options = {})\n branch options.merge(every: :minute)\n end",
"title": ""
},
{
"docid": "b57e4cbbd7229c41dd2a0741807cfe9f",
"score": "0.47284916",
"text": "def minutely(options = {})\n branch options.merge(every: :minute)\n end",
"title": ""
},
{
"docid": "1ce65316c5328b71fefb55ff4050359e",
"score": "0.47243875",
"text": "def frame_time=(a); motion.frame_time = a; end",
"title": ""
},
{
"docid": "67dc4ce260943007b734d45280a7db86",
"score": "0.47178462",
"text": "def start=(time); end",
"title": ""
},
{
"docid": "17e80639aa78c90586f89b95d7dd5788",
"score": "0.47128642",
"text": "def minute\n @minute\n end",
"title": ""
},
{
"docid": "ef24f51ae5335e5b291bec962b1c26b1",
"score": "0.47106323",
"text": "def set_pomodoro\n @pomodoro = Pomodoro.find(params[:id])\n end",
"title": ""
},
{
"docid": "ef24f51ae5335e5b291bec962b1c26b1",
"score": "0.47106323",
"text": "def set_pomodoro\n @pomodoro = Pomodoro.find(params[:id])\n end",
"title": ""
},
{
"docid": "4b552c3fd52a108624e409c812895908",
"score": "0.47091335",
"text": "def pmt\n factor = (1.0 + monthly_rate)**duration\n second_factor =\n if monthly_rate.zero?\n duration\n else\n (factor - 1) * (1 + monthly_rate * ptype) / monthly_rate\n end\n\n -((future_value + amount * factor) / second_factor)\n end",
"title": ""
},
{
"docid": "a65cf79e7d721d7702c709e259187fce",
"score": "0.47047552",
"text": "def to_minutes; Rational === @val ? @val/60 : @val/60.0 end",
"title": ""
},
{
"docid": "33a6ca31a9ed7abf7cc6d9583872227c",
"score": "0.47029668",
"text": "def create\n @setting=Setting.create(:start_time=>Time.now,:end_time=>Time.now+ 30.minute)\n end",
"title": ""
},
{
"docid": "46f1baabd8b729407731e0364c697a82",
"score": "0.4702863",
"text": "def time_tick timestamp\n\t @now = timestamp\n\t super\n\tend",
"title": ""
}
] |
46b030d72e431ff1fdbb60f4b6130378
|
GET /arteditors/new GET /arteditors/new.json
|
[
{
"docid": "7ba84d1a662e47d9b247cd62b9b32666",
"score": "0.683915",
"text": "def new\n @veditor = Veditor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @veditor }\n end\n end",
"title": ""
}
] |
[
{
"docid": "fea46ea2209cd4710e9b2c7f6268fb56",
"score": "0.76137453",
"text": "def new\n @editor = Editor.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @editor }\n end\n end",
"title": ""
},
{
"docid": "1ca1fbbbe2d68b0994494c3b8a29f77a",
"score": "0.7605129",
"text": "def new\n @editor = Editor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @editor }\n end\n end",
"title": ""
},
{
"docid": "98385ee22adc10bf0c463df78efe950d",
"score": "0.7137784",
"text": "def new\n @art = Art.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @art }\n end\n end",
"title": ""
},
{
"docid": "98385ee22adc10bf0c463df78efe950d",
"score": "0.7137784",
"text": "def new\n @art = Art.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @art }\n end\n end",
"title": ""
},
{
"docid": "c2454811727ff8dbc41dad56e787c74d",
"score": "0.7106839",
"text": "def new\n @art = Art.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @art }\n end\n end",
"title": ""
},
{
"docid": "832785b4d38db2b472fbdd5a2b685d66",
"score": "0.71054757",
"text": "def new\n\tadd_breadcrumb \"Nueva editorial\", :new_editorial_path\n @editorial = Editorial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @editorial }\n end\n end",
"title": ""
},
{
"docid": "dd5ca6c8e88628e4fa4a4cf98cc43a2a",
"score": "0.7043644",
"text": "def new\n @editorial = Editorial.new\n #binding.pry\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @editorial }\n end\n end",
"title": ""
},
{
"docid": "2450ce4f78b79ff1683d4d80a81c5651",
"score": "0.70044893",
"text": "def new\n @part = Part.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part }\n end\n end",
"title": ""
},
{
"docid": "8be4845a82f65c84f4b9d9fe6a110875",
"score": "0.6947083",
"text": "def new\n @editable = Editable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @editable }\n end\n end",
"title": ""
},
{
"docid": "0dbafc776524e603dca2578f8abfafb7",
"score": "0.6942929",
"text": "def new\n @artcile = Article.new\n @artcile.build_notice_content\n\n @script='boards/new'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @artcile }\n end\n end",
"title": ""
},
{
"docid": "35ce569f740d7e6d8f8d18c3269b3013",
"score": "0.6938623",
"text": "def new\n @article = Artile.new\n @article.build_article_content\n\n @script='boards/new'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @article }\n end\n end",
"title": ""
},
{
"docid": "1b6e6f7cc1558dc2b12eb2ced93d18b1",
"score": "0.6933231",
"text": "def new\n @art_type = ArtType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @art_type }\n end\n end",
"title": ""
},
{
"docid": "bc38ebf54659503401415bc4a2dca318",
"score": "0.6923821",
"text": "def new\n @ed = Ed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ed }\n end\n end",
"title": ""
},
{
"docid": "3651b748ffb973bc39efb270a8427efa",
"score": "0.6870746",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.js\n format.json { render json: @org }\n end\n end",
"title": ""
},
{
"docid": "264487c35068a6bd43f865ca316c91d7",
"score": "0.6855147",
"text": "def new\n @editor = Editor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @editor }\n end\n end",
"title": ""
},
{
"docid": "264487c35068a6bd43f865ca316c91d7",
"score": "0.6855147",
"text": "def new\n @editor = Editor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @editor }\n end\n end",
"title": ""
},
{
"docid": "bb5627e7b8b125ced140d5be9a48c5e1",
"score": "0.6854094",
"text": "def create\n @editor = Editor.new(params[:editor])\n respond_to do |format|\n if @editor.save\n format.html { redirect_to @editor, notice: 'Article was successfully created.' }\n format.json { render json: @editor, status: :created, location: @editor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @editor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dff069b27c4c25b3e7881ce9b364198b",
"score": "0.6842086",
"text": "def new\n @article_press = ArticlePress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article_press }\n end\n end",
"title": ""
},
{
"docid": "b824e958921065851c0f09dd9d3ed134",
"score": "0.68330353",
"text": "def new\n unless current_user.try(:admin?)\n redirect_to \"/\"\n end\n @page = \"pieces\"\n @creator = Creator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creator }\n end\n end",
"title": ""
},
{
"docid": "efbaf8258016215fa2c1a2ffec479633",
"score": "0.68178076",
"text": "def new\n @project = Project.find_by_slug(params[:project_id])\n @edition = @project.editions.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @edition }\n end\n end",
"title": ""
},
{
"docid": "ff73a1f02c062664042c5d9362cdd8e1",
"score": "0.68116087",
"text": "def new\n @edit = Edit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @edit }\n end\n end",
"title": ""
},
{
"docid": "8a081635a18772382aebf00a00a3f6cb",
"score": "0.67736536",
"text": "def create\n @editor = Editor.new(params[:editor])\n\n respond_to do |format|\n if @editor.save\n format.html { redirect_to @editor, notice: 'Editor was successfully created.' }\n format.json { render json: @editor, status: :created, location: @editor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @editor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63b94c62b3cacd1aae98226e4333bf62",
"score": "0.6763942",
"text": "def new\n @repo = Repo.new\n\n respond_to do |format|\n format.json { render json: @repo }\n end\n end",
"title": ""
},
{
"docid": "eaccf1acce77d12ddf7d0f9753b254ef",
"score": "0.67604357",
"text": "def new\n @part_type = PartType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @part_type }\n end\n end",
"title": ""
},
{
"docid": "ced9969cf3cf4d5d906eb258bf4375f1",
"score": "0.6751567",
"text": "def new\n @game = Game.find(params[:game_id])\n @editors = Editor.all(:order => \"name ASC\")\n @edition = Edition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @edition }\n end\n end",
"title": ""
},
{
"docid": "1edd6770c2ba3f6a65126b6e15ea6a5a",
"score": "0.67081195",
"text": "def new\n @saved_article = SavedArticle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @saved_article }\n end\n end",
"title": ""
},
{
"docid": "f1c3d22e3d1441b1dc932bd07370cd37",
"score": "0.6688249",
"text": "def new\n @artwork = Artwork.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @artwork }\n end\n end",
"title": ""
},
{
"docid": "95431e45d131f76b27c6d1be4e54a189",
"score": "0.6673088",
"text": "def new\n @article_type = ArticleType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article_type }\n end\n end",
"title": ""
},
{
"docid": "936a7d6d41bb802070064823ee494993",
"score": "0.6666588",
"text": "def new\n @committee = Committee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @committee }\n end\n end",
"title": ""
},
{
"docid": "9a4cf24f20bbe0079dba2ca4632b81b3",
"score": "0.66395634",
"text": "def new\n @partite = Partite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partite }\n end\n end",
"title": ""
},
{
"docid": "4add588be817e4f11e236213ad5d2a24",
"score": "0.6633601",
"text": "def new\n @admin_article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_article }\n end\n end",
"title": ""
},
{
"docid": "d3753c671f4ad81bc5541c8fdfda55c1",
"score": "0.66332",
"text": "def new\n @creator = Creator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creator }\n end\n end",
"title": ""
},
{
"docid": "5b8161774af5a40a246ac1d9407a97db",
"score": "0.66277754",
"text": "def new\n # set the dafault value for editor\n @project = Project.new({editor: Project::EditorDefault})\n @project.user = current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end",
"title": ""
},
{
"docid": "cf0e5d43075e8993fc13b3cda3bf3243",
"score": "0.66189796",
"text": "def new\n @arte = Arte.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @arte }\n end\n end",
"title": ""
},
{
"docid": "b161de3a23d61bdfa8e1982b4c326dd8",
"score": "0.66165245",
"text": "def new\n @matter = Matter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @matter }\n end\n end",
"title": ""
},
{
"docid": "b161de3a23d61bdfa8e1982b4c326dd8",
"score": "0.66165245",
"text": "def new\n @matter = Matter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @matter }\n end\n end",
"title": ""
},
{
"docid": "881405d55990ba40e6a13f9f4d431611",
"score": "0.6614376",
"text": "def new\n @part_detail = PartDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part_detail }\n end\n end",
"title": ""
},
{
"docid": "d93694f0c50a2f3353fbb69026bf671e",
"score": "0.6613554",
"text": "def new\n @draft = Draft.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @draft }\n end\n end",
"title": ""
},
{
"docid": "d0ff7a3de98429660b9e5b24829146c7",
"score": "0.66062325",
"text": "def new\n @part_db = PartDb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part_db }\n end\n end",
"title": ""
},
{
"docid": "0424fd3b9b8625b545cae1f93204c739",
"score": "0.65985173",
"text": "def new\n @artifact = Artifact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artifact}\n end\n end",
"title": ""
},
{
"docid": "4f9594d1c5a89a8343c62d36541d663d",
"score": "0.6595926",
"text": "def new\n @artista = Artista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artista }\n end\n end",
"title": ""
},
{
"docid": "24445c087885b027f1601b346c18cce7",
"score": "0.65888035",
"text": "def new\n @title = 'New Article'\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "d6c415b35ca300065c51ee0e0ff81735",
"score": "0.65872794",
"text": "def new\n @artifact = Artifact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artifact }\n end\n end",
"title": ""
},
{
"docid": "5119fd77183ed6840d7dacf4e176e1e6",
"score": "0.6587219",
"text": "def new\n @author = Author.new\n render json: @author\n end",
"title": ""
},
{
"docid": "35c820d1fa80a9cbb4b8e981f66daef7",
"score": "0.65848047",
"text": "def new\n @game = Game.new\n @editor = Editor.find_by_id(params[:editor_id])\n @title = \"Creer un nouveau jeu \"\n @edition = @game.editions.build(editor: @editor)\n @edition.build_box_front\n @base_games = Game.base_games\n ariane.add \"Nouveau jeu\", new_game_path\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "91f93d2956a3f9c3a30664d23aee3688",
"score": "0.65675735",
"text": "def new\n # @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: { artist: @artist } }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "a4b349146acb1ad6600747fcd11f38d9",
"score": "0.65603197",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "f4da9f56264f943642f533b725ec4cf8",
"score": "0.6556757",
"text": "def new\n @articles_and_page = ArticlesAndPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @articles_and_page }\n end\n end",
"title": ""
},
{
"docid": "8ded90bbce9f2063dab8926473289b1c",
"score": "0.6548542",
"text": "def new\n @article_of_clothing = ArticleOfClothing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article_of_clothing }\n end\n end",
"title": ""
},
{
"docid": "8fc88dba52c9cb837e27ac1ba9ec0e44",
"score": "0.65484405",
"text": "def new\n @robot_part = RobotPart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @robot_part }\n end\n end",
"title": ""
},
{
"docid": "964b074cda83be35e8d7e4eab45450e0",
"score": "0.65483963",
"text": "def new\n @snippet = Snippet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @snippet }\n end\n end",
"title": ""
},
{
"docid": "964b074cda83be35e8d7e4eab45450e0",
"score": "0.65483963",
"text": "def new\n @snippet = Snippet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @snippet }\n end\n end",
"title": ""
},
{
"docid": "964b074cda83be35e8d7e4eab45450e0",
"score": "0.65483963",
"text": "def new\n @snippet = Snippet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @snippet }\n end\n end",
"title": ""
},
{
"docid": "964b074cda83be35e8d7e4eab45450e0",
"score": "0.65483963",
"text": "def new\n @snippet = Snippet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @snippet }\n end\n end",
"title": ""
},
{
"docid": "964b074cda83be35e8d7e4eab45450e0",
"score": "0.65483963",
"text": "def new\n @snippet = Snippet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @snippet }\n end\n end",
"title": ""
},
{
"docid": "964b074cda83be35e8d7e4eab45450e0",
"score": "0.65483963",
"text": "def new\n @snippet = Snippet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @snippet }\n end\n end",
"title": ""
},
{
"docid": "495833f557b680a6b6e79fea32006eed",
"score": "0.65446365",
"text": "def new\n @press_article = PressArticle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @press_article }\n end\n end",
"title": ""
},
{
"docid": "f9d7a8ac79301748bee9df008781ee1c",
"score": "0.6544624",
"text": "def new\n authorize! :create, Node\n render file: \"app/assets/javascripts/angular/pages/spawn_job_editor.html\"\n #render file: \"vendor/assets/bindery-ui/spawn-job-editor.html\", layout: false\n end",
"title": ""
},
{
"docid": "86fef452640f980e3b65e0cd2b2685b5",
"score": "0.65362287",
"text": "def new\n @show_artwork = ShowArtwork.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @show_artwork }\n end\n end",
"title": ""
},
{
"docid": "1be6805e7186dc6c9c8736dfe1a44a07",
"score": "0.65330905",
"text": "def new\n\tart = Article.new\n\t@type = art.get_type_by_id(params[:c])\n\tif userCanCreateArticle? and @type != nil\n\t @title = @header = \"#{@type[:form_title]}\"\n @path_array = [\n {:name => 'Медиа', :link => '/media'},\n\t\t\t\t\t {:name => @type[:multiple_name], :link => \"/media?t=#{@type[:link]}\"},\n\t\t\t\t\t {:name => \"#{@header}\"}\n\t\t\t\t ]\n\t\trespond_to do |format|\n\t\t format.html # new.html.erb\n\t\t format.json { render :json => @formArticle }\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end",
"title": ""
},
{
"docid": "ad8c55913bcdd2f0f0e87d543dc5ce41",
"score": "0.65327656",
"text": "def new\n @lectivo = Lectivo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lectivo }\n end\n end",
"title": ""
},
{
"docid": "edacae1437264393bb3a28da66181a63",
"score": "0.65305483",
"text": "def new\n @artifact_type = ArtifactType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artifact_type }\n end\n end",
"title": ""
},
{
"docid": "fa4c17aaede2d1a133529ab16406adad",
"score": "0.65268856",
"text": "def new\n @author = Author.new\n @page_title = \"New Author\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @author }\n end\n end",
"title": ""
},
{
"docid": "d1be4ce476c216ddba0f6c6ab6a59b37",
"score": "0.6523127",
"text": "def new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @article }\n end\n end",
"title": ""
},
{
"docid": "99ff14c5f7beeefbc6c8439fb44348c0",
"score": "0.6520032",
"text": "def new\n @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artist }\n end\n end",
"title": ""
},
{
"docid": "99ff14c5f7beeefbc6c8439fb44348c0",
"score": "0.6520032",
"text": "def new\n @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artist }\n end\n end",
"title": ""
},
{
"docid": "99ff14c5f7beeefbc6c8439fb44348c0",
"score": "0.6520032",
"text": "def new\n @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artist }\n end\n end",
"title": ""
},
{
"docid": "10f3a6a0fc1056bdb8190cc22868eabf",
"score": "0.651232",
"text": "def new\n @orden = Orden.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orden }\n end\n end",
"title": ""
},
{
"docid": "b9935e033ef9b8f8d26cd87f12a160a4",
"score": "0.65098274",
"text": "def new\n @partido = Partido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partido }\n end\n end",
"title": ""
},
{
"docid": "b9935e033ef9b8f8d26cd87f12a160a4",
"score": "0.65098274",
"text": "def new\n @partido = Partido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partido }\n end\n end",
"title": ""
},
{
"docid": "e8959476b888d609ee94c9808d696bd7",
"score": "0.65042716",
"text": "def new\n @richtext = Richtext.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @richtext }\n end\n end",
"title": ""
},
{
"docid": "be3f494f37fb90ee5d7c14c9c6f0ea95",
"score": "0.6499618",
"text": "def new\n @content = Content.new\n\n render json: @content\n end",
"title": ""
},
{
"docid": "be3f494f37fb90ee5d7c14c9c6f0ea95",
"score": "0.6499618",
"text": "def new\n @content = Content.new\n\n render json: @content\n end",
"title": ""
},
{
"docid": "d8974ec599c9a389bba0bf0ce91c9d11",
"score": "0.6498482",
"text": "def new\n @title = t('view.articles.new_title')\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end",
"title": ""
},
{
"docid": "e7e258e8fe044feb9f812a94a0a12bad",
"score": "0.64971197",
"text": "def new\n @author = Author.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @author }\n end\n end",
"title": ""
},
{
"docid": "45b8e31b36d7b6b7371934ee4854a74c",
"score": "0.64961755",
"text": "def new\n @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @artist }\n end\n end",
"title": ""
},
{
"docid": "bb8621ac93e92cc607f02a3c682843a8",
"score": "0.64948213",
"text": "def new\n @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @artist }\n end\n end",
"title": ""
},
{
"docid": "bb8621ac93e92cc607f02a3c682843a8",
"score": "0.64948213",
"text": "def new\n @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @artist }\n end\n end",
"title": ""
},
{
"docid": "1f587692fad128116fc0738cca30a732",
"score": "0.64927614",
"text": "def new\n @idea = Idea.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @idea }\n end\n end",
"title": ""
},
{
"docid": "3aa344bdc88b368136fc693a7e96daa5",
"score": "0.64918244",
"text": "def new\n @escritorio = Escritorio.new\n\n respond_to do |format|\n format.html { render layout: nil } # new.html.erb\n format.json { render json: @escritorio }\n end\n end",
"title": ""
},
{
"docid": "8253358893cdef5690b1f218cf29dfee",
"score": "0.64853495",
"text": "def new\n unless current_user.try(:admin?)\n redirect_to \"/\"\n end\n @page = \"pieces\"\n @piece = Piece.new\n @creators = Creator.find(:all)\n @galleries = Gallery.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @piece }\n end\n end",
"title": ""
},
{
"docid": "ff4ff0cf5118c749eab0a631d90b0813",
"score": "0.6483367",
"text": "def new\n @artist = Artist.new\n\n respond_to do |format|\n format.json { render json: @artist }\n end\n end",
"title": ""
}
] |
c025151d2e0065dc5c699a0348c9a9ea
|
Time complexity: O(logn) The number of digits in a number is given by log(n) and we are processing each digit in the number Space complexity: Closely related to the time complexity, and is a measure of what numbers we're putting in the HashSet, and how big they are. For a large enough n, the most space will be taken by n itself.
|
[
{
"docid": "ac9114a182f59e995d34a1883973f278",
"score": "0.0",
"text": "def is_happy(n)\n seen = Set.new\n while(n != 1 && !seen.include?(n))\n seen.add(n)\n n = calculate_sum(n)\n end\n n == 1\nend",
"title": ""
}
] |
[
{
"docid": "15ded1cdcc13e127d95fb9f9c0a9256f",
"score": "0.64888805",
"text": "def is_happy(n)\r\n set = Set.new\r\n while true do\r\n digits = n.to_s.split('').map(&:to_i)\r\n total = 0\r\n digits.each { |digit| total += digit**2 }\r\n return true if total == 1\r\n return false if set.include?(total)\r\n set.add(total)\r\n n = total\r\n end\r\nend",
"title": ""
},
{
"docid": "6873bf34ab4e769479973b42a758185c",
"score": "0.64234155",
"text": "def weird_number(n)\n sum = 0\n subset_sums = Hash.new\n subset_sums[0] = true\n for d in 1...n\n next unless n % d == 0\n # Calculate sum of all divisors\n sum += d\n # Calculate sums for all subsets\n subset_sums.keys.each do | s |\n return false if s + d == n\n subset_sums[s + d] = true\n end\n end\n sum > n\n end",
"title": ""
},
{
"docid": "ea3598feb04269e3e5c2934d8f1a95f8",
"score": "0.63974047",
"text": "def find_sum_numbers(list, sum)\n hash = {}\n\n count = 0\n\n list.each do |num| #O(n) - time\n hash[num] = true\n end\n\n hash.each_key do |key|\n pair = sum - key #100 - 97 => 3 look for 3 in the hash\n if hash[pair] # O(1) - time\n count += 1\n #hash.delete(key) #if delete, then there is only 1 set, no need to return /2\n end\n end\n return count/2\nend",
"title": ""
},
{
"docid": "0c59871a96e1c7f703fa8c43d521279c",
"score": "0.6396881",
"text": "def solve( n = 8 )\n max = 1_000_000\n bits = Math.log10( max )\n mask = 1 << bits\n \n h = Hash.new\n max.prime_sieve.each {|i| h[i.to_s] = i}\n min = 0\n arr = []\n\n while 0 < mask\n p = Hash.new\n h.keys.each do |k|\n s = String.new( k )\n sub = false\n\n 0.upto( [bits, s.length].min - 1 ) do |b|\n s[b], sub = '-', true if 0 != (mask & (1 << b))\n end\n\n if sub\n p[s] = [] if !p.include?( s )\n p[s] << k\n end\n end\n\n p.each do |v, j|\n a = []\n (0..9).each {|i| t = v.tr( '-', i.to_s ); a << t if j.include?( t )}\n if min < a.length\n arr = a\n min = a.length\n end\n end\n mask -= 1\n end\n\n arr[0].to_i # puts arr.inspect\n end",
"title": ""
},
{
"docid": "00a67cc3d2c89cc2c7a415701f24cc92",
"score": "0.6380167",
"text": "def persistence(n)\n count = 0\n number_array = n.digits\n while number_array.size > 1\n number_array = number_array.reduce(:*).digits\n count +=1\n end\n count\nend",
"title": ""
},
{
"docid": "82982d247594cf29af51eb821b305477",
"score": "0.62957877",
"text": "def problem_111(num_digits = 10)\n digits = (0..9).to_a\n last = [1,3,7,9]\n total = 0\n hits = {}\n (0..9).each do |digit|\n d_found,d_sum = 0,0\n array = [digit] * num_digits\n (1).upto(num_digits-1) do |num_replacements|\n # We have an array of the search digit, then we\n # generate 'n' length permutations of all available locations\n # and place our 'replacement' numbers in those locations.\n rep_finish = 10**num_replacements\n\n slots = Array.new(num_digits) {|i| i}\n # We use p_seen as a simple way to stop the duplicate value\n # problem, since we permutate over all replacement combinations\n # and we try all values each time.\n p_seen = {}\n slots.permutation(num_replacements) do |rep|\n # Remove permutation duplication\n reps = rep.sort\n next if p_seen[reps]\n p_seen[reps] = true\n\n # Put replacement values in the 'rep' locations.\n # We do this by just incrementing a number and chopping it up into\n # the locations\n test = array.dup\n v = 0 # want it visable outside\n 0.upto(10**num_replacements) do |rep_value|\n rep.each do |i|\n v = rep_value % 10\n break if v == digit\n test[i] = v\n rep_value /= 10\n end\n next if v == digit\n # no leading 0's\n # skip if the last digit stops us being prime\n next unless last.member? test[-1]\n next if test[0] == 0\n if (t = test.join.to_i).prime?\n d_found += 1\n d_sum += t\n hits[t] = true\n end\n end\n end\n if d_found > 0\n total += d_sum\n puts \"M(#{num_digits},#{digit})=#{num_digits - num_replacements} \" +\n \"N(#{num_digits},#{digit})=#{d_found} \" +\n \"S(#{num_digits},#{digit})=#{d_sum}\"\n break \n end\n end\n end\n total\nend",
"title": ""
},
{
"docid": "a15ab97f373f1f5f416b204d7e3a5e71",
"score": "0.6290872",
"text": "def weird_number(n)\n d = r = s = nil\n sum = 0\n subset_sums = Hash.new\n subset_sums[0] = true\n for d in 1...n\n next unless n % d == 0\n # Calculate sum of all divisors\n sum += d\n # Calculate sums for all subsets\n subset_sums.keys.each do | s |\n return false if s + d == n\n subset_sums[s + d] = true\n end\n end\n sum > n\nend",
"title": ""
},
{
"docid": "595cd38db602ee29e5e5c56a109b6362",
"score": "0.627452",
"text": "def problem_118\n # Return hash with the keys being a sorted array or sorted arrays of\n # suitable elements\n def problem_118_solve(set,d)\n good = {}\n d.length.downto(1) do |n|\n d.combination(n) do |a|\n # Trivial prime check\n next if n > 1 && a.reduce(&:+) % 3 == 0\n rem = (d - a).sort\n # If only one digit left, make sure it is prime\n a.permutation do |p|\n if p.join.to_i.prime?\n if rem.length == 0\n good[(set.dup << a).sort] = true\n # puts good.last.inspect\n else\n good = good.merge problem_118_solve(set.dup << a,rem.sort)\n end\n break\n end\n end\n\n end\n end\n good\n end\n\n puts \"Find sets\"\n good = problem_118_solve([],[1,2,3,4,5,6,7,8,9]).keys\n # good is an array of sets that have at least one solution\n hits = 0\n cache = {}\n puts \"Number of digit groupings is #{good.length}\"\n puts \"Permutate sets\"\n\n good.each do |a|\n times = 1\n # For each element, how many primes can we make\n a.each do |p|\n unless t = cache[p]\n if p.length == 1 # Must be prime\n t = 1\n else\n t = 0\n p.join.to_i.permutation do |q|\n t += 1 if q.prime?\n end\n end\n cache[p] = t\n end\n times *= t\n end\n hits += times\n end\n hits\nend",
"title": ""
},
{
"docid": "e09c5a0c72a5d3b962c2234430500843",
"score": "0.62277436",
"text": "def all_numbers(int)\n digit_chars = int.to_s.chars \n arr = digit_chars.permutation(digit_chars.size).to_a\n arr.map {|digit_set| digit_set.join.to_i}.uniq.sort\nend",
"title": ""
},
{
"docid": "4dfe50426435b1cf94c032b24eb333cc",
"score": "0.6207646",
"text": "def solution(n)\n n = n >> 1 while n % 2 == 0\n n.to_s(2).split('1').push('').max_by(&:size).size \nend",
"title": ""
},
{
"docid": "8c88203a4149b7b05f7a71fc789e0999",
"score": "0.617212",
"text": "def solution_23\n def abundant_list(n)\n (12...n).select { |num| 2 * num < divisor_list(num).reduce(:+) }\n end\n num_set = (1...28123).to_set\n a_list = abundant_list(28123)\n a_set = [].to_set\n a_list.each do |x|\n a_list.each { |y| a_set.add(x + y) }\n end\n (num_set - a_set).reduce(:+)\n end",
"title": ""
},
{
"docid": "17bcc6620e558ee15ac96061fb9df182",
"score": "0.6170226",
"text": "def problem_74\n fac = (0..9).map {|n| n.factorial}\n (0..9).each { |n| fac[n + ?0.ord] = fac[n] }\n\n seen = {\n 1454 => 3, 169 => 3, 363601 => 3,\n 871 => 2, 45361 => 2, \n 145 => 1\n }\n total = 0\n (10..1_000_000).each do |number|\n n = number\n run = []\n until len = seen[n] do\n seen[n] = -1\n run << n\n #n = n.to_digits.reduce(0) {|a,d| a + fac[d.to_i]}\n n = n.to_s.unpack(\"C*\").reduce(0) {|a,d| a + fac[d]} # 21sec\n# n = n.to_digits.reduce(0) {|a,d| a + fac[d]} # 21sec\n# puts \">>#{run.length} #{run.inspect}\"\n end\n # We have now entered a loop\n len += run.length\n# puts \"#{n} => #{len} #{run.inspect}\"\n run.reverse.each_index {|i| seen[run[i]] = len - i }\n if len >= 60\n puts \"#{number} => #{len}\" \n total += 1\n end\n end\n total\nend",
"title": ""
},
{
"docid": "4a1d9022a32e7e4ba0c59610fec88d51",
"score": "0.6162962",
"text": "def find_unique(numbers)\n # Code here\n result = []\n temp_hash = {}\n\n numbers.each do |n|\n if temp_hash[n]\n temp_hash[n] += 1\n else\n temp_hash[n] = 1\n end\n end\n\n temp_hash.key(1)\nend",
"title": ""
},
{
"docid": "4da27f5f57e5e00b5e505b707fcc0214",
"score": "0.61591005",
"text": "def lonelyinteger(a)\n res = Set.new\n\n a.each do |num|\n res.include?(num) ? res.delete(num) : res.add(num)\n end\n\n res.first\nend",
"title": ""
},
{
"docid": "2b2bb29cc7ec8274f211d7aed1c811dd",
"score": "0.61449456",
"text": "def similar_nums(num)\n freq = Hash.new(0)\n fact = factorial(num.to_s.length)\n num.to_s.each_char { |ltr| freq[ltr] += 1 }\n freq.values.map(&:to_i).each { |count| fact /= factorial(count) }\n fact\nend",
"title": ""
},
{
"docid": "b33817b5981420a69b3f8c89fb7af4a1",
"score": "0.6144537",
"text": "def solution(n)\n arr = n.to_s.split('')\n arr.delete('0')\n result = arr.to_a.permutation.map(&:join).map(&:to_i).uniq\n p result.size\nend",
"title": ""
},
{
"docid": "3ccfc062daf3575763cb1d5df462d9a0",
"score": "0.61370945",
"text": "def power_set(n)\n return [[], [0]] if n == 0\n n_minus_1_set = power_set(n-1) if n > 0\n (n_minus_1_set + n_minus_1_set.map { |set| set.clone << n }).sort_by { |set| set.size }\nend",
"title": ""
},
{
"docid": "a7e2ae460d54f56d1c4b4eeb03e4e401",
"score": "0.61361",
"text": "def sevens(n)\n result = []\n num = 0\n\n while result.length < n\n result << num if has_7_digit?(num)\n num += 1\n end\n\n return result\nend",
"title": ""
},
{
"docid": "c3fb73377ae6951ecad35b107f99496d",
"score": "0.6123622",
"text": "def can_be_written_by_nth_power_of_digits(n)\n # find the max possible number of digits\n num_digits = 1\n while (10 ** num_digits) - 1 < (9**n) * num_digits\n num_digits += 1\n end\n\n vals = []\n for i in 2..((10 ** num_digits) - 1)\n if i == i.to_s.split(\"\").collect{|d| d.to_i ** n}.reduce(:+)\n puts \"found one: #{i}\"\n vals.push(i)\n end\n end\n\n vals\nend",
"title": ""
},
{
"docid": "87bdc7eaaec10f221b629ffb377e820f",
"score": "0.6106564",
"text": "def problem34\n sum = 0\n factorials = { 1 => 1, 2 => 2, 3 => 6, 4 => 24, 5 => factorial(5), 6 => factorial(6), 7 => factorial(7), 8 => factorial(8), 9 => factorial(9), 0 => 1}\n (3..9999999).each{|i|\n subSum = 0\n i.to_s.split(\"\").each do |digit|\n subSum += factorials[digit.to_i]\n end\n if subSum == i\n sum += subSum\n puts \"adding #{i}; sum = #{sum}\"\n end\n }\n sum\nend",
"title": ""
},
{
"docid": "1673a2ccf73b294441a4f01bfc050632",
"score": "0.60744447",
"text": "def amicable_numbers(n)\n integers = (1...n)\n sum = 0\n amicable_nums = []\n\n integers.each do |int|\n current_sum = sum_of_divisors(int)\n amicable_sum = sum_of_divisors(current_sum)\n if (int == amicable_sum) && (int != current_sum)\n amicable_nums << int << current_sum\n end\n end\n\n amicable_nums = amicable_nums.uniq\n\n amicable_nums.each do |num|\n sum += num\n end\n\n sum\nend",
"title": ""
},
{
"docid": "557b26fa77c4cb8d02db3579960aa4c0",
"score": "0.60438913",
"text": "def millionth\n digits = \"0123456789\"\n solution = \"\"\n perm_left = 999999\n\n (0..9).each do |x|\n if x == 9\n perm_count = 1\n else\n perm_count = (1..9-x).inject(:*)\n end\n n = perm_left / perm_count\n solution += digits[n]\n perm_left -= perm_count * n\n digits.delete(digits[n])\n end\n\n puts solution\nend",
"title": ""
},
{
"docid": "19ef7d6e85b5a1e5184502759f2be623",
"score": "0.6033999",
"text": "def featured(n)\r\n for num in ((n+1)...10_000_000_000) do\r\n (return num) if num.odd? && (num % 7 == 0) && (num.digits.uniq == num.digits)\r\n end\r\n \"Error\"\r\nend",
"title": ""
},
{
"docid": "ce7a7c5b4374d4381beedb9c765e6f3c",
"score": "0.59751064",
"text": "def sieve\n # A range is given\n sieve = Set.new(2..10000)\n \n # Loop through each number in Set\n # Note: Any other iterators won't work as they are obviously slower than iterating through a Set directly.\n sieve.each do |item|\n \n # 2 is the first prime number\n n = 2\n \n # If n's multiple is less than upper range(10000)\n while n * item <= 10000\n \n # Delete that multiple from Set\n \t\tsieve.delete(item * n)\n \n # Move to the next number\n \t\tn += 1\n end\n end\n\n sieve\nend",
"title": ""
},
{
"docid": "ee678cc262aa3a5f0bba0bd1f1033d0f",
"score": "0.5972073",
"text": "def uniq_digits(num)\n num.to_s.chars == num.to_s.chars.uniq\nend",
"title": ""
},
{
"docid": "b1fc744ff7977079c6bb483b6a528d06",
"score": "0.59617746",
"text": "def AdditivePersistence(num)\n num.to_s.split(//).map(&:to_i).combination(2).to_a.each do |comb|\n return comb.size if comb.reduce(&:+) > 0 && comb.reduce(&:+) <= 9\n end\n return 0\nend",
"title": ""
},
{
"docid": "cb5b2d8a0d717955c439dbfc88c40525",
"score": "0.59608746",
"text": "def find_n_top_digits(n)\r\n\ta_string = ['73167176531330624919225119674426574742355349194934', '96983520312774506326239578318016984801869478851843',\r\n\t\t\t\t\t'85861560789112949495459501737958331952853208805511', '12540698747158523863050715693290963295227443043557',\r\n\t\t\t\t\t'66896648950445244523161731856403098711121722383113', '62229893423380308135336276614282806444486645238749',\r\n\t\t\t\t\t'30358907296290491560440772390713810515859307960866', '70172427121883998797908792274921901699720888093776',\r\n\t\t\t\t\t'65727333001053367881220235421809751254540594752243', '52584907711670556013604839586446706324415722155397',\r\n\t\t\t\t\t'53697817977846174064955149290862569321978468622482', '83972241375657056057490261407972968652414535100474',\r\n\t\t\t\t\t'82166370484403199890008895243450658541227588666881', '16427171479924442928230863465674813919123162824586',\r\n\t\t\t\t\t'17866458359124566529476545682848912883142607690042', '24219022671055626321111109370544217506941658960408',\r\n\t\t\t\t\t'07198403850962455444362981230987879927244284909188', '84580156166097919133875499200524063689912560717606',\r\n\t\t\t\t\t'05886116467109405077541002256983155200055935729725', '71636269561882670428252483600823257530420752963450']\r\n\r\n\tthe_string = a_string.join('').split('')\r\n\r\n\tmax = 0\r\n\twhile the_string.size > 0\r\n\t\tdo_steps = (n < the_string.size)? (n-1) : (the_string.size-1)\r\n#\t\tputs do_steps\r\n\r\n\t\ttmp = the_string[0..do_steps].inject(1){ |multi, i| multi*i.to_i }\r\n#\t\tputs tmp\r\n\t\tmax = tmp if(tmp > max)\r\n\t\tthe_string.shift()\r\n\tend\r\n\r\n\treturn max\r\nend",
"title": ""
},
{
"docid": "04b208e234cf3d4eb5130cb1368b4cd7",
"score": "0.592198",
"text": "def euler16(n)\n (2**n).to_s.split('').map { |i| i.to_i }.inject(:+)\nend",
"title": ""
},
{
"docid": "e10e15f429c7e480f0eb78c6e8c81ac9",
"score": "0.59217083",
"text": "def super_size(n)\n n = n.to_s.split(//).sort.reverse\n big = \"\"\n n.each {|i| big << i}\n big.to_i\nend",
"title": ""
},
{
"docid": "c33a262c078fba27a9a84e7bbd69b546",
"score": "0.5918414",
"text": "def reordered_power_of2(n) #O(29logN)\n return true if n == 1\n n = digit_count(n)\n get_potentials.each { |p| return true if p == n }\n return false\nend",
"title": ""
},
{
"docid": "e01829d730248799296412af15cb7541",
"score": "0.5915588",
"text": "def solve( n = 16 )\n # Finding all numbers with each of three digits repeated at least once\n # amounts to finding the complement of those missing one or more of the\n # specified digits. First define three sets of numbers: \n #\n # No0 – numbers that have no 0 digit\n # No1 - numbers that have no 1 digit\n # NoA - numbers that have no A digit\n #\n # Subtracting the union of these sets from the set of all numbers gives\n # the total we are looking for. The union is calculated from:\n #\n # No0 ∪ No1 ∪ NoA = No0 + No1 + NoA -\n # (No0 ∩ No1) - (No1 ∩ NoA) - (NoA ∩ No0) +\n # (No1 ∩ NoA ∩ NoA)\n #\n # The size of each of these sets varies by the number of digits, so we\n # must calculate it separately for each length and sum the results. The\n # shortest possible length is 3; the maximum is 16 (for this problem).\n #\n # The cardinality of each set is easy to compute as the simple product\n # of the number of digit choices available at each position. Since we\n # have been directed to ignore leading zeros, there are 15 possible\n # starting digits, [1-9,a-f], then 16 choices for subsequent digits in\n # the base case (all digits allowed). We adjust these numbers as appro-\n # priate to compute the size of each restricted subset for some digit\n # count, len:\n #\n # All = 15 * 16^(len - 1)\n # No0 = 15^len\n # No1 = 14 * 15^(len - 1)\n # NoA = 14 * 15^(len - 1)\n # No0 ∩ No1 = 14^len\n # No0 ∩ NoA = 14^len\n # No1 ∩ NoA = 13 * 14^(len - 1)\n # No0 ∩ No1 ∩ NoA = 13^len\n # \n # Substituting these values into the formula above yields:\n #\n # union = 15^len + 14*15^(len - 1) + 14*15^(len - 1) -\n # 14^len - 14^len - 13*14^(len - 1) +\n # 13^len\n #\n # Define a change of variables to simplify and compute the total:\n #\n # u = 16^(len - 1), v = 15^(len - 1), w = 14^(len - 1), x = 13^(len - 1) \n # union = 15*v + 14*v + 14*v - 14*w - 14*w - 13*w + 13*x\n # = 43*v - 41*w + 13*x\n # total = 15*u - union\n # = 15*u - 43*v + 41*w - 13*x\n #\n # Now use a recurrence relation to vary u, v, w, x (instead of making them\n # functions of len) and we can factor their coefficients out of each iter-\n # ation. \n u, v, w, x = 15*16, 43*15, 41*14, 13*13\n\n (3..n).reduce( 0 ) do |acc, i|\n u, v, w, x = u*16, v*15, w*14, x*13\n acc + u - v + w - x\n end.to_s( 16 ).upcase\n end",
"title": ""
},
{
"docid": "519111a2aa997fcf476bf3c266a76630",
"score": "0.59068507",
"text": "def uniq_digits?(num)\n num.digits.uniq == num.digits\nend",
"title": ""
},
{
"docid": "5c4e33a3b1bd1406d0ef1452097556f0",
"score": "0.5902499",
"text": "def make_num2(n, d)\n init = Array.new(n, d)\n num = Array.new\n primes = Array.new\n\n for p in 0..n-1 # --try first digit\n num = Array.new(init) # resetting the initial array\n (0..9).each do |j|\n next if j == d # no need to loop the same digit\n num[p] = j\n next if num[0] == 0 # skipping num beginning with 0\n for q in 1..n-1 # --try second digit\n num2 = Array.new(num)\n if q != p\n (0..9).each do |k|\n next if k == d # no need to loop the same digit\n num2[q] = k\n next if num2[0] == 0 # skipping num beginning with 0\n a = num2.join.to_i\n next if a % 2 == 0\n primes << a if a.prime? # take only the primes\n # puts \"#{num.inspect} #{num2.inspect} #{a} p=#{p} q=#{q} j=#{j} k=#{k} #{a.prime?}\"\n end\n end\n end\n end\n end\n primes.uniq # possibility of duplicates, take only once\nend",
"title": ""
},
{
"docid": "ebcac8ee57d6ea5d62debc08c3f9d95f",
"score": "0.58961594",
"text": "def contains_duplicate(nums)\n set = Hash.new(0)\n nums.each do |num|\n return true if set[num] > 0\n set[num] += 1\n end\n false\nend",
"title": ""
},
{
"docid": "f32cea85d592f3c4939ef44072b55f3b",
"score": "0.5885134",
"text": "def refined_super_digit(n, k)\n\n array = k.to_s.split(\"\")\n first = array.map{|k|k.to_i}.sum * n \n\n if first < 10 \n return first \n end \n\n new_num = first \n while new_num > 9\n new_array = new_num.to_s.split(\"\")\n new_num = new_array.map{|n|n.to_i}.sum\n end \n\n return new_num\n\nend",
"title": ""
},
{
"docid": "9a54f0de082637d69602b6b03bff367e",
"score": "0.58758414",
"text": "def distinct_powers(n)\n integers = (2..n).to_a\n powers = (2..n).to_a\n unique_powers = []\n\n integers.each do |int|\n\n powers.each do |pwr|\n result = int ** pwr\n unique_powers << result unless unique_powers.include?(result)\n end\n end\n unique_powers.length\nend",
"title": ""
},
{
"docid": "90ba361b01ae9c95b2afa755049f1852",
"score": "0.5873238",
"text": "def three_sum(integers)\n result = Set.new\n\n # Add indexes so we cen tell if we're reusing a number\n # O(n)\n integers = integers.each_with_index.to_a\n\n # Create hash to tell when a value exists\n # O(n)\n hash = integers.to_h\n\n integers.combination(2) do |(a, i), (b, j)|\n c = 0 - a - b\n\n # O(1)\n k = hash[c]\n\n result << [a, b, c].sort unless k.nil? || k == i || k == j\n end\n\n result.to_a\nend",
"title": ""
},
{
"docid": "cdad31414ff3cbee12dc9ab3d0d7f9d3",
"score": "0.58713067",
"text": "def fast_solution(a)\n nondivisors = []\n amax = a.max\n freq = Hash.new(0)\n divisors = {}\n\n # Frequency hash of each num\n # Initialize hash of divisors of each num\n a.each do |num|\n freq[num] += 1\n divisors[num] = num == 1 ? [1] : [1, num]\n end\n# freq: {3=>2, 1=>1, 2=>1, 6=>1, 12=>1}\n# divisors: {3=>[1, 3], 1=>[1], 2=>[1, 2], 6=>[1, 6], 12=>[1, 12]}\n\n # Sieve of Eratosthenes: Hash of divisors of each num\n div = 2\n while div * div <= amax\n num = div\n while num <= amax\n if divisors[num] && !divisors[num].include?(div)\n divisors[num] << div\n divisors[num] << num / div\n end\n num += div\n end\n div += 1\n end\n # divisors: {3=>[1, 3], 1=>[1], 2=>[1, 2], 6=>[1, 6, 2, 3], 12=>[1, 12, 2, 6, 3, 4]}\n\n a.each do |num|\n num_of_divisors = 0\n divisors[num].uniq.each do |div|\n num_of_divisors += freq[div]\n end\n nondivisors << a.size - num_of_divisors\n end\n nondivisors\nend",
"title": ""
},
{
"docid": "fdab6c668f4c245bf0a058f0bcd60d9e",
"score": "0.5866296",
"text": "def solution_24\n def f(n)\n (1..n).reduce(:*)\n end\n \n perm = (0..9).to_a\n level = 1 \n which = 1000000\n while f(level) < which\n level += 1\n end\n \n digits = perm[10-level..-1]\n (level-1).downto(1).each do |i|\n count = 0\n while which - f(i) > 0\n count += 1\n which -= f(i)\n end\n perm[10-(i+1)] = digits[count]\n digits.delete_at(count)\n end\n perm = perm[0..-(digits.length+1)] + digits\n perm.join('').to_i \n end",
"title": ""
},
{
"docid": "a07d1213dd1c2e9e81168bc0ae9a506b",
"score": "0.5843659",
"text": "def is_happy(n)\n \n tested = Set.new\n sum = n\n until sum == 1\n sum = sum.digits.map{|x| x.to_i ** 2}.inject(:+)\n if tested.include?(sum)\n return false\n end\n tested.add(sum)\n end\n return sum == 1\n\nend",
"title": ""
},
{
"docid": "eefbad74ba4cd13d8f39252257f889f4",
"score": "0.5839923",
"text": "def unique_digits?(num)\n num.to_s.chars == num.to_s.chars.uniq\nend",
"title": ""
},
{
"docid": "8f6e38cddad286ab6da97ba555d1a785",
"score": "0.5835362",
"text": "def problem(arr, k)\n answer = false\n numberlist = {} # the hash to store number\n for i in arr # loop only once\n if numberlist[k-i] #check if the number is in the hash if so we found the answer\n answer = true\n puts i, k-i\n else #if not place the number in the hashlist\n numberlist[i] = true\n end\n end\n answer\nend",
"title": ""
},
{
"docid": "31065e59b0ec6928bb813d763582e713",
"score": "0.5831063",
"text": "def generate_hash_set(n)\n a = Array.new(n) {|i| i + 1 }\n b = generate_set(n)\n c = Hash[a.zip(b)] \n c\nend",
"title": ""
},
{
"docid": "39faa2d512b60d57e40c5040c77c4dcd",
"score": "0.58204013",
"text": "def solution(digits)\n sets = []\n arr = digits.to_s.chars.map(&:to_i)\n while arr != []\n sets += arr.each_slice(5).to_a\n arr.delete_at(0)\n end\n sets.reject! { |e| e.length != 5 }.map { |e| e.join.to_i }.max\nend",
"title": ""
},
{
"docid": "27f29666484272c0d973e8400c4c357c",
"score": "0.58080536",
"text": "def hash_two_sum?(arr, num)\n hash = Hash.new(0) #O(1) work\n arr.each do |ele| # N times\n return true if hash.has_key?(num - ele) # O(1) work\n hash[ele]+= 1 # O(1) work\n end\n false\nend",
"title": ""
},
{
"docid": "7c341432fa7294e71154b72e87bcc162",
"score": "0.58043826",
"text": "def problem_75\n p3 = lambda do |m,n|\n raise \"bad value\" if m == n\n m,n = n,m if m < n\n mm = m*m\n nn = n*n\n [mm - nn, 2*m*n, mm + nn]\n end\n\n max = 1_500_000\n upto = Math.sqrt(max/2).to_i\n# upto = max\n hits = Hash.new\n\n (1..upto).each do |x|\n hit = 0\n y = x + 1\n ((x+1)..(upto+1)).each do |y|\n next unless (x+y).odd?\n a,b,c = p3.call(x,y).sort\n d = a+b+c\n if d <= max\n k = 1\n begin\n hits[d*k] ||= {}\n hits[d*k][[a*k,b*k,c*k].sort.join(\"-\")] = true\n hit += 1\n k += 1\n end while d*k <= max\n else\n break\n end\n end\n puts \"for x = #{x}, #{hit} hits\"\n end\n puts hits.length\n h = hits.select {|k,v| v.length == 1}\n h.length\nend",
"title": ""
},
{
"docid": "a6845823bc87915eda64b5bc9eb1b5e2",
"score": "0.5802176",
"text": "def lexicographic(n = 1_000_000)\n digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n res = []\n \n 9.downto(1) do |i|\n fact = (1..i).reduce(:*)\n quotient = n / fact\n res.push(digits.delete_at(quotient))\n n = n - (quotient * fact)\n end\n res.join\nend",
"title": ""
},
{
"docid": "183bdcc3d9ebce3e10817b198b9a1d59",
"score": "0.5801154",
"text": "def sum_to_n? arr, n\n # define a hashmap which stores\n _hash_map = Hash.new\n \n # one pass iteration\n for i in 0..arr.size - 1\n # calculate the complement number\n _complement = n - arr[i]\n \n # check whether the complement occurred before\n if _hash_map.has_key?(_complement)\n return true\n end\n \n # store the current number\n _hash_map[arr[i]] = i\n end\n \n return false\nend",
"title": ""
},
{
"docid": "36fd964b143f5fdceb5b3ca4e9393e54",
"score": "0.5787912",
"text": "def super_digit(n)\n ar = [1,2,3,4,5,6,7,8,9]\n if ar.include? n\n return n\n end\n n = n.digits.sum\n return super_digit(n)\nend",
"title": ""
},
{
"docid": "d2168cd9af44dafe7606eac39dc9e5f4",
"score": "0.5774685",
"text": "def groups size\n #1234567 => %w(765 432 1)\n @array = @number.to_s.reverse.split(\"\").in_groups_of(size)\n #%w(765 432 1) => %w(1 432 765)\n @array.reverse!\n\n #%w(1 432 765) => [1, 234, 567]\n @array.map! {|group| group.reverse.join(\"\").to_i}\n @array.reverse! # put in ascending order of power of ten\n\n power = 0\n\n #[1, 234, 567] => {6 => 1, 3 => 234, 0 => 567}\n @array.inject({}) do |o, digits|\n o[power] = digits\n power += size\n o\n end\n end",
"title": ""
},
{
"docid": "f561f57224906d53aa465a51c99e02b1",
"score": "0.57742333",
"text": "def eliminate_set_bits(number)\n binary_representation = number.delete(\"0\")\n\n sum = 0\n binary_representation.chars.each_with_index { |num, idx| sum += num.to_i * (2**idx) }\n\n return sum\nend",
"title": ""
},
{
"docid": "97cf680ea5a9ec5879071d10c693e7e7",
"score": "0.5772938",
"text": "def sum_of_powers(n)\n numbers = []\n\n (2..1000000).each do |x|\n sum_of_powers = x.to_s.split('').map{|i| i.to_i**n}.inject(:+)\n if sum_of_powers == x\n p numbers << sum_of_powers\n end\n end\n numbers.inject(:+)\nend",
"title": ""
},
{
"docid": "0516af8021dfbcfd3f3bbf7d0de84856",
"score": "0.57722694",
"text": "def nb_dig(n, d)\n k = []\n counter = 0\n \n (0..n).each do |x|\n k << x**2\n end\n\n k.each do |x|\n counter += x.digits.count(d)\n end\n\n counter\nend",
"title": ""
},
{
"docid": "d79c8f199fe68fff56ed56480ef0bc89",
"score": "0.5772169",
"text": "def sum_to_n? arr, n\n result = false \n i=0\n convertHash = Hash.new(0)\n\n arr.each do |num| \n convertHash[num] = i \n i+=1\n end \n\n convertHash.each do |k,v|\n if convertHash.has_key?(n-k) && convertHash[n-k] != v \n result = true \n break \n end\n end \n \n result\n \nend",
"title": ""
},
{
"docid": "764dc1ee9fee54c75bd97b1fecf8a285",
"score": "0.5766616",
"text": "def featured(num)\n loop do\n num += 1\n no_duplicated = num.to_s.chars.uniq.size == num.to_s.chars.size\n break if num.odd? && (num % 7).zero? && no_duplicated\n end\n num\nend",
"title": ""
},
{
"docid": "07964e7532fdf647b2ae423ae372586f",
"score": "0.5760994",
"text": "def component_digits(n, unique = false)\n digits = n.to_s.split(//).map { |i| i.to_i }\n unique ? digits.uniq.sort : digits.sort \n end",
"title": ""
},
{
"docid": "927e1b497bf221bac27238a17aa37eaf",
"score": "0.5750111",
"text": "def div_sum_divisors(n)\n results = []\n (2..1_000_000).each do |num|\n results << num if (num**3) % div_sum(num) == 0\n break if results.length == n\n end\n results\nend",
"title": ""
},
{
"docid": "6be09813b11af7edcc7ecfd07e13b5a2",
"score": "0.5749443",
"text": "def count_distinct_using_hashing(arr, n , k)\n hsh = {}\n distint_count = 0\n for i in 0...k\n if(hsh[arr[i]])\n hsh[arr[i]] += 1\n else\n hsh[arr[i]] = 1\n distint_count += 1\n end \n end\n\n puts distint_count \n\n for i in k...n\n\n if hsh[arr[i-k]] == 1\n hsh[arr[i-k]] = nil\n distint_count -= 1\n else\n hsh[arr[i-k]] -= 1\n end\n\n if(hsh[arr[i]])\n hsh[arr[i]] += 1\n else\n hsh[arr[i]] = 1\n distint_count += 1\n end\n\n puts distint_count\n end \nend",
"title": ""
},
{
"docid": "64d594bfe5c9a7560ef3956a3dd27da1",
"score": "0.5747787",
"text": "def three_sum(integers)\n result = Set.new\n\n # O(nlogn)\n integers.sort!\n\n # Add indexes so we cen tell if we're reusing a number\n integers = integers.each_with_index.to_a\n\n integers.combination(2) do |(a, i), (b, j)|\n c = 0 - a - b\n\n # O(logn)\n c, k = integers.bsearch { |(n, _)| c <=> n }\n\n result << [a, b, c].sort unless c.nil? || k == i || k == j\n end\n\n result.to_a\nend",
"title": ""
},
{
"docid": "cb0abfdf6630cc2e1f14f5028648fea1",
"score": "0.57460445",
"text": "def find_duplicates(nums)\n hash = {}\n output = []\n nums.each do |n|\n hash[n] = hash[n] ? hash[n] + 1 : 1\n end\n \n hash.each do |key, val|\n output << key if val > 1\n end\n output\nend",
"title": ""
},
{
"docid": "49f07a29def806c6bb30ff0c40a23e02",
"score": "0.57441866",
"text": "def sum_to_n?(a, n)\n\treturn false if a.empty? or a.length == 1\n\n\th = Hash.new\n\ta.each{|x| \n\t\tif h.key? x\n\t\t\treturn true\n\t\telse\n\t\t\th[n - x] = n\t\n\t\tend\n\t}\n\treturn false\nend",
"title": ""
},
{
"docid": "ef8d43b6b2e021068e75a1a1fb285d16",
"score": "0.57362264",
"text": "def problem_26a\n # A bit of an evil cheat using RE. The other solution is to keep track\n # of the remainder of the division until we see a repeat\n max,val,number = 0,0,0\n (2...1000).each do |n|\n v = (10**2002 / n).to_s\n if m = v.match(/(\\d+?)(\\1)+$/)\n number,max,val = n,m[1].length,m[1] if m[1].length > max\n end\n end\n number\nend",
"title": ""
},
{
"docid": "ff493a58bc90fe9ade1834e905aef907",
"score": "0.57348883",
"text": "def proper_divisors(n)\n divisors = Set.new([1])\n 2.upto(Math.sqrt(n)) do |i|\n divisors = divisors.merge([i, n/i]) if n.modulo(i).zero?\n end\n divisors.to_a.sort\n end",
"title": ""
},
{
"docid": "551f46a34da92d5d12946d811e7ca420",
"score": "0.5724091",
"text": "def nb_dig(n, d)\n\tcount = 0\n squared_numbers = []\n i = 0\n while i <= n\n squared_numbers << (i ** 2)\n i += 1\n end\n array = squared_numbers.join('').split('')\n array.each do |digit|\n if digit.to_i == d \n count += 1\n end\n end\n count\nend",
"title": ""
},
{
"docid": "7b098716e20772a86cc022d7968cf5d3",
"score": "0.5722484",
"text": "def find_digits(n)\n n.digits\n .count { |e| !e.zero? && (n % e).zero? }\nend",
"title": ""
},
{
"docid": "01d65f828880f2b3ce5cccb589374205",
"score": "0.5722226",
"text": "def problem30\n total = 0\n (10..1000000).each{|n|\n total += n if n == n.to_s.split(\"\").inject(0){|sum,d|sum+=d.to_i**5}\n }\n total\nend",
"title": ""
},
{
"docid": "1b32d12110d03025a4df2add98d7f9d6",
"score": "0.5721046",
"text": "def solve( n = 1_000 )\n (2**n).sum_digits\n end",
"title": ""
},
{
"docid": "edfb807db3608dd5199114e12b2c3c01",
"score": "0.5711434",
"text": "def sum_to_n? arr, n\n hash = Hash.new()\n for x in arr\n if hash[n-x] != nil then\n return true\n end\n hash[x]=true\n end\n return false\nend",
"title": ""
},
{
"docid": "86e8324d4292c9312d64eae6f2041796",
"score": "0.57079893",
"text": "def solution_21\n def d(n)\n divisors = divisor_list(n)\n divisors.delete(n)\n divisors.reduce(:+)\n end\n result = 0\n (2..9999).each do |a|\n b = d(a)\n result += a if a == d(b) and a != b\n end\n result\n end",
"title": ""
},
{
"docid": "17ba4c539d4621a3256942f503f27f51",
"score": "0.57040733",
"text": "def persistence(n)\n k = 0\n while n > 9 do\n n = n.to_s.split(//).map{|x| x.to_i}.inject(:*)\n k+=1\n end\n k\nend",
"title": ""
},
{
"docid": "e7dbd8470b8249f8dd5323ce2f51d289",
"score": "0.56952375",
"text": "def featured(n)\n (n+1).upto(9_999_999_999) do |i|\n i_as_array = i.to_s.chars\n if i.odd? &&\n i % 7 == 0 &&\n i_as_array == i_as_array.uniq\n return i\n else\n next\n end\n end\n puts \"There is no possible number that fulfills those requirements\"\nend",
"title": ""
},
{
"docid": "489566c0e9a4a7e91ab8410c3ead4c55",
"score": "0.5693753",
"text": "def amicableNumbersUnder n\n\t\th = Array.new\n\t\t1.upto(n) do |x|\n\t\t\ty = sum(properDivisors(x))\n\t\t\th.push x if x != y && x == sum(properDivisors(y))\n\t\tend\n\t\th\n\tend",
"title": ""
},
{
"docid": "8f4308dcaeb189d620ff8615ae92abb2",
"score": "0.56931657",
"text": "def factorions()\n # Initialize an array of factorials with index n giving the nth factorial.\n fac = (0..9).map { |i| if i.zero? then 1 else (1..i).reduce(:*) end }\n\n # This is the lowest upper bound that can be found analytically.\n upper_bound = 1499999\n\n factorions = []\n\n 1.upto(upper_bound).each do |i|\n next if i <= 2 # 1 and 2 should not be included, as stated by the problem.\n # The code is rather straightforward. Add all the factorials of the digits\n # of a number i. If the sum equals i, add i to the list of factorions.\n factorions << i if i == i.to_s.chars.map(&:to_i)\n .reduce(0) { |sum, digit| sum + fac[digit] }\n end\n return factorions\nend",
"title": ""
},
{
"docid": "5ede4b3b32110044740136c9f5de630f",
"score": "0.56864387",
"text": "def solution2(a)\n uniq_a = {}\n a.each do |n|\n uniq_a[n] = true\n end\n uniq_a.size\nend",
"title": ""
},
{
"docid": "088f56edca0147e876847344cb42ea3c",
"score": "0.56842005",
"text": "def get_sets(nums)\n set = []\n if nums.size == 1\n (0..nums[0]).each do |k|\n set.push k\n end\n elsif nums.size == 2\n (0..nums[0]).each do |i0|\n break if i0 > nums[0]/2\n (i0..nums[1]).each do |i1|\n break if nums[0] % 2 ==0 and i0 == nums[0]/2 and i1 > nums[1]/2\n set.push [i0, i1]\n end\n end\n end\n set\nend",
"title": ""
},
{
"docid": "ba05fc42f521e53626bca4d0a41e231e",
"score": "0.5683469",
"text": "def persistence(n)\n sum = 1\n count = 0\n\n if n < 10\n return count\n end\n\n\n while true\n n.to_s.each_char do |char|\n sum *= char.to_i\n end\n\n count += 1\n \n if sum < 10\n break\n else\n n = sum\n sum = 1\n end\n end\n count\nend",
"title": ""
},
{
"docid": "8a349bfa30f2ca510eeb00dfd8f6b612",
"score": "0.567984",
"text": "def solution(a)\n # write your code in Ruby 2.2\n if a.nil?\n 0\n end\n \n result_hash = Set.new\n \n a.each do |item|\n result_hash << item # unless item.nil?\n end\n \n result_hash.length\n \nend",
"title": ""
},
{
"docid": "4ec9e6a1800b4771c22de823c9a271de",
"score": "0.5675259",
"text": "def smallest(n)\n result = [n]\n size = n.to_s.size\n size.times do |i1|\n size.times do |i2|\n digits = n.to_s\n x = digits.slice!(i1)\n digits.insert(i2, x)\n result = [digits.to_i, i1, i2] if digits.to_i < result.first\n end\n end\n result\nend",
"title": ""
},
{
"docid": "23a31f343e8bdd2c867350a35f62dcc3",
"score": "0.5675182",
"text": "def solve( n = 50_000_000 )\n terms = (2..4).map {|root| (1 + n**(1.0 / root)).to_i.prime_sieve}\n (2..4).each {|i| terms[i - 2].map! {|j| j**i}}\n\n sums = {}\n for c in terms[2]\n for b in terms[1]\n for a in terms[0]\n sum = a + b + c\n sums[sum] = true if sum < n\n end\n end\n end\n\n sums.keys.count\n end",
"title": ""
},
{
"docid": "95827cd204cf5536d59163079b0433e3",
"score": "0.56744045",
"text": "def digit_powers(n)\n a = []\n digit_array = (0..9).to_a.repeated_permutation(n + 1).to_a\n digit_array.map!{|array| array.join(\"\")}.to_s\n digit_array.select!{|number| number.to_i == number.split(\"\").map{|digit| digit.to_i ** n}.inject(:+)}\n digit_array.select!{|number| number.to_i != 1}.map!{|digit| digit.to_i}\n digit_array.inject(:+)\nend",
"title": ""
},
{
"docid": "f458a5fc1fc3c5ec38fcb11f29f0b150",
"score": "0.56736034",
"text": "def solution(number)\n b = ['I', 1], ['V', 5], ['X', 10], ['L', 50], ['C', 100], ['D', 500], ['M', 1000]\n p = 1\n res = []\n while p <= number.to_s.size\n x = (number % 10**p) / 10**(p-1)\n p x\n res << get_nums(b, p, x) if x != 0\n p res\n p+= 1\n end\n res.reverse.join\nend",
"title": ""
},
{
"docid": "184978b34707e2c9d190e35b6305dd56",
"score": "0.5673212",
"text": "def solution(n)\n a = n.to_s(2).split('')\n count, start, store = 0,0,0\n a.each do |i|\n start = 1 if i == '1' && count == 0\n count +=1 if i == '0' && start ==1\n if i=='1' && count > 0\n store = count if count > store\n count = 0\n end\n end\n store\nend",
"title": ""
},
{
"docid": "4fcb042de6af6b76dc383090247fc115",
"score": "0.56679815",
"text": "def solve( n = 2_000_000 )\n n.prime_sieve.inject( :+ )\n end",
"title": ""
},
{
"docid": "992e0bb923266179c4b1884313b1844b",
"score": "0.56670374",
"text": "def solve( n = 1_000_000 )\n total = 0\n\n (2...n).each do |i|\n str = i.to_s.chars.to_a\n prime = true\n\n # Rotate every digit into the first position as long as the resulting\n # number continues to be prime.\n str.length.times do\n prime = str.join.to_i.prime?\n break if !prime\n str.rotate!\n end\n\n total += 1 if prime\n end\n\n total\n end",
"title": ""
},
{
"docid": "e11582b13b5018eb7c5ca0f6a44ab79b",
"score": "0.5665728",
"text": "def solve( n = 1_000_000 )\n # Worst kind of brute force...\n (%w(0 1 2 3 4 5 6 7 8 9).permutation( 10 ).to_a.map! {|a| a.join}.sort![n - 1]).to_i\n end",
"title": ""
},
{
"docid": "4a43cdc79c04f955ca6e484aa2f238ae",
"score": "0.56555396",
"text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n unless arr.length > 1\n return false\n end\n h=Hash.new\n arr.each{|a|\n if h.key? a \n return true else h[n-a] = n end}\n return false\nend",
"title": ""
},
{
"docid": "5be71186d27817e9afebda72a7991724",
"score": "0.5652733",
"text": "def all_power_digits_sums(n)\n max_possible = (9**n) * (n + 1)\n results = []\n \n (10..max_possible).each do |number| \n results << number if is_power_digit_sum?(number, n)\n end\n \n results\nend",
"title": ""
},
{
"docid": "887d5b9d105cad5aad74318ead0f4830",
"score": "0.5648792",
"text": "def list_of_digits(set_count)\n digit_list = []\n count = set_count \n count.times do \n set_count -= 1\n digit_list << set_count \n end \n digit_list\n end",
"title": ""
},
{
"docid": "a5739e8fb1b952fed5dc61e33574b3d7",
"score": "0.56419253",
"text": "def factorInteger(n)\n arr = []\n k = 2\n while n > 1\n if n % k == 0\n n /= k\n arr << k\n else\n k += 1\n end\n end\n return arr\nend",
"title": ""
},
{
"docid": "0744974a30fadeedd69d9a13a1392075",
"score": "0.5639013",
"text": "def solution(a)\n num_hash = {}\n a.each do |num|\n num_hash.has_key?(num) ? num_hash.delete(num) : num_hash[num] = 1\n end\n return num_hash.keys[0]\nend",
"title": ""
},
{
"docid": "dfcfbc72cb63ac1cba3cbfc1cae88fac",
"score": "0.5638245",
"text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n unless arr.length > 1\n return false\n end\n h=Hash.new\n arr.each{|a|\n if h.key? a \n return true else h[n-a] = n end}\n return false\nend",
"title": ""
},
{
"docid": "390adbc1693314fc182134b8fc81e35e",
"score": "0.56382006",
"text": "def find_amicable_numbers(limit)\n result = []\n (1...limit).each do |a|\n b = d(a)\n res = d(b)\n result.push(a) if (a == res) && (a != b)\n end\n result\nend",
"title": ""
},
{
"docid": "6b61fd99ade18c73a09919d85102c7e4",
"score": "0.56374437",
"text": "def number_of_repeating_digits(n)\r\n repeated = false\r\n decimals = []\r\n d = 10\r\n while !repeated do\r\n decimals << d / n % 10\r\n repeated = repeating?(decimals)\r\n d *= 10\r\n end\r\n return decimals.size/2\r\nend",
"title": ""
},
{
"docid": "38670a938e23f4fb7302ac322c452dbc",
"score": "0.56371796",
"text": "def number_families(num_digits)\r\n #As an optimization, we can exclude masks that have the last digit being replaced, because it'll never hit 8 primes\r\n #since most of those will be even numbers.\r\n subgroups = power_set(0...num_digits-1)\r\n families = []\r\n subgroups.each do |fixed_mask|\r\n families += construct_families(num_digits, fixed_mask)\r\n end\r\n families\r\nend",
"title": ""
},
{
"docid": "026c50f028ab990e1476682d8aadcb61",
"score": "0.5628275",
"text": "def count_n_digit_powers(n)\n min = 10**(n-1)\n j = 1\n power = 1\n count = 0\n while power < 10**n\n count += 1 unless power < min\n j += 1 \n power = j**n\n end \n count\nend",
"title": ""
},
{
"docid": "d557b691bdd49023053fc7fe3e609fef",
"score": "0.56268287",
"text": "def find_all(n, k)\n return [] if n > k * 9 || n < k\n arr = 1.upto(n).to_a\n combs = arr.combination(k - 1).to_a.map {|subar| subar + [n]}\n digits_arr = combs.map do |subar|\n k.times.map {|i| i>0 ? subar[i] - subar[i-1] : subar[i]}\n end\n solutions = digits_arr.select do |subar|\n subar.max <= 9\n end.select do |subar|\n (k-1).times.to_a.all? {|i| subar[i+1] >= subar[i] }\n end\n return [] if solutions.empty?\n [solutions.length, solutions.min.join.to_i, solutions.max.join.to_i]\nend",
"title": ""
},
{
"docid": "71392384140fa82a7e6137a46e38dd0f",
"score": "0.5626266",
"text": "def persistence(n)\n return 0 if n < 10\n 1 + persistence(n.digits.inject(:*))\nend",
"title": ""
},
{
"docid": "906944e0910bbacfd3ff90764bbea0c5",
"score": "0.562469",
"text": "def solve( n = 5 )\n # Sort cube digits.\n digits = (0...10_000).map {|i| (i*i*i).to_s.chars.sort}\n\n # For each cube, count cubes that share the same digits (twins).\n counts = digits.map {|d| digits.count( d )}\n\n # Find the first entry that has the required number of twins.\n counts.find_index( n )**3\n end",
"title": ""
},
{
"docid": "cfcb6194acaa47bb06b293891dee4f42",
"score": "0.561251",
"text": "def additive_persistence(num)\n digits = num.to_s.split('').map(&:to_i)\n result = num.to_s\n times = 0\n until result.to_s.size <= 1\n result = digits.reduce(:+)\n digits = result.to_s.split('').map(&:to_i)\n times += 1\n end\n times\nend",
"title": ""
},
{
"docid": "458bc310ab8afa9496d22311623d8c25",
"score": "0.560734",
"text": "def power_sumDigTerm(n)\n result = []\n (2..100).each do |i|\n (2..130).each do |j|\n number = (i**j).to_s\n number_digit_total = number.chars.map!(&:to_i).sum\n result << i**j if number_digit_total == i\n end\n end\n result.sort[n - 1]\nend",
"title": ""
},
{
"docid": "d68037289e371e5d37c017896d6d44f4",
"score": "0.5599816",
"text": "def problem_92\n hit = 0\n seen = {0 => 0, 1 => 1, 89 => 89}\n\n check = lambda do |n|\n# puts n.inspect\n index = n.join.to_i\n return 0 if index == 0\n sum = index\n until seen[sum] do\n sum = sum.to_s.each_byte.map {|b| (b-48)*(b-48)}.reduce(&:+)\n end\n# puts \"#{n} => #{seen[sum]}\"\n seen[index] = seen[sum]\n end\n\n values = lambda do |a,off|\n (a[off-1] .. 9).each do |v|\n a[off] = v\n if off == (a.length-1)\n if check.call(a) == 89\n # now many uniq permutations of 'a' are there.\n if true\n hit += a.permutations\n else\n h = {}\n a.my_permutate {|a| h[a.join] = true }\n hit += h.size\n end\n end\n else\n values.call(a,off+1)\n end\n end\n end\n\n a = Array.new(7,0)\n values.call(a,0)\n puts \"seen.length = #{seen.length}\"\n hit\nend",
"title": ""
}
] |
ea1c566baa1a75434537270aef9caf32
|
returns all the valid questions for a company
|
[
{
"docid": "c53f3427564f78f1e4ac8969f1869e6f",
"score": "0.6927046",
"text": "def valid_questions\n questions.select { |question| question.valid_for_quiz?(self.id) }.uniq\n end",
"title": ""
}
] |
[
{
"docid": "a73443d4724bbb5d652d59d0f810210e",
"score": "0.6518735",
"text": "def valid_questions\n @valid_questions ||= @group.parent_questions.select{|pq|!pq.hidden?}\n end",
"title": ""
},
{
"docid": "d783e3c25edf15b0c04258bd0fd4fbd6",
"score": "0.65090287",
"text": "def usable_questions\n @questionnaire_content = questionnaire.content\n # If there are old questionnaires in the system that no longer have seeds\n # attached to them and are still in the old format, just leave them alone.\n return [] unless @questionnaire_content.is_a?(Hash) &&\n @questionnaire_content.key?(:questions) && @questionnaire_content.key?(:scores)\n\n range_questions(@questionnaire_content[:questions]) +\n other_questions(@questionnaire_content[:questions]) +\n checkbox_questions(@questionnaire_content[:questions]) +\n scores(@questionnaire_content[:scores])\n end",
"title": ""
},
{
"docid": "3c082dfbd8563e37f85a32d61ab584f3",
"score": "0.6387762",
"text": "def check_questions\r\n response = Request.get_request(URL_QUESTION)\r\n questions = []\r\n if response.success?\r\n data = Request.manage_response(response)\r\n end\r\n data.each do |question|\r\n questions << Question.new(question)\r\n end\r\n questions\r\nend",
"title": ""
},
{
"docid": "3d1f1cfb795679635503120ed022ace9",
"score": "0.61479086",
"text": "def reportable_questions\n self.questions.find_all{|q| q.adequate_responses?}\n end",
"title": ""
},
{
"docid": "b6da2e40d85d527e62a16efd061aa705",
"score": "0.6090184",
"text": "def generate_questions\n category = self.category\n questions = self.questions\n if category == EMPTY_STRING\n questions = Question.all\n return questions.sample(QUESTIONS_IN_A_BATTLE)\n else\n questions = Question.where(area: category)\n return questions.sample(QUESTIONS_IN_A_BATTLE)\n end\n end",
"title": ""
},
{
"docid": "1eb4cba5bd97f8f56293f42c050ad455",
"score": "0.60900193",
"text": "def question\n @company = Company.find(params[:id])\n @questions = @company.questions.all\n @current_user = @current_user\n end",
"title": ""
},
{
"docid": "7e1cebeffc6940834e18a36768b66d46",
"score": "0.6017674",
"text": "def all_questions\n @all_questions ||= lsat_sections.inject([]) { |memo, obj| obj.questions + memo }\n end",
"title": ""
},
{
"docid": "4d970b4fba837bbf9d2097596a1dbad3",
"score": "0.59943724",
"text": "def questions\n request('questions')\n end",
"title": ""
},
{
"docid": "8efef2e85c6cb5b17be094bb0020e429",
"score": "0.59597176",
"text": "def get_list_of_questions\n questions = []\n unless @situation.blank? || @situation[:groups].blank?\n @situation[:groups].each_key do |group_name|\n unless @situation[:groups][group_name].blank? || @situation[:groups][group_name][:questions].blank?\n questions << @situation[:groups][group_name][:questions].keys\n end\n end\n end\n questions.flatten\n end",
"title": ""
},
{
"docid": "a8b89a4645d7fb45f017c018baccc0c5",
"score": "0.59271306",
"text": "def correct_questions\n self.winning_games.map do |game|\n game.question\n end\n end",
"title": ""
},
{
"docid": "3e1cd028af4c4da94c80eb853dc8e5c0",
"score": "0.5903654",
"text": "def ask_every_questions\n #read_json\n answers = []\n (get_data[\"questions\"]).each_with_index do |v,i|\n answers.push(ask_question(i))\n end\n return answers\n end",
"title": ""
},
{
"docid": "d46dba503ee78715e1e790260c897e42",
"score": "0.58985573",
"text": "def build_response_question_list(questions)\n if questions.present?\n build_response = build_response_list(questions)\n success(all_question: build_response)\n else\n failure({errors: \"No Question found\"})\n end\n end",
"title": ""
},
{
"docid": "23e9d37c23e2e0db6bcc7bbee2d492bf",
"score": "0.58851886",
"text": "def prebooking_questions\n\n if @url.blank? or @api_token.blank?\n return []\n end\n\n [\n {\n question: \"What is your trip purpose?\", \n choices: purpose_choices, \n code: \"purpose\"\n },\n {\n question: \"Are you traveling with anyone?\", \n choices: passenger_choices, \n code: \"guests\"\n },\n { question: \"What is your apartment number?\",\n choices: ['string'],\n code: \"pickup_unit_number\"\n },\n { question: \"What is the apartment number at your destination?\",\n choices: ['string'],\n code: \"dropoff_unit_number\"\n }\n ]\n end",
"title": ""
},
{
"docid": "239cdc2f0a87baaa5047ec5775191549",
"score": "0.5873417",
"text": "def questions\n @extraction_form = ExtractionForm.find(params[:extraction_form_id])\n @assigned_questions = ExtractionForm.get_assigned_key_questions(params[:extraction_form_id])\n @key_questions = KeyQuestion.where(:project_id=>params[:project_id])\n\n # get information regarding which questions are still available, and which have been assigned \n # to other extraction forms\n available_question_info = ExtractionForm.get_available_questions(params[:project_id],params[:extraction_form_id])\n\n @available_questions = available_question_info[0]\n @assigned_to_other = available_question_info[1]\n end",
"title": ""
},
{
"docid": "1997805079b975b8516b9f61e063857d",
"score": "0.5849458",
"text": "def questions\n self.class.get('&category=25&type=multiple')\n end",
"title": ""
},
{
"docid": "4eab20693edfd06c0a930501ef56b4fa",
"score": "0.58486027",
"text": "def index\n @comms_questions = CommsQuestion.all\n end",
"title": ""
},
{
"docid": "711b829b47c7f83f19debcc464e139b6",
"score": "0.5815892",
"text": "def format_of_questions\n return unless questions.present?\n\n q_types = QuestionType.all.select(:id).map { |q| q.id }\n\n schema = Dry::Validation.JSON do\n configure do\n config.input_processor = :form\n config.type_specs = true\n config.messages = :i18n\n end\n\n each do\n schema do\n required(:question_id, :int).value(:int?)\n required(:text, :int).value(:str?)\n required(:type_id, :int).value(:int?, included_in?: q_types)\n end\n end\n end\n\n result = schema.call(questions)\n\n errors.add(:questions, result) unless result.success?\n end",
"title": ""
},
{
"docid": "b422a756ac8374d6fda43cbacae7b0ab",
"score": "0.5799836",
"text": "def questions\n @_questions ||= input_questions.map do |question|\n text_answers = answers_for(question.ids)\n\n Question.with_response_data(\n question: question,\n answer: typecast_answer(answer: text_answers, type: question.type),\n text: extrapolated_question_text(question),\n original_answer: text_answers\n )\n end\n end",
"title": ""
},
{
"docid": "04b52eb90e8c6182f29000635873cc8c",
"score": "0.5776911",
"text": "def format_of_questions\n return unless questions.present?\n\n q_types = QuestionType.all.select(:id).map { |q| q.id }\n\n schema = Dry::Validation.JSON do\n configure do\n config.input_processor = :form\n config.type_specs = true\n config.messages = :i18n\n end\n\n each do\n schema do\n required(:question_id, :int).value(:int?)\n required(:text, :int).value(:str?)\n required(:type_id, :int).value(:int?, included_in?: q_types)\n end\n end\n end\n\n result = schema.call(questions)\n\n result_errors_to_active_model :questions, result\n end",
"title": ""
},
{
"docid": "089cb93f3f3120b3037bd2bca5e09d09",
"score": "0.5752131",
"text": "def forms\n questionings.collect(&:form).uniq\n end",
"title": ""
},
{
"docid": "089cb93f3f3120b3037bd2bca5e09d09",
"score": "0.5752131",
"text": "def forms\n questionings.collect(&:form).uniq\n end",
"title": ""
},
{
"docid": "089cb93f3f3120b3037bd2bca5e09d09",
"score": "0.5752131",
"text": "def forms\n questionings.collect(&:form).uniq\n end",
"title": ""
},
{
"docid": "16cb65a642064ceb93658231158edf36",
"score": "0.5745652",
"text": "def no_company_with_required_input_values?\n return false unless @requirement == :all\n @companies_with_values&.empty?\n end",
"title": ""
},
{
"docid": "40424c477bcb39837fafeef69daa6f33",
"score": "0.57340187",
"text": "def questions\n return @questions\n end",
"title": ""
},
{
"docid": "2ddd69d0c4e9688a483bd33712134f77",
"score": "0.57143795",
"text": "def questions\n @questions ||= pages.flat_map { |p| p.questions }\n end",
"title": ""
},
{
"docid": "2c552eb825fb3a8164e4dce121cba65d",
"score": "0.5713346",
"text": "def surveys_build_questions(survey_name)\n survey = Survey.find_by_name(survey_name)\n questions = survey.questions(:order => 'order')\n \n questions_to_ask = Array.new\n questions.each do |question| \n questions_to_ask << { :name => question.name, \n :question => question.question, \n :valid_responses => question.valid_responses, \n :audio_file => surveys_create_file(question.question),\n :database_record => question }\n end\n return questions_to_ask\n end",
"title": ""
},
{
"docid": "5dad9386b6fe1a050a0a4bd89d4a47cc",
"score": "0.57067686",
"text": "def questions\n @_questions = @_bet.filtered_questions(filtered_params[:filter]).all\n @questions = QuestionPresenter.map(@_questions)\n\n @_question_bets = @_bet.filtered_question_bets(filtered_params[:filter]).all\n @question_bets = QuestionBetPresenter.map(@_question_bets)\n end",
"title": ""
},
{
"docid": "d846cef6a28edacbf36c990a2a19f07f",
"score": "0.5704357",
"text": "def all_companies\n @companies = []\n Company.all\n .each do |comp|\n choosed = Offer.where(student_id: set_student.id).find_by_company_id(comp.id) ? 'yes' : 'no'\n @companies << { id: comp.id, name: comp.name, choosed: choosed }\n end\n end",
"title": ""
},
{
"docid": "405ac3da7c8fd43e83b5e281f7ad1549",
"score": "0.5695651",
"text": "def questions\n @mapped_questions ||= Basecamp3::Question.all(bucket.id, id)\n end",
"title": ""
},
{
"docid": "bcab35ddd27409a032b9b8f734797c3d",
"score": "0.5694819",
"text": "def questions\n @data[:questions]\n end",
"title": ""
},
{
"docid": "2ab02322d51c8cff1a8d440c237b5028",
"score": "0.5682318",
"text": "def answer_questions\n @questions = Question.all\n end",
"title": ""
},
{
"docid": "94ba1c03bcc3a8b5a0f04907b5bae5fb",
"score": "0.56822205",
"text": "def get_questions_of(tester_name)\n my_questions = Array.new\n \n @bundles.each do |name, parcels|\n next if name == tester_name\n next if parcels == nil\n \n parcels.each do |parcel|\n bundle = parcel[1]\n \n if bundle[0][\"option0\"] == tester_name or \n bundle[0][\"option1\"] == tester_name\n bundle.each_with_index do |quiz, index|\n my_array = [parcel[0], index, name, quiz]\n my_questions << my_array\n end\n end\n end\n end\n return my_questions\n end",
"title": ""
},
{
"docid": "04ae5cc3717bd831cfab9a5a109f55ea",
"score": "0.5681019",
"text": "def question_set\n [\n Prompt.for('Name of product: '),\n Prompt.for_yes_no_question('Imported?: ', 'yes'),\n Prompt.for_yes_no_question('Exempted from sales tax? ', 'yes'),\n Integer(Prompt.for('Price: '))\n ]\n end",
"title": ""
},
{
"docid": "f21bdf5068d061850a35a8ce3e340eba",
"score": "0.56803465",
"text": "def questions\n self.class.get('/2.2/questions', @options)\n end",
"title": ""
},
{
"docid": "e31d8dedd42db07ec6661f9957b90460",
"score": "0.56729484",
"text": "def questions\n question_settings = settings(:export).fields[:questions]\n @questions ||= if question_settings.present?\n case question_settings\n when :all\n Question.where(section_id: plan.sections.collect(&:id)).pluck(:id)\n when Array\n question_settings\n else\n []\n end\n else\n []\n end\n end",
"title": ""
},
{
"docid": "fd411438ddcf6897d29c5244bf9c96fb",
"score": "0.5672856",
"text": "def all_answers\n Answer.where company_id: id\nend",
"title": ""
},
{
"docid": "330e89b8f96c8ca88f90ac732ec35bda",
"score": "0.5670321",
"text": "def rejected_questions\n @author = User.find_by_id(current_user.role).email\n @rejected_questions = Question.where(\"author = ? AND workflow_state = 'rejected'\",current_user.email)\n end",
"title": ""
},
{
"docid": "1471a92fb38ca7f650ddae6827fbc212",
"score": "0.56521463",
"text": "def correct_options\n return self.questions.map(&:correct_options).flatten\n end",
"title": ""
},
{
"docid": "1471a92fb38ca7f650ddae6827fbc212",
"score": "0.56521463",
"text": "def correct_options\n return self.questions.map(&:correct_options).flatten\n end",
"title": ""
},
{
"docid": "1471a92fb38ca7f650ddae6827fbc212",
"score": "0.56521463",
"text": "def correct_options\n return self.questions.map(&:correct_options).flatten\n end",
"title": ""
},
{
"docid": "bb4ed00f0e4bc388dfdaaada184e8f92",
"score": "0.56519544",
"text": "def questions\n questions_hash = self.questions_hash()\n questions = []\n\n self.question_ids.each do |question_id|\n questions << questions_hash[question_id]\n end\n\n questions\n end",
"title": ""
},
{
"docid": "88f346716db6190818289271173f3d68",
"score": "0.56365925",
"text": "def questions\n question_settings = self.settings(:export).fields[:questions]\n @questions ||= if question_settings.present?\n if question_settings == :all\n Question.where(section_id: self.plan.sections.collect { |s| s.id }).pluck(:id)\n elsif question_settings.is_a?(Array)\n question_settings\n else\n []\n end\n else\n []\n end\n end",
"title": ""
},
{
"docid": "11621155e630c137d23cff54824a2358",
"score": "0.5635764",
"text": "def check_for_non_profile_questions\n sample_opportunity = Opportunity.find(@sample_opportunity_id)\n profile = Opportunity::Profile.current\n @extra_question_ids = sample_opportunity.questions.map(&:form_field_id) - profile.questions.map(&:form_field_id)\n\n automatch_missing_questions = []\n Opportunity::Automatch.not_archived.find_each do |opportunity|\n extra_question_ids.each do |question_id|\n if opportunity.questions.where(form_field_id: question_id).blank?\n automatch_missing_questions << opportunity.id\n end\n end\n end\n # automatch_missing_questions.count\n\n apply_missing_questions = []\n Opportunity::Apply.not_archived.find_each do |opportunity|\n extra_question_ids.each do |question_id|\n if opportunity.questions.where(form_field_id: question_id).blank?\n apply_missing_questions << opportunity.id\n end\n end\n end\n # apply_missing_questions.count\n puts \"Extra Questions Count: #{@extra_question_ids.count}\"\n puts \"Missing Auto-Match Questions: #{automatch_missing_questions.count}\"\n puts \"Missing Apply-To Questions: #{apply_missing_questions.count}\"\n end",
"title": ""
},
{
"docid": "cf736b9eaa96d0fc9ac83af6e2b3a6dd",
"score": "0.563471",
"text": "def valid_question_count\n valid_questions.count\n end",
"title": ""
},
{
"docid": "04e3965b636d828b8990c4f556c11383",
"score": "0.56304216",
"text": "def questions\n @_questions ||= Answers.collate(parsed_response: parsed_response,\n parsed_questions: parsed_questions,\n input_questions: input_questions)\n end",
"title": ""
},
{
"docid": "2106dd51a1d8b2a25c68045f90b489f6",
"score": "0.56295437",
"text": "def cleanCompanies\n @companyList.select! {|company|validURL?(company.companyURL)&&validURL?(company.jobURL)}\n end",
"title": ""
},
{
"docid": "def19d8d9ccaacda4e310650154fdc4b",
"score": "0.5621615",
"text": "def survey_questions\n ids = []\n\n survey_pages.find_each do |page|\n ids += page.survey_question_ids\n end\n\n SurveyQuestion.where(id: ids).distinct\n end",
"title": ""
},
{
"docid": "949983abebc4a8ca218efa0b1e74ede9",
"score": "0.5601428",
"text": "def recommended\n\n areas = [\"ciências da natureza e suas tecnologias\",\n \"ciências humanas e suas tecnologias\",\n \"linguagens, códigos e suas tecnologias\",\n \"matemática e suas tecnologias\"]\n @questions = []\n areas.each do |area|\n classification = current_user.classification(area)\n @questions = @questions | instance_eval(\"Question.#{classification}_questions('#{area}')\")\n end\n @questions = @questions.select { |q| !current_user.accepted_questions.include? q.id }\n\n return @questions\n\n end",
"title": ""
},
{
"docid": "305a953c6bafe903cfc39a92d5d4e7e9",
"score": "0.5588318",
"text": "def questions\n expansions.map(&:questions).flatten\n end",
"title": ""
},
{
"docid": "2af7cfef3e7e1a07e7bfe8b6c40dcc24",
"score": "0.5577714",
"text": "def questions\n @questions ||= qa_buffer.map{|qq|qq.first}\n end",
"title": ""
},
{
"docid": "8297109996063ce8200b9885b4d2a4ab",
"score": "0.5576874",
"text": "def custom_questions\n return @custom_questions\n end",
"title": ""
},
{
"docid": "8297109996063ce8200b9885b4d2a4ab",
"score": "0.5576874",
"text": "def custom_questions\n return @custom_questions\n end",
"title": ""
},
{
"docid": "e5512b2cfc05a908a5808438d860f624",
"score": "0.55752",
"text": "def parent_questions\n valid_questions[lbound...ubound]\n end",
"title": ""
},
{
"docid": "fe023d2a01363a7e0fd42b7258553ab4",
"score": "0.5574616",
"text": "def check_questions_requirements\n if questions.empty? || questions.collect(&:options).empty?\n errors.add(:base, 'Section without questions or options cannot be saved')\n end\n end",
"title": ""
},
{
"docid": "fe101609014754800148cbd51214083b",
"score": "0.5566025",
"text": "def questions\n @questions\n end",
"title": ""
},
{
"docid": "c2a490e5d2165a69e03137c44ebcac63",
"score": "0.55613077",
"text": "def check_questions_requirements\n if self.questions.empty? || self.questions.collect(&:options).empty?\n errors.add(:base, \"Section without questions or options cannot be saved\")\n end\n end",
"title": ""
},
{
"docid": "04f56602a4b9bafbc9c6c82a3174af5c",
"score": "0.55516887",
"text": "def get_question_choices(project_id)\n questions = KeyQuestion.find(:all, :order => \"question_number ASC\", :conditions => [\"project_id = ?\", project_id])\n return(questions)\n end",
"title": ""
},
{
"docid": "1eca387980dc98f8c726d5b70e7e0d92",
"score": "0.5509256",
"text": "def recommended\n areas ||= [\"ciências da natureza e suas tecnologias\",\n \"ciências humanas e suas tecnologias\",\n \"linguagens, códigos e suas tecnologias\",\n \"matemática e suas tecnologias\"]\n @questions ||= []\n areas.each do |area|\n classification = current_user.classification(area)\n @questions ||= @questions | instance_eval(\"Question.#{classification}_questions('#{area}')\")\n return @questions\n end\n \n @questions ||= @questions.select { |q| !current_user.accepted_questions.include? q.id }\n return @questions\n end",
"title": ""
},
{
"docid": "d2fc6944b9a80b957418b4321df41962",
"score": "0.5508391",
"text": "def fetchQuestions(condition)\n\t\tquestions = Question.where condition\n\t\t@questions = {}\n\t\t@questionRequirement = {}\n\t\t@questionType = {}\n\t\tquestions.each do |question|\n\t\t\t@questions[question.id] = question.question_text\n\t\t\t@questionRequirement[question.id] = question.mandatory\n\t\t\t@questionType[question.id] = question.responseType\n\t\tend\n\tend",
"title": ""
},
{
"docid": "38240117d5cac36b272ae5a69f2f67e0",
"score": "0.5489255",
"text": "def unanswered_nc_questions\n self.nc_questions.where(\"target_date <= ?\" , DateTime.now).select{ |x| x.answers.blank?}\n end",
"title": ""
},
{
"docid": "91c6afe901515f0ebd16f5115f73a21e",
"score": "0.54888016",
"text": "def test_q23_e_all\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q23] = 'e'\n params[:q23_e_a] = \"true\"\n params[:q23_e_b] = \"true\"\n params[:q23_e_c] = \"true\"\n\n form_processor = Multi.new\n form_processor.process_question(test_agreement.agreementid.to_i, '23', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r32\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "4c3f9d220ae1381dd838cd5a176e0195",
"score": "0.548448",
"text": "def questions_all(limit=nil) descendants_linked_objects('questions_genuine', limit) end",
"title": ""
},
{
"docid": "70ac3286bc6510fa62ee723788b636e7",
"score": "0.5454586",
"text": "def test_q14_d_all\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q14] = 'd'\n params[:q14_d_a] = \"true\"\n params[:q14_d_b] = \"true\"\n params[:q14_d_c] = \"true\"\n\n form_processor = Manuscripts.new\n form_processor.process_question(test_agreement.agreementid.to_i, '14', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r32\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "3c4242571dbfdeb0323f87f8720680aa",
"score": "0.54304755",
"text": "def answers \n exam_questions = self.test_bank_questions\n exam_questions.each do |question|\n answer_choices = question.answer_choices\n answer_choices.each do |choice|\n if choice.correct_choice == true\n self.correct_answers_ids << choice.id.to_s\n end\n end\n end\n\n return correct_answers_ids\n end",
"title": ""
},
{
"docid": "28e2f2d2abd305db131a5e3aa739ac42",
"score": "0.5430236",
"text": "def show\n @choosen_questions = @questionaire.questions\n @possible_questions = Question.where.not(id: @choosen_questions)\n \n end",
"title": ""
},
{
"docid": "0ad49c50f8f082c9cacf292112c6db05",
"score": "0.5429236",
"text": "def get_questionnaires\n @get_questionnaires ||= begin\n questionnaire_service.search('context-type-value': get_use_context)\n end\n end",
"title": ""
},
{
"docid": "33b0a3c95b8b7890c74058e6d94936f0",
"score": "0.54235923",
"text": "def job_questions(shortcode)\n transform_to(:question, get_request(\"jobs/#{shortcode}/questions\")['questions'])\n end",
"title": ""
},
{
"docid": "978cbf1b7f7fcde37e3a3a2c4de9940b",
"score": "0.5413581",
"text": "def validate_questionnaire\n errors.add(:max_question_score, 'The maximum question score must be a positive integer.') if max_question_score < 1\n errors.add(:min_question_score, 'The minimum question score must be a positive integer.') if min_question_score < 0\n errors.add(:min_question_score, 'The minimum question score must be less than the maximum.') if min_question_score >= max_question_score\n\n results = Questionnaire.where('id <> ? and name = ? and instructor_id = ?', id, name, instructor_id)\n errors.add(:name, 'Questionnaire names must be unique.') if results.present?\n end",
"title": ""
},
{
"docid": "56d43169534d2d006c1e7c141793d4fc",
"score": "0.54048663",
"text": "def valid_solutions\n self.solutions.reject{|s| s.item.nil? }.uniq{|s| s.identity}\n end",
"title": ""
},
{
"docid": "8ee688cddc604fdeee4d58392d402492",
"score": "0.5394485",
"text": "def getQuestions()\n @@questions\n end",
"title": ""
},
{
"docid": "1fb338735715cc0db57ce96e6a56e1df",
"score": "0.5384449",
"text": "def index\n @actual_questions = ActualQuestion.all\n end",
"title": ""
},
{
"docid": "1deb3593b6a3dda61ef5207635faf6ca",
"score": "0.53821135",
"text": "def questions\n SurveyQuestion.joins(:survey_item).order(\"survey_items.item_number ASC\").where(id: question_ids)\n end",
"title": ""
},
{
"docid": "7b70bf818d50529885184b511f51276e",
"score": "0.5377691",
"text": "def show\n @company = Company.find(params[:id])\n @interview = Interview.all( :conditions => {:company_id => [@company.id]}, :limit => 1)\n @offers = @company.offers.all\n @questions = Question.all( :conditions => {:company_id => [@company.id]}, :limit => 3)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "d4e4026cfaca1be728c41ca0f5d58f8a",
"score": "0.53695923",
"text": "def questions\n @questions ||= {\n\n sex: {\n index: :x8021,\n strategy: :straight_multiplication,\n question: \"You are:\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'Female'],\n [1, 'Male']\n ]\n },\n\n age: {\n index: :x8022,\n strategy: :straight_multiplication,\n question: \"What is your age?\",\n type: :integer_input,\n min: 1,\n max: 119\n },\n\n married: {\n index: :x7372,\n strategy: :straight_multiplication,\n question: \"Are you married?\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'No'],\n [1, 'Yes']\n ]\n },\n\n no_people: {\n index: :x101,\n strategy: :straight_multiplication,\n question: \"Number of people in your household?\",\n type: :integer_input,\n min: 1\n },\n\n real_estate_val: {\n index: :x1706,\n strategy: :straight_multiplication,\n question: \"How much is your real estate property worth if sold today?\",\n type: :select,\n answer_options: [0, 1, 2, 3, 4, 5, 6],\n select_options: [\n [0, \"$0\"],\n [1, \"$1 to $10,000\"],\n [2, \"$10,000 to $50,000\"],\n [3, \"$50,000 to $100,000\"],\n [4, \"$100,000 to $500,000\"],\n [5, \"$500,000 to $1,000,000\"],\n [6, \"over $1,000,000\"]\n ]\n },\n\n saving_reason: {\n index: :x3006,\n strategy: :custom,\n question: \"What would you describe as your most important reason for saving?\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'Liquidity and consumption'],\n [1, 'Education and family']\n ]\n ### MAPPING:\n # Liquidity and consumption? (0) (3006_1 == 1, 3006_5 == 0)\n # Education and family? (1) (3006_1 == 0, 3006_5 == 1)\n },\n\n investment_timeline: {\n index: :x3008_1,\n strategy: :straight_multiplication,\n question: \"In planning your saving and spending, are the next few months most important for you?\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'No'],\n [1, 'Yes']\n ]\n },\n\n investment_timeline_length: {\n index: :x3008_45,\n strategy: :straight_multiplication,\n question: \"In planning your saving and spending, do you have longer than 5 years before needing the majority of your funds?\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'No'],\n [1, 'Yes']\n ]\n },\n\n economy_performance: {\n index: :x301,\n strategy: :custom,\n question: \"Do you expect the economy to perform better in the next 5 years than it has over the past 5?\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'Better'],\n [1, 'Worse']\n ]\n ### MAPPING:\n # Better? (x301_1 == 1, x301_3 == 0)\n # Worse? (x301_1 == 0, x301_3 == 1)\n },\n\n financial_risk: {\n index: :x3014,\n strategy: :straight_multiplication,\n question: \"You are comfortable taking financial risks with your savings.\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'True'],\n [1, 'False']\n ]\n },\n\n credit_card: {\n index: :x432,\n strategy: :straight_multiplication,\n question: \"Do you always pay off the full balance of your credit card account each month?\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'No'],\n [1, 'Yes']\n ]\n },\n\n pension: {\n index: :x5608,\n strategy: :straight_multiplication,\n question: \"How much do you expect your future monthly pension to be?\",\n type: :select,\n answer_options: [0, 1, 2, 3, 4, 5, 6],\n select_options: [\n [0, '$0'],\n [1, '$1 to $499'],\n [2, '$500 to $999'],\n [3, '$1,000 to $1,999'],\n [4, '$2,000 to $4,999'],\n [5, '$5,000 to $9,999'],\n [6, 'over $10,000']\n ]\n },\n\n inheritance: {\n index: :x5821,\n strategy: :straight_multiplication,\n question: \"About how much in future inheritance (or transfer of assets) do you expect?\",\n type: :select,\n answer_options: [0, 1, 2, 3, 4, 5, 6],\n select_options: [\n [0, '$0'],\n [1, '$1 to $10,000'],\n [2, '$10,000 to $50,000'],\n [3, '$50,000 to $100,000'],\n [4, '$100,000 to $500,000'],\n [5, '$500,000 to $1,000,000'],\n [6, 'over $1,000,000']\n ]\n },\n\n bequeath: {\n index: :x5825,\n strategy: :straight_multiplication,\n question: \"Do you expect to leave a sizable estate to others?\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'Yes'],\n [1, 'No']\n ]\n },\n\n degree: {\n index: :x5905,\n strategy: :straight_multiplication,\n question: \"What is the highest degree you have earned?\",\n type: :select,\n answer_options: [1, 2, 3, 4, 5],\n select_options: [\n [1, 'Nursing, Chiropratic, other'],\n [2, \"Associate's, junior college\"],\n [3, \"Bachelor's degree\"],\n [4, 'MA, MS, MBA'],\n [5, 'PhD, MD, Law, JD, other doct.']\n ]\n },\n\n loan: {\n index: :x7131,\n strategy: :straight_multiplication,\n question: 'Have you applied for any type of credit or loan in the last 5 years?',\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'Yes'],\n [1, 'No']\n ]\n },\n\n forseeable_expenses: {\n index: :x7186,\n strategy: :straight_multiplication,\n question: \"You are currently saving for forseeable future expenses.\",\n type: :select,\n answer_options: [0, 1],\n select_options: [\n [0, 'Yes'],\n [1, 'No']\n ]\n },\n\n emergency_fund: {\n index: :x7187,\n strategy: :straight_multiplication,\n question: \"About how much do you think you need to have in savings for emergencies and other unexpected things that may come up?\",\n type: :select,\n answer_options: [0, 1, 2, 3, 4, 5, 6],\n select_options: [\n [0, '$0'],\n [1, '$1 to $10,000'],\n [2, '$10,000 to $50,000'],\n [3, '$50,000 to $100,000'],\n [4, '$100,000 to $500,000'],\n [5, '$500,000 to $1,000,000'],\n [6, 'over $1,000,000']\n ]\n },\n\n job_title: {\n index: :x7401,\n strategy: :custom,\n question: \"Which of the following closely matches your job title?\",\n type: :select,\n answer_options: [0, 1, 2],\n select_options: [\n [0, \"Managerial, Executive\"],\n [1, \"Technical, Sales, Administrative\"],\n [2, \"Operator, Fabricator, Laborer\"]\n ]\n ### MAPPING:\n # 0? -- x7401_1 == 1, otherwise x7401_1 == 0\n # 1? -- x7401_2 == 1, otherwise x7401_2 == 0\n # 2? -- x7401_5 == 1, otherwise x7401_5 == 0\n }\n\n }\n\n end",
"title": ""
},
{
"docid": "2f3c70b17866b84c9f7547e307e5c5fc",
"score": "0.53692913",
"text": "def training_question\n # Obtain the categorys of the questions answered\n question_categories = questions.pluck(:category)\n # if the categorys is empty (new user), return a random question\n return Question.random if question_categories.empty?\n h = Hash.new(0)\n # Hashed the values, for count purposes\n question_categories.each { | v | h.store(v, h[v]+1) }\n # We set maximum 4 law questions, and 3 of the others for the training. If the user fulfilled the quota in a category,\n # this method discard a question of that category\n a = Array.new(0)\n a << 'law' if h['law'] < 4\n a << 'penalty' if h['penalty'] < 3\n a << 'sign' if h['sign'] < 3\n # Find the question in the valid category\n Question.where(category: a).random\n end",
"title": ""
},
{
"docid": "319845823a5f94fd64135ebe0cca276e",
"score": "0.5365913",
"text": "def questions_exist\n errors.add_to_base(\"You must choose at least one question to ask\") if questions.empty?\n end",
"title": ""
},
{
"docid": "2ca31cdf8d1b5e2dec7f65268c3f70a4",
"score": "0.5363532",
"text": "def find_company_emails\n EMAIL_SAMPLES.each do |name, email|\n all_company_emails[name] = email if match_company_domain?(email)\n end\n all_company_emails\n end",
"title": ""
},
{
"docid": "808e288cdeece18ff376a92edec5020b",
"score": "0.53594005",
"text": "def available_questions\n questions - questions_in_game\n end",
"title": ""
},
{
"docid": "8a559631529424813d34130174be7fbd",
"score": "0.5358736",
"text": "def are_all_contacts_provided?(question)\n ri = true\n [1,2,3].each do |i|\n ri = false if person.responses_for(\"TRACING_INT.CONTACT_RELATE_#{i}\").blank?\n end\n answer_for(question, ri)\n end",
"title": ""
},
{
"docid": "15b8ec7ed2f5fb61115324a731281c5f",
"score": "0.5357699",
"text": "def get_company_reasons(company_id)\n connect\n boycotts = @@db[\"SELECT * FROM boycotts WHERE company_id = ?\", company_id]\n reason_ids = boycotts.collect { |b| b[:reason_id] }.uniq\n\n reason_ids.collect do |id|\n @@db[\"SELECT * FROM reasons WHERE id = ?\", id].first\n end\n end",
"title": ""
},
{
"docid": "08f0cb53cb454e3a9850a22c6179564e",
"score": "0.53573865",
"text": "def parse_questions\n question_rows = []\n raws = connect(options)\n unless raws.nil? || raws.empty?\n raws.each do |q|\n owner = q['owner']\n question_rows << [owner['display_name'], q['title'], \"http://stackoverflow.com/q/#{q['question_id']}\", \"http://stackoverflow.com/a/#{q['accepted_answer_id']}\"]\n end\n Terminal::Table.new headings: ['Owner', 'Title', 'Question', 'Accepted Answer'], rows: question_rows\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "8867b78f1c03d3b5ce11681c27ecfe3a",
"score": "0.5340262",
"text": "def build_quiz\n return false if !ready_for_quiz?\n valid_questions.sample(8).map {|question| question.build_for_quiz(self.id)}\n end",
"title": ""
},
{
"docid": "02d10cd4bc9c62859dd9b3777895be61",
"score": "0.5334583",
"text": "def validate_quiz\n num_questions = Assignment.find(params[:aid]).num_quiz_questions\n valid = 'valid'\n if params[:questionnaire][:name] == '' # questionnaire name is not specified\n valid = 'Please specify quiz name (please do not use your name or id).'\n end\n (1..num_questions).each do |i|\n break unless valid == 'valid'\n\n valid = validate_question(i)\n end\n valid\n end",
"title": ""
},
{
"docid": "55575cc6f2a27e76ac0ca7227a6ad296",
"score": "0.5333118",
"text": "def question\n # get the question for every user\n end",
"title": ""
},
{
"docid": "08fc497b704e4ff842f83b89e7b19589",
"score": "0.53280115",
"text": "def resolve_questions\n eds = dindex.keys\n ers = rindex.keys\n\n qscope = survey.questions\n qd = (qscope.where(:data_export_identifier => eds) unless eds.empty?) || []\n qr = (qscope.where(:reference_identifier => ers) unless ers.empty?) || []\n\n qrefs_ok!(eds, qd.map(&:data_export_identifier))\n qrefs_ok!(ers, qr.map(&:reference_identifier))\n\n fulfill(qd, dindex) { |q| q.data_export_identifier }\n fulfill(qr, rindex) { |q| q.reference_identifier }\n end",
"title": ""
},
{
"docid": "a6a032cd110b795abdf8665acc91c4d6",
"score": "0.53219604",
"text": "def questions\n # Create an empty array\n arr = []\n # Iterate over the range 1 through 5\n (1..5).each do |i|\n # Create a question with:\n # - question text of \"Test Likert Question #{i}\"\n # - answers based on the array found in the function likert_answers\n # - the STANDARD question type (you can make more question types yourself in app/model/question_type.rb)\n # - just make sure and also create your QuestionType.new in db/seeds.rb\n # - the LIKERT question type\n # - layer of 0 (which means these questions will be shown before all others of layer > 0)\n\n\n arr << get_question(\"Test Likert Question #{i}\", likert_answers, QuestionType::LIKERT, QuestionFormat::LIKERT, 0)\n\n\n # Create a question with:\n # - question text of \"Test Multiple Choice Question #{i}\"\n # - answers based on the array found in the function multiple_choice_answers\n # - the ALTERNATE question type (you can make more question types yourself in app/model/question_type.rb)\n # - just make sure and also create your QuestionType.new in db/seeds.rb\n # - the MULTIPLE question type\n # - layer of 1 (which means these questions will be shown before all others of layer > 1)\n arr << get_question(\"Test Check Choice Question #{i}\", multiple_choice_answers, QuestionType::CHECK, QuestionFormat::CHECK, 1)\n arr << get_question(\"Test Radio Choice Question #{i}\", multiple_choice_answers, QuestionType::MULTIPLE, QuestionFormat::MULTIPLE, 2)\n end\n arr\n end",
"title": ""
},
{
"docid": "252577e837b530758ce7213349e3c578",
"score": "0.53180027",
"text": "def smerf_get_group_questions(group)\n group.questions \n end",
"title": ""
},
{
"docid": "36fb1a92d8d713f3294dc3f1b280214a",
"score": "0.53036493",
"text": "def incorrect_options\n return self.questions.map(&:incorrect_options).flatten\n end",
"title": ""
},
{
"docid": "36fb1a92d8d713f3294dc3f1b280214a",
"score": "0.53036493",
"text": "def incorrect_options\n return self.questions.map(&:incorrect_options).flatten\n end",
"title": ""
},
{
"docid": "36fb1a92d8d713f3294dc3f1b280214a",
"score": "0.53036493",
"text": "def incorrect_options\n return self.questions.map(&:incorrect_options).flatten\n end",
"title": ""
},
{
"docid": "d2bba27fa738fba1a5f2c69f38377fa3",
"score": "0.5301119",
"text": "def questions\n q = []\n pages_with_embeddables.each do |p|\n p.embeddables.each do |e|\n if QUESTION_TYPES.include? e.class\n q << e\n end\n end\n p.interactives.each do |i|\n q << i if i.respond_to?('save_state') && i.save_state\n end\n end\n return q\n end",
"title": ""
},
{
"docid": "7aab048e1d7554fb0ebb8a094a2cab54",
"score": "0.5295071",
"text": "def get_valid_answers_for_response(response)\n answers = Answer.where(response_id: response.id)\n valid_answer = answers.select { |answer| (answer.question.type == 'Criterion') && !answer.answer.nil? }\n valid_answer.empty? ? nil : valid_answer\n end",
"title": ""
},
{
"docid": "89f8824384b4759406ff16c91841c401",
"score": "0.5294094",
"text": "def languages\n @questions ||= Question.where(area: \"linguagens, códigos e suas tecnologias\").order(:year, :number)\n assert(@questions.kind_of?(Question))\n return @questions\n end",
"title": ""
},
{
"docid": "27ea643056e513d7d53fd54bc1904b9d",
"score": "0.52940154",
"text": "def obtain_questions(body)\n size = parse_number(body)\n if size > 0\n size -= 1\n end\n response = DYNAMODB.scan(table_name: TABLE_NAME)\n parse_items(response.items.shuffle[0..size])\nend",
"title": ""
},
{
"docid": "1a2efaff63823da553b9d0a36d75bc55",
"score": "0.52907544",
"text": "def available_quests\n ret = Quest.nin(_id: self.completed_quests + self.accepted_quests)\n ret.any_of({:parent_id.in => self.completed_quests}, {parent_id: nil})\n end",
"title": ""
},
{
"docid": "80e65a7b5d94871ec276652c5654eef9",
"score": "0.5287142",
"text": "def getsurveyquestion_app\n response = getsurvey_question(params[:form_id].to_i)\n if response.present?\n puts \"Got all survey questions!\"\n render json: { message: response }, status: 200 \n else\n puts \"Could not get survey questions!\"\n render json: { message: 'Could not get survey questions!'}, status: 403\n end\n end",
"title": ""
},
{
"docid": "29ed5b3d9e2f5a608796fec118de1ad7",
"score": "0.52834535",
"text": "def index\n @person_questions = PersonQuestion.all\n end",
"title": ""
},
{
"docid": "8bf7859547dcf42781a1299339fd7065",
"score": "0.52541435",
"text": "def test_company\n @sets.each do |x|\n assert_not_nil x.company, \"#{x.id} belongs to no company\"\n end\n end",
"title": ""
},
{
"docid": "6e49c2395e776063d6146a6abec303f5",
"score": "0.52528155",
"text": "def forms\n option_sets.collect{|os| os.questionings.collect(&:form)}.flatten.uniq\n end",
"title": ""
},
{
"docid": "6e49c2395e776063d6146a6abec303f5",
"score": "0.52528155",
"text": "def forms\n option_sets.collect{|os| os.questionings.collect(&:form)}.flatten.uniq\n end",
"title": ""
}
] |
a157de36ec16787edbca649f295fdf00
|
GET /howtodos/1 GET /howtodos/1.json
|
[
{
"docid": "51ab0d267ca78cc71b37fcf2531a0dcf",
"score": "0.0",
"text": "def show\n @comments = @howtodo.comments\n @ratings = @howtodo.ratings\n current_user.view_howtodo(@howtodo)\n end",
"title": ""
}
] |
[
{
"docid": "16b8ff79f0996db0991cbc98b91943fa",
"score": "0.67970604",
"text": "def index\n @to2dos = To2do.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @to2dos }\n end\n end",
"title": ""
},
{
"docid": "39400dc029c1a6dbd878f065d90b9dbe",
"score": "0.6192505",
"text": "def index\n @doctores = Doctores.all\n\n render json: @doctores\n end",
"title": ""
},
{
"docid": "d8af48c3a66a0ce3e0f80f6918a9eab1",
"score": "0.60839",
"text": "def show\n @texto = Texto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @texto }\n end\n end",
"title": ""
},
{
"docid": "c6ad26641305917927efd2ded9fff2fd",
"score": "0.6073407",
"text": "def realizar_get\r\n @retorno = self.class.get('/todos')\r\n end",
"title": ""
},
{
"docid": "ec5ce8f2e53a2c82b603d7c503f3b74a",
"score": "0.60536295",
"text": "def readme\n @service = Service.find(params[:service_id])\n @readme=@service.readme\n respond_to do |format|\n format.html\n format.json { render json: @readme }\n end\n end",
"title": ""
},
{
"docid": "2ac66c821c1d1ecdbedaebfd5277b962",
"score": "0.6044648",
"text": "def index\n @textos = Texto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @textos }\n end\n end",
"title": ""
},
{
"docid": "f793a332b42bb82381c2f44033741fa1",
"score": "0.6019335",
"text": "def show\n @todo = Todo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @todo }\n end\n end",
"title": ""
},
{
"docid": "49ae1b6d33087db21a860eb987f5fcb5",
"score": "0.5994697",
"text": "def show\n @to_do = ToDo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @to_do }\n end\n end",
"title": ""
},
{
"docid": "a4e72b909310ceb2d8c0a146e9ce503e",
"score": "0.59877527",
"text": "def show\n @to2do = To2do.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @to2do }\n end\n end",
"title": ""
},
{
"docid": "ab34bb34c40148fe27e4a9839982a080",
"score": "0.5967386",
"text": "def show\n @ordo = Ordo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ordo }\n end\n end",
"title": ""
},
{
"docid": "94b8645c155b8ad96e9d677a14d0e953",
"score": "0.59651226",
"text": "def show\n @apodo = Apodo.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apodo }\n end\n end",
"title": ""
},
{
"docid": "89ff8f565f1df5bf85abf67857722b7a",
"score": "0.5948751",
"text": "def index\n @to_dos = ToDo.page(params[:page]).per_page(20).order(\"created_at desc\").find_all_by_user_id current_user[:id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @to_dos }\n end\n end",
"title": ""
},
{
"docid": "9523de3136aa59edceb38101bc5d0101",
"score": "0.59298",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @descuento }\n end\n end",
"title": ""
},
{
"docid": "c16be5131581e97d99ddb45de4f4414a",
"score": "0.5901424",
"text": "def index\n @todos = Todo.all\n json_response(@todos)\n end",
"title": ""
},
{
"docid": "1b32289535ee2e2d1fba84f9b8c95cc3",
"score": "0.5869482",
"text": "def index\n @terminy = Termin.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @terminy }\n end\n end",
"title": ""
},
{
"docid": "5ed467ce5fbc89d66fdaebc79f39839f",
"score": "0.5844209",
"text": "def show\n @docente = Docente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @docente }\n end\n end",
"title": ""
},
{
"docid": "5ed467ce5fbc89d66fdaebc79f39839f",
"score": "0.5844209",
"text": "def show\n @docente = Docente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @docente }\n end\n end",
"title": ""
},
{
"docid": "dc87583a8eaa6052eb18f4dafce1a4f7",
"score": "0.58401877",
"text": "def show\n @concepto = Concepto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concepto }\n end\n end",
"title": ""
},
{
"docid": "187b1e4340708c1421c70982e642e511",
"score": "0.5837541",
"text": "def show\n json_response(@todo)\n end",
"title": ""
},
{
"docid": "ef01e1271feec176306982beee745364",
"score": "0.58337736",
"text": "def index\n @questaos = Questao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @questaos }\n end\n end",
"title": ""
},
{
"docid": "618fc83ac857bab63a8d671a79ea32ae",
"score": "0.58222574",
"text": "def index\n @anios_escolares = AnioEscolar.order(\"anio\") # all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @anios_escolares }\n end\n end",
"title": ""
},
{
"docid": "9e8b999b99f7272f59a35d35c4dceafe",
"score": "0.5821156",
"text": "def show\n @moeda = Moeda.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @moeda }\n end\n end",
"title": ""
},
{
"docid": "2e179d479d5208ffbda4e8df00709ade",
"score": "0.58193713",
"text": "def show\n @startup = Startup.find(params[:id])\n \n @comentarios = JSON.parse(open(\"http://api.oula.co/twitter/topic/?q=\" << @startup.name).read) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @startup }\n end\n end",
"title": ""
},
{
"docid": "d934704b8c5fdf5954fa745514354fc0",
"score": "0.5816188",
"text": "def show\n todo = Todo.find(params[:id])\n render json: {\n todo: todo\n }\nend",
"title": ""
},
{
"docid": "1b8f48b9e439803a707e64278378d75a",
"score": "0.5814045",
"text": "def show\n @doacao = Doacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doacao }\n end\n end",
"title": ""
},
{
"docid": "95f9492988c6caec9878d0d83a76e414",
"score": "0.58095205",
"text": "def index\n @todo = Todo.new\n @todos = Todo.all\n render json: @todos\n end",
"title": ""
},
{
"docid": "0f6a636316fa6e8227dc4fb543363ff4",
"score": "0.57890743",
"text": "def show\n @things_to_do = ThingsToDo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @things_to_do }\n end\n end",
"title": ""
},
{
"docid": "3bc05961da138f9f16a61a9c3ba705b8",
"score": "0.57791907",
"text": "def show\n @historia = Historia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historia }\n end\n end",
"title": ""
},
{
"docid": "9607b3b58f5ebeeac857bc2a21f9d8db",
"score": "0.5767935",
"text": "def index\n @tipos_eventos = TipoEvento.por_colegio(colegio.id).order(\"cuaderno_control DESC\", \"descripcion\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipos_eventos }\n end\n end",
"title": ""
},
{
"docid": "3b250cc49b9b48532e5c11e19cc9efa4",
"score": "0.5766526",
"text": "def show\n @condo = Condo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @condo }\n end\n end",
"title": ""
},
{
"docid": "690982d293ef4d8087940dcfe71b91e1",
"score": "0.5764195",
"text": "def index\n @descuento_clientes = DescuentoCliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @descuento_clientes }\n end\n end",
"title": ""
},
{
"docid": "b4ece647825a18f5625dbf4c480ddc4a",
"score": "0.5760281",
"text": "def show\n @aluno = Aluno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aluno }\n end\n end",
"title": ""
},
{
"docid": "b4ece647825a18f5625dbf4c480ddc4a",
"score": "0.5760281",
"text": "def show\n @aluno = Aluno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aluno }\n end\n end",
"title": ""
},
{
"docid": "b4ece647825a18f5625dbf4c480ddc4a",
"score": "0.5760281",
"text": "def show\n @aluno = Aluno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aluno }\n end\n end",
"title": ""
},
{
"docid": "e49fd845c1f5d5d5fde3a5ec23a73a27",
"score": "0.5756261",
"text": "def show\n @ontology = Ontology.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ontology }\n end\n end",
"title": ""
},
{
"docid": "0819a1a3358adc26765f085ed80b98ff",
"score": "0.57559264",
"text": "def index\n @donees = Donee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @donees }\n end\n end",
"title": ""
},
{
"docid": "c019514688050937d9bd66c9eae292a7",
"score": "0.5753795",
"text": "def index\n @clientes = Cliente.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 => @clientes }\n end\n end",
"title": ""
},
{
"docid": "6e3654e06e02e365524391e29ed99f27",
"score": "0.5752726",
"text": "def show\n @resposta = Resposta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resposta }\n end\n end",
"title": ""
},
{
"docid": "27803425c29d053f6d417e07b58ea665",
"score": "0.5737766",
"text": "def show\n @questao = Questao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @questao }\n end\n end",
"title": ""
},
{
"docid": "27803425c29d053f6d417e07b58ea665",
"score": "0.5737766",
"text": "def show\n @questao = Questao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @questao }\n end\n end",
"title": ""
},
{
"docid": "27803425c29d053f6d417e07b58ea665",
"score": "0.5737766",
"text": "def show\n @questao = Questao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @questao }\n end\n end",
"title": ""
},
{
"docid": "49305a5ca44f06133098002c19fdac4a",
"score": "0.57285297",
"text": "def index\n \t@todones = ToDone.order(\"created_at DESC\").each\n respond_to do |format|\n \tformat.html do\n \t\trespond_with @todones\n \tend\n \tformat.json do\n \t\trender json: @todones.as_json\n \tend\n end\n end",
"title": ""
},
{
"docid": "5be1ada68a63192111f48ab597cce423",
"score": "0.57276434",
"text": "def show\n @documento = Documento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @documento }\n end\n end",
"title": ""
},
{
"docid": "d126937218b15d84420d28b93838d796",
"score": "0.57230014",
"text": "def index\n @datos = Dato.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @datos }\n end\n end",
"title": ""
},
{
"docid": "2b08372bc2ee7fe2fa4ddc9321258956",
"score": "0.57223946",
"text": "def index\n @todos = Todo.all\n render json: @todos, status: :ok\n end",
"title": ""
},
{
"docid": "316a5a2e07d32033a0a2fd2092597649",
"score": "0.57179576",
"text": "def show\n @idioma = Idioma.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idioma }\n end\n end",
"title": ""
},
{
"docid": "f34f5ac022ee555807032455cc638a38",
"score": "0.5713831",
"text": "def show\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @oficio }\n end\n end",
"title": ""
},
{
"docid": "69027b93ad108cbc98c783f917822cca",
"score": "0.5713245",
"text": "def index\n @alunos = Aluno.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @alunos }\n end\n end",
"title": ""
},
{
"docid": "3bcad379b9753f205d8a802ef0533268",
"score": "0.5711394",
"text": "def show\n @telco = Telco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @telco }\n end\n end",
"title": ""
},
{
"docid": "c44a698e9d96ef8a948fb8cf3961263c",
"score": "0.5709769",
"text": "def index\n @descuentos ||= Descuento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @descuentos }\n end\n end",
"title": ""
},
{
"docid": "477fc772461dce29090df58215c03ce0",
"score": "0.5705839",
"text": "def show\n curWord = Word.find_by_word(params[:id])\n respond_to do |format|\n format.json { render json: curWord }\n end\n end",
"title": ""
},
{
"docid": "68551b5a44a3e35f792ad62388f09df4",
"score": "0.57016766",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pedido }\n end\n end",
"title": ""
},
{
"docid": "6091b85904bec5767ddc91861a51bd4f",
"score": "0.56987303",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @todos }\n end\n end",
"title": ""
},
{
"docid": "0d1f8e9052d692d06c13f94915a9619f",
"score": "0.5684594",
"text": "def index\n @diretorios = Diretorio.where(pessoa_id: params[:usuario]).first\n render json: @diretorios\n end",
"title": ""
},
{
"docid": "f8fa23b956f796da7133f5acdd5a5874",
"score": "0.56839377",
"text": "def index\n @puntos = calcdistang(params[:proyecto_id])\n @puntosarr = @puntos.to_json\n @proyecto_id = params[:proyecto_id]\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @puntos }\n end\n end",
"title": ""
},
{
"docid": "24a536fb0104c2cc38a74df47ad8c0b8",
"score": "0.56793296",
"text": "def show\n @opcion = Opcion.find(params[:id])\n\n render json: @opcion\n end",
"title": ""
},
{
"docid": "f457dae60d9e429eeebf55aad69b2a2b",
"score": "0.56726027",
"text": "def todosJSON\n render :json => Todo.all\n end",
"title": ""
},
{
"docid": "ee15f534c388f9200d9a0779265301e2",
"score": "0.56713897",
"text": "def show\n @testudo = Testudo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @testudo }\n end\n end",
"title": ""
},
{
"docid": "7033dafcb878866f9c3110c0ad8266d7",
"score": "0.5667439",
"text": "def show\n @dato = Dato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dato }\n end\n end",
"title": ""
},
{
"docid": "8444a4915f030bbc09802b833cef340f",
"score": "0.56635517",
"text": "def show\n @donee = Donee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @donee }\n end\n end",
"title": ""
},
{
"docid": "232f96f7b4f66c56bc76fe052a0aa035",
"score": "0.5661069",
"text": "def enviar_get\n @get_retorno = self.class.get('/todos')\n end",
"title": ""
},
{
"docid": "f23ca27eb69f43814ac7b8b921c72d70",
"score": "0.56610346",
"text": "def index\n @dioceses = Diocese.all\n\n render json: @dioceses\n end",
"title": ""
},
{
"docid": "593122710fb9dd291b90d90b620dce75",
"score": "0.5652798",
"text": "def index\n @donaciones = Donacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @donaciones }\n end\n end",
"title": ""
},
{
"docid": "48b8b480f6af903f51dc40f078e286b3",
"score": "0.56440634",
"text": "def show\n @cancelamento_adocao = CancelamentoAdocao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cancelamento_adocao }\n end\n end",
"title": ""
},
{
"docid": "d2afa025d10f27c1b959f6678eb2173f",
"score": "0.56437004",
"text": "def show\n @moneda = Moneda.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @moneda }\n end\n end",
"title": ""
},
{
"docid": "8083d17d825e9fa61dad2888519ddbaa",
"score": "0.5640902",
"text": "def index\n @pedidos = @producto.pedidos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end",
"title": ""
},
{
"docid": "5b962db9e9992efc13cdaf058c33a0a8",
"score": "0.5640718",
"text": "def show\n @loco = Loco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loco }\n end\n end",
"title": ""
},
{
"docid": "a50bac106e69a3d8011dcd2ff1bd6b7b",
"score": "0.5638864",
"text": "def index\n @todos = Todo.all.order(:id)\n render json: @todos\n end",
"title": ""
},
{
"docid": "47aeb2c71e55446d0a3b75ac09831054",
"score": "0.5638719",
"text": "def index\n @denuncias = Denuncia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @denuncias }\n end\n end",
"title": ""
},
{
"docid": "9f7547b94ebf7b993da593bc57e6621c",
"score": "0.5638611",
"text": "def index\n @contelefono = find_contelefono\n @telefonos = @contelefono.telefonos\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @telefonos }\n end\n\n end",
"title": ""
},
{
"docid": "0b9eaf438314821b0bd1620530525766",
"score": "0.5636509",
"text": "def show\n @phono = Phono.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @phono }\n end\n end",
"title": ""
},
{
"docid": "aaa25b61851e8b4f7bab0948f8c7f743",
"score": "0.563593",
"text": "def index\n @respostas = Resposta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @respostas }\n end\n end",
"title": ""
},
{
"docid": "18da6c487111df121477da2f030823b5",
"score": "0.56329834",
"text": "def index\n @pedidos = Pedido.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end",
"title": ""
},
{
"docid": "efe29d495d2dc00aca590a3e971ee4ab",
"score": "0.5632723",
"text": "def show\n @menu = \"buscar terapeuta\" \n @terapeuta = Terapeuta.find(params[:id])\n @title = @terapeuta.nombre\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @terapeuta }\n end\n end",
"title": ""
},
{
"docid": "1b86caab697b8b0f552d3a1ad0dabe29",
"score": "0.56326723",
"text": "def index\n @codigos = Codigo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @codigos }\n end\n end",
"title": ""
},
{
"docid": "b497c1b52d433b3484becbd2624cf58c",
"score": "0.56266904",
"text": "def show\n @torneotipo = Torneotipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @torneotipo }\n end\n end",
"title": ""
},
{
"docid": "391510886307915dc23effe324f3b0dd",
"score": "0.5622984",
"text": "def show\n @olimpiada = Olimpiada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @olimpiada }\n end\n end",
"title": ""
},
{
"docid": "711bcf606f943c4d1b0319da7db300ec",
"score": "0.56161094",
"text": "def show\n @torneio = Torneio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @torneio }\n end\n end",
"title": ""
},
{
"docid": "d4ff527585d9d6d44d5cce630b10bd99",
"score": "0.5613821",
"text": "def annoj_get\n case params[:annoj_action]\n when \"syndicate\"\n @response = syndicate(params[:id])\n when \"describe\"\n @response = describe(params[\"id\"])\n end\n render :json => @response, :layout => false\n end",
"title": ""
},
{
"docid": "51ad864a8626d6d37f1a8de5f2520ad7",
"score": "0.56100065",
"text": "def wordle_data\n if params[:id]\n file = \"#{Rails.root}/tmp/vivo/wordle_data/#{params[:id]}.json\"\n end\n respond_to do |format|\n format.json { send_file file, :type => 'text/json', :disposition => 'inline' }\n format.js { send_file file, :type => 'text/json', :disposition => 'inline' }\n end\n end",
"title": ""
},
{
"docid": "6379a7ff48846c5e5a6823ecf20a53b6",
"score": "0.5602427",
"text": "def show\n @to_do_list = ToDoList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @to_do_list }\n end\n end",
"title": ""
},
{
"docid": "0659c591867cb998e336d204b9046c1c",
"score": "0.56023884",
"text": "def show\n @condomino = Condomino.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @condomino }\n end\n end",
"title": ""
},
{
"docid": "71be772236007c7e57a0d5772e4049f2",
"score": "0.5601854",
"text": "def index\n @pregunta = Pregunta.all\n\n # buscamos parametro de tipo para filtrar la consulta\n if tipo = params[:tipo]\n @pregunta = @pregunta.where(tipo: tipo)\n end\n\n respond_to do |format|\n if @pregunta.count > 0\n #render json:@pregunta, :only =>[:id, :descripcion, :obligatoria], status: :ok \n format.json\n else\n format.json { render json:Pregunta.none, status: :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "1795dea83b74c65f27e581c40135e893",
"score": "0.55977684",
"text": "def index\n @destaques = Destaque.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 => @destaques }\n end\n end",
"title": ""
},
{
"docid": "ac311afcdf6d43ae61fb88b6308d451a",
"score": "0.55974877",
"text": "def show\n @descripcion = Descripcion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @descripcion }\n end\n end",
"title": ""
},
{
"docid": "a5be4187b46c3f61db1692674e058dfb",
"score": "0.5597241",
"text": "def show\n @taco = Taco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taco }\n end\n end",
"title": ""
},
{
"docid": "dd9894340d4cf16757baca74371f9f43",
"score": "0.55955476",
"text": "def test\n get(\"/help/test.json\")\n end",
"title": ""
},
{
"docid": "dd9894340d4cf16757baca74371f9f43",
"score": "0.55955476",
"text": "def test\n get(\"/help/test.json\")\n end",
"title": ""
},
{
"docid": "79cae82470b624c9e22b2101f023804f",
"score": "0.55893385",
"text": "def show\n @tipo_webnota = TipoWebnota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_webnota }\n end\n end",
"title": ""
},
{
"docid": "6f5e64256b0b007fd505b87eb94ebeaa",
"score": "0.5587359",
"text": "def show\n @tobedo = Tobedo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tobedo }\n end\n end",
"title": ""
},
{
"docid": "e6dccee41493a5863fbcffcde20a78a4",
"score": "0.5582447",
"text": "def show\n @todo = current_user.todos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @todo }\n end\n end",
"title": ""
},
{
"docid": "0dc40a5a6344d9d5b79aea9e7987a2ea",
"score": "0.5576646",
"text": "def index\n render json: {'status' => 'SUCCESS',\n 'endpoints': [\"get /logica/mover/:columna\",\n \"get /logica/new/:tamF/:n2w | Tamaño de la fila, seguidas para ganar | GET por mientras, despues se cambia\"]\n }, status => 'ok'\n end",
"title": ""
},
{
"docid": "4138bd02428db998a6e09b3a8ac3f458",
"score": "0.5573004",
"text": "def show\n @termo_uso = TermoUso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @termo_uso }\n end\n end",
"title": ""
},
{
"docid": "1d003fb1d62d7df4a4941970b514b224",
"score": "0.5570719",
"text": "def index\n @duracion_en_textos = DuracionEnTexto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @duracion_en_textos }\n end\n end",
"title": ""
},
{
"docid": "7ccebee0d4839eba8a4a2c3245a09764",
"score": "0.55702686",
"text": "def index\n @todos = @user.todos\n render json: @todos\n end",
"title": ""
},
{
"docid": "3ae85848340fa5da14e1bc5967a682c9",
"score": "0.5569928",
"text": "def show\n @tipo = Tipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo }\n end\n end",
"title": ""
},
{
"docid": "f5efba4ea6580bdf83829f856608c23f",
"score": "0.5565816",
"text": "def index\n @tuantis = Tuanti.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tuantis }\n end\n end",
"title": ""
},
{
"docid": "59b2666c346208d77b451fb010539d71",
"score": "0.5562242",
"text": "def show\n @clientetipo = Clientetipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientetipo }\n end\n end",
"title": ""
},
{
"docid": "6891640be28cd84de1d7b4a61d6f1425",
"score": "0.5551296",
"text": "def show\n @rodeo = Rodeo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rodeo }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.55512685",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.55512685",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
}
] |
40f6092839d2fac975ef15628af4c57d
|
Update a 'appliance.Upgrade' resource.
|
[
{
"docid": "d42b91ef7add5b8cfbbfe2c7b1e5eca3",
"score": "0.6237799",
"text": "def update_appliance_upgrade(moid, appliance_upgrade, opts = {})\n data, _status_code, _headers = update_appliance_upgrade_with_http_info(moid, appliance_upgrade, opts)\n data\n end",
"title": ""
}
] |
[
{
"docid": "202af165d1ed1fa4ab14baccee755c88",
"score": "0.72635597",
"text": "def update\n @upgrade = Upgrade.find(params[:id])\n\n respond_to do |format|\n if @upgrade.update_attributes(params[:upgrade])\n format.html { redirect_to(@upgrade, :notice => 'Upgrade was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @upgrade.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff4416de4c4cf69ed9cc5c2949725ae3",
"score": "0.70625377",
"text": "def update\n pkgget_with_cat \"-f\", :upgrade, @resource[:name]\n end",
"title": ""
},
{
"docid": "b6bf8d618f4edbaa5badca66f1774c26",
"score": "0.6811854",
"text": "def update!(**args)\n @auto_upgrade = args[:auto_upgrade] if args.key?(:auto_upgrade)\n @upgrade_options = args[:upgrade_options] if args.key?(:upgrade_options)\n end",
"title": ""
},
{
"docid": "34c52ae6bbeddf5a7dd1ba3b9b691e2b",
"score": "0.6771108",
"text": "def update\n respond_to do |format|\n if @upgrade.update(upgrade_params)\n format.html { redirect_to redirect_panel_path, notice: 'Upgrade was successfully updated.' }\n format.json { render :show, status: :ok, location: @upgrade }\n else\n format.html { render :edit }\n format.json { render json: @upgrade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17d0b45f4106e5a1ed14a729ed2dc2a3",
"score": "0.65900093",
"text": "def set_upgrade\n @upgrade = Upgrade.find(params[:id])\n end",
"title": ""
},
{
"docid": "17d0b45f4106e5a1ed14a729ed2dc2a3",
"score": "0.6589928",
"text": "def set_upgrade\n @upgrade = Upgrade.find(params[:id])\n end",
"title": ""
},
{
"docid": "9c068f91389eee9a6fb976e75ac61059",
"score": "0.65009654",
"text": "def action_upgrade\n # Could be uninstalled or have no candidate\n if @current_resource.version.nil? || candidate_version.nil? \n super\n # Ensure the candidate is newer\n elsif RPMVersion.parse(candidate_version) > RPMVersion.parse(@current_resource.version)\n super\n else\n Chef::Log.debug(\"#{@new_resource} is at the latest version - nothing to do\")\n end\n end",
"title": ""
},
{
"docid": "ddea8adca7415540c97b915bbfd57f01",
"score": "0.648846",
"text": "def update\n @upgrade = Upgrade.find(params[:id])\n\n respond_to do |format|\n if @upgrade.update_attributes(params.require(:upgrade).permit(:contract_id, :cost, :upgrade_type_id))\n format.html { redirect_to upgrades_url,\n notice: 'Upgrade was successfully updated.' }\n format.json { head :no_content }\n else\n prepFormVariables\n format.html { render action: \"edit\" }\n format.json { render json: @upgrade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cee37c41bac020b9c99ae035043b75a1",
"score": "0.6434547",
"text": "def update\n @upgrade = Upgrade.find(params[:id])\n if @upgrade.update_attributes(upgrade_params)\n flash[:success] = \"Potenziamento modificato con successo\"\n # redirect to upgrades index for the selected product\n redirect_to upgrades_path(product_id: @upgrade.product.id)\n else\n # if validataion fails redirect to the edit upgrade form\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "bb9a9bf21ddec004766bf454046d22a1",
"score": "0.64310086",
"text": "def update\n respond_to do |format|\n if @ability_upgrade.update(ability_upgrade_params)\n format.html { redirect_to @ability_upgrade, notice: 'Ability upgrade was successfully updated.' }\n format.json { render :show, status: :ok, location: @ability_upgrade }\n else\n format.html { render :edit }\n format.json { render json: @ability_upgrade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b14f7237bc8d10e9fa43eb825df786b",
"score": "0.6419204",
"text": "def update\n @rig_upgrade = RigUpgrade.find(params[:id])\n\n respond_to do |format|\n if @rig_upgrade.update_attributes(params[:rig_upgrade])\n flash[:notice] = 'RigUpgrade was successfully updated.'\n format.html { redirect_to(@rig_upgrade) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rig_upgrade.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01a3eee8e710be8a69190dd818693a2c",
"score": "0.64136386",
"text": "def update\n respond_to do |format|\n if @wow_upgrade.update(wow_upgrade_params)\n format.html { redirect_to @wow_upgrade, notice: 'Wow upgrade was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @wow_upgrade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6cf6edb1ed0b4ac82ec4d4f531c9e50",
"score": "0.63487506",
"text": "def upgrade(resource)\n if enough?(resource)\n pay_upgrade_cost(resource)\n increase_level\n end\n end",
"title": ""
},
{
"docid": "96e8a6faf3a1796090994937eb66df74",
"score": "0.62380695",
"text": "def patch_appliance_upgrade(moid, appliance_upgrade, opts = {})\n data, _status_code, _headers = patch_appliance_upgrade_with_http_info(moid, appliance_upgrade, opts)\n data\n end",
"title": ""
},
{
"docid": "65f6134fa32610e840314d1be52f1815",
"score": "0.6209476",
"text": "def update\n respond_to do |format|\n if @element_upgrade.update(element_upgrade_params)\n format.html { redirect_to @element_upgrade, notice: 'Element upgrade was successfully updated.' }\n format.json { render :show, status: :ok, location: @element_upgrade }\n else\n format.html { render :edit }\n format.json { render json: @element_upgrade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af6c9557632fb4b07fe5dc200da94f94",
"score": "0.6135661",
"text": "def action_upgrade\n cmd = Mixlib::ShellOut.new \"#{new_resource.schematool_path} -dbType mysql \"\\\n \"-userName #{new_resource.dbadmin_username} -passWord #{new_resource.dbadmin_password} \"\\\n '-upgradeSchema'\n cmd.run_command\n\n if cmd.stdout =~ /Starting upgrade metastore schema from version.*\\nUpgrade script/\n new_resource.updated_by_last_action true\n elsif cmd.stdout =~ /No schema upgrade required from version.*/\n new_resource.updated_by_last_action false\n else\n error_details = cmd.format_for_exception.gsub(/passWord \\w+/, 'passWord <scrubbed>')\n raise UpgradeError, 'Unexpected error when running upgrade' + \"\\n\" + error_details\n end\n end",
"title": ""
},
{
"docid": "64b6a585c966ac6abbd38d1ec6501bdb",
"score": "0.6037707",
"text": "def edit\n @upgrade = Upgrade.find(params[:id])\n end",
"title": ""
},
{
"docid": "d906849d7c916d8b63877b97ca29c81f",
"score": "0.5998223",
"text": "def upgrade\n install\n end",
"title": ""
},
{
"docid": "14cceb289618533ba5762280d0eb871d",
"score": "0.5979061",
"text": "def set_wow_upgrade\n @wow_upgrade = WowUpgrade.find(params[:id])\n end",
"title": ""
},
{
"docid": "6290710b7bf9a5abdfb0b33e2ad3b729",
"score": "0.591136",
"text": "def upgrade\n tier = shift_argument\n error(\"Usage: heroku apps:upgrade TIER\\nMust specify TIER to upgrade.\") if tier.nil? || tier.empty?\n validate_arguments!\n\n action(\"Upgrading #{app} to #{tier}\") do\n api.put_app(app, \"tier\" => tier)\n end\n end",
"title": ""
},
{
"docid": "40ada1d9baf778eddcaa48282ca3d19e",
"score": "0.58949804",
"text": "def upgrade\n return install if version\n upgrade_to = available_upgrade\n if upgrade_to\n Installer.new(plugin_name, version: upgrade_to).install\n end\n end",
"title": ""
},
{
"docid": "57b1132e128c69afa921e61c00d60dae",
"score": "0.5868767",
"text": "def update_appliance_upgrade_with_http_info(moid, appliance_upgrade, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ApplianceApi.update_appliance_upgrade ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling ApplianceApi.update_appliance_upgrade\"\n end\n # verify the required parameter 'appliance_upgrade' is set\n if @api_client.config.client_side_validation && appliance_upgrade.nil?\n fail ArgumentError, \"Missing the required parameter 'appliance_upgrade' when calling ApplianceApi.update_appliance_upgrade\"\n end\n # resource path\n local_var_path = '/api/v1/appliance/Upgrades/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(appliance_upgrade)\n\n # return_type\n return_type = opts[:debug_return_type] || 'ApplianceUpgrade'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"ApplianceApi.update_appliance_upgrade\",\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: ApplianceApi#update_appliance_upgrade\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "43d8036da4880c5bf08c6e07b31a33f9",
"score": "0.58504343",
"text": "def agent_upgrade(agent_id, options = {})\n put \"/agents/#{agent_id}/upgrade\", options\n end",
"title": ""
},
{
"docid": "f7859315009c77263146734b1835d7af",
"score": "0.5843232",
"text": "def update!(**args)\n @package_name = args[:package_name] if args.key?(:package_name)\n @upgrade_to_version = args[:upgrade_to_version] if args.key?(:upgrade_to_version)\n end",
"title": ""
},
{
"docid": "0b682fdb9435f5929b9076a69cf5aad4",
"score": "0.581251",
"text": "def cmdUpgradeProgram(id)\n params = {\n \"upgrade_program\" => 1,\n \"id\" => id,\n \"app_version\" => @config[\"version\"],\n }\n response = @client.request(params, @sid)\n return response\n end",
"title": ""
},
{
"docid": "f18c66d0d58e18cdeb568a08771b1ef6",
"score": "0.58001226",
"text": "def update!(**args)\n @auto_upgrade_start_time = args[:auto_upgrade_start_time] if args.key?(:auto_upgrade_start_time)\n @description = args[:description] if args.key?(:description)\n end",
"title": ""
},
{
"docid": "b6bbc5df108037f48fbf182a83a0e0af",
"score": "0.5723598",
"text": "def update_resource(opts = {})\n data, _status_code, _headers = update_resource_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "f25296cd27d5757012e709550a9cd402",
"score": "0.5703808",
"text": "def downgrade\n upgrade\n end",
"title": ""
},
{
"docid": "219d065a999e45cde50662f63b10ded9",
"score": "0.5676983",
"text": "def upgrade\n authorize! :upgrade, User\n @user = User.find(params[:id])\n @user.update(admin: true)\n respond_to do |format|\n format.html { redirect_to users_url,\n notice: 'User was successfully upgraded' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5c237a63ebec27c488f6e53f20e43ae2",
"score": "0.56659645",
"text": "def upgrade(dir)\n version, = Driver.run('terraform version --json')\n version = JSON.parse(version)['terraform_version']\n version = Gem::Version.new(version)\n\n return if version < Gem::Version.new('0.12')\n\n if version < Gem::Version.new('0.13')\n cmd = '0.12upgrade'\n elsif version < Gem::Version.new('0.15')\n cmd = '0.13upgrade'\n else\n return\n end\n\n # Upgrade\n Driver.retry_loop \"Driver action 'tf upgrade' failed\" do\n _, e, s = Driver.run(\"cd #{dir}; terraform #{cmd} -yes\")\n\n unless s && s.success?\n raise OneProvisionLoopException, e\n end\n end\n end",
"title": ""
},
{
"docid": "cc2634731f7938b33808810e01862013",
"score": "0.5660739",
"text": "def action_upgrade\n notifying_block do\n install_scl_utils\n install_scl_repo_package\n flush_yum_cache\n install_scl_package(:upgrade)\n install_scl_devel_package(:upgrade) if new_resource.dev_package\n end\n end",
"title": ""
},
{
"docid": "be0d84ac5f196e1962529e2d39a3a671",
"score": "0.56579566",
"text": "def upgrade\n raise NotImplementedError.new(\"upgrade is not implemented by #{self.class.name}\")\n end",
"title": ""
},
{
"docid": "b182c8e142e36f6b7ce2db870a5c3bfa",
"score": "0.5629832",
"text": "def update\n response = update_gringotts_resource(RESOURCE, params)\n if response\n if response.success?\n render body: nil, status: 200\n else\n send_operation_outcome(response, 400)\n end\n else\n send_operation_outcome(nil, 503, 'Application unavailable at this time')\n end\n end",
"title": ""
},
{
"docid": "d1863caa270603f27eb89f7076fc14d9",
"score": "0.5573603",
"text": "def update!(**args)\n @continue = args[:continue] if args.key?(:continue)\n @resource_version = args[:resource_version] if args.key?(:resource_version)\n @self_link = args[:self_link] if args.key?(:self_link)\n end",
"title": ""
},
{
"docid": "d1863caa270603f27eb89f7076fc14d9",
"score": "0.5573603",
"text": "def update!(**args)\n @continue = args[:continue] if args.key?(:continue)\n @resource_version = args[:resource_version] if args.key?(:resource_version)\n @self_link = args[:self_link] if args.key?(:self_link)\n end",
"title": ""
},
{
"docid": "3ed4c55c0b7657a4cea9d9f005481ae3",
"score": "0.5552884",
"text": "def update_resource\n resource\n end",
"title": ""
},
{
"docid": "7651d1da93ac0d89649d838619a04e04",
"score": "0.55306536",
"text": "def update_resource(attrs = resource_params)\n resource.update(attrs)\n end",
"title": ""
},
{
"docid": "3e51101e02fa9f5ef32e1d0aca108629",
"score": "0.55268353",
"text": "def set_ability_upgrade\n @ability_upgrade = AbilityUpgrade.find(params[:id])\n end",
"title": ""
},
{
"docid": "b32b75c35f718c142c52d31a7f364c18",
"score": "0.5508459",
"text": "def patch_appliance_upgrade_with_http_info(moid, appliance_upgrade, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ApplianceApi.patch_appliance_upgrade ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling ApplianceApi.patch_appliance_upgrade\"\n end\n # verify the required parameter 'appliance_upgrade' is set\n if @api_client.config.client_side_validation && appliance_upgrade.nil?\n fail ArgumentError, \"Missing the required parameter 'appliance_upgrade' when calling ApplianceApi.patch_appliance_upgrade\"\n end\n # resource path\n local_var_path = '/api/v1/appliance/Upgrades/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(appliance_upgrade)\n\n # return_type\n return_type = opts[:debug_return_type] || 'ApplianceUpgrade'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"ApplianceApi.patch_appliance_upgrade\",\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: ApplianceApi#patch_appliance_upgrade\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "61c9e62ba821112c7c458ed86e34c530",
"score": "0.55006605",
"text": "def upgrade_version\n\t\tp self.version.to_s\n\t\tif ! self.version.eql? 1\n\t\t\tmain = Catalog.main.first\n\t\t\tif ! main.nil?\n\t\t\t\tmain.version = 2\n\t\t\t\tmain.save\n\t\t\tend\n\t\t\tself.version = 1\n\t\t\tself.save\n\t\tend\n\t\tself.version\n\tend",
"title": ""
},
{
"docid": "96fc6098ee7d4b941a5b890dd194e89a",
"score": "0.55005044",
"text": "def downgrade\n tier = shift_argument\n error(\"Usage: heroku apps:downgrade TIER\\nMust specify TIER to downgrade.\") if tier.nil? || tier.empty?\n validate_arguments!\n\n action(\"Upgrading #{app} to #{tier}\") do\n api.put_app(app, \"tier\" => tier)\n end\n end",
"title": ""
},
{
"docid": "e9847c8ec14697239715a38bf9d440e0",
"score": "0.547759",
"text": "def update\n @bonus_upgrade_detail = BonusUpgradeDetail.find(params[:id])\n\n respond_to do |format|\n if @bonus_upgrade_detail.update_attributes(params[:bonus_upgrade_detail])\n format.html { redirect_to(@bonus_upgrade_detail, :notice => '更新成功!') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bonus_upgrade_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ce7c02517a687bff34ee2138db374f5",
"score": "0.5461853",
"text": "def update_resource(resource, params)\n super\n end",
"title": ""
},
{
"docid": "f764f063931563f1b2ac845b58a575c5",
"score": "0.5449528",
"text": "def update!(**args)\n @resource_type = args[:resource_type] if args.key?(:resource_type)\n @service = args[:service] if args.key?(:service)\n @version = args[:version] if args.key?(:version)\n end",
"title": ""
},
{
"docid": "6aa1c8faaba32fca39f63597ccdfc55f",
"score": "0.5445332",
"text": "def update!(**args)\n @resource = args[:resource] if args.key?(:resource)\n end",
"title": ""
},
{
"docid": "6aa1c8faaba32fca39f63597ccdfc55f",
"score": "0.5445332",
"text": "def update!(**args)\n @resource = args[:resource] if args.key?(:resource)\n end",
"title": ""
},
{
"docid": "6aa1c8faaba32fca39f63597ccdfc55f",
"score": "0.5445332",
"text": "def update!(**args)\n @resource = args[:resource] if args.key?(:resource)\n end",
"title": ""
},
{
"docid": "6aa1c8faaba32fca39f63597ccdfc55f",
"score": "0.5445332",
"text": "def update!(**args)\n @resource = args[:resource] if args.key?(:resource)\n end",
"title": ""
},
{
"docid": "6aa1c8faaba32fca39f63597ccdfc55f",
"score": "0.5445332",
"text": "def update!(**args)\n @resource = args[:resource] if args.key?(:resource)\n end",
"title": ""
},
{
"docid": "6aa1c8faaba32fca39f63597ccdfc55f",
"score": "0.5445332",
"text": "def update!(**args)\n @resource = args[:resource] if args.key?(:resource)\n end",
"title": ""
},
{
"docid": "6aa1c8faaba32fca39f63597ccdfc55f",
"score": "0.5445332",
"text": "def update!(**args)\n @resource = args[:resource] if args.key?(:resource)\n end",
"title": ""
},
{
"docid": "5b094a329a5473abcfb1f14b5b8fd8b5",
"score": "0.5436684",
"text": "def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @kind = args[:kind] if args.key?(:kind)\n @resource_id = args[:resource_id] if args.key?(:resource_id)\n @version = args[:version] if args.key?(:version)\n end",
"title": ""
},
{
"docid": "2cfbd230e37ca1e65aac410e9d1c5d9b",
"score": "0.54055965",
"text": "def apply_update(version)\n end",
"title": ""
},
{
"docid": "a60ec7dabd5d7d7e4c58d70ce8a176c2",
"score": "0.5389909",
"text": "def update\n respond_to do |format|\n if @appliance.update(appliance_params)\n format.html { redirect_to @appliance, notice: 'Appliance was successfully updated.' }\n format.json { render :show, status: :ok, location: @appliance }\n else\n format.html { render :edit }\n format.json { render json: @appliance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "815fa08689d9111531922c1b2151a426",
"score": "0.538481",
"text": "def update\n @updateavail = Updateavail.find(params[:id])\n\n respond_to do |format|\n if @updateavail.update_attributes(params[:updateavail])\n format.html { redirect_to @updateavail, notice: 'Updateavail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @updateavail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8d0fa60ccf378a569756aaa442a5c04",
"score": "0.53793657",
"text": "def update!(**args)\n @appliance_infrastructure_version = args[:appliance_infrastructure_version] if args.key?(:appliance_infrastructure_version)\n @appliance_software_version = args[:appliance_software_version] if args.key?(:appliance_software_version)\n @available_versions = args[:available_versions] if args.key?(:available_versions)\n @bucket = args[:bucket] if args.key?(:bucket)\n @create_time = args[:create_time] if args.key?(:create_time)\n @error = args[:error] if args.key?(:error)\n @name = args[:name] if args.key?(:name)\n @registration_id = args[:registration_id] if args.key?(:registration_id)\n @service_account = args[:service_account] if args.key?(:service_account)\n @state = args[:state] if args.key?(:state)\n @state_time = args[:state_time] if args.key?(:state_time)\n @update_time = args[:update_time] if args.key?(:update_time)\n @upgrade_status = args[:upgrade_status] if args.key?(:upgrade_status)\n @version = args[:version] if args.key?(:version)\n end",
"title": ""
},
{
"docid": "657c2362ff1fc61457fe7026c5cb98a6",
"score": "0.53780615",
"text": "def update(id, deployment)\n @deployment = Locomotive::Deployment.get(id)\n raise NotFound unless @deployment\n\n old_release = @deployment.release\n old_platform = @deployment.platform\n\n #Locomotive::Deployment.transaction do\n # update the service instances data to reflect the changes\n begin\n @deployment.update_attributes(deployment)\n\n # somehow, the relation attributes don't get updated automatically\n # after their corresponding _id attributes have been updated, so\n # reload manually to flush the cache\n @deployment.reload\n\n if old_platform != @deployment.platform\n # move from one platform to another\n end\n\n if old_release != @deployment.release\n # up / downgrade\n puts \"upgrading from #{old_release.name} to #{@deployment.release.name}\"\n @deployment.deploy\n end\n\n rescue Exception\n STDERR.puts \"ERROR: #{$!}\"\n end\n #end\n\n redirect resource(@deployment), :message => {:notice => 'Deployment was successfully updated'}\n end",
"title": ""
},
{
"docid": "8b0a27bc9fe63dbc15aa8ccf808e1d97",
"score": "0.53770566",
"text": "def set_element_upgrade\n @element_upgrade = ElementUpgrade.find(params[:id])\n end",
"title": ""
},
{
"docid": "42f74d0d06675a3862d7fe9a0972ac68",
"score": "0.53711724",
"text": "def upgrade(options={})\n cmd = <<-CMD\n sh -c \"#{APT_GET} -qy upgrade\"\n CMD\n sudo(cmd, options)\n end",
"title": ""
},
{
"docid": "71d7e73bdb17a587ea0152c226d04bbc",
"score": "0.5364427",
"text": "def upgrade\n addon = args.shift\n raise CommandFailed.new(\"Missing add-on name\") if addon.nil?\n addon = addon.dup.sub('@', '')\n\n plan = args.shift\n raise CommandFailed.new(\"Missing add-on plan\") if addon.nil?\n\n config = parse_options(args)\n\n action(\"Upgrading #{addon} to #{plan}\") do\n api.request(\n :body => json_encode({\n \"config\" => config,\n \"plan\" => { \"name\" => plan }\n }),\n :expects => 200,\n :headers => { \"Accept\" => \"application/vnd.heroku+json; version=edge\" },\n :method => :patch,\n :path => \"/apps/#{app}/addons/#{addon}\"\n )\n end\n end",
"title": ""
},
{
"docid": "0067b27533c2e916cb1be731dd0ceb65",
"score": "0.53575206",
"text": "def resource_update_applied(resource, action, update); end",
"title": ""
},
{
"docid": "60a65bd74563f3e7fca839370f31d14c",
"score": "0.5343326",
"text": "def upgrade!\n unless upgradable?\n raise AufAktienException, \"#{inspect} upgraded without possibility.\"\n end\n @level += 1\n end",
"title": ""
},
{
"docid": "af89cf732fa42ae305c2ff8243aa84b1",
"score": "0.53322065",
"text": "def upgrade\n\t\t# todo: add if statement to confirmed if transaction is complete.\n\t\t# to do that, we need to pass some argv from upgrade_pay to upgrade\n\t\tredirect_to action: 'home'\n\tend",
"title": ""
},
{
"docid": "e502c3551b1f4db6960444dc1d2e95dd",
"score": "0.5330929",
"text": "def update!(**args)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "e502c3551b1f4db6960444dc1d2e95dd",
"score": "0.5330929",
"text": "def update!(**args)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "e502c3551b1f4db6960444dc1d2e95dd",
"score": "0.5330929",
"text": "def update!(**args)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "e502c3551b1f4db6960444dc1d2e95dd",
"score": "0.5330929",
"text": "def update!(**args)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "e502c3551b1f4db6960444dc1d2e95dd",
"score": "0.5330929",
"text": "def update!(**args)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "e502c3551b1f4db6960444dc1d2e95dd",
"score": "0.5330929",
"text": "def update!(**args)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "e502c3551b1f4db6960444dc1d2e95dd",
"score": "0.5330929",
"text": "def update!(**args)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "e502c3551b1f4db6960444dc1d2e95dd",
"score": "0.5330929",
"text": "def update!(**args)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "e502c3551b1f4db6960444dc1d2e95dd",
"score": "0.5330929",
"text": "def update!(**args)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "3b12420b2b8e2ff2909de6df0e60bb12",
"score": "0.5327641",
"text": "def update\n @fuel_up = FuelUp.find(params[:id])\n\n respond_to do |format|\n if @fuel_up.update_attributes(params[:fuel_up])\n format.html { redirect_to(@fuel_up, :notice => 'Fuel up was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fuel_up.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9eb23daa7b76242064b8c28f4975630f",
"score": "0.53242815",
"text": "def upgrade(api_level=nil)\n if api_level.nil?\n api_level = 'auth' unless self.permit? 'auth'\n api_level = 'connect' unless self.permit? 'connect'\n end\n res = Connection.post('upgrade', { access_token: self.access_token, upgrade_to: api_level })\n\n # Reset accounts and transaction\n self.accounts = []\n self.transactions = []\n update(res)\n end",
"title": ""
},
{
"docid": "0173cacedb065f09a59bf0e5cf801573",
"score": "0.5320258",
"text": "def web_proxy_update\n update_status = check_update\n return false if update_status.nil?\n\n response = request(:post, '/devmgr/v2/upgrade/download')\n status(response, 200, [200], 'Failed to download the latest version')\n response = request(:post, '/devmgr/v2/upgrade/reload')\n status(response, 200, [200], 'Failed to install latest version')\n end",
"title": ""
},
{
"docid": "36c2bcc6fce67299e71b2bb9e030db51",
"score": "0.5311642",
"text": "def update\n respond_to do |format|\n if @app_version.update(app_version_params)\n format.html { redirect_to @app_version, notice: 'App version was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @app_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "169469b2bd2212a4e25d0ba344388e7b",
"score": "0.5306952",
"text": "def update\n debug 'pfsense: update called'\n uninstall\n install\n end",
"title": ""
},
{
"docid": "86358e88f155efb847c4cdd077cde456",
"score": "0.5305095",
"text": "def upgrade_params\n params.require(:upgrade).permit(:name, :product_id, :price)\n end",
"title": ""
},
{
"docid": "a1c15856e13f87d8e4439ad223d321f0",
"score": "0.529131",
"text": "def update\n @app_version = AppVersion.find(params[:id])\n\n respond_to do |format|\n if @app_version.update_attributes(params[:app_version])\n format.html { redirect_to @app_version, notice: 'App version was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "561706992b1dccf8e6d45dca8772427c",
"score": "0.52850336",
"text": "def update_resource(resource, params)\n resource.update(params)\n end",
"title": ""
},
{
"docid": "e561340d0cfe7a09d48fdf4466e87871",
"score": "0.5280357",
"text": "def update_necessary?\n load_mixlib_versioning\n cur_version = current_version\n des_version = desired_version\n if cur_version.nil?\n Chef::Log.debug(\"#{new_resource.product_name} is not installed. Proceeding with installing its #{des_version} version.\")\n true\n else\n cur_version = Mixlib::Versioning.parse(current_version)\n Chef::Log.debug(\"The current #{new_resource.product_name} version is #{cur_version} and the desired version is #{des_version}\")\n necessary = new_resource.prevent_downgrade ? (des_version > cur_version) : (des_version != cur_version)\n Chef::Log.debug(\"A #{chef_infra_product_name} upgrade #{necessary ? 'is' : \"isn't\"} necessary\")\n necessary\n end\nend",
"title": ""
},
{
"docid": "52f56b9e973c1e3c8958ea53d717bba1",
"score": "0.52787817",
"text": "def update\n build_responder.call(update_resource, :action => :update)\n end",
"title": ""
},
{
"docid": "907cb3da72705c2be1d3efff752ce52f",
"score": "0.5274294",
"text": "def for_resource_update\n with_topic(Constants::RESOURCE_UPDATE)\n end",
"title": ""
},
{
"docid": "3b410e238cfdf899bded9081e16c240f",
"score": "0.52719736",
"text": "def upgrade\n current_shell.exec \"#{@bin_path}/brew upgrade #{@package_name}\"\n\n current_shell.last_exit_status.zero?\n end",
"title": ""
},
{
"docid": "cef83fd246aeb7b34532790e5324a0d4",
"score": "0.5269412",
"text": "def update!(**args)\n @credentials = args[:credentials] if args.key?(:credentials)\n @deployment_name = args[:deployment_name] if args.key?(:deployment_name)\n @description = args[:description] if args.key?(:description)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n @route_service_url = args[:route_service_url] if args.key?(:route_service_url)\n @syslog_drain_url = args[:syslog_drain_url] if args.key?(:syslog_drain_url)\n @volume_mounts = args[:volume_mounts] if args.key?(:volume_mounts)\n end",
"title": ""
},
{
"docid": "7fcfc2a88a48bbf90e3eb49d74dc4507",
"score": "0.52678984",
"text": "def update!(**args)\n @in_place_update = args[:in_place_update] if args.key?(:in_place_update)\n @new_deployable_appliance = args[:new_deployable_appliance] if args.key?(:new_deployable_appliance)\n end",
"title": ""
},
{
"docid": "3181c49f1879622539f9f8a20b12c60c",
"score": "0.5255708",
"text": "def update!(**args)\n @secret_version = args[:secret_version] if args.key?(:secret_version)\n end",
"title": ""
},
{
"docid": "3181c49f1879622539f9f8a20b12c60c",
"score": "0.52554584",
"text": "def update!(**args)\n @secret_version = args[:secret_version] if args.key?(:secret_version)\n end",
"title": ""
},
{
"docid": "3181c49f1879622539f9f8a20b12c60c",
"score": "0.52554584",
"text": "def update!(**args)\n @secret_version = args[:secret_version] if args.key?(:secret_version)\n end",
"title": ""
},
{
"docid": "bcb78d8af39fa9058cc0383d3e4906b9",
"score": "0.5252228",
"text": "def upgrade\n return install if version\n installed = installed(plugin_name)\n pre = installed.version.prerelease?\n\n raise \"Plugin #{plugin_name} not installed\" unless installed\n latest = rubygems_client.latest_version(prefix(plugin_name), pre: pre)\n if latest > installed.version\n Installer.new(plugin_name, version: latest.to_s).install\n end\n end",
"title": ""
},
{
"docid": "1b840b26af8e297d5a095cc8ff518482",
"score": "0.52500975",
"text": "def upgrade?\n self[:upgrade] == 1\n end",
"title": ""
},
{
"docid": "d5dbd0697e342264f537a033228ff535",
"score": "0.5245634",
"text": "def update!(**args)\n @version = args[:version] if args.key?(:version)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n end",
"title": ""
},
{
"docid": "d5dbd0697e342264f537a033228ff535",
"score": "0.5245634",
"text": "def update!(**args)\n @version = args[:version] if args.key?(:version)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n end",
"title": ""
},
{
"docid": "d5dbd0697e342264f537a033228ff535",
"score": "0.5245634",
"text": "def update!(**args)\n @version = args[:version] if args.key?(:version)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n end",
"title": ""
},
{
"docid": "58e86e26997127709ea52690652e141d",
"score": "0.5240522",
"text": "def update\n respond_to do |format|\n if @capability_request_resource_release.update(capability_request_resource_release_params)\n format.html { redirect_to @capability_request_resource_release, notice: 'Capability request resource release was successfully updated.' }\n format.json { render :show, status: :ok, location: @capability_request_resource_release }\n else\n format.html { render :edit }\n format.json { render json: @capability_request_resource_release.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7a40c16f28c0b8f362504c59f9e7e89",
"score": "0.52188355",
"text": "def update!(**args)\n @availability_condition = args[:availability_condition] if args.key?(:availability_condition)\n @available_permissions = args[:available_permissions] if args.key?(:available_permissions)\n @available_resource = args[:available_resource] if args.key?(:available_resource)\n end",
"title": ""
},
{
"docid": "e7a40c16f28c0b8f362504c59f9e7e89",
"score": "0.52188355",
"text": "def update!(**args)\n @availability_condition = args[:availability_condition] if args.key?(:availability_condition)\n @available_permissions = args[:available_permissions] if args.key?(:available_permissions)\n @available_resource = args[:available_resource] if args.key?(:available_resource)\n end",
"title": ""
},
{
"docid": "77e1c65aefc021a9cade4a311ebe8256",
"score": "0.5217597",
"text": "def update(&block)\n blueprint(:update, &block)\n end",
"title": ""
},
{
"docid": "78e9e2dfed36376270e5673b64af2e59",
"score": "0.52152",
"text": "def update!(**args)\n @endpoints = args[:endpoints] if args.key?(:endpoints)\n @resource = args[:resource] if args.key?(:resource)\n end",
"title": ""
},
{
"docid": "ce8648b45cf258750d39595dea31a300",
"score": "0.52151775",
"text": "def update\n @migrate_version = MigrateVersion.find(params[:id])\n\n respond_to do |format|\n if @migrate_version.update_attributes(params[:migrate_version])\n format.html { redirect_to @migrate_version, notice: 'Migrate version was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @migrate_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
30400e314ecc7a849c2500d7390a13ea
|
Takes populatoin_density and state as parameters. Returns the number of months it will take the virus to spread.
|
[
{
"docid": "e3fd825fb821128298b718f0b58c0da8",
"score": "0.0",
"text": "def speed_of_spread #in months\n speed = 0.0\n case @population_density\n when @population_density >= 200\n speed += 0.5\n when 150..199\n speed += 1\n when 100..149\n speed += 1.5\n when 50..99\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",
"title": ""
}
] |
[
{
"docid": "1d25b71b8aeff42dde44420e006d407b",
"score": "0.7578014",
"text": "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 num_of_months = 0.0\n\n case @population_density\n when 0..49\n num_of_months += 2.5\n when 50..99\n num_of_months += 2\n when 100..149\n num_of_months += 1.5\n when 150..199\n num_of_months += 1.0\n else\n num_of_months += 0.5\n end\n\n end",
"title": ""
},
{
"docid": "711aeac3278fdc1d324331ebd5345958",
"score": "0.7092971",
"text": "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\n if @population_density >= 200\n num_months = 0.5\n elsif @population_density >= 150\n num_months = 1\n elsif @population_density >= 100\n num_months = 1.5\n elsif @population_density >= 50\n num_months = 2\n else\n num_months = 2.5\n end\n\n puts \" and will spread across the state in #{num_months} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "42672563716a070e4021849afc9933ca",
"score": "0.6993254",
"text": "def months_to_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 months = 0.0\n\n if @population_density >= 200\n months += 0.5\n elsif @population_density >= 150\n months += 1\n elsif @population_density >= 100\n months += 1.5\n elsif @population_density >= 50\n months += 2\n else\n months += 2.5\n end\n months\n end",
"title": ""
},
{
"docid": "426d5f7023e9942670a36a11bbe578b2",
"score": "0.69403905",
"text": "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 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 end",
"title": ""
},
{
"docid": "c1077338a2b65e5ad9241dbb86a17013",
"score": "0.69396615",
"text": "def speed_of_spread#(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n #puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n end",
"title": ""
},
{
"docid": "a5e1900589cf38bf16028067778f1609",
"score": "0.6938239",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "a5e1900589cf38bf16028067778f1609",
"score": "0.6938239",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "a5e1900589cf38bf16028067778f1609",
"score": "0.6938239",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "a5e1900589cf38bf16028067778f1609",
"score": "0.6938239",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "a5e1900589cf38bf16028067778f1609",
"score": "0.6938239",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "a5e1900589cf38bf16028067778f1609",
"score": "0.6938239",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "a5e1900589cf38bf16028067778f1609",
"score": "0.6938239",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "a5e1900589cf38bf16028067778f1609",
"score": "0.6938239",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "811ec5408cbf03f2ddd9e671474f287c",
"score": "0.6938152",
"text": "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 case @population_density\n when (200..1000)\n speed += 0.5\n when (150...200)\n speed += 1\n when (100...150)\n speed += 1.5\n when (50...100)\n speed += 2\n when (0...50)\n speed += 2.5\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "811ec5408cbf03f2ddd9e671474f287c",
"score": "0.6938152",
"text": "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 case @population_density\n when (200..1000)\n speed += 0.5\n when (150...200)\n speed += 1\n when (100...150)\n speed += 1.5\n when (50...100)\n speed += 2\n when (0...50)\n speed += 2.5\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "e72b110ad8364b03a0c4bdd3273c811c",
"score": "0.693761",
"text": "def speed_of_spread#(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "e72b110ad8364b03a0c4bdd3273c811c",
"score": "0.693761",
"text": "def speed_of_spread#(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "6d2611856ef560a424606320e424e5c3",
"score": "0.69079316",
"text": "def speed_of_spread#(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n puts \" and the virus will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "8406fb8093ff4c823daa0260833ac639",
"score": "0.6875093",
"text": "def speed_of_spread(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n end",
"title": ""
},
{
"docid": "541035bf6c9a943c1e71fd0d2c4479f8",
"score": "0.6872176",
"text": "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 += 1itu\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",
"title": ""
},
{
"docid": "3dbad21181a07e4680aefb8fcaa9f2a4",
"score": "0.6859877",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "3dbad21181a07e4680aefb8fcaa9f2a4",
"score": "0.6859877",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "8ed610fa45b0a81a2c33c5ff416f381b",
"score": "0.6858609",
"text": "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 case @population_density\n when (151...200)\n speed = 1\n\n when (100...150)\n speed = 1.5\n\n when (50...100)\n speed = 2\n\n when (0..50)\n speed = 2.5\n\n else\n speed = 0.5\n\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.68508583",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b935c0c89be38d66a3e230add860fecd",
"score": "0.6848487",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "262a7b4f0a1b312809f454653506f804",
"score": "0.68465537",
"text": "def speed_of_spread(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "262a7b4f0a1b312809f454653506f804",
"score": "0.68465537",
"text": "def speed_of_spread(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "262a7b4f0a1b312809f454653506f804",
"score": "0.68465537",
"text": "def speed_of_spread(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "7751910ff6de2218192b39ee954aae39",
"score": "0.68439436",
"text": "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 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",
"title": ""
},
{
"docid": "9c3d19ea31028f90d6354c7c8be3f06a",
"score": "0.6826563",
"text": "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 when @population_density(151..200)\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",
"title": ""
},
{
"docid": "fa02390839c2ecf1903d4a72003212ef",
"score": "0.6781237",
"text": "def speed_of_spread#(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n speed += if @population_density >= 200\r\n 0.5\r\n elsif @population_density >= 150\r\n 1\r\n elsif @population_density >= 100\r\n 1.5\r\n elsif @population_density >= 50\r\n 2\r\n else\r\n 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "8a2329fa5149eb73b9219d19b8cc07e6",
"score": "0.6765837",
"text": "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 if population_density >= 200\n speed = 0.5\n else\n speed = 2.5 - 0.5 * (population_density.floor/50)\n end\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "c16f2a9067197bc3140eb2fb50e224bc",
"score": "0.67634064",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "deec834d52e84bc716bce4c63afd8b94",
"score": "0.676184",
"text": "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\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",
"title": ""
},
{
"docid": "f83952d8867d6635e23ead4fe16cf600",
"score": "0.67592096",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "c71f8884685227b11dd4181702a97d4d",
"score": "0.6752703",
"text": "def speed_of_spread #(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n\r\n speed = if @population_density >= 200\r\n 0.5\r\n elsif @population_density >= 150\r\n 1\r\n elsif @population_density >= 100\r\n 1.5\r\n elsif @population_density >= 50\r\n 2\r\n else\r\n 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "c0fa06c10bbf33e2d2cff6abef377d0d",
"score": "0.674467",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "c0fa06c10bbf33e2d2cff6abef377d0d",
"score": "0.674467",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "c0fa06c10bbf33e2d2cff6abef377d0d",
"score": "0.674467",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "c0fa06c10bbf33e2d2cff6abef377d0d",
"score": "0.674467",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "7081732fcfef7ca8251d1462c0bd5f9c",
"score": "0.67339575",
"text": "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 # case @population_density\n # when 200..300\n # speed += 0.5\n # when 150..199\n # speed += 1\n # when 100..149\n # speed += 1.5\n # when 50..99\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",
"title": ""
},
{
"docid": "f26e3c460fb52ba31375787ca6de84f0",
"score": "0.6712405",
"text": "def speed_of_spread #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n \r\n\r\n if @population_density >= 200\r\n puts \" and will spread across the state in half a month.\\n\\n\"\r\n elsif @population_density >= 150\r\n puts \" and will spread across the state in a month.\\n\\n\"\r\n elsif @population_density >= 100\r\n puts \" and will spread across the state in a month and a half.\\n\\n\"\r\n elsif @population_density >= 50\r\n puts \" and will spread across the state in two months.\\n\\n\"\r\n else\r\n puts \" and will spread across the state in two and a half months.\\n\\n\"\r\n end\r\n\r\n \r\n\r\n end",
"title": ""
},
{
"docid": "54b38ffef75a3a61156d43ce6a52ec18",
"score": "0.6711135",
"text": "def speed_of_spread #in months #doesn't need arguments\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 months = 0.0\n\n if @population_density >= 200\n months = 0.5\n elsif @population_density >= 150\n months = 1\n elsif @population_density >= 100\n months = 1.5\n elsif @population_density >= 50\n months = 2\n else\n months = 2.5\n end\n\n puts \" and will spread across the state in #{months} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "95b010cdfc8580f7e7ccfeee4d8de0c9",
"score": "0.6711099",
"text": "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 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 end",
"title": ""
},
{
"docid": "e81d721d01516241ccd045065c9e2c75",
"score": "0.67029977",
"text": "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 months_to_spread = 0.0\n case @population_density\n when @population_density >= 200 then months_to_spread += 0.5\n when @population_density >= 150 then months_to_spread += 1\n when @population_density >= 100 then months_to_spread += 1.5\n when @population_density >= 50 then months_to_spread += 2\n when @population_density < 50 then months_to_spread += 2.5\n end\n puts \" and will spread across the state in #{months_to_spread} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "7b644c7346eca2de9efbe7b60f590ec5",
"score": "0.66999775",
"text": "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# puts the speed in months to a string.\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "cdc813fef1259fa745f927cd4deb090a",
"score": "0.6694792",
"text": "def speed_of_spread #(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n # puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "fbbcc9d76bf79fc9955805089c465a19",
"score": "0.6687441",
"text": "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 time = 0.0\n\n if @population_density >= 200\n time += 0.5\n elsif @population_density >= 150\n time += 1\n elsif @population_density >= 100\n time += 1.5\n elsif @population_density >= 50\n time += 2\n else\n time += 2.5\n end\n\n puts \" and will spread across the state in #{time} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "78645f931370ce947da7088e41d5289c",
"score": "0.66835016",
"text": "def speed_of_spread #(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "733fc45744452153a94666287adb298a",
"score": "0.66782576",
"text": "def speed_of_spread(population_density, state) #in months\n speed = 0.0\n\n case @population_density\n when 0..50\n speed += 2.5\n when 50..100\n speed += 2\n when 100..150\n speed += 1.5\n when 150..200\n speed += 1\n else\n speed += 0.5\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "c295310ee612b55dd91cfa78372ec60f",
"score": "0.6676326",
"text": "def speed_of_spread #in months (population_density, state)\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 case \n when @population_density >= 200 then speed += 0.5\n when @population_density >= 150 then speed += 1\n when @population_density >= 100 then speed += 1.5\n when @population_density >= 50 then speed += 2\n when @population_density >= 0 then speed += 2.5 \n end\n\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "cece4afa236c426cf1ae24ff9d2f781f",
"score": "0.6668734",
"text": "def speed_of_spread(pop_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 @pop_density >= 200\n speed += 0.5\n elsif @pop_density >= 150\n speed += 1\n elsif @pop_density >= 100\n speed += 1.5\n elsif @pop_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",
"title": ""
},
{
"docid": "b0e01a10fdba86010f5753e269c3753e",
"score": "0.6666628",
"text": "def speed_of_spread(population_density, state) #in months\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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b0e01a10fdba86010f5753e269c3753e",
"score": "0.6666628",
"text": "def speed_of_spread(population_density, state) #in months\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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b0e01a10fdba86010f5753e269c3753e",
"score": "0.6666628",
"text": "def speed_of_spread(population_density, state) #in months\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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b0e01a10fdba86010f5753e269c3753e",
"score": "0.6666628",
"text": "def speed_of_spread(population_density, state) #in months\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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b0e01a10fdba86010f5753e269c3753e",
"score": "0.6666628",
"text": "def speed_of_spread(population_density, state) #in months\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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "b0e01a10fdba86010f5753e269c3753e",
"score": "0.6666628",
"text": "def speed_of_spread(population_density, state) #in months\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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "c87aaafa4842cb2d01ac7088cb8f21aa",
"score": "0.66563255",
"text": "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\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",
"title": ""
},
{
"docid": "fe84e0d4db69a8048879b2ca98cf12a3",
"score": "0.6652433",
"text": "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 end",
"title": ""
},
{
"docid": "8227d20c0bbe50f59fe75892385ac576",
"score": "0.6645335",
"text": "def predicted_deaths#(population_density, population, state)\n # predicted deaths is solely based on population density\n if @population_density >= 200\n x = 0.4\n elsif @population_density >= 150\n x = 0.3\n elsif @population_density >= 100\n x = 0.2\n elsif @population_density >= 50\n x = 0.1\n else\n x = 0.05\n end\n \n @number_of_deaths = (@population * x).floor \n \n end",
"title": ""
},
{
"docid": "6056aa8387b33e434e905551f4b6248a",
"score": "0.66445154",
"text": "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 speed += 0.5 if @population_density >= 200\n speed += 1 if @population_density >= 150\n speed += 1.5 if @population_density >= 100\n speed += 2 if @population_density >= 50\n speed += 2.5\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "e8923a18d81fcd078d2597ed4940f081",
"score": "0.66397995",
"text": "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 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 end",
"title": ""
},
{
"docid": "bc8228a8582cd7091f7b6d9c47fb1cec",
"score": "0.663763",
"text": "def speed_of_spread #in months #no parameters needed (population_density, state) as method predicted_death works with instance variables; state not even used.\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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "f7dfebfbc430b324d05dcf571e933f18",
"score": "0.6622235",
"text": "def speed_of_spread(population_density, state) #in months\n speed = 0.0\n case @population_density\n when 0..49 then speed += 2\n when 50..99 then speed += 1.5\n when 100..149 then speed += 1 \n when 150..200 then speed += 0.5\n else \n speed += 0.5 \n end \n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "38a869bc9cf4650bf432541c032f8b1b",
"score": "0.6618974",
"text": "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 case @population_density\n when (0...50)\n speed += 2.5\n when (50...100)\n speed += 2\n when (100...150)\n speed += 1.5\n when (150...200)\n speed += 1\n else\n speed += 0.5\n end\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "b861cf8145ec09b1bba72324d0dec4fb",
"score": "0.6618683",
"text": "def speed_of_spread(population_density, state) #in months\n\n case @population_density\n when 200..Float::INFINITY\n speed = 0.5\n when 150..199.9999\n speed = 1\n when 100..149.9999\n speed = 1.5\n when 50..99.9999\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",
"title": ""
},
{
"docid": "92c2a864ea94ca0b4b37a008654ce04b",
"score": "0.66150165",
"text": "def speed_of_spread(population_density, state) #in months\n speed = 0.0\n rate = [2.5, 2, 1.5, 1]\n if @population_density >= 200\n speed += 0.5\n else \n speed += rate[(@population_density/50)]\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "eba0f87df4596f34549fd8cba22098d9",
"score": "0.65964794",
"text": "def speed_of_spread(population_density, state) #in months\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",
"title": ""
},
{
"docid": "feaee44d4f79b2f64ffda038d5f883a4",
"score": "0.6594587",
"text": "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\n if @population_density >= 200\n months = 0.5\n elsif @population_density >= 150\n months = 1\n elsif @population_density >= 100\n months = 1.5\n elsif @population_density >= 50\n months = 2\n else\n months = 2.5\n end\n\n end",
"title": ""
},
{
"docid": "fcd8a60d47bf0d5099db7f01ab2bb2c3",
"score": "0.6577893",
"text": "def speed_of_spread(population_density, state) #in months\n speed = 0.0\n case @population_density\n when @population_density >= 200\n speed += 0.5\n when 101..150\n speed += 1\n when 51..100\n speed += 1.5\n when @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",
"title": ""
},
{
"docid": "646bf1c954348bf0cb48c1045a0be36c",
"score": "0.6577019",
"text": "def speed_of_spread #(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n# puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "4ffba10eec6a2e01bc1fcb25d343bda2",
"score": "0.65767014",
"text": "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\n case @population_density\n when @population_density >= 200\n speed += 0.5\n when (151..200)\n speed += 1\n when (101..150)\n speed += 2\n when (51..100)\n speed += 2\n else\n speed += 2.5\n end\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "5a69bc7b966a0e1be95d3cf2faab1351",
"score": "0.65749115",
"text": "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\n months_to_spread = 0.0\n case @population_density\n\n when @population_density >= 200 then months_to_spread += 0.5\n when @population_density >= 150 then months_to_spread += 1\n when @population_density >= 100 then months_to_spread += 1.5\n when @population_density >= 50 then months_to_spread += 2\n when @population_density < 50 then months_to_spread += 2.5\n\n end\n\n puts \" and will spread across the state in #{months_to_spread} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "d384a1ad6eec384a3c04c06ba37fd001",
"score": "0.6574623",
"text": "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 if self.population_density >= 200\n speed += 0.5\n elsif self.population_density >= 150\n speed += 1\n elsif self.population_density >= 100\n speed += 1.5\n elsif self.population_density >= 50\n speed += 2\n else\n speed += 2.5\n end\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "6c266d0eb47e738b66bbc5e19a625755",
"score": "0.65689623",
"text": "def speed_of_spread #(population_density, state) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "33d310649e7cf9ae8e98d484a9c8935f",
"score": "0.6566538",
"text": "def speed_of_spread(population_density) #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n duration = 0.0\r\n\r\n if @population_density >= 200\r\n duration += 0.5\r\n elsif @population_density >= 150\r\n duration += 1\r\n elsif @population_density >= 100\r\n duration += 1.5\r\n elsif @population_density >= 50\r\n duration += 2\r\n else\r\n duration += 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{duration} months.\\n\\n\"\r\n\r\n end",
"title": ""
},
{
"docid": "d69e582bb9e2325ccdddaacfc96da680",
"score": "0.6544937",
"text": "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 # \n \n speed = (2.5 - (@population_density / 100)).round(2)\n \n if speed < 0\n speed = 0\n end\n \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 puts \" and will spread across the state in #{speed} months.\\n\"\n\n end",
"title": ""
},
{
"docid": "61cd88e9de16a520c23361f5417a12d8",
"score": "0.65441346",
"text": "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 case @population_density\n when(0..49)\n speed += 2.5\n when(150..199)\n speed += 1\n when(100..149)\n speed += 1.5\n when(50..99)\n speed += 2\n else\n speed += 0.5\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "4322dcfac1016b799915c47efa7f5bd8",
"score": "0.6540423",
"text": "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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "f056a44a63902a408f474474108753d7",
"score": "0.6531331",
"text": "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 rate = 0\n\n if @population_density >= 200\n rate = 0.5\n elsif @population_density >= 150\n rate = 1\n elsif @population_density >= 100\n rate = 1.5\n elsif @population_density >= 50\n rate = 2\n else\n rate = 2.5\n end\n\n puts \" and will spread across the state in #{rate} months.\\n\\n\"\n return rate\n\n end",
"title": ""
},
{
"docid": "f054fbe4cc6cbcf1ced1ed02b78bb267",
"score": "0.6529276",
"text": "def speed_of_spread #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n speed += 2\r\n else\r\n speed += 2.5\r\n end\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n end",
"title": ""
},
{
"docid": "e31f3dc23bfe39f9ecbbf0849aa9389e",
"score": "0.65256774",
"text": "def speed_of_spread #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n speed = case @population_density\r\n when 200..99999 then 0.5\r\n when 150...200 then 1\r\n when 100...150 then 1.5\r\n when 50...100 then 2\r\n when 0...50 then 2.5\r\n end\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n end",
"title": ""
},
{
"docid": "bfd211accec3a602993948c3b5f1e53b",
"score": "0.65159345",
"text": "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\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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "52ce08c8d6f4dee7ab10b3e590dd9e5d",
"score": "0.6513968",
"text": "def speed_of_spread(population_density, state) #in months\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 case @population_density\n when 0..50\n speed += 2.5\n when 50..100\n speed += 2\n when 100..150\n speed += 1.5\n when 150..200\n speed += 1\n else\n speed += 0.5\n end\n\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n\n end",
"title": ""
},
{
"docid": "ead818de71e77e9f323db5f5939913c6",
"score": "0.65124446",
"text": "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 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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "ead818de71e77e9f323db5f5939913c6",
"score": "0.65124446",
"text": "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 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 puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end",
"title": ""
},
{
"docid": "5b7f5951714424d87e8608463e37f830",
"score": "0.6511683",
"text": "def speed_of_spread #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n\r\n case @population_density\r\n when 200..Float::INFINITY\r\n speed = 0.5\r\n when 150..199\r\n speed = 1\r\n when 100..149\r\n speed = 1.5\r\n when 50..99\r\n speed = 2\r\n else\r\n speed = 2.5\r\n end\r\n\r\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end",
"title": ""
}
] |
8d134a837d795003c4c62ea5e7fa05a0
|
Summarizes the annotation results for this RelationInstance
|
[
{
"docid": "309df50f59375ea965386ff33500538c",
"score": "0.66008234",
"text": "def summarize_annotations\n\t\tresult = {is_expressed: 0, is_not_expressed: 0, not_sure_expressed: 0, is_bad_pattern: 0, total_anns: self.annotations.count}\n\t\tself.annotations.each do |ann|\n\t\t\tcase ann.annotation\n\t\t\twhen 0\n\t\t\t\tresult[:is_not_expressed] += 1\n\t\t\twhen 1\n\t\t\t\tresult[:is_expressed] += 1\n\t\t\twhen 2\n\t\t\t\tresult[:not_sure_expressed] += 1\n\t\t\tend\n\n\t\t\tif(!ann.is_bad_pattern.nil? && ann.is_bad_pattern)\n\t\t\t\tresult[:is_bad_pattern] += 1\n\t\t\tend\n\t\tend\n\t\tresult\n\tend",
"title": ""
}
] |
[
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.63381535",
"text": "def annotations; end",
"title": ""
},
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.63381535",
"text": "def annotations; end",
"title": ""
},
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.63381535",
"text": "def annotations; end",
"title": ""
},
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.63381535",
"text": "def annotations; end",
"title": ""
},
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.63381535",
"text": "def annotations; end",
"title": ""
},
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.63381535",
"text": "def annotations; end",
"title": ""
},
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.63381535",
"text": "def annotations; end",
"title": ""
},
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.63381535",
"text": "def annotations; end",
"title": ""
},
{
"docid": "340ed8f575a796209aa03e8006adbaba",
"score": "0.6249942",
"text": "def output_results\n if @annotated_paths.any?\n puts(\"Annotated #{@annotated_paths.join(', ')}\")\n @flags.include?(:error_on_annotation) ? 1 : 0\n else\n puts('Nothing to annotate')\n 0\n end\n end",
"title": ""
},
{
"docid": "cc9752b2355edb29a4dc946007ce1cad",
"score": "0.60877573",
"text": "def annotator; end",
"title": ""
},
{
"docid": "73a640db66e4d64be7269a00b9d25a7d",
"score": "0.57459956",
"text": "def inspect\n \"<Annotations for #{@resource.resourceid}: #{to_s}>\"\n end",
"title": ""
},
{
"docid": "619a9e397626d755d6f2f2c1ce77788c",
"score": "0.5716936",
"text": "def annotations\n @research_object.annotations(@uri)\n end",
"title": ""
},
{
"docid": "c74f29bc19699e6f2266219736834677",
"score": "0.56735176",
"text": "def aggregated_ratings\n PropertyRatingService::RatingData.new(self).data\n end",
"title": ""
},
{
"docid": "c74f29bc19699e6f2266219736834677",
"score": "0.56735176",
"text": "def aggregated_ratings\n PropertyRatingService::RatingData.new(self).data\n end",
"title": ""
},
{
"docid": "4cfa79ee2efe894a6d46616600d5d465",
"score": "0.5631247",
"text": "def per_page_annotation_counts\n self.annotations.group('page_number').count\n end",
"title": ""
},
{
"docid": "ca41d51e66cfe1ec84eae8e590911fa1",
"score": "0.5588188",
"text": "def custom_annotation_output\n @custom_annotation_output ||= raw_response[:customAnnotationOutput]\n end",
"title": ""
},
{
"docid": "6691976f3b4646ecaeb6c60e6dd5c99e",
"score": "0.5502641",
"text": "def score\n\n if self.annotations_count\n return self.annotations_count\n else\n return 0\n end\n\n end",
"title": ""
},
{
"docid": "6691976f3b4646ecaeb6c60e6dd5c99e",
"score": "0.5502641",
"text": "def score\n\n if self.annotations_count\n return self.annotations_count\n else\n return 0\n end\n\n end",
"title": ""
},
{
"docid": "15f03ea8a0e6311e28eb0d06ef73d12f",
"score": "0.5460673",
"text": "def annotations\n @object = @descriptor\n render '/shared/data/all/annotations'\n end",
"title": ""
},
{
"docid": "851d14fefe4c51df158b2271e98484a2",
"score": "0.5460628",
"text": "def total_annotations_count(source_type)\n 0\n end",
"title": ""
},
{
"docid": "858d3d33ac4315a5fb0bdacc5303249c",
"score": "0.5411986",
"text": "def annotations\n form = self.to_json\n annotations = Array.new\n annotations += bc_annotations\n annotations += question_annotations\n return annotations\n end",
"title": ""
},
{
"docid": "18acdb1f3263e78712f52e2e03ef2922",
"score": "0.53734845",
"text": "def custom_annotation_output\n response_json[\"response\"].fetch(\"customAnnotationOutput\", \"\")\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "4c5f9f40338dca6a36a97bf5bbd60fa9",
"score": "0.53348684",
"text": "def statistics\n super\n end",
"title": ""
},
{
"docid": "f38d361b378d26218857ebaa5efe399c",
"score": "0.53169733",
"text": "def statistics\n find(:all, :select => \"title, count(*) AS count, sum(amount) AS sum, avg(amount) AS avg\", :group => :title).map{|stat| stat.attributes}\n end",
"title": ""
},
{
"docid": "7c2deef17673d5963fb2d084a5e984e2",
"score": "0.5308145",
"text": "def analyze\n format_results\n end",
"title": ""
},
{
"docid": "b518905af93e227c93d604c608d3e950",
"score": "0.528749",
"text": "def annotations\n @empty_collection\n end",
"title": ""
},
{
"docid": "26fbb93a51dc957fefc9b7ef7da981f8",
"score": "0.5278789",
"text": "def total_annotations_count(source_type)\n count = 0\n \n count += self.count_annotations_by(source_type)\n \n # TODO: get counts for resources, methods, parameters and representations.\n \n return count\n end",
"title": ""
},
{
"docid": "a950afbb83e3fdb75564e267ff4674a4",
"score": "0.5276207",
"text": "def annotations\n @annotations ||= Annotation.new :interval_id => self.id\n end",
"title": ""
},
{
"docid": "02c9e2b27f6f94b7b6aa10a0a64ea44d",
"score": "0.52567536",
"text": "def annotations_for(annotatable_type, annotatable_id, include_values = false)\n obj_type = self.class.base_class.name\n\n options = {\n conditions: { source_type: obj_type,\n annotatable_type: annotatable_type,\n annotatable_id: annotatable_id },\n order: 'updated_at DESC'\n }\n\n options[:include] = [:value] if include_values\n\n Annotation.find(:all, options)\n end",
"title": ""
},
{
"docid": "5a42d560aa566e2dd6e32fc0647344ae",
"score": "0.5241578",
"text": "def summarize_per_relation(generator)\n @from = \"#{generator.to_subquery} AS #{visit_identifier(generator.name)} NATURAL LEFT JOIN #{@from}\"\n end",
"title": ""
},
{
"docid": "a2a0fdc0a2fef6221f418f4f909817ee",
"score": "0.5220357",
"text": "def annotations_for(annotatable_type, annotatable_id)\n obj_type = ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s\n \n Annotation.find(:all,\n :conditions => { :source_type => obj_type,\n :annotatable_type => annotatable_type, \n :annotatable_id => annotatable_id },\n :order => \"created_at DESC\")\n end",
"title": ""
},
{
"docid": "f60cc7aeb0e9009ac704f599ffeb4fd5",
"score": "0.5206189",
"text": "def explanations\n return nil unless @id\n\n @explanation ||= response[\"annotations\"].map do |annotation|\n annotation[\"body\"][\"plain\"]\n end\n end",
"title": ""
},
{
"docid": "71b60b4f73843f8efadbe0042c4b5559",
"score": "0.5205733",
"text": "def extra_annotations; end",
"title": ""
},
{
"docid": "49a2978670ff68e1b171a95f5aa5bd30",
"score": "0.5202215",
"text": "def statistics; end",
"title": ""
},
{
"docid": "f7c234ffa2962864f122c3b2bf4bb39c",
"score": "0.51964754",
"text": "def annotations_with_attribute(attrib, include_values = false)\n return [] if attrib.blank?\n\n obj_type = self.class.base_class.name\n\n options = {\n joins: :annotation_attribute,\n conditions: { annotatable_type: obj_type,\n annotatable_id: id,\n annotation_attributes: { name: attrib.strip.downcase } },\n order: 'updated_at DESC'\n }\n\n options[:include] = [:value] if include_values\n\n fetch_annotations(options)\n end",
"title": ""
},
{
"docid": "8f840a53fe2a03198164f38d5fa3f7c4",
"score": "0.5194511",
"text": "def annotation(*annotations)\n @metadata = @metadata.with_annotation(annotations.flat_map { |annotation|\n annotation.respond_to?(:each) ? annotation.each.to_a : annotation\n })\n end",
"title": ""
},
{
"docid": "1408810b5b57e6a518fab7cead9cae6a",
"score": "0.5177121",
"text": "def exams_statistics\n end",
"title": ""
},
{
"docid": "f428ce04a3fb6a5ec77e599e9c104094",
"score": "0.5164399",
"text": "def summary\n \n end",
"title": ""
},
{
"docid": "d349ed10e1474100a6dcf8b8b082806b",
"score": "0.51596624",
"text": "def annotate(text, options={})\n ontologies = options[:ontologies].is_a?(Array) ? options[:ontologies] : []\n expand_class_hierarchy = options[:expand_class_hierarchy] == true ? true : false\n expand_hierarchy_levels = options[:expand_hierarchy_levels].is_a?(Integer) ? options[:expand_hierarchy_levels] : 0\n expand_with_mappings = options[:expand_with_mappings] == true ? true : false\n\n annotations = annotate_direct(text, options)\n return annotations.values if annotations.length == 0\n\n if expand_class_hierarchy || expand_hierarchy_levels > 0\n expand_hierarchy_levels = DEFAULT_HIERARCHY_LEVEL if expand_hierarchy_levels <= 0\n hierarchy_annotations = []\n expand_hierarchies(annotations, expand_hierarchy_levels, ontologies)\n end\n\n if expand_with_mappings\n expand_mappings(annotations, ontologies)\n end\n return annotations.values\n end",
"title": ""
},
{
"docid": "4ed9908b66f7e6d5e13605868398de17",
"score": "0.51563144",
"text": "def aggregates\n @aggregates\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5144735",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "339a7d76d8b7a4c3a8c0f7311c1eb291",
"score": "0.51154184",
"text": "def to_a\n\t\tpred_list.each do |pred|\n\t\t\tputs \"\\[#{pred[:user_id]}, #{pred[:movie_id]}, #{pred[:rating]}, #{pred[:predict]} \\]\"\n\t\tend\n\t\tputs \"over\"\n\tend",
"title": ""
},
{
"docid": "1c3d35f02a61cc63e11875ce59edbf1b",
"score": "0.51121426",
"text": "def annotate_with(annotations, attr = 'tag', owner = User.current_user, user_owned_only = false)\n if annotations.is_a?(String)\n annotations = annotations.split(',').map(&:strip).uniq\n elsif annotations.is_a?(Array)\n annotations = annotations.map(&:strip).uniq\n else\n annotations = []\n end\n potential_values = Array(annotations).uniq(&:downcase).compact\n\n existing = send(\"#{attr}_annotations\")\n\n params = {}\n param_index = 0\n\n any_deletes = false\n duplicates = []\n existing.each do |ann|\n if user_owned_only && ann.source != owner\n params[(param_index += 1).to_s] = { id: ann.id }\n elsif ann.persisted?\n index = potential_values.index { |v| v.casecmp(ann.value_content) == 0 }\n if index\n duplicates << index\n params[(param_index += 1).to_s] = { id: ann.id }\n else\n any_deletes = true\n params[(param_index += 1).to_s] = { id: ann.id, _destroy: true }\n end\n end\n end\n\n potential_values.delete_if.with_index { |_, i| duplicates.include?(i) }\n\n potential_values.each do |value|\n # Annotation model can take either a String or an AR object as the value\n text_value = TextValue.where('lower(text) = ?', value.downcase).first || value\n params[(param_index += 1).to_s] = { source_type: owner.class.name, source_id: owner.id,\n attribute_name: attr, value: text_value }\n end\n\n send(\"#{attr}_annotations\").reset # Clear any previously assigned, but unsaved annotations\n send(\"#{attr}_annotations_attributes=\", params)\n\n potential_values.any? || any_deletes\n end",
"title": ""
},
{
"docid": "1e8e0a21127ed7e91fd2d527fc455dc7",
"score": "0.51084685",
"text": "def annotations_with_attribute_and_by_source(attrib, source, include_values = false)\n return [] if attrib.blank? || source.nil?\n\n obj_type = self.class.base_class.name\n\n options = {\n joins: :annotation_attribute,\n conditions: { annotatable_type: obj_type,\n annotatable_id: id,\n source_type: source.class.name,\n source_id: source.id,\n annotation_attributes: { name: attrib.strip.downcase } },\n order: 'updated_at DESC'\n }\n\n options[:include] = [:value] if include_values\n\n fetch_annotations(options)\n end",
"title": ""
},
{
"docid": "4f4c17e5e548000e3130c74b99f3f05f",
"score": "0.50991035",
"text": "def summaries\n header = summarize_per.header\n summaries = default_summaries\n operand.each { |tuple| summaries.summarize_by(header, tuple) }\n summaries\n end",
"title": ""
},
{
"docid": "5390a6030d564ac54ee3681aae0e909d",
"score": "0.5098112",
"text": "def list_ratings\n final_result = []\n # grab all of the rating attributes and counts and turn them into an array\n rating_results = rating.count_attributes.to_a\n \n # order the rating counts and attributes\n ordered_results = []\n ['one', 'two', 'three', 'four'].each do |order|\n rating_results.each do |result|\n if order == result[0]\n ordered_results << result\n end\n end\n end\n \n # add in the friendly name\n for i in 0...ordered_results.length\n final_result << [AppConstants::FRIENDLY_RATING_NAMES[i],ordered_results[i][0],(ordered_results[i][1].to_f/total_votes.to_f)*100]\n end\n \n final_result\n end",
"title": ""
},
{
"docid": "e8a48bbd16ab2c8a016f025da4d968a1",
"score": "0.5092442",
"text": "def evaluate_all\n EXAMPLES.each_with_object({}) do |example, hsh|\n puts \"Example: #{example}\"\n\n dog_annotations = annotate(example, 'dog')\n food_annotations = annotate(example, 'food')\n dogs_with_dog_labels = count_occurrences(dog_annotations, DOG_LABELS)\n dogs_with_food_labels = count_occurrences(dog_annotations, FOOD_LABELS)\n food_with_dog_labels = count_occurrences(food_annotations, DOG_LABELS)\n food_with_food_labels = count_occurrences(food_annotations, FOOD_LABELS)\n\n puts \"\\tDogs: #{dogs_with_dog_labels} with dog labels\"\n puts \"\\tDogs: #{dogs_with_food_labels} with food labels\"\n puts \"\\tFood: #{food_with_dog_labels} with dog labels\"\n puts \"\\tFood: #{food_with_food_labels} with food labels\"\n end\n end",
"title": ""
},
{
"docid": "b0ac2a1962c216ca924b1e45ee635368",
"score": "0.50841767",
"text": "def each &blk\n annotations_hash.each &blk\n self\n end",
"title": ""
},
{
"docid": "46de39922d674134c833b8aa4c255a39",
"score": "0.5080922",
"text": "def get_annotations(word, article_id, lang)\n if word.learn_type=='view'\n word.annotations = Annotation.where('article_id=? AND paragraph_idx=? AND text_idx=? AND selected_text=?',\n article_id, word.paragraph_index, word.word_index, word.text).order('vote + 0.1*implicit_vote DESC').limit(ANNOTATION_COUNT_MAX).pluck_all(:id, :translation, :vote, :implicit_vote)\n if !word.annotations.nil?\n word.annotations.each do |annotation|\n annotation['pronunciation'] = Utilities::AnnotationUtil.get_pronunciation_by_word(annotation['translation'], lang)\n annotation['audio_urls'] = Utilities::LearningUtil.get_audio_urls(annotation['pronunciation'], lang)\n annotation['more_url'] = Utilities::LearningUtil.get_more_url(annotation['translation'], lang)\n annotation['weighted_vote'] = Utilities::LearningUtil.get_weighted_vote(annotation['vote'], annotation['implicit_vote'], 'human')\n end\n end\n end\n end",
"title": ""
},
{
"docid": "57c50d2e046b78bdbc4bad505174b326",
"score": "0.5064997",
"text": "def find_annotations_by(source_type, source_id, include_values = false)\n obj_type = self.class.base_class.name\n\n options = {\n conditions: { annotatable_type: obj_type,\n source_type: source_type,\n source_id: source_id },\n order: 'updated_at DESC'\n }\n\n options[:include] = [:value] if include_values\n\n fetch_annotations(options)\n end",
"title": ""
},
{
"docid": "2a453936164f55defcea22e0b5d82db3",
"score": "0.506445",
"text": "def summary_metrics\n []\n end",
"title": ""
},
{
"docid": "fd9ede3a7e0b9247abf705eb6e715c9d",
"score": "0.5046868",
"text": "def summary\n end",
"title": ""
},
{
"docid": "fd9ede3a7e0b9247abf705eb6e715c9d",
"score": "0.5046868",
"text": "def summary\n end",
"title": ""
},
{
"docid": "dba46cc7c84cc794aa620c4b4bc0b80d",
"score": "0.50456536",
"text": "def total_results\n opensearch_totalResults\n end",
"title": ""
},
{
"docid": "8cdd0454aeff5bba21ab4f1d7b30cb1a",
"score": "0.5029833",
"text": "def summary; end",
"title": ""
},
{
"docid": "8cdd0454aeff5bba21ab4f1d7b30cb1a",
"score": "0.5029833",
"text": "def summary; end",
"title": ""
},
{
"docid": "8cdd0454aeff5bba21ab4f1d7b30cb1a",
"score": "0.5029833",
"text": "def summary; end",
"title": ""
},
{
"docid": "8cdd0454aeff5bba21ab4f1d7b30cb1a",
"score": "0.5029833",
"text": "def summary; end",
"title": ""
},
{
"docid": "8245d0e563a354df838fe92165272076",
"score": "0.5017263",
"text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Preview.Understand.IntentStatisticsInstance #{values}>\"\n end",
"title": ""
},
{
"docid": "a46aa5461ebcbab0fc91fdae1516c5f9",
"score": "0.5007976",
"text": "def cumulative_annotations\n @cumulative_annotations ||= {}\n end",
"title": ""
},
{
"docid": "874c3691f5d7e5500f6404593bad809e",
"score": "0.49982303",
"text": "def swagger \n critiq_rating + like_rating\n end",
"title": ""
},
{
"docid": "448f8baffbbdfb8492eef93dcbf08fef",
"score": "0.49933708",
"text": "def add_metadata(klass)\n super\n # Build the annotation metadata.\n klass.add_annotation_metadata(self)\n # Register the annotation class.\n annotation_classes << klass\n \n # TODO - uncomment and confirm that the test_biopsy_target works.\n # # Annotation classes are introspected, but the annotation constant is not set properly\n # # in the annotation module. This occurs sporadically, e.g. in the PSBIN migration_test\n # # test_biopsy_target test case the NewDiagnosisHealthAnnotation class is introspected\n # # but when subsequently referenced by the migrator, the NewDiagnosisHealthAnnotation\n # # class object id differs from the original class object id. However, the analogous\n # # test_surgery_target does not exhibit this defect.\n # #\n # # The cause of this bug is a complete mystery. The work-around is to get the constant.\n # # below. This is a seemingly unnecessary action to take, but was the most reasonable\n # # remedy. The const_get can only be done with annotation classes, and breaks\n # # non-annotation classes.\n # const_get(klass.name.demodulize)\n end",
"title": ""
},
{
"docid": "53279e6e827580b015f796f3ee3385f4",
"score": "0.4993349",
"text": "def aggregate\n #response = Result.collection.map_reduce(self.map_fn(), _reduce(), :raw => true, :out => {:inline => true}, :query => {:execution_id => id})\n response = Result.where(execution_id: id).map_reduce(self.map_fn(), self.query.reduce).out(inline: true).raw()\n results = response['results']\n if results\n self.aggregate_result = {}\n results.each do |result|\n result = prettify_generated_result(result) if self.query.generated? && result['value']['rereduced']\n self.aggregate_result[result['_id']] = result['value']\n end\n save!\n end\n end",
"title": ""
},
{
"docid": "dab67b88dd57fc59e9219200c62ce53c",
"score": "0.49889177",
"text": "def to_s\n annotations_hash.to_s\n end",
"title": ""
},
{
"docid": "9006e9d2617df290c6c2241566b16019",
"score": "0.49380824",
"text": "def gather_annotations(streams)\n raw_annotations = streams.keys.inject(Array.new) do |a, s|\n if s.type.name == \"/logger/Annotations\"\n a.concat(s.samples.enum_for(:raw_each).to_a)\n end\n a\n end\n raw_annotations.map(&:last).sort_by { |s| s.raw_time.microseconds }\n end",
"title": ""
},
{
"docid": "aeef8e21f282226c0f2f23b1e841a41e",
"score": "0.4927817",
"text": "def spreadsheet_annotation_search_fields\n annotations = []\n unless content_blob.nil?\n content_blob.worksheets.each do |ws|\n ws.cell_ranges.each do |cell_range|\n annotations = annotations | cell_range.annotations.collect{|a| a.value.text}\n end\n end\n end\n annotations\n end",
"title": ""
},
{
"docid": "4f93663bee64d9dd2efc458b7917d19f",
"score": "0.49239916",
"text": "def count_annotations_by(source_type_in)\n if source_type_in.nil? || source_type_in.casecmp('all').zero?\n annotations.count\n else\n annotations.where(source_type: source_type_in).count\n end\n end",
"title": ""
},
{
"docid": "82592b616104160e2d21ac42fcb87a68",
"score": "0.4911791",
"text": "def aggregates\n self.class.instance_variable_get(:@aggregates) || {}\n end",
"title": ""
},
{
"docid": "13628a7b25ca284e2a9fdd692f45f9ba",
"score": "0.49108928",
"text": "def index\n @annots = Annot.all\n end",
"title": ""
},
{
"docid": "897ea30235957b832442d4467c0777e5",
"score": "0.48970062",
"text": "def my_annotations_or_group_annotaitons\n if self.current_group_id == 0\n AnnotationCollection.where(originator_id: self.id)\n else\n AnnotationCollection.find_by_sql(\"SELECT * FROM annotation_collections AS a JOIN annotation_collections_groups AS g ON a.id = g.annotation_collection_id WHERE g.group_id = #{self.current_group_id} GROUP BY a.id;\")\n end\n end",
"title": ""
},
{
"docid": "e6e090734977ca3b3777e6ab36b84361",
"score": "0.48912784",
"text": "def statistics\n # sort the product by brand then label\n product_brands = @current_knowledge.products.collect do |p|\n b = p.get_value(\"brand\")\n b = b.first if b\n b ||= \"\"\n [p, b] \n end\n product_brands.sort! do |pb1, pb2|\n x = (pb1.last <=> pb2.last)\n x == 0 ? pb1.first.label <=> pb2.first.label : x\n end\n @products = product_brands.collect(&:first)\n @hash_product_opinions = Opinion.all().inject({}) do |h, opinion|\n opinion.product_ids.each do |opinion_product_id|\n (h[opinion_product_id] ||= []) << opinion\n end\n h\n end\n\n @hash_product_reviews = Review.all(:knowledge_id => @current_knowledge.id).inject({}) do |h, r|\n r.product_ids.each { |pid| ((h[pid] ||= {})[r.category] ||= []) << r }\n h\n end\n \n @opinions_classes = [Rating, Tip, Ranking, Comparator, Neutral]\n @review_categories = [\"amazon\", \"expert\"]\n\n @overall_dimension_id = @current_knowledge.dimension_root.id\n end",
"title": ""
},
{
"docid": "c0ce6e6eea787976822a165afb7b96df",
"score": "0.4889492",
"text": "def results\n @impacts.inspect\n end",
"title": ""
},
{
"docid": "0ebc7a0473f975ac96047a8523aa589a",
"score": "0.4881139",
"text": "def modeler_description\n return 'Reports resilience metric(s) of interest.'\n end",
"title": ""
},
{
"docid": "7769f89ac010ad65384deb217bd99819",
"score": "0.48798063",
"text": "def feedAllAnnoIds\n @annotation = Annotation.all\n allAnnoIds = CSV.generate do |csv|\n headers = \"annotation_id\"\n csv << [headers]\n @annotation.each do |annotation|\n csv << [annotation.annotation_id]\n end\n end\n respond_with do |format|\n format.json {render :text => allAnnoIds}\n format.text {render :text => allAnnoIds}\n end\n end",
"title": ""
},
{
"docid": "9a546e824abaab9e770729121fa48cfb",
"score": "0.48761466",
"text": "def spreadsheet_annotation_search_fields\n annotations = []\n if content_blob\n content_blob.worksheets.each do |ws|\n ws.cell_ranges.each do |cell_range|\n annotations |= cell_range.annotations.collect { |a| a.value.text }\n end\n end\n end\n annotations\n end",
"title": ""
},
{
"docid": "639090cf5bd0a1f8f78d928bcf40c16f",
"score": "0.4874587",
"text": "def print_results\r\n @cordinators.each do |c|\r\n print c.klass.to_s.ljust(25, ' ')\r\n c.print_stats\r\n end\r\n end",
"title": ""
},
{
"docid": "35914042be5b9b1e29d1dc184c702cbe",
"score": "0.48671898",
"text": "def index\n # visualization parameters\n @title = @annotation.name\n prepare_for_rendering\n end",
"title": ""
},
{
"docid": "b4b4ddac24f5b2b45e16711a276b037a",
"score": "0.4840781",
"text": "def add_aggregations\n add_collection_aggregation\n add_tag_aggregations\n end",
"title": ""
}
] |
21d72fd344f446ed9025a3b55e516318
|
The following methods are to unescape the direct upload url path
|
[
{
"docid": "d3717bd2e42b1ee2d3ea688a9fb491ae",
"score": "0.6340758",
"text": "def layout_upload_direct_upload_url=(escaped_url)\n write_attribute :layout_upload_direct_upload_url, self.unescape_url(escaped_url)\n end",
"title": ""
}
] |
[
{
"docid": "26569b6c5c4dd54e23b70bc2fc729bde",
"score": "0.7783842",
"text": "def unescape_path(s); end",
"title": ""
},
{
"docid": "26569b6c5c4dd54e23b70bc2fc729bde",
"score": "0.7783842",
"text": "def unescape_path(s); end",
"title": ""
},
{
"docid": "26569b6c5c4dd54e23b70bc2fc729bde",
"score": "0.7783842",
"text": "def unescape_path(s); end",
"title": ""
},
{
"docid": "26569b6c5c4dd54e23b70bc2fc729bde",
"score": "0.7783842",
"text": "def unescape_path(s); end",
"title": ""
},
{
"docid": "26569b6c5c4dd54e23b70bc2fc729bde",
"score": "0.7783842",
"text": "def unescape_path(s); end",
"title": ""
},
{
"docid": "26569b6c5c4dd54e23b70bc2fc729bde",
"score": "0.7783842",
"text": "def unescape_path(s); end",
"title": ""
},
{
"docid": "77826c6a5332d9d32c351804967adaf8",
"score": "0.7380695",
"text": "def filepath\n unescape_path url\n end",
"title": ""
},
{
"docid": "ef04805968774167266368ee50fcb5fe",
"score": "0.71417797",
"text": "def original_file_direct_upload_url=(escaped_url)\n write_attribute(:original_file_direct_upload_url, self.unescape_url(escaped_url))\n end",
"title": ""
},
{
"docid": "2d31595c28e776260f6da4d8a6eca3f7",
"score": "0.7088619",
"text": "def unescaped_path\n @unescaped_path ||= self.class.unescape_path path\n end",
"title": ""
},
{
"docid": "c3e1761ae5c4f142dcd41dd48165b674",
"score": "0.6922116",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, CGI.unescape(escaped_url))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "fcd5e502a1db855963623c3f00960db6",
"score": "0.6920877",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "e8c3d27435a1327dd99e56a2c9a86179",
"score": "0.6874301",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "e8c3d27435a1327dd99e56a2c9a86179",
"score": "0.6874301",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "e8c3d27435a1327dd99e56a2c9a86179",
"score": "0.6874301",
"text": "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "633c6f63903b7b9aba6bd5547081436d",
"score": "0.6799451",
"text": "def direct_upload_url=(escaped_url)\n\t\twrite_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end",
"title": ""
},
{
"docid": "dfce06d276a0ca8c39eb73b387737fa4",
"score": "0.67694265",
"text": "def normalize_path(url); end",
"title": ""
},
{
"docid": "dfce06d276a0ca8c39eb73b387737fa4",
"score": "0.6769362",
"text": "def normalize_path(url); end",
"title": ""
},
{
"docid": "dfce06d276a0ca8c39eb73b387737fa4",
"score": "0.6769362",
"text": "def normalize_path(url); end",
"title": ""
},
{
"docid": "7831ba0661be45c2543cf0e8ff15c3e9",
"score": "0.67323476",
"text": "def original_fullpath; end",
"title": ""
},
{
"docid": "dbf795aa2d32d7972aacc1638353738f",
"score": "0.6730681",
"text": "def abs_filepath\n unescape_path abs_url\n end",
"title": ""
},
{
"docid": "93be5aa101d25f42a5c367930db6c2f0",
"score": "0.6728888",
"text": "def sanitise_path(path)\n path.gsub(/\\/+/, \"/\")\nend",
"title": ""
},
{
"docid": "4ceb8e90c0584ce88e55a817e839252c",
"score": "0.66576713",
"text": "def escaped_url_path\n CGI.escape(self.url_path).gsub('%2F', '/')\n end",
"title": ""
},
{
"docid": "c2c1d3fc5079283c2944bdf840d6ffb1",
"score": "0.6654636",
"text": "def filename_for_url\n self.filename.gsub(/\\./, '_')\n end",
"title": ""
},
{
"docid": "5f25a562c0b1f2cafc9e414a27bdbb6b",
"score": "0.6653356",
"text": "def filename(options = {})\n return unless (file_url = url(options))\n CGI.unescape(file_url.split('?').first).gsub(/.*\\/(.*?$)/, '\\1')\n end",
"title": ""
},
{
"docid": "854655c1182894bbbb660df726bb65d8",
"score": "0.66421974",
"text": "def mixed_path(string)\n string.tr('\\\\', '/')\n end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.66134757",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.66134757",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.66134757",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.66134757",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.66134757",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.66134757",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "c57bd6b653696084047365a9e2d7b537",
"score": "0.6612968",
"text": "def file_url(uri)\n uri.gsub(/\\Afile:\\/\\//, '')\n end",
"title": ""
},
{
"docid": "71e21c869b6133eb17ea14392875ebb3",
"score": "0.6584383",
"text": "def normalize_file_path(path)\n # remove leading and trailing slashes and change any multiple slashes to single.\n return (path || '').gsub(\"\\\\\", '/').gsub(/^\\/+/, '').gsub(/\\/+$/, '').gsub(/\\/+/, '/')\n end",
"title": ""
},
{
"docid": "bba6eb2d2f0f73dc5ee378e091c32942",
"score": "0.6557292",
"text": "def normalized_path; end",
"title": ""
},
{
"docid": "bba6eb2d2f0f73dc5ee378e091c32942",
"score": "0.6557292",
"text": "def normalized_path; end",
"title": ""
},
{
"docid": "180ac03a65b05f4823a9ca93d6832d5d",
"score": "0.65548956",
"text": "def extract_path\n path = @request[:uri][:path].to_s\n if path[0] == \"/\" && path != \"/\"\n path = path[1..-1] \n end\n path.gsub(/%20/, \" \").strip\n end",
"title": ""
},
{
"docid": "0074d319cc13c84b9a64262ee9ee3376",
"score": "0.65238506",
"text": "def normalize_path(path)\n path.tr(\"\\\\\", \"/\")\n end",
"title": ""
},
{
"docid": "0074d319cc13c84b9a64262ee9ee3376",
"score": "0.65238506",
"text": "def normalize_path(path)\n path.tr(\"\\\\\", \"/\")\n end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.65151095",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.65151095",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.65151095",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.65151095",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.65151095",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.65151095",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "4a34e02824735634e97308ba8f4f1a3a",
"score": "0.65057176",
"text": "def normalized_path(file); end",
"title": ""
},
{
"docid": "db2340f23aeac4d4f1bca359b89f7d98",
"score": "0.64624614",
"text": "def unescape_slug_and_path\n self.slug = CGI::unescape(self.slug) unless self.slug.nil?\n self.full_path = CGI::unescape(self.full_path) unless self.full_path.nil?\n end",
"title": ""
},
{
"docid": "1a074f82f0c92eedcf2bc757b1ef293c",
"score": "0.64419687",
"text": "def url_for original\n (@wuala_dir + \"./#{original.path}\").cleanpath.to_s\n end",
"title": ""
},
{
"docid": "2dbc380cc6110c7ef4bc234af563b0d6",
"score": "0.6439613",
"text": "def clean_path(url)\n url = url.to_s\n url = url[0..1] == \"./\" ? url[2..-1] : url\n end",
"title": ""
},
{
"docid": "9ec644ffef13c41a0ee5071668ef1bdf",
"score": "0.6434576",
"text": "def normalize_uri; end",
"title": ""
},
{
"docid": "0bac76a7bf9378532305acdc75539df2",
"score": "0.6432977",
"text": "def real_path #:nodoc:\n real_path = Buildr::Util.win_os? && path =~ /^\\/[a-zA-Z]:\\// ? path[1..-1] : path\n URI.unescape(real_path)\n end",
"title": ""
},
{
"docid": "96ed086711b75de5ff6e0a964bfa2308",
"score": "0.6420881",
"text": "def unescaped_path_info\n @unescaped_path_info ||= self.class.unescape_path path_info\n end",
"title": ""
},
{
"docid": "43da1fa66df4a02ebf589c3985f940dc",
"score": "0.6416791",
"text": "def url_path\n path = self.path\n path = path.sub(/\\/[^\\/]+$/, '/') if path.include?('/')\n path\n end",
"title": ""
},
{
"docid": "8dacc1ea220d1b645efe21b53582d7e5",
"score": "0.64010864",
"text": "def get_url_for_path(path)\n \"file:#{path}\"\n end",
"title": ""
},
{
"docid": "da8c2600c61142f4498f890af674f254",
"score": "0.63925153",
"text": "def real_path; real_url.path end",
"title": ""
},
{
"docid": "d329b270ca9e784940284671cac09c92",
"score": "0.63729",
"text": "def to_unc_path(path, server_name)\n return nil if path.nil? || path.empty? || server_name.nil? || server_name.empty?\n path.gsub(/(\\p{L})+(:\\\\)/i) { \"\\\\\\\\#{server_name}\\\\#{Regexp.last_match(1)}$\\\\\" } # replace local paths with network paths\n end",
"title": ""
},
{
"docid": "d329b270ca9e784940284671cac09c92",
"score": "0.63729",
"text": "def to_unc_path(path, server_name)\n return nil if path.nil? || path.empty? || server_name.nil? || server_name.empty?\n path.gsub(/(\\p{L})+(:\\\\)/i) { \"\\\\\\\\#{server_name}\\\\#{Regexp.last_match(1)}$\\\\\" } # replace local paths with network paths\n end",
"title": ""
},
{
"docid": "31d16b8adaf831cf37e58b0ab0ac9533",
"score": "0.6369287",
"text": "def filename_from_path(path)\n filename = path.split(\"/\").last\n CGI.unescape(filename) if filename\n end",
"title": ""
},
{
"docid": "9357d6b4c5ad7b136a3caa0e691b51bb",
"score": "0.6368557",
"text": "def escape_path(path); end",
"title": ""
},
{
"docid": "f7a1a68307e30c5131257a3d8449915f",
"score": "0.63659275",
"text": "def split_file_uri(uri); end",
"title": ""
},
{
"docid": "f7a1a68307e30c5131257a3d8449915f",
"score": "0.63659275",
"text": "def split_file_uri(uri); end",
"title": ""
},
{
"docid": "5562fcf161284d8e0d3bcaff6d2300a2",
"score": "0.63616496",
"text": "def unescape_uri(uri); end",
"title": ""
},
{
"docid": "5e5b31d588a3c7b0686e5e1a8fa466ec",
"score": "0.63436645",
"text": "def rtmp_url(uri)\n result = uri.path.gsub(' ', '/')\n result[0] = ''\n if uri.query\n \"#{result}?#{uri.query}\"\n else\n result\n end\n end",
"title": ""
},
{
"docid": "c9ce945b60fcc4aba54bf522cc5f4dbc",
"score": "0.63433284",
"text": "def sanitize_as_filename\n self.gsub(/^.*(\\\\|\\/)/, '').transliterate.downcase.gsub(/[^a-z0-9\\. ]/, ' ').strip.gsub(/[ ]+/, '-')\n end",
"title": ""
},
{
"docid": "0dc40645cfbd296d7fc05c08a3897f32",
"score": "0.6339898",
"text": "def sanitize_filename(value)\n #get only the filename, not the whole path\n just_filename = value.gsub(/^.*(\\\\|\\/)/, '')\n #NOTE: File.basename doesn't work right with Windows paths on Unix\n #INCORRECT: just_filename = File.basename(value.gsub('\\\\\\\\', '/')) \n #replace all none alphanumeric, underscore or periods with underscore\n just_filename.gsub(/[^\\w\\.\\-]/,'_') \n end",
"title": ""
},
{
"docid": "8d7b37b156ed5736b461f397a1b94289",
"score": "0.633959",
"text": "def sanitize_filename(path)\n return if path.nil?\n\n # we do not filter :, backslash and forward slash, since they are part of the path\n @spath = path.gsub(/[<>\"|?*]/, \"\")\n end",
"title": ""
},
{
"docid": "2f4e03c030f524cb637d7a65f319a0a2",
"score": "0.63304096",
"text": "def filenameize(path)\n path.gsub!(/www.|^(http:\\/\\/|\\/|C:\\\\)/, '')\n path.gsub(/[^0-9A-Za-z.]/, '_') \n end",
"title": ""
},
{
"docid": "d1559415c61b58ae4422911408c90657",
"score": "0.6285934",
"text": "def sanitizeFilePath(path)\n path = path.gsub(/[^-a-z A-Z0-9_.\\/]/, '_').split(\"/\").map { |part|\n part.sub(/^\\.+/, '_').sub(/\\.+$/, '_')\n }.join('/')\nend",
"title": ""
},
{
"docid": "de8be92bca63c458e4dfa5efd44f75f2",
"score": "0.6264971",
"text": "def normalize_path path\n path.gsub ::Regexp.union(/\\\\+/, /\\/+/, *PATH_MODIFIERS), '/'\n end",
"title": ""
},
{
"docid": "de8be92bca63c458e4dfa5efd44f75f2",
"score": "0.6264971",
"text": "def normalize_path path\n path.gsub ::Regexp.union(/\\\\+/, /\\/+/, *PATH_MODIFIERS), '/'\n end",
"title": ""
},
{
"docid": "3d420fd51b70178c7565921e504b5db4",
"score": "0.6244723",
"text": "def file_url\n url\n end",
"title": ""
},
{
"docid": "03f04fbdcd370e3266fd62ec07fcb73a",
"score": "0.62407196",
"text": "def quotepath s\n\t\t\ts = s.strip\n\t\t\ts = \"\\\"#{s}\\\"\" if s =~ /^([\\/*.])|((http|https|ftp):)/\n\t\t\ts\n\t\tend",
"title": ""
},
{
"docid": "1c3059ee28780e7b66c28dbbd1f0ed39",
"score": "0.62275445",
"text": "def contract_direct_upload_url=(escaped_url)\n write_attribute(:contract_direct_upload_url, self.unescape_url(escaped_url))\n end",
"title": ""
},
{
"docid": "f8cb37ec7ff23b4ea5e56862b8228df5",
"score": "0.62066877",
"text": "def clean_url_path(url)\n url.gsub(/\\/?<sub>\\/?/, \"\")\n end",
"title": ""
},
{
"docid": "1b2736b54856a2cb1ebfd669fe65030d",
"score": "0.6205816",
"text": "def filepath\n Addressable::URI.unescape(id.sub(/\\A\\//, '')).to_s # Remove initial / and decode %20 etc.\n end",
"title": ""
},
{
"docid": "1b2736b54856a2cb1ebfd669fe65030d",
"score": "0.6205816",
"text": "def filepath\n Addressable::URI.unescape(id.sub(/\\A\\//, '')).to_s # Remove initial / and decode %20 etc.\n end",
"title": ""
},
{
"docid": "d86bfb59d0f2dfb0ccda428c3116aec3",
"score": "0.6201339",
"text": "def clean_filename(filename=nil)\n if filename.nil?\n uparts = URI.parse(self.imgurl)\n while uparts.path.match(/%25/)\n uparts.path.gsub!(/%25/,'%')\n end\n filename = File.basename(URI.decode(uparts.path))\n end\n filename.gsub!(/(jpe?g|png|gif).*$/,'\\1')\n filename.gsub!(/[^[:alnum:].]+/,'')\n File.join(@options[:path],filename)\n end",
"title": ""
},
{
"docid": "c736153050401131d3e5c09fc7fba61c",
"score": "0.6189566",
"text": "def filename_short\n self.file.to_s.split('/')[-1] #from file.name full URL name to loremipsum.pdf\n end",
"title": ""
},
{
"docid": "ff7a99113080c2b5ce9cbc6ba852d585",
"score": "0.6187021",
"text": "def raw_cover_direct_upload_url=(escaped_url)\n write_attribute :raw_cover_direct_upload_url, self.unescape_url(escaped_url)\n end",
"title": ""
},
{
"docid": "c429ecb2e9b4f0b124020c1bafd21f4a",
"score": "0.6182021",
"text": "def normalize_path(path)\n n_path = path.dup\n # xyz/./abc => xyz/abc\n n_path.gsub!('/\\./', '/')\n # xyz/../abc => abc\n n_path.gsub!(%r|[^/]+/\\.\\./|, '')\n # xyz/. => xyz/\n n_path.sub!( %r|/\\.$|, '/')\n\n # illegal filespec \n if %r|^\\.\\.| =~ n_path\n ## raise HTTPBadRequest,\n\t## \"recieve illegal name `#{path}'\\n\"\n n_path.sub!(%r|^(\\.\\.)+|, '/')\n end\n n_path\n end",
"title": ""
},
{
"docid": "2b6e530d6fb5d7bb920be3af4d521280",
"score": "0.61803687",
"text": "def get_file_uri_path(uri)\n uri.sub(%r{\\Afile://}, '')\n end",
"title": ""
},
{
"docid": "adcb337ae87231ce36aa53d823d3d684",
"score": "0.61726904",
"text": "def pdf_direct_upload_url=(escaped_url)\n write_attribute(:pdf_direct_upload_url, self.unescape_url(escaped_url))\n end",
"title": ""
},
{
"docid": "860502c1465e24a9596b2ff5e66022f5",
"score": "0.6164939",
"text": "def upload_url\n upload_url_response['p']\n end",
"title": ""
},
{
"docid": "4393476106ad638d8937164c479ac9e6",
"score": "0.61606413",
"text": "def build_url(absolute_path)\n absolute_path.gsub(self.fs_path, '').gsub(/^\\//, '').downcase\n end",
"title": ""
},
{
"docid": "59437cac06ebd10508792b6001dac2d1",
"score": "0.6149497",
"text": "def path_in_zip(path)\n [ source_epub.prefix, CGI.unescape(path) ].join('/')\n end",
"title": ""
},
{
"docid": "0542747cfaa35dcfb8cb36270cb6e61e",
"score": "0.6147365",
"text": "def get_web_path(path)\n path.sub( $config['upload_path'], \"#{$config['static_url']}/uploads\")\n end",
"title": ""
},
{
"docid": "bc0521ac5088940952ed01b5f0ca95cf",
"score": "0.61392814",
"text": "def file_name_formater\r\n host = URI.parse($uri.to_s).host\r\n host\r\nend",
"title": ""
},
{
"docid": "5236c657533bb633f71f30a57d40dfa5",
"score": "0.61358106",
"text": "def get_url_path\n # return @parsed_url.path.rstrip('/')\n return @parsed_url.path.rtrim!(\"/\") || @parsed_url.path\n end",
"title": ""
},
{
"docid": "0787e21e04e6a998bff57d0675b08dcf",
"score": "0.6130163",
"text": "def file_path path_style\n path = []\n path << \"/#{@bucket_name}\" if path_style\n path << \"/#{String(@file_name)}\" if @file_name && !@file_name.empty?\n CGI.escape(path.join).gsub(\"%2F\", \"/\").gsub \"+\", \"%20\"\n end",
"title": ""
},
{
"docid": "dc82b11481f2f703c9c0394322f19136",
"score": "0.612256",
"text": "def parse_path; BLANK_STR; end",
"title": ""
},
{
"docid": "a5cd195c5bb87fd0fc9cf52b0d26a2d2",
"score": "0.60996246",
"text": "def sanitize_file_path(entry)\n parts = entry.name.split(File::SEPARATOR)\n parts.shift\n parts.join(File::SEPARATOR)\n end",
"title": ""
},
{
"docid": "3221a7ff84f202c2a1b3e9f2bb31557f",
"score": "0.6089834",
"text": "def upload_path_for(file_path, segment)\n \"%s/%s/%s/%08d\" % (file_info(file_path) << segment)\n end",
"title": ""
}
] |
665830f9c2d366748e13b763121e5ecb
|
Called when a new Regional is created
|
[
{
"docid": "54f76e8864fe7d813e2d9a176207a373",
"score": "0.0",
"text": "def initialize(regional_x, regional_y)\n @coordinates = { x: regional_x, y: regional_y }\n end",
"title": ""
}
] |
[
{
"docid": "5d19805557847f51c5c2b89177e51316",
"score": "0.70779437",
"text": "def create\n @breadcrumb = 'create'\n @region = Region.new(params[:region])\n @region.created_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: crud_notice('created', @region) }\n format.json { render json: @region, status: :created, location: @region }\n else\n @countries = Country.order(:name)\n format.html { render action: \"new\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e9a0f2e43dc8283bd0aa16245fa1656",
"score": "0.7002588",
"text": "def create_region(attributes)\n \n unless attributes[:source_data_set_id]\n attributes[:source_data_set_id] = attributes[:source_data_set] && attributes[:source_data_set].id || nil\n end\n \n attributes[:category] ||= attributes[:category_id] \n attributes[:category] = attributes[:category].id if attributes[:category].kind_of? PublicEarth::Db::Category\n \n place = new(one.create_region(\n nil, \n attributes[:name], \n attributes[:region_vertexes] || nil, \n attributes[:original_id], \n attributes[:original_uri], \n attributes[:priority],\n attributes[:category],\n attributes[:source_data_set_id],\n attributes[:is_visible] || true\n ))\n \n place.created = 'region'\n \n # Create the name attribute...\n place.details.from attributes[:source_data_set_id]\n place.details.name = attributes[:name]\n place.details.save\n \n place\n end",
"title": ""
},
{
"docid": "f0dffb9bf302e2b5515abdc8e3bc526c",
"score": "0.6937855",
"text": "def create\n @regional = Regional.new(params[:regional])\n\n respond_to do |format|\n if @regional.save\n format.html { redirect_to @regional, notice: 'Regional was successfully created.' }\n format.json { render json: @regional, status: :created, location: @regional }\n else\n format.html { render action: \"new\" }\n format.json { render json: @regional.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90c1474b189a31b347ab79e259ced9e9",
"score": "0.6926191",
"text": "def create\n @regional = Regional.new(regional_params)\n\n respond_to do |format|\n if @regional.save\n format.html { redirect_to @regional, notice: 'Regional was successfully created.' }\n format.json { render :show, status: :created, location: @regional }\n else\n format.html { render :new }\n format.json { render json: @regional.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa92b2e7483664808e2895f9a8d17376",
"score": "0.68481463",
"text": "def set_newregion\n @newregion = Newregion.find(params[:id])\n end",
"title": ""
},
{
"docid": "336cb46785908240aea34e25e04b0973",
"score": "0.6807006",
"text": "def create\n\t\tauthorize! :create, Regional\n @regional = Regional.new(regional_params)\n respond_to do |format|\n if @regional.save\n\t\t\t\tsesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n\t\t\t\tTransaccion.create!(\n \t\t\t\tdescripcion: \"Creación de la Regional #{@regional.attributes}\",\n \t\t\t\tsesion_id: sesion.id\n\t\t\t\t)\n format.html { redirect_to @regional, notice: 'Regional was successfully created.' }\n format.json { render :show, status: :created, location: @regional }\n else\n format.html { render :new }\n format.json { render json: @regional.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e06fa37e0ac7a68323c4c72e1b3e6da",
"score": "0.6774053",
"text": "def set_regional\n @regional = Regional.find(params[:id])\n end",
"title": ""
},
{
"docid": "9e06fa37e0ac7a68323c4c72e1b3e6da",
"score": "0.6774053",
"text": "def set_regional\n @regional = Regional.find(params[:id])\n end",
"title": ""
},
{
"docid": "3fd25a7453047620cef1125b4e31c7c3",
"score": "0.6756636",
"text": "def create\n @region = Region.new(region_params)\n\n if @region.save\n render :show, status: :created\n else\n render json: @region.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bbda4d412ca056118b5d963ee5cf7a76",
"score": "0.66800404",
"text": "def create\n @region = Region.new(region_params)\n\n if @region.save\n render :show, status: :created, location: @region\n else\n render json: @region.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "af1e32dfe1754fde2e1ba1aadaefc8cc",
"score": "0.6673078",
"text": "def initialize(region)\n @region = region\n end",
"title": ""
},
{
"docid": "e825f6b174b1af847cb6c807a0d0f56a",
"score": "0.6665255",
"text": "def new\n @regional = Regional.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @regional }\n end\n end",
"title": ""
},
{
"docid": "47278e74529cdbf12d2527f5ce3e0855",
"score": "0.6638593",
"text": "def create\n @region = Region.new(region_param)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render json: @region, status: :created, location: @region }\n else\n format.html { render action: \"new\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "257b92b303bd9b056e648b3bfb590d59",
"score": "0.66174287",
"text": "def create\n @admin_region = Admin::Region.new(admin_region_params)\n\n respond_to do |format|\n if @admin_region.save\n format.html { redirect_to @admin_region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @admin_region }\n else\n format.html { render :new }\n format.json { render json: @admin_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "257b92b303bd9b056e648b3bfb590d59",
"score": "0.66174287",
"text": "def create\n @admin_region = Admin::Region.new(admin_region_params)\n\n respond_to do |format|\n if @admin_region.save\n format.html { redirect_to @admin_region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @admin_region }\n else\n format.html { render :new }\n format.json { render json: @admin_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "590a0ed0fd10ca6dc5a4ecc87ce648c3",
"score": "0.66051245",
"text": "def region\n #custom_region || region && region.name\n UsRegion.new(region_id)\n end",
"title": ""
},
{
"docid": "2cbc7d68956510549ac2c45e7bee9cfa",
"score": "0.6592328",
"text": "def create\n @title = t 'view.regions.new_title'\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: t('view.regions.correctly_created') }\n format.json { render json: @region, status: :created, location: @region }\n else\n format.html { render action: 'new' }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3288de9c8d715a241a017d928d0b910e",
"score": "0.65574837",
"text": "def create\n @map_region = Map::Region.new(params[:map_region])\n\n respond_to do |format|\n if @map_region.save\n format.html { redirect_to @map_region, notice: 'Region was successfully created.' }\n format.json { render json: @map_region, status: :created, location: @map_region }\n else\n format.html { render action: \"new\" }\n format.json { render json: @map_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "837a8a06c9a2a0a494a5d5bb13666dc5",
"score": "0.65522814",
"text": "def create\n @region = Region.new(params[:region])\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render json: @region, status: :created, location: @region }\n else\n format.html { render action: \"new\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "693c15fd45fed97427009463420c88c0",
"score": "0.65476066",
"text": "def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region creada exitosamente.' }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3b914fe574f03651860f922e1084b42",
"score": "0.6520184",
"text": "def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3b914fe574f03651860f922e1084b42",
"score": "0.6520184",
"text": "def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3b914fe574f03651860f922e1084b42",
"score": "0.6520184",
"text": "def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3b914fe574f03651860f922e1084b42",
"score": "0.6520184",
"text": "def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3b914fe574f03651860f922e1084b42",
"score": "0.6520184",
"text": "def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b8d47dd9e947486ab900e256e5decb4d",
"score": "0.6496688",
"text": "def create\n @region = Irm::Region.new(params[:irm_region])\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to({:action=>\"index\"},:notice => (t :successfully_created))}\n format.xml { render :xml => @region, :status => :created, :location => @region }\n else\n @error = @region\n format.html { render \"new\" }\n format.xml { render :xml => @region.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d60f3659bf490a611208067e1cf8edf3",
"score": "0.6471822",
"text": "def create\n @newregion = Newregion.new(newregion_params)\n\n respond_to do |format|\n if @newregion.save\n format.html { redirect_to @newregion, notice: 'Newregion was successfully created.' }\n format.json { render :show, status: :created, location: @newregion }\n else\n format.html { render :new }\n format.json { render json: @newregion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "305ae028e0eee8f02e3dedb9ef3d4965",
"score": "0.6457353",
"text": "def create\n begin\n us_region = UsRegion.new(params.require(:us_region).permit(:name))\n if us_region.save\n @us_rep_region.us_region = us_region\n end\n rescue\n # probably didn't have a form that can provide a new region\n end\n respond_to do |format|\n if @us_rep_region.save!\n format.html { redirect_to([:admin, @us_rep_region.us_rep], notice: 'US Rep Region was successfully created.') }\n format.xml { render xml: @us_rep_region, status: :created, location: @us_rep_region }\n format.js\n website.add_log(user: current_user, action: \"Created US Rep Region #{@us_rep_region.us_rep.name}, #{@us_rep_region.us_region.name}\")\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @us_rep_region.errors, status: :unprocessable_entity }\n format.js { render template: \"admin/us_rep_regions/create_error\" }\n end\n end\n end",
"title": ""
},
{
"docid": "f76b3cc64d17e4abce8b2d81faafa62d",
"score": "0.6423472",
"text": "def new\n @breadcrumb = 'create'\n @region = Region.new\n @countries = Country.order(:name)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @region }\n end\n end",
"title": ""
},
{
"docid": "c02283ad835a389a700100e8635a6007",
"score": "0.64172",
"text": "def create\n @uip_region = UipRegion.new(params[:uip_region])\n\n if @uip_region.save\n render json: @uip_region, status: :created, location: @uip_region\n else\n render json: @uip_region.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8f7eef8f86d1822ccc66b2fc121cbccc",
"score": "0.64071995",
"text": "def create\n do_new_resource\n do_set_attributes(region_params)\n get_project_if_exists\n do_authorize_instance\n\n if @region.save\n if @project.nil?\n respond_create_success(shallow_region_path(@region))\n else\n respond_create_success(project_region_path(@project, @region))\n end\n else\n respond_change_fail\n end\n end",
"title": ""
},
{
"docid": "fa8372e1a38e56812276b7e5a5465b7a",
"score": "0.63925904",
"text": "def create\n @canal_regional = CanalRegional.new(canal_regional_params)\n\n respond_to do |format|\n if @canal_regional.save\n format.html { redirect_to @canal_regional, notice: 'Canal regional was successfully created.' }\n format.json { render :show, status: :created, location: @canal_regional }\n else\n format.html { render :new }\n format.json { render json: @canal_regional.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cda63cabed3e174c4d1d0b14967ca725",
"score": "0.63795733",
"text": "def create\n @region = Region.new(region_params)\n if \"a\" == \"a\"\n if @region.save\n redirect_to \"/#{@region.state.slug}\"\n end\n else\n redirect_to root_path\n flash[:alert] = \"You are not authorized to do that, BRO.\"\n end\n end",
"title": ""
},
{
"docid": "e624307cd8c978e2beceb5d7a6559f1f",
"score": "0.6357501",
"text": "def new\n @map_region = Map::Region.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @map_region }\n end\n end",
"title": ""
},
{
"docid": "bcc6bd054d723fea4ad9e28035055e2b",
"score": "0.6320665",
"text": "def create\n @tipo_region = TipoRegion.new(tipo_region_params)\n\n respond_to do |format|\n if @tipo_region.save\n format.html { redirect_to @tipo_region, notice: 'Tipo region was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tipo_region }\n else\n format.html { render action: 'new' }\n format.json { render json: @tipo_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54f5e0699f98afd20d072b408b814abd",
"score": "0.6293571",
"text": "def create\n @regions = Region.all\n @region = Region.create(region_params)\n\n @states = State.all.order(:state_name)\n end",
"title": ""
},
{
"docid": "6df78616281b6850fcb24d6338daae57",
"score": "0.62919074",
"text": "def create\n @administrative_region = AdministrativeRegion.new(administrative_region_params)\n\n respond_to do |format|\n if @administrative_region.save\n format.html { redirect_to @administrative_region, notice: 'Administrative region was successfully created.' }\n format.json { render :show, status: :created, location: @administrative_region }\n else\n format.html { render :new }\n format.json { render json: @administrative_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4609b4708e903d3c92d52e3c9ed37bc0",
"score": "0.6251276",
"text": "def new\n @title = t 'view.regions.new_title'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @region }\n end\n end",
"title": ""
},
{
"docid": "94e8f1ea88f352b80c849ac47f40e0aa",
"score": "0.6247884",
"text": "def create\n @region.attributes = params[:region]\n respond_to do |format|\n if @region.save\n flash[:notice] = 'Region was successfully created.'\n format.html { redirect_to([:admin, @region]) }\n format.xml { render :xml => @region, \n :status => :created, :location => @region }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @region.errors, \n :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de961f2a8d7f5ad6de77031964424d52",
"score": "0.6245282",
"text": "def new\n @region = Region.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @region }\n end\n end",
"title": ""
},
{
"docid": "de961f2a8d7f5ad6de77031964424d52",
"score": "0.6245282",
"text": "def new\n @region = Region.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @region }\n end\n end",
"title": ""
},
{
"docid": "3634f1d789ec2d9382709e76542f95d0",
"score": "0.6239341",
"text": "def create\n @major_region = MajorRegion.new(major_region_params)\n @major_region.user_id = current_user.id\n\n respond_to do |format|\n if @major_region.save\n format.html { redirect_to @major_region, notice: 'Major region was successfully created.' }\n format.json { render :show, status: :created, location: @major_region }\n else\n format.html { render :new }\n format.json { render json: @major_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0abc505224b1fd077549bf796d688723",
"score": "0.6231636",
"text": "def create\n @regional = Regional.new(params[:regional])\n @branch = Cabang.get_id\n @brand = Merk.all\n\n respond_to do |format|\n if @regional.save\n format.html { redirect_to @regional, notice: 'Regional was successfully created.' }\n format.json { render json: @regional, status: :created, location: @regional }\n else\n format.html { render action: \"new\" }\n format.json { render json: @regional.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cdb49a894634cc4eeb1dfbf07fce057f",
"score": "0.6214675",
"text": "def set_region\n @region = Region.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "d2bf7bfa028452cf092b1fa359b67663",
"score": "0.62123793",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "4fc05682126fe4651ad008bae9a941f4",
"score": "0.620775",
"text": "def create\n @regione = Regione.new(params[:regione])\n\n respond_to do |format|\n if @regione.save\n format.html { redirect_to new_regione_url, notice: 'Regione was successfully created.' }\n format.json { render json: @regione, status: :created, location: @regione }\n else\n format.html { render action: \"new\" }\n format.json { render json: @regione.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "359b28b5a4c8b7a65387622975edfe8d",
"score": "0.6186587",
"text": "def new\n @region = Irm::Region.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @region }\n end\n end",
"title": ""
},
{
"docid": "720dfb6cf555ac0e97faabfaee3adb97",
"score": "0.6185524",
"text": "def initialize(region_name, region_url)\n\t\t@region_name = region_name\n\t\t@region_url = region_url\n\t\t@@all << self\n\tend",
"title": ""
},
{
"docid": "14d1893cd39b5ba9728f81bb4d3f0bd8",
"score": "0.61657006",
"text": "def create\n @lab_region = LabRegion.new(lab_region_params)\n\n respond_to do |format|\n if @lab_region.save\n format.html { redirect_to @lab_region, notice: 'Lab region was successfully created.' }\n format.json { render :show, status: :created, location: @lab_region }\n else\n format.html { render :new }\n format.json { render json: @lab_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d353d5c70dfd43b7c15cc28f65abebf",
"score": "0.61561036",
"text": "def create\n @conservedregion = Conservedregion.new(conservedregion_params)\n\n respond_to do |format|\n if @conservedregion.save\n format.html { redirect_to @conservedregion, notice: 'Conservedregion was successfully created.' }\n format.json { render :show, status: :created, location: @conservedregion }\n else\n format.html { render :new }\n format.json { render json: @conservedregion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bfb06279e27848d15ae13b186fef11d",
"score": "0.61485785",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "3eb12de75bcc28498b4848cd0b959db3",
"score": "0.613926",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "3eb12de75bcc28498b4848cd0b959db3",
"score": "0.613926",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "ec6ad84319e9a5ed85b6e0049912c5a2",
"score": "0.61324316",
"text": "def createregion\n region_name = params[\"regionName\"]\n region_active = params[\"active\"] == \"true\"\n @carrierRegions = []\n if session[:carrier]\n soap_client = MyFreightWorldCarrier.new\n @carrierRegions = soap_client.createRegion(session[:carrier][\"token\"], region_name, region_active)\n end\n\n render :json => @carrierRegions\n end",
"title": ""
},
{
"docid": "309387a682aa672ab6627ad4ce3194a6",
"score": "0.61223346",
"text": "def new\n logger.debug \"** ORGANISATION NEW **\"\n @organisation = Organisation.new\n setup_organisation\n end",
"title": ""
},
{
"docid": "2e472591bf9926c05244a01a214f08b5",
"score": "0.61178243",
"text": "def create\n @region = @object.new(region_params)\n @region.acl = nil\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to region_path(@region.objectId), notice: \"Region was successfully created.\" }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1aa1789fcdcf86299ba6a284158a3692",
"score": "0.61137766",
"text": "def create\n @map_region = MapRegion.new(params[:map_region])\n\n respond_to do |format|\n if @map_region.save\n format.html { redirect_to(admin_yandex_maps_path, :notice => 'Map region was successfully created.') }\n format.xml { render :xml => @map_region, :status => :created, :location => @map_region }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @map_region.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40689e939a249b2e12d08743eed01e80",
"score": "0.6111563",
"text": "def create_regions\n template.region_templates.each do |t|\n region = Region.create!(:region_template => t, :world => self)\n end\n end",
"title": ""
},
{
"docid": "5f934b045f0a0bfb3fe97f2fac1f7eae",
"score": "0.60964453",
"text": "def create\n if params[:id]\n @region = Region.find(params[:id])\n @region.name =params[:name];\n @region.status =1;\n @region.createdOn = Time.now.getutc;\n if @region.save\n render :json => @region\n else\n render :json => @region.errors.full_messages, status: :unprocessable_entity\n end\n else\n @region = Region.new\n @region.name =params[:region_name];\n @region.status =1;\n @region.createdOn = Time.now.getutc;\n if @region.save\n render :json => @region\n else\n render :json => @region.errors.full_messages, status: :unprocessable_entity\n end\n end \n end",
"title": ""
},
{
"docid": "c3b6e075e2f1989f9d71701ce5b4f9b1",
"score": "0.6090162",
"text": "def set_region_lethality\n @region_lethality = RegionLethality.find(params[:id])\n end",
"title": ""
},
{
"docid": "cefd2cb6706af79816b56e2c0fa93fa4",
"score": "0.6084744",
"text": "def create\n @regiontype = Regiontype.new(params[:regiontype])\n\n respond_to do |format|\n if @regiontype.save\n format.html { redirect_to @regiontype, notice: 'Regiontype was successfully created.' }\n format.json { render json: @regiontype, status: :created, location: @regiontype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @regiontype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4a907c954186c6d41745a35eb2a4c3e",
"score": "0.6081492",
"text": "def set_region\n @region = Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "2a3fe6623453d460002c3738104df2c0",
"score": "0.6064186",
"text": "def new\n @subregion = Subregion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subregion }\n end\n end",
"title": ""
},
{
"docid": "98e4e8c510f6d2fcabf9c876b6f3e14f",
"score": "0.60615444",
"text": "def new\n @region = Region.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js\n format.json { render json: @region }\n end\n end",
"title": ""
},
{
"docid": "e2262d70252ab42649ae67bbe1f84ae2",
"score": "0.6053669",
"text": "def create\n x = RegionalProsecution.all.pluck(:id).sort[-1] + 1\n @regional_prosecution = RegionalProsecution.new(id: x, name: admin_regional_prosecution_params[\"name\"], region: admin_regional_prosecution_params[\"region\"].to_i)\n respond_to do |format|\n if @regional_prosecution.save\n format.html { redirect_to admin_regional_prosecutions_path, notice: 'Fiscalía Regional ha sido creada con éxito.' }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "d9a765032efb3bba99e10da57ae7f52b",
"score": "0.60360706",
"text": "def create\n @target_region = TargetRegion.new(params[:target_region])\n\n respond_to do |format|\n if @target_region.save\n flash[:notice] = 'TargetRegion was successfully created.'\n format.html { redirect_to(@target_region) }\n format.xml { render :xml => @target_region, :status => :created, :location => @target_region }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @target_region.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e394fc979c6c7e9be78370264ce0256",
"score": "0.60355484",
"text": "def create\n @region = Region.new(region_params)\n upsert_trigger(@region)\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62e4568fee4cb3496f5a575ece06ea0e",
"score": "0.6033028",
"text": "def new\n @map_region = MapRegion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @map_region }\n end\n end",
"title": ""
},
{
"docid": "745c11dc6984ee0675b7120ed63f0f37",
"score": "0.60160494",
"text": "def create\n @subregion = Subregion.new(params[:subregion])\n\n respond_to do |format|\n if @subregion.save\n format.html { redirect_to @subregion, notice: 'Registro creado satisfactoriamente.' }\n format.json { render json: @subregion, status: :created, location: @subregion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subregion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9bfa4bfdc2173ada1b66d6d352d33d38",
"score": "0.600779",
"text": "def create\n respond_to do |format|\n if @us_region.save\n format.html { redirect_to(admin_us_reps_url, notice: 'US Region was successfully created.') }\n format.xml { render xml: @us_region, status: :created, location: @us_region }\n website.add_log(user: current_user, action: \"Created US Region #{@us_region.name}\")\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @us_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efc9016b98610f9e041b28291fa298b6",
"score": "0.6002229",
"text": "def create\n @region_lethality = RegionLethality.new(region_lethality_params)\n\n respond_to do |format|\n if @region_lethality.save\n format.html { redirect_to region_lethalities_path, notice: 'Region lethality was successfully created.' }\n else\n format.html { render action: 'new' }\n format.json { render json: @region_lethality.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db5e72c73c8727e2f685ff5af8dfe30a",
"score": "0.600194",
"text": "def new\n @region = Region.new\n\n # A study to redirect to afterwards\n if (!params[:study_id].nil?)\n @study = Study.find(params[:study_id])\n end\n if (!params[:region_set_id].nil?)\n @region_set = RegionSet.find(params[:region_set_id])\n end\n\n # Whether or not to automatically create a region_set containing this region\n @create_set = params[:create_set]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @region }\n end\n end",
"title": ""
},
{
"docid": "a6db143b106c3677d0ba41097a600801",
"score": "0.5997081",
"text": "def create\n init = params[:region][:name][0]\n region_number = Region.create_number(params)\n @region = Region.new(region_params)\n if @region.save\n flash[:notice] = 'Warna berhasil ditambahkan'\n redirect_to regions_path\n else\n flash[:error] = @region.errors.full_messages.join('<br/>')\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "eb29b3b698cac0185e465d8f0a291562",
"score": "0.5996245",
"text": "def create\n @regione = Regione.new(params[:regione])\n\n respond_to do |format|\n if @regione.save\n format.html { redirect_to(@regione, :notice => 'Regione was successfully created.') }\n format.xml { render :xml => @regione, :status => :created, :location => @regione }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @regione.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c439fc6db5b4c67b16a090e7158a1dec",
"score": "0.597789",
"text": "def set_regional_profile\n @regional_profile = RegionalProfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d1ad94c8693e92dc573195c39f01a57",
"score": "0.59670794",
"text": "def create\n @breadcrumb = 'create'\n @province = Province.new(params[:province])\n @province.created_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @province.save\n format.html { redirect_to @province, notice: crud_notice('created', @province) }\n format.json { render json: @province, status: :created, location: @province }\n else\n @regions = Region.order(:name)\n format.html { render action: \"new\" }\n format.json { render json: @province.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e42f77bdf2f97adcace780e1ce9b4505",
"score": "0.5957807",
"text": "def create\n @nombr_regione = NombreRegion.new(nombr_regione_params)\n\n respond_to do |format|\n if @nombr_regione.save\n format.html { redirect_to @nombr_regione, notice: 'Nombre region was successfully created.' }\n format.json { render action: 'show', status: :created, location: @nombr_regione }\n else\n format.html { render action: 'new' }\n format.json { render json: @nombr_regione.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81a5a1c9d4d7d2761cf66ebb9a649105",
"score": "0.59407777",
"text": "def create\n @region = Region.new(params[:region])\n @region.user_id = current_user.id\n\n # security - load a study if one has been passed in\n if params[:study_id]\n @study = Study.find(params[:study_id])\n unless current_user.admin || (@study.user == current_user)\n return trigger_403('You cannot add a region to this study')\n end\n\n # If someone is an admin, create with the owner of the study\n if current_user.admin\n @region.user_id = @study.user_id\n end\n end\n\n # security - load a region_set if one has been passed in\n if params[:region_set_id]\n @region_set = RegionSet.find(params[:region_set_id])\n unless current_user.admin || (@region_set.user == current_user)\n return trigger_403('You cannot add a region to this region_set')\n end\n end\n\n # attempt to save the region\n if @region.save()\n\n # add locations to region\n if (!params[:points].empty?)\n points = params[:points].scan /([\\d.-]+)[^\\d.-]+([\\d.-]+)/\n points.each do |point|\n l = Location.new()\n l.region_id = @region.id\n l.latitude = point[0].to_f\n l.longitude = point[1].to_f\n l.heading = rand(360)\n l.pitch = 0\n l.save()\n end\n end\n\n # If the create set flag is set, we need to create a region_set\n if params[:create_set]\n\n # create and save the region set\n @region_set = RegionSet.new()\n if @study\n # name the imageset after the study if possible\n @region_set.name = @study.name + ' Image Set'\n @region_set.description = 'This is image set was created specifically for the study \"' + @study.name + '\"'\n else\n # use region name as backup\n @region_set.name = @region.name + ' Image Set'\n @region_set.description = 'This is image set was created specifically for the region \"' + @region.name + '\"'\n end\n @region_set.user_id = current_user.id\n @region_set.save()\n\n # add the region set to the study\n if @study\n @study.region_set_id = @region_set.id\n @study.save()\n end\n end\n\n # if a region set exists, tie this new region to it\n if @region_set\n @rsm = RegionSetMembership.new()\n @rsm.region_set_id = @region_set.id\n @rsm.region_id = @region.id\n @rsm.save()\n end\n\n end\n\n\n respond_to do |format|\n if !@region.valid?\n\n # Whether or not to automatically create a region_set containing this region\n @create_set = params[:create_set]\n format.html { render action: \"new\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n else\n\n if @study\n if params[:add_another] == 'true'\n # should go back to this page without create_set flag\n format.html {\n redirect_to url_for(\n :controller => \"regions\",\n :action => \"new\",\n ) + '?study_id='+ @study.id.to_s() + '®ion_set_id=' + @region_set.id.to_s(),\n notice: 'Area was successfully created.'\n }\n else\n\n session.delete(:initial_setup)\n\n # should go back to study curate page?\n format.html {\n redirect_to url_for(\n :controller => \"studies\",\n :action => \"curate\",\n :id => @study\n ) + '?region_id=' + @region.id.to_s(),\n notice: 'Area was successfully created.'\n }\n end\n elsif @rs\n # study logic duplicated here?\n else\n # Should go to local region curate?\n format.html { redirect_to @region, notice: 'Area was successfully created.' }\n format.json { render json: @region, status: :created, location: @region }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "270e1038ff008d023eaabe2940b39dd2",
"score": "0.59337544",
"text": "def create\n @user_region = UserRegion.new(user_region_params)\n\n respond_to do |format|\n if @user_region.save\n format.html { redirect_to @user_region, notice: \"User region was successfully created.\" }\n format.json { render :show, status: :created, location: @user_region }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @user_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34ec0056cfac6321a1eabef34dffc436",
"score": "0.5925149",
"text": "def region; end",
"title": ""
},
{
"docid": "34ec0056cfac6321a1eabef34dffc436",
"score": "0.5925149",
"text": "def region; end",
"title": ""
},
{
"docid": "34ec0056cfac6321a1eabef34dffc436",
"score": "0.5924015",
"text": "def region; end",
"title": ""
},
{
"docid": "ca7a3923d696efc79d0162fc36c413a7",
"score": "0.59216994",
"text": "def create\n @regional_profile = RegionalProfile.new(regional_profile_params)\n\n respond_to do |format|\n if @regional_profile.save\n format.html { redirect_to @regional_profile, notice: 'Regional profile was successfully created.' }\n format.json { render :show, status: :created, location: @regional_profile }\n else\n format.html { render :new }\n format.json { render json: @regional_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5c6b52b42b764b7b5eefe7379a976da",
"score": "0.59122765",
"text": "def new\n @breadcrumb = 'create'\n @province = Province.new\n @regions = Region.order(:name)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @province }\n end\n end",
"title": ""
},
{
"docid": "03f58cc63a629e0cdcf2c42ffcf777bf",
"score": "0.591156",
"text": "def ldap_region_set_record_vars(ldap_region)\n ldap_region.name = @edit[:new][:name]\n ldap_region.description = @edit[:new][:description]\n ldap_region.zone = Zone.find_by_id(from_cid(@edit[:new][:zone_id]))\n end",
"title": ""
},
{
"docid": "09995bc8d64acf35328d19c2300a0d8d",
"score": "0.59050065",
"text": "def set_canal_regional\n @canal_regional = CanalRegional.find(params[:id])\n end",
"title": ""
},
{
"docid": "2014a70c58cd88d7404148f396bf4815",
"score": "0.59047395",
"text": "def create\n init = params[:area][:name][0]\n region_id = Region.find_by_name(params[:region_id])\n area_number = Area.create_number(params)\n @area = Area.new(area_params.merge(:region_id => (region_id.id rescue nil)))\n if @area.save\n flash[:notice] = t(:successfully_created)\n redirect_to areas_path\n else\n flash[:error] = @area.errors.full_messages.join('<br/>')\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "e58ba2c60e6a70994f9674ff740fe4e0",
"score": "0.58737576",
"text": "def new\n @target_region = TargetRegion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @target_region }\n end\n end",
"title": ""
}
] |
6790e3721ca9b89ece142d048fad5b93
|
DELETE /has_tags/1 DELETE /has_tags/1.json
|
[
{
"docid": "810158092dd8983aab006ba6fc1d0b14",
"score": "0.7393988",
"text": "def destroy\n @has_tag.destroy\n respond_to do |format|\n format.html { redirect_to has_tags_url, notice: 'Has tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "06667229334809f93125852c81f53ca3",
"score": "0.7493433",
"text": "def delete()\n\n client.delete(\"/tags/#{gid}\") && true\n end",
"title": ""
},
{
"docid": "f3556d6972f6f78f70303c500860537f",
"score": "0.7479012",
"text": "def delete_tag tag\n delete \"tag/#{tag}\"\n end",
"title": ""
},
{
"docid": "e709d186ed680bf2e3dd3364788ba5c3",
"score": "0.74060905",
"text": "def delete(tag)\n api_client.tags.multi_delete(resource_hrefs: [api_client.get_instance.href], tags: [tag])\n end",
"title": ""
},
{
"docid": "6cca111d8a04a4d484e18f111a760900",
"score": "0.74020296",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n \n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :ok }\n end\n\n end",
"title": ""
},
{
"docid": "f93ec8ecb3926797d0e43f33dcc2596e",
"score": "0.73936915",
"text": "def destroy\n get_status\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eaf570294a240f521a1e487838366ae7",
"score": "0.7367739",
"text": "def destroy\n @api_tag = Api::Tag.find(params[:id])\n @api_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to api_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "834bfa8a759941deb4f697c191efac5e",
"score": "0.73494375",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n render json: JSON.parse({msg:\"success\"}.to_json)\n end",
"title": ""
},
{
"docid": "1db40e550937fa93a144ba818b416a80",
"score": "0.7301715",
"text": "def destroy\n @tag = Tag.find(params[:id])\n respond_to do |format|\n if @tag.destroy\n format.json { render json: {:id => @tag.id}, status: :ok }\n else\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d757ab0cd3c3c2a08984703461e792b8",
"score": "0.7299739",
"text": "def destroy\n # @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "58ef9ce9c7f316dbc9e335b6efa68986",
"score": "0.7296403",
"text": "def destroy\n tag = @user.tags.find_by_tid(params[:id])\n if tag.nil?\n render json_status_response(404, \"Tag not found\")\n return\n end\n\n tag.destroy\n render json_status_response(200, \"Tag removed successfully\")\n end",
"title": ""
},
{
"docid": "30dd77b67b9e236a7b8a156d3c95dc01",
"score": "0.7290827",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "30dd77b67b9e236a7b8a156d3c95dc01",
"score": "0.7290827",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "30dd77b67b9e236a7b8a156d3c95dc01",
"score": "0.7290827",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cc038b27433d7cbf29ab34da482ec1ba",
"score": "0.7241394",
"text": "def destroy\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c7312ffa3e0b138795a6380388e459dd",
"score": "0.72393864",
"text": "def destroy\n @tag = Tag.find(params[:id])\n\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c77a194ddd892c1d575e74df72dce96f",
"score": "0.72388977",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1192e0c4c8b521a70462242fd308333f",
"score": "0.72208744",
"text": "def destroy\n\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n\n end",
"title": ""
},
{
"docid": "ee234fbeabaedf2f2abc8c86e59398ef",
"score": "0.72145385",
"text": "def destroy\n tag = tag.find(params[:id])\n\n if tag.destroy\n render json: {\"message\": \"Record was deleted\", status: :ok, }, status: :ok\n else\n render json: {\"message\": \"You are not authorized to delete this tag\"}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "7b75133244b6607edaefd0806d11ae37",
"score": "0.7184257",
"text": "def destroy\n @taggable = current_user.taggables.find(params[:id])\n\n #destroy each tag in the taggable\n @taggable.tags.each do |tag|\n tag.destroy\n end\n\n @taggable.destroy\n\n respond_to do |format|\n format.html { redirect_to taggables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cbf4ed11a56ae1bd21e5ba5bf4e11760",
"score": "0.71739507",
"text": "def destroy\n @tags_of_novel = TagsOfNovel.find(params[:id])\n @tags_of_novel.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_of_novels_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "804ebfe19f6dc12b3208bdbf32d2acf6",
"score": "0.71476257",
"text": "def destroy\n @posttag = Posttag.find(params[:id])\n @posttag.destroy\n\n respond_to do |format|\n format.html { redirect_to posttags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f94a041aae025b474cecc00367925386",
"score": "0.7143062",
"text": "def delete_tags(name); end",
"title": ""
},
{
"docid": "01e34270dcfb60a8310ad3d449be2351",
"score": "0.71407473",
"text": "def destroy\n @tagging.destroy\n respond_to do |format|\n format.html { redirect_to taggings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1d0f454d6a55395a395c0811635a7247",
"score": "0.7116533",
"text": "def delete\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "313aae2f8d2b9de674224fa3dcffe43a",
"score": "0.71010244",
"text": "def remove_tag\n @kyu_entry.tag_list.remove(params[:tag])\n @kyu_entry.save\n render json: true\n end",
"title": ""
},
{
"docid": "f5ecd4818f67be76fa2a4f975bd2c755",
"score": "0.7086448",
"text": "def delete\n resource.delete_tags([self])\n nil\n end",
"title": ""
},
{
"docid": "8aca0cb52f61b5925b424e79dd05ef0a",
"score": "0.7073479",
"text": "def destroy\n @tag.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "d9a03bd5400af66604a60ed6e3fc20ca",
"score": "0.7073451",
"text": "def destroy\n tag = Tag.find_by_name(params[:id])\n render(json: {error: \"Tag with name #{params[:id]} does not exists.\"}, status: :not_found) and return if tag.nil?\n if tag.destroy\n render text: '{\"success\": true}', status: :no_content, location: tag_path(params[:version], tag.name)\n else\n Rails.logger.error \"cannot destroy tag because there were errors deleting the tag #{tag.attributes.inspect} ... #{tag.errors.to_hash}\"\n render(json: tag.errors, status: :bad_request)\n end\n end",
"title": ""
},
{
"docid": "7eff077940d1750798db5d1d40c591f3",
"score": "0.7032417",
"text": "def destroy\n @post_tag.destroy\n respond_to do |format|\n format.html { redirect_to post_tags_url, notice: 'Tagi poistettu' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7761879210be3c36a27d7d8f9fe586e4",
"score": "0.7028069",
"text": "def destroy\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to collection_path, success: I18n.t(\"admin.flash.tags.success.destroy\") }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "943944e665701f0369cb265bc9534885",
"score": "0.7020268",
"text": "def destroy\n @tag_collection = TagCollection.find(params[:id])\n @tag_collection.destroy\n render json: {}\n \n end",
"title": ""
},
{
"docid": "f4a360d5d9492d987d7a1e98e4d253c3",
"score": "0.70094216",
"text": "def destroy\n @taggable.destroy\n\n respond_to do |format|\n format.html { redirect_to(taggables_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "16aeed73848d55a546c40f724f2eb461",
"score": "0.70036346",
"text": "def destroy\n @tagging = Tagging.find(params[:id])\n @tagging.destroy\n\n respond_to do |format|\n format.html { redirect_to taggings_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c17ad6e5012b0518a679d4b01a895e63",
"score": "0.7002132",
"text": "def destroy\n real_post_path = @tag.post\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to post_path(real_post_path), notice: 'tag deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "840e3a55dcb5813695d788163a958b98",
"score": "0.7000518",
"text": "def delete\n validate_presence_of :name\n wrapper.delete_tag(@name) || raise(OperationFailed)\n end",
"title": ""
},
{
"docid": "ace31159c9f41c7eb6b5a03405a1c48c",
"score": "0.69968307",
"text": "def destroy\n @tag_one.destroy\n respond_to do |format|\n format.html { redirect_to tag_ones_url, notice: 'Tag one was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "484b9b18f423aeab62abe78890505e2a",
"score": "0.6991375",
"text": "def destroy\n tag = Tag.find_by_id(params[:id])\n #If tag does exist\n if !tag.nil?\n tag.destroy\n head :no_content\n else\n respond_with message: \"Resource not found\", status: :not_found\n end\n end",
"title": ""
},
{
"docid": "408e0ebbda6e2bf06220c62c52b90f33",
"score": "0.6979008",
"text": "def destroy\n @tag_ref.destroy\n respond_to do |format|\n format.html { redirect_to tag_refs_url, notice: 'Usunięto Tag z artykułu.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c439ccbd42273e085853ac2797d73c8d",
"score": "0.6960479",
"text": "def destroy\n @tag_tag = TagTag.find(params[:id])\n @tag_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tag_tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ed8ca37dc1df8604e6057d25058947b5",
"score": "0.69493586",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ed8ca37dc1df8604e6057d25058947b5",
"score": "0.69493586",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ed8ca37dc1df8604e6057d25058947b5",
"score": "0.69493586",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ed8ca37dc1df8604e6057d25058947b5",
"score": "0.69493586",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "643d6e6ec9af5706c9c1035a42ba76c4",
"score": "0.6933828",
"text": "def destroy\n @tag.destroy\n if @tag.errors.any?\n flash[:alert] = t('.message')\n else\n flash[:notice] = t('.destroy')\n end\n respond_to do |format|\n format.html { redirect_to tags_url}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "997eef0f3340a1a00074ee5ffe4639c1",
"score": "0.6926733",
"text": "def destroy\n @tagged_item = TaggedItem.find(params[:id])\n @tagged_item.destroy\n\n respond_to do |format|\n format.html { redirect_to all_items_tagged_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c79db7808ea5990864285759de32dca7",
"score": "0.69123894",
"text": "def destroy\n @quotetags = Quotetags.find(params[:id])\n @quotetags.destroy\n\n respond_to do |format|\n format.html { redirect_to(quotetags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "920e3eab1695d302a6150611f6280680",
"score": "0.69104975",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "574c304966dabc16f9e2297b64262483",
"score": "0.6885387",
"text": "def delete\n @tag.destroy\n redirect_to(tags_url)\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.68818897",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.68818897",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba7f3386955a2c7a38fa83aa5b0033f0",
"score": "0.68813634",
"text": "def destroy\n # @post.delete_all_tags\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9f4bd7abc822c12a020c6bd9c523ffab",
"score": "0.6878645",
"text": "def delete_tags\n tags = self.tags\n tags.each do |tag|\n tag.destroy if tag.posts.count == 1\n end\n end",
"title": ""
},
{
"docid": "18213991415922a885a7cb7525d3f146",
"score": "0.68785393",
"text": "def destroy\n @tagg = Tagg.find(params[:id])\n @tagg.destroy\n\n respond_to do |format|\n format.html { redirect_to taggs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9799ffb7ea9451324992d480f5173884",
"score": "0.6877047",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: \"Tag was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20bd83ad40716ca2388fb27e7230a68f",
"score": "0.68737817",
"text": "def tag_delete(id, tag)\n wf_event_id?(id)\n wf_string?(tag)\n api.delete([id, 'tag', tag].uri_concat)\n end",
"title": ""
},
{
"docid": "ea27cdbf1a30014a5e6e8d670efd9155",
"score": "0.68685275",
"text": "def destroy\n \t\t\n\t@tag = Tag.find(params[:id])\n @tag.destroy\n\t\t\n respond_to do |format|\n format.html { redirect_to(tags_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0d3ce11ea64c9b1121b2b8e9ad4c839a",
"score": "0.6861018",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\tflash[:error] = @tag.errors[:base]\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "93f1f494a5c465621c4a89f4fe06a916",
"score": "0.68499523",
"text": "def tags_delete(tag)\n params = prepare_tags_delete_param(tag)\n response = request(API_PATH_TAGS_DELETE, params)\n parse_and_eval_execution_response(response.body)\n end",
"title": ""
},
{
"docid": "1f078dcac9e466764ff8110f21dda9f6",
"score": "0.6849292",
"text": "def destroy\n @ad_tag = AdTag.find(params[:id])\n @ad_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_tags_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "38c7d21141c3f23866072bcbd047ea3d",
"score": "0.68469524",
"text": "def destroy\n @tag_identity = Identity.find(params[:id])\n @tag_identity.destroy\n\n respond_to do |format|\n format.html { redirect_to tag_identities_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a1b4f9590c8c7f4f190dc0258ca3acbf",
"score": "0.6839873",
"text": "def deleteEntityTag( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/tag\",params)\n end",
"title": ""
},
{
"docid": "50f9aa3e2f8009eb18f0844e2eea2192",
"score": "0.68386686",
"text": "def destroy\n authorize @user\n @tags = @user.tag_list if @tags.empty?\n @user.tag_list.remove @tags\n if @user.save\n render :json => @user.reload.tags\n else\n error!(:invalid_resource, @user.errors, \"Tags have not been saved\")\n end\n end",
"title": ""
},
{
"docid": "a55da7a51e8bb8eb3b0516bcc27ce6fa",
"score": "0.6837062",
"text": "def destroy\n # If given metadata_id ==> detach tag\n if params[:metadata_id]\n tag = current_user.detach_tag params[:metadata_id], params[:id]\n # Otherwise ==> delete tag\n else\n tag = current_user.delete_tag params[:id]\n end\n _respond_tag_request tag \n end",
"title": ""
},
{
"docid": "fcb43914382827f14c741193f5f281ba",
"score": "0.6828607",
"text": "def destroy\n @tag.destroy\n end",
"title": ""
},
{
"docid": "fcb43914382827f14c741193f5f281ba",
"score": "0.6828607",
"text": "def destroy\n @tag.destroy\n end",
"title": ""
},
{
"docid": "7c97266422d78bb868675db990fe956a",
"score": "0.6827347",
"text": "def destroy\n @events_tag = EventsTag.find(params[:id])\n @events_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to events_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "08ee912e373e5957c9053d2190ef3bd8",
"score": "0.6827103",
"text": "def destroy\n @question_tag = QuestionTag.find(params[:id])\n @question_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to question_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ced8f84629051eb5681c885f4cda9f75",
"score": "0.6817297",
"text": "def destroy\n @hash_tag = HashTag.find(params[:id])\n @hash_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(hash_tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "05731d8685b329083555faf3020ccd6c",
"score": "0.68023115",
"text": "def remove_tag\n @asset = Asset.find(params[:id])\n tag_to_remove = params[:tag]\n \n @asset.tags = @asset.tags.select{|tag| tag.name != tag_to_remove}\n \n respond_to do |format|\n if @asset.save\n format.html { redirect_to(assets_url, :notice => 'Tag was successfully removed from asset.') }\n format.json { render :json => @asset }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "180882fdc5312a45e658b24f8cdfc49c",
"score": "0.6791193",
"text": "def destroy\n @activity_tag = ActivityTag.find(params[:id])\n @activity_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to activity_tags_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3404a1a559ae1f0f0fb4890490689b8e",
"score": "0.67902",
"text": "def destroy\n @asset_tag = AssetTag.find(params[:id])\n @asset_tag.destroy\n render json: {}\n \n end",
"title": ""
},
{
"docid": "5e7253ddb95181db60572d53d3d3cc62",
"score": "0.67795885",
"text": "def destroy\n @asset = Asset.find(params[:asset_id])\n @tag = @asset.tags.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(asset_manager_asset_tags_path(@asset)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8fe034814704a6013cc9940ceae31c3b",
"score": "0.67784894",
"text": "def destroy\n @user_tag = UserTag.find(params[:id])\n @user_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to user_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1772684648c7a090d32db3e736426dde",
"score": "0.67723316",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to :tags, notice: 'Метка успешно удалена.' }\n end\n end",
"title": ""
},
{
"docid": "4271e994546513740ff26517d0cc26cf",
"score": "0.67710274",
"text": "def destroy\n @tagging = Tagging.find(params[:id])\n @tagging.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_taggings_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ed292b4deac87a6328ff059d599537c3",
"score": "0.6762266",
"text": "def destroy\n begin\n breed = Tagger.tagged_klass.constantize.find(params[:id])\n breed.destroy\n render json: { message: \"Deleted successfully\" }\n rescue Exception => e\n render json: { error: \"Unprocessable entity\" }, status: 422\n end\n end",
"title": ""
},
{
"docid": "9c37856a7038aa71c3a26f11955e4285",
"score": "0.6747876",
"text": "def destroy\n @photo_tag.destroy\n respond_to do |format|\n format.html { redirect_to photo_tags_url, notice: 'Photo tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "96645fba4d0c71b56fda23cc4cbf49ec",
"score": "0.6745138",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_url(parent: @parent_tag)) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "14aada3eaf4d8300f14af6569b8862e2",
"score": "0.6742259",
"text": "def destroy\n BuzzTag.where(:buzz_id => params[:buzz_id], :tag_id => params[:tag_id]).first.destroy\n end",
"title": ""
},
{
"docid": "d3bfe757f6ec4b12a1978e3fceb5b888",
"score": "0.6741438",
"text": "def destroy\n @image_tag.destroy\n respond_to do |format|\n format.html { redirect_to image_tags_url, notice: 'Image tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0ef7ec04a7a02737a8f4fbb390734090",
"score": "0.6726099",
"text": "def destroy\n @storyline_tag.destroy\n respond_to do |format|\n format.html { redirect_to storyline_tags_url, notice: 'Storyline tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "51d3c997dad9696ff32331ab5c2054bd",
"score": "0.6725372",
"text": "def destroy\n @task_tag.destroy\n respond_to do |format|\n format.html { redirect_to task_tags_url, notice: 'Task tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "880548be12914dc5cb13364cfbaaf119",
"score": "0.6724421",
"text": "def destroy\n @tagging = Tagging.find(params[:id])\n @tagging.destroy\n\n respond_to do |format|\n format.html { redirect_to(taggings_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6284409883fcb0c83fa04a45d970562a",
"score": "0.6718831",
"text": "def destroy\n @climb_tag.destroy\n respond_to do |format|\n format.html { redirect_to climb_tags_url, notice: 'Climb tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5f4487d3ff89269ce7197fd3cef5f1ca",
"score": "0.6714911",
"text": "def destroy\n @admin_tag.destroy\n respond_to do |format|\n format.html { redirect_to admin_tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7fdb4b7cff6159a8b74fd93ababef8b6",
"score": "0.6711547",
"text": "def destroy\n @skill_tag = SkillTag.find(params[:id])\n @skill_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to skill_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fb9e2ebb4e0280b2938309bb6cbc3e6e",
"score": "0.67075425",
"text": "def destroy\n @hash_tag.destroy\n respond_to do |format|\n format.html { redirect_to hash_tags_url, notice: 'Hash tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8b14cd797351ef80c4299397e828d336",
"score": "0.67074174",
"text": "def destroy\n @thetag.destroy\n respond_to do |format|\n format.html { redirect_to thetags_url, notice: 'Thetag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "451522edf93bc38abeeb28469a731b2d",
"score": "0.67055535",
"text": "def destroy\n @tag.destroy\n redirect_to tags_url\n end",
"title": ""
},
{
"docid": "c33dc7c17248742ee1c62424dc4ee36a",
"score": "0.67032945",
"text": "def destroy\n @tags_post.destroy\n respond_to do |format|\n format.html { redirect_to tags_posts_url, notice: 'Tags post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8382e18ed2aeb7f3987f6acfd0536ffb",
"score": "0.6700605",
"text": "def destroy\n @asset_tag.destroy\n respond_to do |format|\n format.html { redirect_to asset_tags_url, notice: 'Asset tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4e90db1b96554391a5946c0bd4c750ba",
"score": "0.66955304",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5f07c1ebc35d02bce3de585138441ed1",
"score": "0.66951364",
"text": "def destroy\n @project_tag = ProjectTag.find(params[:id])\n @project_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to project_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "67f070ab80a52ffd4dc290cdebd7ed04",
"score": "0.66876006",
"text": "def destroy\n @tagging = Tagging.find(params[:id])\n @tagging.destroy\n\n respond_to do |format|\n format.html { redirect_to(tagging_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c47e75745d1d41ac22c8a2be6fbaa68c",
"score": "0.6686049",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.deleted = 9\n set_user_column @tag\n @tag.save!\n \n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "59b72b75233e6bac141bef22f767ee8a",
"score": "0.66859204",
"text": "def destroy\n @tag.destroy\n render :nothing => true, :status => :no_content\n end",
"title": ""
},
{
"docid": "84a398c7c0f73c7711895c5069820854",
"score": "0.66816634",
"text": "def destroy\n @image.tags.destroy_all\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "87075cc81ccc98bd7dc253ce659933dd",
"score": "0.66760343",
"text": "def destroy\n @answer_tag.destroy\n respond_to do |format|\n format.html { redirect_to answer_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f208f1a455ee2426af9d4ce84a824b31",
"score": "0.66699284",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @hastags = Hastag.where(:photo_id => @photo.id)\n @hastags.destroy_all\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to '/home', notice: 'You have deleted the picture' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0c887d3a4741acad2f4a15c6f6eaf202",
"score": "0.66689456",
"text": "def destroy\n\t b = Blog.find(params[:id])\n\t b.taggings.each do |t|\n\t\t if (t.tag.taggings.count == 1)\n\t\t\t t.tag.destroy\n\t\t end\n\t end\n Blog.find(params[:id]).destroy\n flash[:sucess] = \"Blog deleted.\"\n redirect_to life_index_path\n end",
"title": ""
}
] |
f7bd6b9652a2221d18a0ff647b069308
|
Train the model. Must call fit prior
|
[
{
"docid": "58c3ea70b04b1040d374c3432e3f007d",
"score": "0.6611805",
"text": "def train\n train_in_epochs(matrix_nnz)\n self\n end",
"title": ""
}
] |
[
{
"docid": "a485479c1203b9531aff15c1df5d8084",
"score": "0.7507078",
"text": "def train\r\n\t\t#Do data splitting\r\n\t\tdata = trainingData\r\n\t\ttrainData\t= data.segregate trainingDataAsArray, true\r\n\t\t@lr\t= Liblinear.train(\r\n\t\t\t{solver_type: self.class.findKernel(@kernel) },\r\n\t\t\ttrainingData.getDataStructure(useHash)\r\n\t\t)\r\n\tend",
"title": ""
},
{
"docid": "e36ed3e453f616f446b9f0b0b9ed5042",
"score": "0.7346373",
"text": "def train\n\t\t##\n\t\t# Never train twice.\n\t\t##\n\t\treturn if @machine\n\t\t##\n\t\t# Abstract method that creates the training and if necessary,\n\t\t# test data. !Must be overridden!\n\t\t##\n\t\tprepareData\n\t\t##\n\t\t# Abstract method that does the actual training. !Must be overridden!\n\t\t##\n\t\t@machine = doTraining\n\tend",
"title": ""
},
{
"docid": "edbcf600391a9ac6f1b4ca3ec51b3980",
"score": "0.69877696",
"text": "def train!\n raise \"You must implement Predictor#train!.\"\n end",
"title": ""
},
{
"docid": "381c3292d601ed5f57c1f0fc5ac7369f",
"score": "0.6965098",
"text": "def train\r\n\t\t@trainer \t= RubyFann::TrainData.new(\r\n\t\t\tinputs: \t\t\ttrainingData, \r\n\t\t\tdesired_outputs: \ttrainingTarget\r\n\t\t)\r\n\t\t@lr\t\t\t= RubyFann::Standard.new(\r\n\t\t\tnum_inputs:\t\t\t@parameters[:num_inputs],\r\n\t\t\thidden_neurons: \t@parameters[:hidden_neurons], \r\n\t\t\tnum_outputs: \t\t@parameters[:num_outputs]\r\n\t\t)\r\n\t\t@lr.train_on_data(\r\n\t\t\t@trainer,\r\n\t\t\t@parameters[:max_epochs],\r\n\t\t\t@parameters[:error_count],\r\n\t\t\t@parameters[:max_mse].to_f\r\n\t\t)\r\n\tend",
"title": ""
},
{
"docid": "3c9bf03fc7c4ad7e28c000e505cdb15d",
"score": "0.6947482",
"text": "def doTraining\n\t\t##\n\t\t# Call the internal pre-training function to do stuff like data prep and whatnot\n\t\t##\n\t\ttrain\t= RubyFann::TrainData.new(inputs: @xData[:train], desired_outputs: @yData[:train])\n\t\tmachine\t= RubyFann::Standard.new(num_inputs: 2, hidden_neurons:[], num_outputs: 2)\n\t\tmachine.train_on_data(train, @iterations, @reportSteps, 0.0) \n\t\t# Return the trained model !!!! Super important. Every doTraining should return the machine\n\t\tmachine\n\tend",
"title": ""
},
{
"docid": "1581fac5296345b00742c3cc19d97645",
"score": "0.69374484",
"text": "def doTraining\n\t\t##\n\t\t# Call the internal pre-training function to do stuff like data prep and whatnot\n\t\t##\n\t\ttrain\t= RubyFann::TrainData.new(inputs: @xData[:train], desired_outputs: @yData[:train])\n\t\tmachine\t= RubyFann::Standard.new(\n\t\t\tnum_inputs: LIST_LENGTH, \n\t\t\thidden_neurons: [LIST_LENGTH],#(0...LIST_LENGTH).map{LIST_LENGTH}, \n\t\t\tnum_outputs: 1\n\t\t)\n\t\tmachine.train_on_data(train, @iterations, @reportSteps, @maxError) \n\t\t# Return the trained model !!!! Super important. Every doTraining should return the machine\n\t\tmachine\n\tend",
"title": ""
},
{
"docid": "2ac567b66b6c29c54faf6506a738d21a",
"score": "0.67684263",
"text": "def train\n # TODO: I can save the most similar centroid and corresponding simil in the\n # training set, then the training should be just some sums! Super fast!\n # NOTE: if I go back to using centroid training at all...\n\n # NOTE: careful if you're using normalized centroids from here on\n compr.train train_set.map &method(:normalize)\n @train_set = []\n end",
"title": ""
},
{
"docid": "df08df6de20e66c28551b9c7838929e8",
"score": "0.6568402",
"text": "def train\n response_data = @app.client.model_train @id\n Clarinet::Model.new @app, response_data[:model]\n end",
"title": ""
},
{
"docid": "136e13d4fbf0ead168e1d65bc869a14c",
"score": "0.65160745",
"text": "def train(train_data, expect, epoch_iter = 50, eta, m)\n fail ArgumentError, 'Training must be Array' unless train_data.is_a? Array\n fail ArgumentError, 'Expectation must be Array' unless expect.is_a? Array\n fail ArgumentError, 'Data and Expectation must be same size' unless train_data.size == expect.size\n\n 1.upto(epoch_iter) do\n error = 0.0\n train_data.zip(expect) do |sample, target|\n predict(sample)\n error += back_propogate(target, eta, m)\n end\n end\n end",
"title": ""
},
{
"docid": "6dbe4a03f873df6117709c16cdd96c07",
"score": "0.6340552",
"text": "def train\n Growing.new.train\n Cluster.current.train\n # Stale. Very untrusty\n DecisionTree.new(Project.projects_by_reference).train\n end",
"title": ""
},
{
"docid": "342d415a05c3cab3d3db8e2611231e8e",
"score": "0.63163686",
"text": "def train\n data = initialize_data\n\n trees = SECTION_METRICS.map do |section, metrics|\n ::DecisionTree::ID3Tree.new(metrics, data[section], 'ClassE', :continuous)\n end\n trees.each(&:train)\n\n @agility_total_dec_tree,\n @agility_last_year_dec_tree,\n @community_total_dec_tree,\n @community_last_year_dec_tree = trees\n end",
"title": ""
},
{
"docid": "1fc925ecd51655718d43e608e0e5b5f6",
"score": "0.63122386",
"text": "def run()\n heuristics.each do |x|\n x.train\n end\n end",
"title": ""
},
{
"docid": "eb4855a1262e192d4024f340ccd49dbd",
"score": "0.6282691",
"text": "def train\n training = @prediction.trainedmodels.insert.request_schema.new\n training.id = 'preconceito-nordeste'\n training.storage_data_location = DATA_OBJECT\n result = @client.execute(\n :api_method => @prediction.trainedmodels.insert,\n :parameters => {'project' => PROJECT_ID},\n :headers => {'Content-Type' => 'application/json'},\n :body_object => training\n )\n\n puts result.inspect\n end",
"title": ""
},
{
"docid": "185ecc8c15ca4697369bf8ac7aff846d",
"score": "0.62744296",
"text": "def train\n puts \"Training started: neurons_count: #{network.layers[0].count}, learning_rate: #{learning_rate}, batch_size: #{batch_size}\"\n max_epochs.times.each do |epoch|\n batch(epoch).each_with_index do |row, index|\n network.train(row[:input], expected_output(row[:output]), learning_rate)\n\n print \"Row: #{index+1}/#{batch_size}\\r\" unless multi\n end\n\n # Po zakonczeniu epoki, zapisywane sa wagi i bias oraz wywolywana jest\n # metoda, ktora ustawia aktualna siec jako ta najlepsza, jesli jej jakosc\n # jest najwieksza z dotychczasowych epok\n network.save_weights_and_bias(learning_rate, batch_size)\n set_best_network\n\n results << { error: network_error.to_f, properly_classified: current_properly_classified.to_i }\n\n #print \"Epoch: #{epoch}/#{max_epochs}\\r\" if multi\n puts \"Epoch: #{epoch}: #{(training_quality * BigDecimal.new(100)).to_f.round(3)}, #{network_error.to_f.round(4)}\" unless multi\n\n # Jesli model osiagnie oczekiwana jakosc, mozna zakonczyc trening\n # return results if training_quality >= DESIRED_QUALITY\n end\n puts \"Training ended: neurons_count: #{network.layers[0].count}, learning_rate: #{learning_rate}, batch_size: #{batch_size}\"\n\n return results\n end",
"title": ""
},
{
"docid": "4722b5aaff853738cbc9fd9402d642d5",
"score": "0.62676257",
"text": "def train(token)\n # Need an authoritative ground truth\n raise \"Cannot train on an untyped token\" if not token.type\n\n # Read the truth for later checks\n truth = token.type\n\n # For each model, run it and see if it was correct\n @models.each_key{|m|\n token.type = nil\n m.estimate_type(token)\n @fits[m] += 1 if token.type == truth\n }\n\n # Increment n\n @trained += 1\n\n # restore and return token\n token.type = truth\n return token\n end",
"title": ""
},
{
"docid": "c19a6bf5310a5b727e4a30e2462ff084",
"score": "0.6261475",
"text": "def train\n Growing.new.train\n # Stale. Very untrusty\n # DecisionTree.new(projects_by_reference).train\n end",
"title": ""
},
{
"docid": "5c8da4863f6d96ea8053f97453bb35b8",
"score": "0.6218034",
"text": "def fit(x, _y = nil)\n x = Rumale::Validation.check_convert_sample_array(x)\n dummy = Numo::DFloat.ones(x.shape[0])\n @model = Numo::Liblinear.train(x, dummy, liblinear_params)\n @weight_vec = @model[:w].dup\n @bias_term = @model[:rho]\n self\n end",
"title": ""
},
{
"docid": "8cacabf908f3789c41d77860ccc6d29b",
"score": "0.61987495",
"text": "def train(x, y, epochs,\n batch_size: 1,\n initial_epoch: 1,\n test: nil,\n verbose: true,\n accuracy: true)\n check_xy_type(x, y)\n train_iterator = Iterator.new(x, y)\n train_by_iterator(train_iterator, epochs,\n batch_size: batch_size,\n initial_epoch: initial_epoch,\n test: test,\n verbose: verbose,\n accuracy: accuracy)\n end",
"title": ""
},
{
"docid": "0aa6e8231473482fe9b4cc77f89d6286",
"score": "0.61692476",
"text": "def do_train(i)\n puts \"Epoch ##{i}\"\n puts \"=============\"\n count = 0\n correct = 0\n\n # Calculate the activation\n @training_set.each do | example |\n # Set the target\n answer = example.last\n next unless (answer == @num1 || answer == @num2)\n target = (answer == @num1 ? 1 : -1)\n\n # Initialize sum to 0\n sum = 0\n example.each_with_index do | elem, j |\n next if j == example.size-1\n sum += (elem * @weights[j])\n end\n\n output = ( sum <= 0 ? -1 : 1 )\n\n # Update the weights if appropriate\n if output == target then\n correct += 1\n else\n update_weights(example, target, output)\n end\n count += 1\n end\n\n accuracy = correct.to_f/count.to_f * 100\n\n puts \"Correct: #{correct}\"\n puts \"Incorrect: #{count - correct}\"\n puts \"Accuracy: #{accuracy}%\"\n puts\n\n accuracy\n end",
"title": ""
},
{
"docid": "94588f6221dd09eb804f582cd30d2fa7",
"score": "0.6167836",
"text": "def train\n raise Error::APIError.new(\"This detector is already trained.\") if is_trained?\n response = Matroid.post(\"detectors/#{@id}/finalize\")\n response['detector']\n end",
"title": ""
},
{
"docid": "faaa0be789123e81db938d3f5b387a86",
"score": "0.61098486",
"text": "def fit(x, y)\n x = Rumale::Validation.check_convert_sample_array(x)\n y = Rumale::Validation.check_convert_label_array(y)\n Rumale::Validation.check_sample_size(x, y)\n xx = fit_bias? ? expand_feature(x) : x\n @model = Numo::Liblinear.train(xx, y, liblinear_params)\n @weight_vec, @bias_term = weight_and_bias(@model[:w])\n self\n end",
"title": ""
},
{
"docid": "9861cd4ffae77cd32cfa3ecfe31939bd",
"score": "0.6084865",
"text": "def train\r\n\t\tresults = @input\r\n\t\terror0 = 1\r\n\t\terror1 = 1\r\n\t\terror2 = 1\r\n it = 0\r\n\r\n # while the error of each output is greater than 0.000001\r\n\t\twhile error0 > 0.000001 and error1 > 0.000001 and error2 > 0.000001\r\n results = feed_forward\r\n\t\t\tbackpropogate\r\n\r\n\t\t\terror0 = (@target_output[0] - @output[0]).abs\r\n\t\t\terror1 = (@target_output[1] - @output[1]).abs\r\n\t\t\terror2 = (@target_output[2] - @output[2]).abs\r\n\r\n # rounds output to the nearest 100th\r\n #@output.each_index do |o|\r\n # @output[o] = (@output[o]*100).ceil/100.0\r\n #end\r\n\r\n puts \"Results of Iteration: \" + it.to_s\r\n puts results\r\n puts \"--------------------\"\r\n it += 1\r\n\t\tend\r\n\r\n puts \"\\n\\nOutput after training:\"\r\n\t\tputs results\r\n\tend",
"title": ""
},
{
"docid": "e13b32076c423c4763bd209be3feb8a4",
"score": "0.6010731",
"text": "def start_fit(x, y, epochs,\r\n batch_size: 1,\r\n initial_epoch: 1,\r\n test: nil,\r\n verbose: true,\r\n need_accuracy: true,\r\n io: $stdout)\r\n Utils.check_input_data_type(\"x\", x, Xumo::SFloat)\r\n Utils.check_input_data_type(\"y\", y, Xumo::SFloat)\r\n train_iterator = Iterator.new(x, y)\r\n start_fit_by_iterator(train_iterator, epochs,\r\n batch_size: batch_size,\r\n initial_epoch: initial_epoch,\r\n test: test,\r\n verbose: verbose,\r\n need_accuracy: need_accuracy,\r\n io: io)\r\n end",
"title": ""
},
{
"docid": "95917d2449a8919b0c11582e5c3de46c",
"score": "0.60044485",
"text": "def train(category_name, item) \n @classifier.train category_name, item\n end",
"title": ""
},
{
"docid": "901c4701330bb9b77dedaa90c36833c4",
"score": "0.5995852",
"text": "def train\n return if performed?\n\n TrainModelJob.perform_async @current_user.id, params[:label], params[:data]\n\n render json: {\n success: \"Training enqued\"\n }, status: 200\n end",
"title": ""
},
{
"docid": "ba041eb0142daa5b76fb95be3bef1b5b",
"score": "0.59944296",
"text": "def fit(x, y)\n x = ::Rumale::Validation.check_convert_sample_array(x)\n y = ::Rumale::Validation.check_convert_label_array(y)\n ::Rumale::Validation.check_sample_size(x, y)\n\n @classes = Numo::Int32[*y.to_a.uniq.sort]\n n_labels = @classes.size\n n_features = x.shape[1]\n sub_rng = @rng.dup\n\n loss = ::Rumale::NeuralNetwork::Loss::SoftmaxCrossEntropy.new\n @network = buld_network(n_features, n_labels, sub_rng)\n @network = train(x, one_hot_encode(y), @network, loss, sub_rng)\n @network.delete_dropout\n\n self\n end",
"title": ""
},
{
"docid": "a9c2f36d460b5a729583bebe8653b179",
"score": "0.59704244",
"text": "def train trainings_set, params, folds\n if folds.empty? # means cross validation is disables -> evaluate with trainings_set\n evaluate(::Libsvm::Model.train(trainings_set, params.to_parameter), [trainings_set]) << params\n else\n evaluate(::Libsvm::Model.train(trainings_set, params.to_parameter), folds) << params\n end\n # rescue\n # #TODO find out why this happens, seems to be something with the trainings_set inside the libsvm training\n # p \"error on #{trainings_set}|#{params}\"\n # return nil\n end",
"title": ""
},
{
"docid": "282063bfbe11b17165057a94e0cf08c5",
"score": "0.59557825",
"text": "def set_train\n @train = Train.find_by_param(params[:id])\n end",
"title": ""
},
{
"docid": "c2a3061c45b5f4fee54ffb38ab9ec4e9",
"score": "0.59433067",
"text": "def train(x)\n x.times do |i|\n input = preset_inputs[i % preset_inputs.length]\n feed_forward(input.values.values)\n output = input.desired_output\n backprop(output.values.values)\n end\n end",
"title": ""
},
{
"docid": "43ba85b4079b699ea16d1c0d8bed56b3",
"score": "0.59418017",
"text": "def train_up(classifier, samples)\n samples.each do |s|\n classifier.train s.kind, s.value\n end\n end",
"title": ""
},
{
"docid": "f60cdd44fb0c64807e00dfe6e6eed84d",
"score": "0.59362215",
"text": "def train( input: [], output: [] )\n before_error = calculate_error( input: input,output: output )\n input.each_with_index do |input,idx| \n calculated_output = update_with_vector( input )\n @layers[\"output\"].neurons.each_with_index do |neuron,neuron_idx|\n neuron.adjust_weights( expected: output[ idx ][ neuron_idx ])\n end \n\n @layers[\"hidden\"].neurons.each do |neuron|\n neuron.adjust_weights( expected: output[ idx ], layer: :hidden, output: calculated_output, weights_at_output_nodes: output_weights( neuron ))\n end \n end\n new_error = calculate_error( input: input,output: output )\n before_error-new_error\n end",
"title": ""
},
{
"docid": "87ab1d84df8de093d8bbd7fbee3f6da1",
"score": "0.5933053",
"text": "def apply_to(train)\n train.category = category\n train.signalling_headcode = signalling_headcode\n train.reservation_headcode = reservation_headcode\n train.service_code = service_code\n train.portion_id = portion_id\n train.power_type = power_type\n train.timing_load = timing_load\n train.speed = speed\n train.operating_characteristics = operating_characteristics\n train.seating_class = seating_class\n train.sleeping_class = sleeping_class\n train.reservations = reservations\n train.catering = catering\n train.branding = branding\n train.uic_code = uic_code\n train\n end",
"title": ""
},
{
"docid": "ab4d3f15b8c06a8ef7278885e49aede5",
"score": "0.5915157",
"text": "def train_with_features stocks, features, start_day, end_day, hidden_nodes, learning_rate, momentum_rate\n self.samples = features\n create_errors(stocks, features)\n\n predictors.each_with_index do |predictor, index|\n predictors[index].set_stocks(stocks[index], features[index], start_day, end_day)\n predictors[index].set_default_network_values(hidden_nodes)\n predictors[index].build_neural_net\n train_neural_net(index, get_delta(index), learning_rate, momentum_rate)\n train_neural_net(index, get_delta(index), learning_rate, momentum_rate)\n puts \"stock: \" + stocks[index].to_s\n adjust_weight(index, get_delta(index), index)\n end\n\n predictors.each_with_index do |predictor, index|\n train_on_highest_error(predictors[index], index, start_day, end_day, learning_rate, momentum_rate)\n train_on_highest_error(predictors[index], index, start_day, end_day, learning_rate, momentum_rate)\n end\n end",
"title": ""
},
{
"docid": "b5ead4ff6fb8d57a76cdfe8a49faa50d",
"score": "0.5888724",
"text": "def learn(input)\n train(input, false)\n end",
"title": ""
},
{
"docid": "0fed94e5f1670830a6903e35462674b9",
"score": "0.5881339",
"text": "def predict input\r\n\t\t@lr.run(input)\r\n\tend",
"title": ""
},
{
"docid": "ad68f3710e4c809c5675a1d6507fb1f0",
"score": "0.58782655",
"text": "def start_fit_by_iterator(train_iterator, epochs,\r\n batch_size: 1,\r\n initial_epoch: 1,\r\n test: nil,\r\n verbose: true,\r\n need_accuracy: true,\r\n io: $stdout)\r\n check_model_setup_complete\r\n check_stop_requested # Clear stop request.\r\n @train_iterator = train_iterator\r\n @max_epochs = epochs\r\n @train_batch_size = batch_size\r\n @epoch = initial_epoch\r\n @test = test\r\n @verbose = verbose\r\n @need_accuracy = need_accuracy\r\n @io = io\r\n @train_state = :start_train_epoch\r\n @train_max_steps = train_iterator.max_steps(batch_size)\r\n @num_train_datas = train_iterator.num_usable_datas(batch_size)\r\n @line_first_pos = 0\r\n call_callbacks(:before_train)\r\n end",
"title": ""
},
{
"docid": "79caa966f1788d2a4510c0417f005e3f",
"score": "0.5870676",
"text": "def set_train\n @train = Train.find(params[:id])\n end",
"title": ""
},
{
"docid": "44e650f13d9069d46f0bb5357729c840",
"score": "0.5816379",
"text": "def monkeylearn_train(samples)\n samples.map! { |x| [x, 590992]}\n r = Monkeylearn.classifiers.upload_samples('cl_ksmgNsh9', samples)\n Monkeylearn.classifiers.train('cl_ksmgNsh9')\n end",
"title": ""
},
{
"docid": "4ad4ec735569a67ed2054803d440a928",
"score": "0.581365",
"text": "def train_step\r\n batches = @train_iterator.next_batch(@train_batch_size)\r\n call_callbacks(:before_train_on_batch)\r\n train_step_met = on_train_step(*batches)\r\n @last_logs.merge!(train_step_met)\r\n call_callbacks(:after_train_on_batch)\r\n if @verbose\r\n @progress_bar.progress(@train_batch_size)\r\n metrics = metrics_to_str(train_step_met)\r\n if @io == $stdout\r\n @progress_bar.print(prepare: \"\\r\", append: metrics)\r\n else\r\n @line_first_pos = @io.pos\r\n @progress_bar.print(append: metrics)\r\n end\r\n end\r\n stop_requested_message = check_stop_requested\r\n if stop_requested_message\r\n @io.puts(\"\\n#{stop_requested_message}\") if @verbose\r\n @train_state = :trainer_end_training\r\n else\r\n @train_state = :end_train_step\r\n end\r\n end",
"title": ""
},
{
"docid": "2019e9354183961b4819874d89776547",
"score": "0.58010083",
"text": "def train(samples, max_epochs = 5000)\n \n samples = Marshal.load(Marshal.dump(samples)) # can't use dup since it's just a shallow copy\n num_examples = samples.length\n\n # Insert bias units of 1 into the first column of each training_sample.\n samples.each { |sample| sample.unshift(1) }\n\n samples_matrix = Matrix[*samples]\n\n\n # Epochs of train\n max_epochs.times do |epoch|\n\n\n #### Step Positive\n # Uv = X . W\n pos_Uv = samples_matrix * @weights\n\n # P (h1=1∣v )= sigmoide (c + wi v) \n pos_G_Uv = pos_Uv.map{|ij| logistic(ij)}\n\n\n # Pu(g(U v)) ={ pij ∣ pij =t }\n pos_P_G_Uv = pos_G_Uv.map{|ij| (ij >= rand) ? 1.0 : 0.0}\n\n # A+\n pos_A = samples_matrix.transpose * pos_G_Uv\n\n\n #### Step Negative\n # Uv = X . W\n neg_Uh = pos_P_G_Uv * @weights.transpose\n\n\n # P (h1=1∣v )= sigmoide (c + wi v) \n # g (U¯h)\n neg_G_Uh = neg_Uh.map{|ij| logistic(ij)}\n\n # Fix the bias unit to 1\n neg_G_Uh = Matrix[*neg_G_Uh.to_a.map { |row| row[0] = 1; row }]\n\n\n # U¯v = g (U¯h) . W\n neg_Uv = neg_G_Uh * @weights\n \n # g (U¯v)\n neg_G_Uv = neg_Uv.map { |e| logistic(e) }\n\n # A-\n neg_A = neg_G_Uh.transpose * neg_G_Uv\n\n\n # Update weights!\n @weights = @weights + @learning_rate*((pos_A - neg_A) / num_examples)\n\n error = ((samples_matrix - neg_G_Uh).map { |e| e ** 2 }).reduce(:+)\n puts \"Epoch #{ epoch }: error is #{ error }\"\n end \n end",
"title": ""
},
{
"docid": "f002930122989c4971006395112d56fe",
"score": "0.5789393",
"text": "def take_train(train)\n @trains << train\n end",
"title": ""
},
{
"docid": "f002930122989c4971006395112d56fe",
"score": "0.5789393",
"text": "def take_train(train)\n @trains << train\n end",
"title": ""
},
{
"docid": "c6c4689aa14a3caa8d8539c076774f69",
"score": "0.57587415",
"text": "def train_by_iterator(train_iterator, epochs,\n batch_size: 1,\n initial_epoch: 1,\n test: nil,\n verbose: true,\n accuracy: true)\n raise DNNError, \"The model is not optimizer setup complete.\" unless @optimizer\n raise DNNError, \"The model is not loss_func setup complete.\" unless @loss_func\n\n num_train_datas = train_iterator.num_datas\n num_train_datas = num_train_datas / batch_size * batch_size if train_iterator.last_round_down\n\n stopped = catch(:stop) do\n (initial_epoch..epochs).each do |epoch|\n @last_log[:epoch] = epoch\n call_callbacks(:before_epoch)\n puts \"【 epoch #{epoch}/#{epochs} 】\" if verbose\n\n train_iterator.foreach(batch_size) do |x_batch, y_batch, index|\n train_step_met = train_step(x_batch, y_batch)\n num_trained_datas = (index + 1) * batch_size\n num_trained_datas = num_trained_datas > num_train_datas ? num_train_datas : num_trained_datas\n log = \"\\r\"\n 40.times do |i|\n if i < num_trained_datas * 40 / num_train_datas\n log << \"=\"\n elsif i == num_trained_datas * 40 / num_train_datas\n log << \">\"\n else\n log << \"_\"\n end\n end\n\n log << \" #{num_trained_datas}/#{num_train_datas} \"\n log << metrics_to_str(train_step_met)\n print log if verbose\n end\n\n if test\n acc, loss = if test.is_a?(Array)\n evaluate(test[0], test[1], batch_size: batch_size, accuracy: accuracy)\n else\n evaluate_by_iterator(test, batch_size: batch_size, accuracy: accuracy)\n end\n if verbose\n metrics = if accuracy\n { accuracy: acc, test_loss: loss }\n else\n { test_loss: loss }\n end\n print \" \" + metrics_to_str(metrics)\n end\n end\n puts \"\" if verbose\n call_callbacks(:after_epoch)\n end\n nil\n end\n\n if stopped\n puts \"\\n#{stopped}\" if verbose\n end\n end",
"title": ""
},
{
"docid": "3ad55a24c67eb51cc44d2c916112fdce",
"score": "0.5754901",
"text": "def runPrediction\n\n end",
"title": ""
},
{
"docid": "cd99a4c9679e9cea0d7fea16255202e5",
"score": "0.57338685",
"text": "def fit_predict(x, y = nil)\n trans_x = apply_transforms(x, y, fit: true)\n last_estimator.fit_predict(trans_x)\n end",
"title": ""
},
{
"docid": "16c4dce99ac23807a7ca2b05c81f7638",
"score": "0.5728622",
"text": "def train_on_batch(x, y)\n raise DNNError, \"The model is not optimizer setup complete.\" unless @optimizer\n raise DNNError, \"The model is not loss_func setup complete.\" unless @loss_func\n check_xy_type(x, y)\n call_callbacks(:before_train_on_batch)\n DNN.learning_phase = true\n output_tensors = call(Tensor.convert(x))\n if output_tensors.is_a?(Array)\n loss_data = []\n output_tensors.each.with_index do |out, i|\n loss_opt = {}\n loss_opt[:layers] = layers if i == 0\n loss_opt[:loss_weight] = @loss_weights[i] if @loss_weights\n loss = @loss_func[i].loss(out, Tensor.convert(y[i]), **loss_opt)\n loss_data << loss.data.to_f\n loss.link.backward(Xumo::SFloat.ones(y[i][0...1, false].shape[0], 1))\n end\n else\n out = output_tensors\n loss = @loss_func.loss(out, Tensor.convert(y), layers: layers)\n loss_data = loss.data.to_f\n loss.link.backward(Xumo::SFloat.ones(y[0...1, false].shape[0], 1))\n end\n @optimizer.update(get_all_trainable_params)\n @last_log[:train_loss] = loss_data\n call_callbacks(:after_train_on_batch)\n loss_data\n end",
"title": ""
},
{
"docid": "0d6d12b1286b39f0ead12a75c47d5b4b",
"score": "0.5725037",
"text": "def add_train(train)\n @trains << train\n end",
"title": ""
},
{
"docid": "0d6d12b1286b39f0ead12a75c47d5b4b",
"score": "0.5725037",
"text": "def add_train(train)\n @trains << train\n end",
"title": ""
},
{
"docid": "3a3bd7a3bb04f54c5ad9fce92d03671c",
"score": "0.57241845",
"text": "def set_train\n @train = Train.find(params[:train_id])\n end",
"title": ""
},
{
"docid": "3a3bd7a3bb04f54c5ad9fce92d03671c",
"score": "0.57241845",
"text": "def set_train\n @train = Train.find(params[:train_id])\n end",
"title": ""
},
{
"docid": "06548735686e8387f4ef717bd1be1b44",
"score": "0.5703706",
"text": "def train(observations)\n registered =\n begin\n Marshal.load(File.read(\"registered.t\"))\n rescue\n $stderr.puts \"Training model for 'registered'\"\n\n Bagging.bootstrap(150, :registered, observations.map{|x| x.except([:unregistered, :total]) }) do |sample|\n CART.regression(:registered, sample, -1, 5)\n end.tap do |ensemble|\n File.open(\"registered.t\", \"w\"){|io| io.write(Marshal.dump(ensemble)) }\n end\n\n # Boosting.stochastic(50, 0.65, :registered, observations.map{|x| x.except([:unregistered, :total]) }) do |sample|\n # CART.regression(:registered, sample, 3)\n # end.tap do |ensemble|\n # File.open(\"registered.t\", \"w\"){|io| io.write(Marshal.dump(ensemble)) }\n # end\n end\n\n unregistered =\n begin\n Marshal.load(File.read(\"unregistered.t\"))\n rescue\n $stderr.puts \"Training model for 'unregistered'\"\n\n Bagging.bootstrap(150, :unregistered, observations.map{|x| x.except([:registered, :total]) }) do |sample|\n CART.regression(:unregistered, sample, -1, 5)\n end.tap do |ensemble|\n File.open(\"unregistered.t\", \"w\"){|io| io.write(Marshal.dump(ensemble)) }\n end\n\n # Boosting.stochastic(50, 0.65, :unregistered, observations.map{|x| x.except([:registered, :total]) }) do |sample|\n # CART.regression(:unregistered, sample, 3)\n # end.tap do |ensemble|\n # File.open(\"unregistered.t\", \"w\"){|io| io.write(Marshal.dump(ensemble)) }\n # end\n end\n\n [registered, unregistered]\nend",
"title": ""
},
{
"docid": "33150f737018df6522ac485ee003ccc6",
"score": "0.5696556",
"text": "def train_on_batch(x, y)\n raise DNNError, \"The model is not optimizer setup complete.\" unless @optimizer\n raise DNNError, \"The model is not loss_func setup complete.\" unless @loss_func\n Utils.check_input_data_type(\"x\", x, Xumo::SFloat)\n Utils.check_input_data_type(\"y\", y, Xumo::SFloat)\n set_learning_phase(true)\n inputs = Tensor.convert(x)\n outputs = call(*inputs)\n losses = optimize(outputs, Tensor.convert(y))\n if losses.is_a?(Array)\n losses.map { |loss| Utils.to_f(loss.data) }\n else\n Utils.to_f(losses.data)\n end\n end",
"title": ""
},
{
"docid": "1fb6204f42e8d28df13c92e3ca12c25a",
"score": "0.5693866",
"text": "def train(training_examples)\n # Iterate over the entire training set T times.\n #\n NUM_PASSES.times do |iteration_number|\n log(\"Beginning iteration number #{iteration_number+1}...\")\n training_examples.each do |tagged_example|\n real_tags,words = split_tags_and_words(tagged_example)\n tags = states_of_events(words)\n if (tags != real_tags)\n update_weights(tagged_example, tags)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "41cae0b44066a34f3a068e3737114917",
"score": "0.5688159",
"text": "def train vec_lst, debug: false\n # Two ways here:\n # - Batch: canonical, centrs updated with each vec\n # - Parallel: could be parallel either on simils or on training (?)\n # Unsure on the correctness of either Parallel, let's stick with Batch\n vec_lst.each_with_index do |vec, i|\n trained_idx = train_one vec\n print '.' if debug\n @ntrains[trained_idx] += 1 if @ntrains\n end\n end",
"title": ""
},
{
"docid": "506b3ce8ddd5c34083c7aef84e03d7f0",
"score": "0.56792325",
"text": "def set_train\n @train = Train.find(params[:train_id]) if params[:train_id]\n end",
"title": ""
},
{
"docid": "c4bb1f0306eead5c90776c3fe625865d",
"score": "0.56614256",
"text": "def fit_by_iterator(train_iterator, epochs,\r\n batch_size: 1,\r\n initial_epoch: 1,\r\n test: nil,\r\n verbose: true,\r\n need_accuracy: true,\r\n io: $stdout)\r\n start_fit_by_iterator(train_iterator, epochs,\r\n batch_size: batch_size,\r\n initial_epoch: initial_epoch,\r\n test: test,\r\n verbose: verbose,\r\n need_accuracy: need_accuracy,\r\n io: io)\r\n update while training?\r\n end",
"title": ""
},
{
"docid": "5b7ab3007f58a2a9d9bd86f7b7f402c1",
"score": "0.5660052",
"text": "def train (duration = nil)\n # Trying to recognize 8, so 8 is 1, other is -1\n if duration.nil?\n while do_train(@epochs) != 100\n @epochs += 1\n end\n else\n 1.upto(duration) do | i |\n do_train(i)\n end\n end\n end",
"title": ""
},
{
"docid": "f7815da04818c1b4ca2753bb5fb75fc7",
"score": "0.5659572",
"text": "def set_train\n @train = Train.find(params[:id])\n end",
"title": ""
},
{
"docid": "fbfd7c9e5318d56ab3ff0910d2ff85da",
"score": "0.5618894",
"text": "def train(args = {}); end",
"title": ""
},
{
"docid": "293c440feaf1ab40d3745baaf3dad063",
"score": "0.56179905",
"text": "def predict input\r\n\t\t@lr.predict input\r\n\tend",
"title": ""
},
{
"docid": "b54ff776ebeb30a26aa9345fbdcc310b",
"score": "0.560277",
"text": "def fit(x, y)\n x = ::Rumale::Validation.check_convert_sample_array(x)\n y = ::Rumale::Validation.check_convert_label_array(y)\n ::Rumale::Validation.check_sample_size(x, y)\n\n @encoder = ::Rumale::Preprocessing::LabelEncoder.new\n y_encoded = @encoder.fit_transform(y)\n @classes = Numo::NArray[*@encoder.classes]\n @estimators.each_key { |name| @estimators[name].fit(x, y_encoded) }\n\n self\n end",
"title": ""
},
{
"docid": "5d3eecca9064e3bd26a33cc65770e5ea",
"score": "0.5592768",
"text": "def fit(x, y) # rubocop:disable Metrics/AbcSize\n x = ::Rumale::Validation.check_convert_sample_array(x)\n y = ::Rumale::Validation.check_convert_label_array(y)\n ::Rumale::Validation.check_sample_size(x, y)\n\n ## Initialize some variables.\n n_samples, n_features = x.shape\n @estimators = []\n @feature_importances = Numo::DFloat.zeros(n_features)\n @params[:max_features] = n_features unless @params[:max_features].is_a?(Integer)\n @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp\n @classes = Numo::Int32.asarray(y.to_a.uniq.sort)\n n_classes = @classes.shape[0]\n sub_rng = @rng.dup\n ## Boosting.\n classes_arr = @classes.to_a\n y_codes = Numo::DFloat.zeros(n_samples, n_classes) - 1.fdiv(n_classes - 1)\n n_samples.times { |n| y_codes[n, classes_arr.index(y[n])] = 1.0 }\n observation_weights = Numo::DFloat.zeros(n_samples) + 1.fdiv(n_samples)\n @params[:n_estimators].times do |_t|\n # Fit classfier.\n ids = ::Rumale::Utils.choice_ids(n_samples, observation_weights, sub_rng)\n break if y[ids].to_a.uniq.size != n_classes\n\n tree = ::Rumale::Tree::DecisionTreeClassifier.new(\n criterion: @params[:criterion], max_depth: @params[:max_depth],\n max_leaf_nodes: @params[:max_leaf_nodes], min_samples_leaf: @params[:min_samples_leaf],\n max_features: @params[:max_features], random_seed: sub_rng.rand(::Rumale::Ensemble::Value::SEED_BASE)\n )\n tree.fit(x[ids, true], y[ids])\n # Calculate estimator error.\n proba = tree.predict_proba(x).clip(1.0e-15, nil)\n pred = Numo::Int32.asarray(Array.new(n_samples) { |n| @classes[proba[n, true].max_index] })\n inds = pred.ne(y)\n error = (observation_weights * inds).sum / observation_weights.sum\n # Store model.\n @estimators.push(tree)\n @feature_importances += tree.feature_importances\n break if error.zero?\n\n # Update observation weights.\n log_proba = Numo::NMath.log(proba)\n observation_weights *= Numo::NMath.exp(-1.0 * (n_classes - 1).fdiv(n_classes) * (y_codes * log_proba).sum(axis: 1))\n observation_weights = observation_weights.clip(1.0e-15, nil)\n sum_observation_weights = observation_weights.sum\n break if sum_observation_weights.zero?\n\n observation_weights /= sum_observation_weights\n end\n @feature_importances /= @feature_importances.sum\n self\n end",
"title": ""
},
{
"docid": "2487582608b22bc19b644b8321f514e1",
"score": "0.55731374",
"text": "def train(num_steps=20_000, batch_size=64, layer_sizes=[64, 64])\n RubyPython.start_from_virtualenv(@virtualenv)\n\n sys = RubyPython.import('sys')\n sys.path.append(\"#{File.expand_path('..', Dir.pwd)}/py/melody_rnn\")\n RubyPython.import('train')\n RubyPython.stop\n end",
"title": ""
},
{
"docid": "5ccdf5b96b418e3e9e829989c0f0cb9d",
"score": "0.55702436",
"text": "def fit(x, y)\n # initialize some variables.\n n_features = x.shape[1]\n @params[:max_features] = n_features if @params[:max_features].nil?\n @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp\n n_outputs = y.shape[1].nil? ? 1 : y.shape[1]\n # train regressor.\n @base_predictions = n_outputs > 1 ? y.mean(0) : y.mean\n @estimators = if n_outputs > 1\n multivar_estimators(x, y)\n else\n partial_fit(x, y, @base_predictions)\n end\n # calculate feature importances.\n @feature_importances = if n_outputs > 1\n multivar_feature_importances\n else\n @estimators.sum(&:feature_importances)\n end\n self\n end",
"title": ""
},
{
"docid": "3eb3c068d9b53f13977dbd5e2b5b5b2f",
"score": "0.5550165",
"text": "def isTrained?\r\n\t\traise \"OllieMlSupervisedBase::#{self.class}::ModelNotTrainedException\" if ! @lr\r\n\tend",
"title": ""
},
{
"docid": "12d30252a8b3783fc7abaac80faba376",
"score": "0.5532151",
"text": "def predict_using_train_and_coords_file(options)\n prefix = File.basename(options[:cds_and_coords_training_path])\n startuse = create_model(:glimmer_dir_path => options[:glimmer_dir_path], :cds_and_coords_training_path => options[:cds_and_coords_training_path], :prefix => prefix, :suppress_messages => options[:suppress_messages])\n run_glimmer_using_model(:glimmer_dir_path => options[:glimmer_dir_path], :input_sequence_path => options[:input_sequence_path], :glimmer_predict_filename => options[:glimmer_predict_filename], :startuse => startuse, :prefix => prefix, :suppress_messages => options[:suppress_messages])\n end",
"title": ""
},
{
"docid": "313eb53e8a6382953e94a2d8ba2c17b2",
"score": "0.55213463",
"text": "def train(options, &block)\n raise NotImplementedError.new\n end",
"title": ""
},
{
"docid": "3b9b7f0b4b06372f52dd7a964c200c87",
"score": "0.551744",
"text": "def train(trainers)\n trainers.each { teach(jedi_school) }\n end",
"title": ""
},
{
"docid": "393caeb0a9490be461779ecc9bf08e7a",
"score": "0.55110675",
"text": "def create\n ml_model = current_user.ml_models.find(params[:ml_model_id])\n if ml_model.ready?\n parameter_names = ml_model.train_parameters.pluck(:name)\n parameter_keys = params[:target_parameters].keys.compact\n if parameter_keys.sort == parameter_names.sort\n\n # TODO: use actual host\n # response = Faraday.post(\"http://44.228.160.94/prediction/#{ml_model.identifier}\", params[:target_parameters].to_json, \"Content-Type\" => \"application/json\")\n response = Faraday.post(\"http://44.228.160.94/prediction/7af365fb-587c-420c-b615-3e522d79a3ce\", params[:target_parameters].to_json, \"Content-Type\" => \"application/json\")\n render json: {predicted: JSON(response.body).dig(\"result\").to_s}, status: 200\n else\n render json: {message: 'invalid parameters'}, status: 422\n end\n else\n render json: {message: 'this model has not been trained'}, status: 422\n end\n end",
"title": ""
},
{
"docid": "ea115e43db3eabd7bc9ce0f8bfc08552",
"score": "0.5510645",
"text": "def train(examples)\n avgErr = 0\n n = 0\n\n examples.each do |example|\n actual = feedForward(example[:input])\n error = meanSquareError(actual, example[:output])\n backPropogation(actual, example[:output])\n\n avgErr = (avgErr * n + error) / (n + 1)\n n += 1\n end\n return avgErr\n end",
"title": ""
},
{
"docid": "18039596d808a8d21c0d11e2634955cf",
"score": "0.5483508",
"text": "def train(sample_data=training_set,max_epochs=1000,epochs_between_reports=1000,desired_error=0.0001)\n #p sample_data\n if sample_data.is_a? RubyFann::TrainData\n\n @brain.init_weights(sample_data)\n @brain.train_on_data(sample_data, max_epochs, epochs_between_reports, desired_error)\n else\n p sample_data\n raise \"Expecting Ruby::Fann training set!\"\n end\n end",
"title": ""
},
{
"docid": "adb886aee642132da544219937252e66",
"score": "0.5478274",
"text": "def fit(x, y)\n x = ::Rumale::Validation.check_convert_sample_array(x)\n y = ::Rumale::Validation.check_convert_label_array(y)\n ::Rumale::Validation.check_sample_size(x, y)\n\n n_samples, n_features = x.shape\n\n @encoder = ::Rumale::Preprocessing::LabelEncoder.new\n y_encoded = @encoder.fit_transform(y)\n @classes = Numo::NArray[*@encoder.classes]\n\n # training base classifiers with all training data.\n @estimators.each_key { |name| @estimators[name].fit(x, y_encoded) }\n\n # detecting feature extraction method and its size of output for each base classifier.\n @stack_method = detect_stack_method\n @output_size = detect_output_size(n_features)\n\n # extracting meta features with base classifiers.\n n_components = @output_size.values.sum\n z = Numo::DFloat.zeros(n_samples, n_components)\n\n kf = ::Rumale::ModelSelection::StratifiedKFold.new(\n n_splits: @params[:n_splits], shuffle: @params[:shuffle], random_seed: @params[:random_seed]\n )\n\n kf.split(x, y_encoded).each do |train_ids, valid_ids|\n x_train = x[train_ids, true]\n y_train = y_encoded[train_ids]\n x_valid = x[valid_ids, true]\n f_start = 0\n @estimators.each_key do |name|\n est_fold = Marshal.load(Marshal.dump(@estimators[name]))\n f_last = f_start + @output_size[name]\n f_position = @output_size[name] == 1 ? f_start : f_start...f_last\n z[valid_ids, f_position] = est_fold.fit(x_train, y_train).public_send(@stack_method[name], x_valid)\n f_start = f_last\n end\n end\n\n # concatenating original features.\n z = Numo::NArray.hstack([z, x]) if @params[:passthrough]\n\n # training meta classifier.\n @meta_estimator.fit(z, y_encoded)\n\n self\n end",
"title": ""
},
{
"docid": "506d9a0401275c0b9f270208ca8ff2ad",
"score": "0.5465285",
"text": "def each_train\n @trains.each { |train| yield train }\n end",
"title": ""
},
{
"docid": "672ebd30b8dfeadc0033ecfa3727977f",
"score": "0.5464425",
"text": "def fit(x, y)\n x = ::Rumale::Validation.check_convert_sample_array(x)\n y = ::Rumale::Validation.check_convert_target_value_array(y)\n ::Rumale::Validation.check_sample_size(x, y)\n\n n_samples, n_features = x.shape\n n_outputs = y.ndim == 1 ? 1 : y.shape[1]\n\n # training base regressors with all training data.\n @estimators.each_key { |name| @estimators[name].fit(x, y) }\n\n # detecting size of output for each base regressor.\n @output_size = detect_output_size(n_features)\n\n # extracting meta features with base regressors.\n n_components = @output_size.values.sum\n z = Numo::DFloat.zeros(n_samples, n_components)\n\n kf = ::Rumale::ModelSelection::KFold.new(\n n_splits: @params[:n_splits], shuffle: @params[:shuffle], random_seed: @params[:random_seed]\n )\n\n kf.split(x, y).each do |train_ids, valid_ids|\n x_train = x[train_ids, true]\n y_train = n_outputs == 1 ? y[train_ids] : y[train_ids, true]\n x_valid = x[valid_ids, true]\n f_start = 0\n @estimators.each_key do |name|\n est_fold = Marshal.load(Marshal.dump(@estimators[name]))\n f_last = f_start + @output_size[name]\n f_position = @output_size[name] == 1 ? f_start : f_start...f_last\n z[valid_ids, f_position] = est_fold.fit(x_train, y_train).predict(x_valid)\n f_start = f_last\n end\n end\n\n # concatenating original features.\n z = Numo::NArray.hstack([z, x]) if @params[:passthrough]\n\n # training meta regressor.\n @meta_estimator.fit(z, y)\n\n self\n end",
"title": ""
},
{
"docid": "31897c1f7d160be56932e00baa810978",
"score": "0.54600316",
"text": "def train\n e = 0\n correct = 0\n @training_examples.each_with_index do |ei, i|\n lambdas = Array.new\n \n o = evaluate(ei)\n\n correct += 1 if o.last.round == @training_outputs[i][0]\n\n for k in @output_neurons do\n lambdas[k] = o[k] * (1.0 - o[k] ) * (@training_outputs[i][0] - o[k] )\n end \n\n for h in @hidden_neurons do\n lambdas[h] = o[h] * (1.0 - o[h]) * @output_neurons.inject(0) {|acc, k| acc + @weights[k][h] * lambdas[k]}\n end\n \n e += ((@training_outputs[i][0] - o.last)**2.0) / @training_outputs.size\n\n update_weights(lambdas, o)\n end\n \n @current_error = e\n \n @current_iteration += 1\n \n correct\n end",
"title": ""
},
{
"docid": "327ff9cf49a497192369610903960c31",
"score": "0.54598373",
"text": "def fitted(with_ran_ef: true)\n if with_ran_ef then\n @model_data.mu.to_flat_a\n else\n @model_data.x.dot(@model_data.beta).to_flat_a\n end\n end",
"title": ""
},
{
"docid": "8201cd1e32fe4780817ae48f80beb729",
"score": "0.5459033",
"text": "def train_with_file(path)\n train_with_text(File.read(path))\n end",
"title": ""
},
{
"docid": "622f486252766f48f68076a3702f32b4",
"score": "0.5454922",
"text": "def load_training_data x_data, y_data, normalize = true\r\n\r\n @normalize = normalize\r\n\r\n # normalize the x_data\r\n x_data = normalize_data( x_data ) if @normalize\r\n\r\n # add 1 column to our data\r\n x_data = x_data.map { |r| [1].concat(r) }\r\n\r\n # build our x Matrix & y Vector\r\n @x = Matrix.rows( x_data )\r\n @y = Matrix.rows( y_data.collect { |e| [e] } )\r\n\r\n @theta = Matrix.zero(@x.column_size, 1)\r\n end",
"title": ""
},
{
"docid": "9a215e133077497a698db7cf6cd09bbf",
"score": "0.5453548",
"text": "def fit(x, y)\n x = Rumale::Validation.check_convert_sample_array(x)\n y = Rumale::Validation.check_convert_label_array(y)\n Rumale::Validation.check_sample_size(x, y)\n\n @classes = Numo::Int32[*y.to_a.uniq.sort]\n x = expand_feature(x) if fit_bias?\n\n if multiclass_problem?\n n_classes = @classes.size\n n_features = x.shape[1]\n n_features -= 1 if fit_bias?\n @weight_vec = Numo::DFloat.zeros(n_classes, n_features)\n @bias_term = Numo::DFloat.zeros(n_classes)\n @prob_param = Numo::DFloat.zeros(n_classes, 2)\n models = if enable_parallel?\n parallel_map(n_classes) do |n|\n bin_y = Numo::Int32.cast(y.eq(@classes[n])) * 2 - 1\n partial_fit(x, bin_y)\n end\n else\n Array.new(n_classes) do |n|\n bin_y = Numo::Int32.cast(y.eq(@classes[n])) * 2 - 1\n partial_fit(x, bin_y)\n end\n end\n models.each_with_index { |model, n| @weight_vec[n, true], @bias_term[n], @prob_param[n, true] = model }\n else\n negative_label = @classes[0]\n bin_y = Numo::Int32.cast(y.ne(negative_label)) * 2 - 1\n @weight_vec, @bias_term, @prob_param = partial_fit(x, bin_y)\n end\n\n self\n end",
"title": ""
},
{
"docid": "723e6cad704ea91131a57bd4cc2e36b0",
"score": "0.5449995",
"text": "def train max_epoch\n epoch = 0\n while epoch < max_epoch do\n for d in 0..@X.size()-1\n epoch = epoch + 1\n @output_layer.target = @Y[d]\n @hidden_layers[0].input = @X[d]\n \n # Forward propagate.\n # i.e compute outputs based on input and current estimated weight vector \n # starting from hidden layer one to the final output layer.\n output = @hidden_layers[0].compute_output\n for i in 1..@hidden_layers.size()-1 \n @hidden_layers[i].input = output\n output = @hidden_layers[i].compute_output\n end\n @output_layer.input = output\n @output_layer.compute_output\n\n # Backward propagate.\n # i.e compute error on the output layer and propagate adjustment values back\n # the the hidden units iteratively till the first hidden unit.\n sigma = @output_layer.compute_sigma\n weights = @output_layer.update_weights\n \n i = @hidden_layers.size()-1\n while i >= 0 do\n sigma = @hidden_layers[i].compute_sigma(sigma,weights)\n weights = @hidden_layers[i].update_weights\n i = i - 1\n end\n end\n end\n dump_weights\n end",
"title": ""
},
{
"docid": "9798d4602f7e273cc1591a7d223e4d7f",
"score": "0.5437326",
"text": "def predict(x)\n @best_estimator.predict(x)\n end",
"title": ""
},
{
"docid": "c7d5eee34db7221c41bb0a1cb488f6a8",
"score": "0.5434368",
"text": "def fit(x, y)\n x = ::Rumale::Validation.check_convert_sample_array(x)\n y = ::Rumale::Validation.check_convert_target_value_array(y)\n ::Rumale::Validation.check_sample_size(x, y)\n\n # Initialize some variables.\n n_samples, n_features = x.shape\n @params[:max_features] = Math.sqrt(n_features).to_i if @params[:max_features].nil?\n @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp\n single_target = y.shape[1].nil?\n sub_rng = @rng.dup\n rngs = Array.new(@params[:n_estimators]) { Random.new(sub_rng.rand(::Rumale::Ensemble::Value::SEED_BASE)) }\n # Construct forest.\n @estimators =\n if enable_parallel?\n parallel_map(@params[:n_estimators]) do |n|\n bootstrap_ids = Array.new(n_samples) { rngs[n].rand(0...n_samples) }\n plant_tree(rngs[n].seed).fit(x[bootstrap_ids, true], single_target ? y[bootstrap_ids] : y[bootstrap_ids, true])\n end\n else\n Array.new(@params[:n_estimators]) do |n|\n bootstrap_ids = Array.new(n_samples) { rngs[n].rand(0...n_samples) }\n plant_tree(rngs[n].seed).fit(x[bootstrap_ids, true], single_target ? y[bootstrap_ids] : y[bootstrap_ids, true])\n end\n end\n @feature_importances =\n if enable_parallel?\n parallel_map(@params[:n_estimators]) { |n| @estimators[n].feature_importances }.sum\n else\n @estimators.sum(&:feature_importances)\n end\n @feature_importances /= @feature_importances.sum\n self\n end",
"title": ""
},
{
"docid": "8aeb1c118e9eaed14ac3b3f14ddc25a5",
"score": "0.54331136",
"text": "def fit_predict(x)\n check_enable_linalg('fit_predict')\n x = ::Rumale::Validation.check_convert_sample_array(x)\n\n fit(x).predict(x)\n end",
"title": ""
},
{
"docid": "99830f4af12e16e9c498cce12b2c8a39",
"score": "0.5431986",
"text": "def train nrun\n first = min_eligible_trg + (nrun-1) * test_size\n last = first + train_size\n raise NoDataLeft unless last + test_size < nrows # make sure there's enough data\n DataModeler::Dataset.new data, ds_args.merge(first_idx: first, end_idx: last)\n end",
"title": ""
},
{
"docid": "c1dbe7b2f919914ca95b14ebcd79aac1",
"score": "0.5429923",
"text": "def train\n decrease = false\n trainings = self.trainings.not_finished.map(&:discount_round)\n trainings.each do |training|\n decrease = true\n if training.round_count == 0\n value = self.attributes[training.ability]\n self.update_attribute(training.ability, value + training.improvement ) if value <= MAX_QUALITY\n end\n end\n\n PLAYER_ATTRIBUTES.each do |attribute|\n percentil = self[attribute] / 10\n acum = 0\n if !decrease\n acum = rand(percentil)\n end\n if self[attribute] - acum >= 0\n self[attribute] -= acum\n else\n self[attribute] = 0\n end\n self.save\n end\n self.update_attribute('quality', self.average_qualities)\n self.save\n end",
"title": ""
},
{
"docid": "0ca4bd18ebd13f4a6cfaf5461c6278f2",
"score": "0.54262424",
"text": "def train(filename, bar = nil)\n lines = File.read(filename).each_line.to_a\n bar.total = lines.length unless bar.nil?\n _train(lines, bar)\n end",
"title": ""
},
{
"docid": "b593984046e5194874b7e96b25d1826e",
"score": "0.54163617",
"text": "def training_set\n results = Guess.select([:is_correct, :height, :weight, :pet_guess]).limit(2000)\n\n data = transfrom_training_set(results)\n\n if data.count < 200\n self.training_set_seed()\n else\n data\n end\n end",
"title": ""
},
{
"docid": "22a3016fb51f560cb58ca8246c89021f",
"score": "0.54090446",
"text": "def create\n @company = Company.find( params[:company_id])\n @training = @company.trainings.build( params[:training])\n if @training.save\n redirect_to manage_company_trainings_path( params[:company_id])\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "47f4aa36e74824b8db83e4aac6fd3808",
"score": "0.5402024",
"text": "def fit_predict(x)\n x = ::Rumale::Validation.check_convert_sample_array(x)\n\n fit(x).predict(x)\n end",
"title": ""
},
{
"docid": "45ed99d3683cb4a1f7c3054d158ccd46",
"score": "0.53946626",
"text": "def fit(x, y)\n x = ::Rumale::Validation.check_convert_sample_array(x)\n y = ::Rumale::Validation.check_convert_label_array(y)\n ::Rumale::Validation.check_sample_size(x, y)\n\n @classes = Numo::Int32[*y.to_a.uniq.sort]\n n_classes = @classes.size\n n_features = x.shape[1]\n\n if n_classes > 2\n @weight_vec = Numo::DFloat.zeros(n_classes, n_features)\n @prob_param = Numo::DFloat.zeros(n_classes, 2)\n models = if enable_parallel?\n parallel_map(n_classes) do |n|\n bin_y = Numo::Int32.cast(y.eq(@classes[n])) * 2 - 1\n partial_fit(x, bin_y)\n end\n else\n Array.new(n_classes) do |n|\n bin_y = Numo::Int32.cast(y.eq(@classes[n])) * 2 - 1\n partial_fit(x, bin_y)\n end\n end\n models.each_with_index { |model, n| @weight_vec[n, true], @prob_param[n, true] = model }\n else\n negative_label = y.to_a.uniq.min\n bin_y = Numo::Int32.cast(y.ne(negative_label)) * 2 - 1\n @weight_vec, @prob_param = partial_fit(x, bin_y)\n end\n\n self\n end",
"title": ""
},
{
"docid": "aa2dc7eff472f69d997a4a215b56fa38",
"score": "0.5376653",
"text": "def train_with_sentence(sentence)\n train_with_ngrams(ngrams_from_sentence(sentence))\n end",
"title": ""
},
{
"docid": "357491b583a5157ffaa5d69b844bd3f9",
"score": "0.5351196",
"text": "def train(item, category)\n features = get_features(item)\n # increment the feature count\n features.each do |feature|\n increment_feature(feature, category)\n end\n # increment he category count\n increment_category(category)\n end",
"title": ""
},
{
"docid": "47d29613f041fcde4ad03fc5eb829cce",
"score": "0.5341154",
"text": "def set_training\n @training = Training.find(params[:id])\n end",
"title": ""
},
{
"docid": "916f69dea558d2ff680dc116ed2541f6",
"score": "0.5335333",
"text": "def create\n @train = Train.new(params[:train])\n @trains = Train.all\n respond_to do |format|\n if @train.save\n format.html { redirect_to new_train_path, notice: 'Train was successfully created.' }\n format.json { render json: @train, status: :created, location: @train }\n else\n format.html { render action: \"new\" }\n format.json { render json: @train.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc3823d4b31b7cf8fd7c2058915c5516",
"score": "0.53301096",
"text": "def set_training\n @training = current_user.trainings.find(params[:id])\n end",
"title": ""
},
{
"docid": "a1c8d442e2a4d29e603daa50f7485a6d",
"score": "0.5300585",
"text": "def train_from_file(filename='../../data/training_set.json')\n file = File.read(File.expand_path(filename, __FILE__))\n data = JSON.parse(file)\n self.train(data)\n end",
"title": ""
},
{
"docid": "694020bcbd2ae02a4355dd7f68414933",
"score": "0.5290841",
"text": "def train_for(category)\n if self.label\n if read_attribute(:category_id)\n begin\n Record.bayesian_system.untrain(read_attribute(:category_id), self.label)\n rescue\n end\n end\n Record.bayesian_system.train(category.id, self.label)\n end\n self.category = category\n end",
"title": ""
},
{
"docid": "b82a6d58195f4f6b4a0f566a25af9a56",
"score": "0.52694696",
"text": "def set_training\n @training = Training.find(params[:id])\n end",
"title": ""
},
{
"docid": "bfb2d6d38b485884dca1d9b68338ecc2",
"score": "0.5257019",
"text": "def train *samples\n unless samples.all? { |s| s.is_a? Hogweed::Sample }\n raise TypeError::new(\"Sample is not a Hogweed::Sample\")\n end\n errors = true\n @iterations.times do\n errors = false\n error = true\n until error.nil?\n samples.each do |sample|\n out = self.feed *sample.input\n error = if out != sample.output\n errors = true\n sample.output - out\n else\n nil\n end\n @weights.back_prop(sample.input, error) if error\n end\n end\n break if not errors\n end\n if errors\n raise \"Did not converge\"\n end\n end",
"title": ""
},
{
"docid": "efd8824550663b8b623feb31cc804f85",
"score": "0.5254873",
"text": "def set_train_record\n @train_record = TrainRecord.find(params[:id])\n end",
"title": ""
}
] |
7860089c84fd381131a370d4ba43dc54
|
Condenses our restaurant address into one string for display purposes in our application.
|
[
{
"docid": "8f6d6070bbd534023d2d89f22c873ba3",
"score": "0.0",
"text": "def get_city_state_zip\n\t\tcity_state_zip = self.city + \", \" + self.state + \" #{self.zip}\"\n\tend",
"title": ""
}
] |
[
{
"docid": "8a53f94af64f26da5cbb815f72e2b41c",
"score": "0.80551547",
"text": "def full_address\n return \"#{business_address} <br/> #{(city ? (city.to_s+',') : '')} #{(state ? (state.to_s+',') : '')} #{zipcode}\"\n end",
"title": ""
},
{
"docid": "be2577218ebd68220acb07b4fbdad1c8",
"score": "0.8010508",
"text": "def full_address\n [address.to_s.titleize, city.to_s.titleize, state.to_s].delete_if(&:blank?).join(', ') + ' ' + zip.to_s\n end",
"title": ""
},
{
"docid": "913b64c7f023a7f73062c64b0215b973",
"score": "0.79392266",
"text": "def full_address\n if self.street2 != \"\"\n \"#{self.street1}\" + tag('br') + \"#{self.street2}\" + tag('br') + \"#{self.city}, #{self.state} #{self.zip}\"\n elsif self.street1 != \"\" && self.zip != \"\"\n \"#{self.street1}\" + tag('br') + \"#{self.city}, #{self.state} #{self.zip}\"\n else\n \"#{self.city}, #{self.state}\"\n end\n end",
"title": ""
},
{
"docid": "afc1fb756ae2c17cc6a1b2deecf0ee5f",
"score": "0.7874761",
"text": "def full_address\n\t\tres = []\n\t\tres << number\n\t\tif not soi.blank? and soi.strip != '-'\n\t\t\tres << \"ซอย#{soi}\"\n\t\tend\n\t\tres << \"ถนน#{road}\"\n\t\tif province.include? 'กรุงเทพ'\n\t\t\tres << \"แขวง#{subdistrict}\"\n\t\t\tres << \"เขต#{district}\"\n\t\telse\n\t\t\tres << \"ตำบล#{subdistrict}\"\n\t\t\tres << \"อำเภอ#{district}\"\n\t\tend\n\t\tres << \"จังหวัด#{province}\"\n\t\tres << zip\n\t\tres.join \" \"\n\tend",
"title": ""
},
{
"docid": "ea76316c29a044cb255b8d145644f36e",
"score": "0.78614384",
"text": "def short_formatted_address\n [self.street_number, self.route].select(&:present?).join(' ')\n end",
"title": ""
},
{
"docid": "3dc921a1335c9b55187ae946d5156f18",
"score": "0.78557587",
"text": "def full_address\n [address_line_1, city, region, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "afe1923b36d0ff47392a0ee2e29b6482",
"score": "0.7843097",
"text": "def full_address\n address + \", \" + location + \" \" + postcode.to_s\n end",
"title": ""
},
{
"docid": "80ed3a619d7392143a24181e8d5beee7",
"score": "0.7840568",
"text": "def full_address\n return \"#{address_line_1}, #{zipcode}, #{city}, #{country}\"\n end",
"title": ""
},
{
"docid": "1a823952808c5e6a6b9ab39cb92fad79",
"score": "0.78299075",
"text": "def full_street_address\n [add1, add2, city, state, post_code].compact.join(', ')\n end",
"title": ""
},
{
"docid": "981b2c8b3d20b57a9cae725fb029fcc8",
"score": "0.78137827",
"text": "def full_address\n return \"#{@address}, ##{@appt_number}, #{@city} #{@state.upcase}, 60611\"\n end",
"title": ""
},
{
"docid": "f1da254377dfc9aecb0572c2e50d93d3",
"score": "0.7796132",
"text": "def full_address\n \"#{address1}, #{address2}, #{address3}, #{city}, #{county}, #{postcode}, #{country}\"\n end",
"title": ""
},
{
"docid": "b5c5a25011d6f01cfe2a6c7e17a4d4da",
"score": "0.77929115",
"text": "def full_address\n [street_one, city, state, zip].compact.join(\", \")\n end",
"title": ""
},
{
"docid": "4956d18a98a703edb6c7504ab656e7a6",
"score": "0.7792016",
"text": "def full_address\n \"#{address_line_1}, #{city}, #{state}, #{zip}\"\n end",
"title": ""
},
{
"docid": "deeca4d35caff8d767ae4f4565cb0092",
"score": "0.7782802",
"text": "def full_address\n addr = self.address_one\n if (self.apt_num)\n addr+= (\" \"+self.apt_num)\n end\n if (self.address_two) \n addr+=\"\\n\"\n addr+=self.address_two\n end\n addr+=\"\\n\"\n addr+=self.city+\", \"+self.state+\", \"+self.zip\n end",
"title": ""
},
{
"docid": "c3f606bc86a956f2dfb80c8b1cbe7360",
"score": "0.77787405",
"text": "def full_address\n [address, city, postcode, state, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "aaba892f8e9b67598ff9630ccafd6030",
"score": "0.7766003",
"text": "def full_address\n [address, address_2, city, state, country].compact.join(\", \")\n end",
"title": ""
},
{
"docid": "bb12184445c54c4a06091392c885ff41",
"score": "0.7765475",
"text": "def full_address\n [address1, address2, city, state, zipcode].join(', ')\n end",
"title": ""
},
{
"docid": "0cb9fc6d94f1f6ae15bf06901c5e07f8",
"score": "0.77342653",
"text": "def full_address\n [address, coountry, city, state].compact.join(', ')\n end",
"title": ""
},
{
"docid": "07c0fb4e09290289f4d1aa8a0b79f039",
"score": "0.772625",
"text": "def full_address\n\t\t[street, city, state].compact.join(', ')\n \tend",
"title": ""
},
{
"docid": "bdc4cd551a865f4be52cac7294fc491d",
"score": "0.7719076",
"text": "def full_address\n \"#{address}, #{zipcode}, #{city}, #{country}\"\n end",
"title": ""
},
{
"docid": "12b199b4d97993948ef5122fae212ffc",
"score": "0.76906836",
"text": "def full_street_address\n [address1, address2, city, state, zip].compact.join(', ')\n end",
"title": ""
},
{
"docid": "ba78276831faa11f0576ebf741ec0f07",
"score": "0.7683287",
"text": "def full_address \n \"#{address1} #{city} #{postal_code}\"\n end",
"title": ""
},
{
"docid": "1bea02704be8331dbcd519291a6c6014",
"score": "0.76797354",
"text": "def full_address\n \"#{address}, #{city}, #{state}, #{zip}\"\n end",
"title": ""
},
{
"docid": "7769b9704582764740ce7669b3fe66c5",
"score": "0.76792574",
"text": "def full_address\n [address, city, state, country].compact.join(',')\n end",
"title": ""
},
{
"docid": "1cf73834118a2217a8fa5892a0075b53",
"score": "0.7676802",
"text": "def full_address\n \"#{address} #{city} #{state} #{postal}\"\n end",
"title": ""
},
{
"docid": "57812194416dfbf5e385f0dd29b26e25",
"score": "0.76755613",
"text": "def full_address\n output = street_address + \", \" + locality + \", \" +\n region + \" \" + postal_code.to_s\n return output\n end",
"title": ""
},
{
"docid": "2387de7519930efc6d431f8d2f3a2974",
"score": "0.76616347",
"text": "def full_address\n street_address + ' ' + postcode + ' ' + city\n end",
"title": ""
},
{
"docid": "6ab721df4cc0bf48814c9931784b99a0",
"score": "0.7641718",
"text": "def full_address\n\t\taddress_line_1 = self.address_line_1\n\t\taddress_line_2 = self.address_line_2\n\t\tcity = self.city\n\t\tpost_code = self.post_code\n\t\tfull_address = \"#{address_line_1}, #{address_line_2}, #{city}, #{post_code}\"\n\tend",
"title": ""
},
{
"docid": "6c5dd50c613172998957ad73cc23b2d2",
"score": "0.7641701",
"text": "def full_street_address\n [address, zip_code, city].compact.join(', ')\n end",
"title": ""
},
{
"docid": "a197ff0a870244d9dafee9f4dd9da7bf",
"score": "0.7641025",
"text": "def full_address\n [:address, :city, :state, :zip_code.to_s].compact.join(', ')\n end",
"title": ""
},
{
"docid": "2ebeeed65e2a79b111142475fb9ca4b3",
"score": "0.762771",
"text": "def full_address\n \"#{address}, #{zipcode} #{city}\"\n end",
"title": ""
},
{
"docid": "c892fec11e622fa9a4b27a2f26e8ce78",
"score": "0.7625585",
"text": "def full_address\n \"#{address} #{house_number} #{house_number_extension}, #{zipcode} #{city} #{country}\"\n end",
"title": ""
},
{
"docid": "20c89ce50259424098eaaf552f163db8",
"score": "0.7618099",
"text": "def full_address\n \"#{self.address_line1}, #{self.city}, #{self.state}, #{self.zip_code}\"\n end",
"title": ""
},
{
"docid": "2e77de17c7718fa36e902d2c97f34a42",
"score": "0.7604607",
"text": "def complete_address\n [street_address, city, zipcode].join(', ')\n end",
"title": ""
},
{
"docid": "bf18e5501060fadfc8f0a61717aabe20",
"score": "0.75914466",
"text": "def full_address \n [city, state_provence].join(', ')\n end",
"title": ""
},
{
"docid": "d1305427ad7995b0b7cdab1e6678cd40",
"score": "0.75862205",
"text": "def complete_address\n [address, city, state, zipcode, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "e64318d5f308f5e6373511d61a59927c",
"score": "0.75853914",
"text": "def full_address\n addr = String.new\n addr << \"#{street1}\"\n # yes, handling commas was a pain - I tried about 10 other ways before settling on this.\n # Fortunately, google maps is insanely smart and can take just about anything.\n # But this is also used by the RSS reader, so it needs to work well.\n addr << (addr == \"\" ? \"#{street2}\" : \", #{street2}\")\n addr << (addr == \"\" ? \"#{city}\" : \", #{city}\")\n addr << (addr == \"\" ? \"#{state}\" : \", #{state}\")\n addr << (addr == \"\" ? \"#{zip}\" : \" #{zip}\")\n return addr\n end",
"title": ""
},
{
"docid": "36ded811b1b0f70e03ef40a0f7c21fe6",
"score": "0.7578122",
"text": "def formatted_address\n address = [address_street]\n address << address_other\n address << address_city_state_postal\n address << model.country\n\n helpers.safe_join(address)\n end",
"title": ""
},
{
"docid": "6d4266c75ebb2a1096eea475236a906a",
"score": "0.7575176",
"text": "def full_address\n \t\"#{address_street}, #{address_city}, #{address_state} #{address_zip}\"\n end",
"title": ""
},
{
"docid": "39197e347cdebb53336a6a54aa77806f",
"score": "0.7554064",
"text": "def full_street_address\n [street_address, city].join(' ')\n end",
"title": ""
},
{
"docid": "d640663a4d58273a36156afde97849e9",
"score": "0.75462437",
"text": "def address\n [street, place, state, country].join(', ')\n end",
"title": ""
},
{
"docid": "eac9946d0b2fcaccbbaa11567907751d",
"score": "0.7536483",
"text": "def full_street_address\n address = \"\"\n address += self.address1 unless self.address1.blank?\n address += \", #{self.address2}\" unless self.address2.blank?\n address += \", \" unless address.blank?\n address += \"#{self.city}, #{self.state}\"\n address += \" #{self.zipcode}\" unless self.zipcode.blank?\n address\n end",
"title": ""
},
{
"docid": "f4ce367cd8b2345c98b1c3380ed7e09f",
"score": "0.75220144",
"text": "def full_address\n\t\t\t[:address, :city, :state, :zip_code.to_s].compact.join(', ')\n\tend",
"title": ""
},
{
"docid": "4b5de2bebeda2bb5aa14c5a4d421c0e3",
"score": "0.75140655",
"text": "def full_address\n \tif self.country.downcase === 'sweden' || self.country.downcase === 'germany'\n self.address + \", \" + self.postal_code + \" \" + self.city + \", \" + self.country\n else\n self.address + \", \" + self.city + \", \" + self.subdivision + \" \" + self.country \n end\n end",
"title": ""
},
{
"docid": "55840c498fe0f307f94aca5d2c9febf3",
"score": "0.7508099",
"text": "def full_address\n address = \"#{@street}, #{@location}\"\n address << \", #{@zip}\" if @zip\n address\n end",
"title": ""
},
{
"docid": "08ff2e6f7acc1d0af5d645dc3539bd2c",
"score": "0.75015825",
"text": "def address\n [\n [street_number, route].compact.join(' '),\n city,\n [state, zip].compact.join(' ')\n ].compact.join(', ')\n end",
"title": ""
},
{
"docid": "7dca130b62eda0199cb50f6254c29977",
"score": "0.7500862",
"text": "def get_full_address\n \"#{address} #{get_city_full_name}\"\n end",
"title": ""
},
{
"docid": "00d9ee9411f0fe44703bf8ef11b510d2",
"score": "0.7497074",
"text": "def full_address\n \"#{address}, #{suburb}, #{state}, Australia\"\n end",
"title": ""
},
{
"docid": "051608cb202f21e2d0cad125d12263e3",
"score": "0.74945486",
"text": "def address\n [address_1, city, state, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "8e1c2752b467b45326e2212297ab29bf",
"score": "0.74937606",
"text": "def full_address\n \"#{address}, #{country}\"\n end",
"title": ""
},
{
"docid": "8bc44a5040091f232670c8291e6da30c",
"score": "0.74903256",
"text": "def full_street_address\n if address?\n address + \", \" + city + \", \" + state\n else\n city + \", \" + state\n end\n end",
"title": ""
},
{
"docid": "3ce9c0eb5ede44d7d33c78f164c4395e",
"score": "0.7487614",
"text": "def address\n [name, state, 'USA'].compact.join(', ')\n end",
"title": ""
},
{
"docid": "f67d61172c271ed5f18300af63c455ad",
"score": "0.74858636",
"text": "def address_full\n \"#{self.address.titleize}, Toronto, ON\"\n end",
"title": ""
},
{
"docid": "5254d69b606f68508aa3036d314d9970",
"score": "0.74851364",
"text": "def address\n [town, postcode, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "97d00082f074c3a0168dd3e272c26940",
"score": "0.7468203",
"text": "def address\n [street, city, state, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "6b9a2df28d9de633533b8d8f05edff0f",
"score": "0.7457415",
"text": "def full_address\n full_address = \"\"\n full_address << self.address_line1 if self.address_line1.present?\n full_address << (full_address.present? ? \", \" : \"\") + self.address_line2 if self.address_line2.present?\n full_address << (full_address.present? ? \", \" : \"\") + self.address_town if self.address_town.present?\n full_address << (full_address.present? ? \"- \" : \"\") + self.address_postcode if self.address_postcode.present?\n full_address << (full_address.present? ? \", \" : \"\") + self.address_country if self.address_country.present?\n return full_address\n end",
"title": ""
},
{
"docid": "e746aa7a7580d23b9b49639b5bbbe060",
"score": "0.7453941",
"text": "def address\n [postal_code, address1].compact.join(', ')\n end",
"title": ""
},
{
"docid": "52e574414ce7b115e55918051728c34e",
"score": "0.7451135",
"text": "def full_address\n\t\t\"#{number} #{street} #{city}, #{state} \"\n\tend",
"title": ""
},
{
"docid": "6eebeb4f0668d4d2b9c9e93f0136c2ab",
"score": "0.74435014",
"text": "def address\n street_and_number = \"#{get(:vejkod, :t)} #{get_clean(:husnr)}\"\n postal_district = \"#{get(:postnr)} #{get(:postnr, :t)}\"\n door = get_clean(:sidedoer)\n floor = get_clean(:etage)\n\n if floor and door\n \"#{street_and_number}, #{floor}. #{door}, #{postal_district}\"\n elsif floor\n \"#{street_and_number}, #{floor}., #{postal_district}\"\n else\n \"#{street_and_number}, #{postal_district}\"\n end\n end",
"title": ""
},
{
"docid": "ac8cfb79f6eb65a05031bb4e4c1f63cb",
"score": "0.74425954",
"text": "def address\n state_and_zip = [state, zipcode].select(&:present?).join(' ')\n [street, city, state_and_zip].select(&:present?).join(', ')\n end",
"title": ""
},
{
"docid": "d580251d18ef7ab4e7a9df4264359709",
"score": "0.7439984",
"text": "def full_street_address\n \"#{street_address}, #{city}, GA\"\n end",
"title": ""
},
{
"docid": "0634ec4f6192e9ec282abe679bddc8ce",
"score": "0.74338764",
"text": "def address\n [street_address, city, state, zip_code].compact.join(', ')\n end",
"title": ""
},
{
"docid": "0634ec4f6192e9ec282abe679bddc8ce",
"score": "0.74338764",
"text": "def address\n [street_address, city, state, zip_code].compact.join(', ')\n end",
"title": ""
},
{
"docid": "0634ec4f6192e9ec282abe679bddc8ce",
"score": "0.74338764",
"text": "def address\n [street_address, city, state, zip_code].compact.join(', ')\n end",
"title": ""
},
{
"docid": "6a2768521ba057dff0f0a1ba7bb06129",
"score": "0.7432737",
"text": "def full_address\n \"#{self.HSN} #{self.CP} #{self.STR} #{self.STREETSUFFIX} #{self.CIT} #{self.STATE} #{self.ZP}\".squeeze(\" \").strip\n end",
"title": ""
},
{
"docid": "59a354c9b6da36060f8f0be5ce730e50",
"score": "0.74294436",
"text": "def address\n return street + \" \" + house_number + \" \" + postal_code + \" \" + city + \" Denmark\"\n end",
"title": ""
},
{
"docid": "008beabc8dc3d6d1f3f73acd286a82b5",
"score": "0.74256563",
"text": "def applicant_display_address_street\n dets = self['address_details']\n \"#{dets['address_line_1']}, #{dets['city']}, #{dets['state'][0..1]} #{dets['zip_code']}\".upcase\n end",
"title": ""
},
{
"docid": "8dd8915cd06efeec2e037f1b074b40f6",
"score": "0.7419037",
"text": "def full_street_address\n return \"#{address_1} #{city} #{state} #{zip_code}\"\n end",
"title": ""
},
{
"docid": "42dcb37d771eaf25b4039e13e04a98eb",
"score": "0.74168485",
"text": "def formatted_address \n [\n [street_number, route].select(&:present?).join(' '),\n city,\n [state, zip].select(&:present?).join(' ')\n ].select(&:present?).join(', ')\n end",
"title": ""
},
{
"docid": "424c032260524a08745ca14b9e5163df",
"score": "0.7407071",
"text": "def full_street_address\n [street, city].compact.join(', ')\n end",
"title": ""
},
{
"docid": "924db4d381da4c4c56d12e3a61791a90",
"score": "0.74023694",
"text": "def human_readable_address\n result = \"\"\n result << street if !street.blank?\n result << ' '\n result << locality if !locality.blank?\n result << ' '\n result << suburb if !suburb.blank?\n result << ' '\n result << region.region_name if !region.blank?\n result << ' '\n x = ContactinfosHelper.get_country_from_country_or_region(self)\n result << x.country_name if !x.blank?\n result << ' '\n \n result\n\n end",
"title": ""
},
{
"docid": "ac8192931d75740fc8f96970c4d0cc32",
"score": "0.7399863",
"text": "def address\n [street_address_1, city, state_province, country, postal_code].compact.join(', ')\n end",
"title": ""
},
{
"docid": "ccadcb5186bdd8084ad4257c1059e0b5",
"score": "0.73956096",
"text": "def full_address\n (address_1.present? ? address_1 : '') + (address_2.present? ? address_2 : '') +\n (postal_code_name.present? ? postal_code_name.to_s : '') + (postal_code_suffix.present? ? postal_code_suffix.to_s : '')\n end",
"title": ""
},
{
"docid": "d8faff9a664cfe928a49fe1302b22128",
"score": "0.73944396",
"text": "def full_address\n \"#{self.address}, #{self.city}, PA #{self.zipcode}\"\n end",
"title": ""
},
{
"docid": "38b014d5ee8fd359d65dc49bca78c7cd",
"score": "0.7388911",
"text": "def one_line_address\n return (address_1.blank? ? \"\" : address_1) + \" \" + (address_2.blank? ? \"\" : address_2) + \" \" + (city.blank? ? \"\" : city) + \" \" + (state.blank? ? \"\" : state) + \" \" + (zip.blank? ? \"\" : zip) + \" \" + (country.blank? ? \"\" : country)\n end",
"title": ""
},
{
"docid": "252bb7bdb3ccde5b27b1de23e0e8fb94",
"score": "0.7381619",
"text": "def address\n [address_1, address_2, city, state, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "e1d4d71f35bc4bd709d2448b88ba7433",
"score": "0.7376402",
"text": "def full_street_address\n if ( street.present? || street_no.present? ) && ( zip_code.present? || city.present? )\n street.to_s + ' ' + street_no.to_s + ', ' + zip_code.to_s + ' ' + city.to_s\n elsif street.present? || street_no.present?\n street.to_s + ' ' + street_no.to_s\n elsif zip_code.present? || city.present?\n zip_code.to_s + ' ' + city.to_s\n else\n ''\n end\n end",
"title": ""
},
{
"docid": "b95575701ff949c301dd50d9727d2ccf",
"score": "0.7371199",
"text": "def address\n [street, city, state, zip_code].join(\", \")\n end",
"title": ""
},
{
"docid": "b95575701ff949c301dd50d9727d2ccf",
"score": "0.7371199",
"text": "def address\n [street, city, state, zip_code].join(\", \")\n end",
"title": ""
},
{
"docid": "fb095657b252f9571a65710eb050beeb",
"score": "0.7363067",
"text": "def pretty_address\n \"#{address1}, #{address2 if address2}, #{city}, #{state}, #{country}\"\n end",
"title": ""
},
{
"docid": "d5bfce794372d574e51bf07f2311c9d5",
"score": "0.73588854",
"text": "def address\n if address_two.nil?\n [address_one, city, state, zip].compact.join(' ')\n else \n [address_one, address_two, city, state, zip].compact.join(' ')\n end\n end",
"title": ""
},
{
"docid": "4a8ad71b553f5ae44b33867837506e12",
"score": "0.7356168",
"text": "def full_address\n\t\tfull_address? ? street_address + \", \" + city + \", \" + state : \"\"\n\tend",
"title": ""
},
{
"docid": "78fdd90ff0cad6d8c2760d5938dc7c05",
"score": "0.7356072",
"text": "def formatted_address\n a = []\n a << self.street_address + \"<br />\"\n a << self.city_name + \", \"\n a << self.state + \" \"\n a << self.zip\n\n return a.compact.join(\"\").to_s.html_safe\n end",
"title": ""
},
{
"docid": "0976b4cc6cb2af75b2594d5a14a713f2",
"score": "0.7352479",
"text": "def address\n [house_number, street_name, suburb, state, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "6e026f8bc61c351dab5fe9eb37290b3a",
"score": "0.73502654",
"text": "def full_address\n address_list.join(\", \")\n end",
"title": ""
},
{
"docid": "537621a2837842f2ee0d0d670d34c6c6",
"score": "0.73422635",
"text": "def full_street_address\n\n [[line_1, line_2].join(\" \"), city, state, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "d17e181dcfb1fe99f24e13e79ee08a69",
"score": "0.7341295",
"text": "def address_string\n \"#{address}, #{city}, #{state} #{zip}\"\n end",
"title": ""
},
{
"docid": "d2489b0d88da7a49ffe65576f2925f77",
"score": "0.73375356",
"text": "def display_address\n ''.tap do |string|\n string << \"#{name}\\n\"\n string << address.street unless address.street&.empty?\n string << \"\\n\" unless string.empty?\n string << address.city unless address.city&.empty?\n string << \", \" if !address.city&.empty? && (!address.state&.empty? || !address.zipcode.empty?)\n string << address.state unless address.state&.empty?\n string << \" \" unless address.state&.empty? || address.zipcode&.empty?\n string << address.zipcode unless address.state&.empty?\n string << \"\\n\" unless address.country&.empty?\n string << address.country unless address.country&.empty?\n end\n end",
"title": ""
},
{
"docid": "940b7e0a7657df7d845cefd43814a394",
"score": "0.7307237",
"text": "def address_combine\n \"#{self.street_number} #{self.street_name} #{self.city}, #{self.state} #{self.zip_code}\"\n end",
"title": ""
},
{
"docid": "38ad6a07bc00847a086c0aad6b320c56",
"score": "0.73043466",
"text": "def address\n\t\t[street_address,city, state, zip, country].compact.join(\", \")\n\tend",
"title": ""
},
{
"docid": "38ad6a07bc00847a086c0aad6b320c56",
"score": "0.73043466",
"text": "def address\n\t\t[street_address,city, state, zip, country].compact.join(\", \")\n\tend",
"title": ""
},
{
"docid": "6f4644f3623df06ab70933d956297e09",
"score": "0.73021466",
"text": "def address\n [street, city, zip_code, province, country].compact.join(', ').presence\n end",
"title": ""
},
{
"docid": "ef2b4d11dcf3d3a77430945100b89657",
"score": "0.7300467",
"text": "def full_address\n address.join(', ')\n end",
"title": ""
},
{
"docid": "da47cc4aa3aa33485997ca3598c6d21d",
"score": "0.727269",
"text": "def full_address\n full_address = \"#{self.address + self.city + self.zip}\"\nend",
"title": ""
},
{
"docid": "e0a6de7abeef294492111725e085db64",
"score": "0.7267812",
"text": "def full_address(separator: '<br />')\n address = []\n city_parts = []\n city_parts.push city if city.present?\n city_parts.push state if state.present?\n address.push street_address if street_address.present?\n address.push unit_number if unit_number.present?\n address.push city_parts.compact.join(', ') unless city_parts.empty?\n address.push zip_code if zip_code.present?\n address.push country_name if country_name.present?\n address.compact.compact.join(separator).html_safe\n end",
"title": ""
},
{
"docid": "639bb36347a26f1d536f31607267c61f",
"score": "0.72652906",
"text": "def address_string\n \"#{address}, #{city}, #{state} #{zip} #{country}\".gsub(/<br>/i, ' ').gsub(/,\\s?,/, ',').gsub(/\\r\\n|\\r|\\n|\\t/, ' ').gsub(/\\&\\;/, '&').gsub(/\\s{2,}/, ' ')\n end",
"title": ""
},
{
"docid": "67def43bbf8ea2d5e1cbf221d1515b30",
"score": "0.7253591",
"text": "def get_complete_address()\n \"#{address} #{city ? ' - ' + city.get_full_name + ' - ' + city.country : ''}\"\n end",
"title": ""
},
{
"docid": "67adffeeb35944a1b3941e7c19e2643a",
"score": "0.72511864",
"text": "def start_full_address\n [start_address, start_city, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "01fad85a5f29d71c3275c39ee8c56488",
"score": "0.72366065",
"text": "def address\n lstreet = \"#{street1}#{street2}\".blank? ? \"\" : \"#{street1}#{street2},\"\n\tlcity = \"#{city}\".blank? ? \"\" : \"#{city},\"\n\t\n lstreet+lcity+ (\"#{province}\".blank? ? \"\":\"#{province},\") + \"#{postal_code}\"\n end",
"title": ""
},
{
"docid": "9f5fb79c6d2dad857c0d05f8d5534648",
"score": "0.7227338",
"text": "def full_street_address\n \"#{self.address} #{self.city} #{self.country} #{self.zip_code}\"\n end",
"title": ""
},
{
"docid": "a545ec294d0e0b28cd9c29c38d733a0a",
"score": "0.7225013",
"text": "def full_address\n @address[:street] + ', ' + @address[:city] + ', ' + @address[:state] + ' ' + @address[:zipcode]\n end",
"title": ""
}
] |
ea33df5dda563af221e649669e1972b6
|
Returns whether `file` contains enough `../` references to reach outside this directory.
|
[
{
"docid": "58624db21074c2ccb5ad66e4e4c342db",
"score": "0.7078477",
"text": "def _reaches_out?(file)\n depth = file.path.count(\"/\")\n file.content.scan(%r{(?:\\.\\./)+}).any? {|match| match.count(\"/\") > depth}\n end",
"title": ""
}
] |
[
{
"docid": "9ca073621046b1f571f1c68dbf703cbf",
"score": "0.6983556",
"text": "def relative?(path)\n expand(path).rindex(@path_root, 0) == 0\n end",
"title": ""
},
{
"docid": "83a46ee7ba9a2d06bbe8800fa9998574",
"score": "0.6651516",
"text": "def relative?\n # FIXME: Need a Path::Relative subclass, so that \"dir/filename\" can be valid.\n # (If the user changes dirs, the relative path should change too.)\n dirs.first == \"..\"\n end",
"title": ""
},
{
"docid": "0a9f0358e3894d6488545fe346646339",
"score": "0.6600697",
"text": "def within?(dir, root)\n expanded_root = File.expand_path(dir, root)\n File.expand_path(@parent, root) == expanded_root ||\n File.expand_path(@path, root).include?(expanded_root)\n end",
"title": ""
},
{
"docid": "127bfb3f68711f77c39d1e5388ce1443",
"score": "0.6588357",
"text": "def in_root?(file)\n # This is better but slow:\n # Pathname.new(Padrino.root).find { |f| File.identical?(Padrino.root(f), figure_path(file)) }\n figure_path(file).index(Padrino.root) == 0\n end",
"title": ""
},
{
"docid": "f950bcbd44e66fca10d22252c9ef4b9f",
"score": "0.6512293",
"text": "def relative?\n path = @path\n while r = chop_basename(path)\n path, = r\n end\n path == ''\n end",
"title": ""
},
{
"docid": "420a9fdcb29663ef610041effd5fd4b5",
"score": "0.6421453",
"text": "def directory_traversal_attack?(path)\n abs_path = (current_dir / path).expand_path.to_s\n abs_current_dir_path = current_dir.expand_path.to_s\n !abs_path.start_with?(abs_current_dir_path)\n end",
"title": ""
},
{
"docid": "195ddaf55f3eee43f49fc5761dc8c38f",
"score": "0.64140517",
"text": "def root_directory?(file_path)\n # Implementation inspired by http://stackoverflow.com/a/4969416:\n # Does file + \"..\" resolve to the same directory as file_path?\n File.directory?(file_path) &&\n File.expand_path(file_path) == File.expand_path(File.join(file_path, '..'))\nend",
"title": ""
},
{
"docid": "438ae1d4abd291c433d1e3a34bc7428d",
"score": "0.63912946",
"text": "def check_own_files(file)\n if @ownFiles.include?(file)\n exists = true\n end\n exists\n end",
"title": ""
},
{
"docid": "3cc1d7b83e41aee59c640c3038bec7d8",
"score": "0.63524437",
"text": "def _within?(within_path, path=@stasis.path)\n if within_path && path\n dir = File.dirname(within_path)\n path[0..dir.length-1] == dir\n else\n true\n end\n end",
"title": ""
},
{
"docid": "b88e7948dfb171f6ea12f810d94f605e",
"score": "0.62768364",
"text": "def in_tree? path\n full_path = @manifest.dir + \"/\" + path\n abs_path = Pathname.new(full_path).expand_path.to_s\n dir = Pathname.new(@source).dirname.expand_path.to_s\n dir.start_with?(abs_path) || abs_path == @source\n end",
"title": ""
},
{
"docid": "b902588ac399e40d828e0b8efa3836f3",
"score": "0.6247086",
"text": "def properly_contained?\n !file_path.empty?\n end",
"title": ""
},
{
"docid": "381d29c6326b3ef8fcca666129127913",
"score": "0.62180567",
"text": "def dir_has_index?(relative_path); end",
"title": ""
},
{
"docid": "64a6cc028441bd149333341e4725c081",
"score": "0.6167922",
"text": "def file_exists?(file_path)\n pages_and_files.any? { |p| p.relative_path == \"/#{file_path}\" }\n end",
"title": ""
},
{
"docid": "58d2725af77c9cef8ec7292a659d05c3",
"score": "0.6163919",
"text": "def relative_path?(path); end",
"title": ""
},
{
"docid": "58d2725af77c9cef8ec7292a659d05c3",
"score": "0.6163919",
"text": "def relative_path?(path); end",
"title": ""
},
{
"docid": "755ddd42ace2b9dd386a7451af913dba",
"score": "0.6146993",
"text": "def include?(file_ref)\n !build_file(file_ref).nil?\n end",
"title": ""
},
{
"docid": "6e19b0af220f75cf2d92689a83150a55",
"score": "0.61450124",
"text": "def root_directory?(file_path)\n File.directory?(file_path) &&\n File.expand_path(file_path) == File.expand_path(File.join(file_path, '..'))\n end",
"title": ""
},
{
"docid": "5c16f78200af9a9dc1be92ee666528ca",
"score": "0.6130194",
"text": "def in_path?\n config.paths.any? do |path_spec|\n path_spec === file\n end\n end",
"title": ""
},
{
"docid": "77f4df85f1902bbaf8037689dbb70c77",
"score": "0.6126823",
"text": "def is_current_path(file, link)\n f = Pathname.new(file).cleanpath\n l = Pathname.new(\"#{@out}/#{link}\").cleanpath\n return f == l\n end",
"title": ""
},
{
"docid": "c608048cb509cda6ffa1ec1645c7c1d8",
"score": "0.61048186",
"text": "def inspected_file_falls_in_lib?\n @file_path.start_with?(\"#{root_dir}/lib\")\n end",
"title": ""
},
{
"docid": "374e9e1ca001c827baa3b13e08430b65",
"score": "0.6081778",
"text": "def file?\n !!realpath\n end",
"title": ""
},
{
"docid": "374e9e1ca001c827baa3b13e08430b65",
"score": "0.6081778",
"text": "def file?\n !!realpath\n end",
"title": ""
},
{
"docid": "374e9e1ca001c827baa3b13e08430b65",
"score": "0.6081778",
"text": "def file?\n !!realpath\n end",
"title": ""
},
{
"docid": "0a1fa8fc35429895c3e78db86057f06c",
"score": "0.6077056",
"text": "def relative?\n @relative ? true : false\n end",
"title": ""
},
{
"docid": "a8926692c90d714bfe9cd300d4123f16",
"score": "0.60743636",
"text": "def root_directory?(file_path)\n File.directory?(file_path) &&\n File.expand_path(file_path) == File.expand_path(File.join(file_path, '..'))\nend",
"title": ""
},
{
"docid": "d9e2edb8d86ff73d2bb612c56393f5b7",
"score": "0.6063792",
"text": "def relative?(path)\n while r = chop_basename(path.to_s)\n path, basename = r\n end\n path == ''\n end",
"title": ""
},
{
"docid": "4d408a46505b24768c1e7d3662d66f0a",
"score": "0.6056931",
"text": "def link_to_reside_under_dir?(dir)\n dir && (dir[-1] == '/')\n end",
"title": ""
},
{
"docid": "342ec913b939d41ea8c7b262cf39506b",
"score": "0.6056852",
"text": "def in_root?(path)\n fp = Pathname.new(path).realpath\n fp.to_s.start_with? self.path\n end",
"title": ""
},
{
"docid": "5657df806117436b4803154c6e50d3eb",
"score": "0.604784",
"text": "def check_file_path(path)\r\n ret = {}\r\n ret[:path] = path.to_s[/\\A\\//] ? File.expand_path(path.to_s) : File.expand_path(path.to_s, Rails.root)\r\n @path ||= ret[:path]\r\n public_root = File.expand_path(Rails.public_path)\r\n ret[:rel_path] = ret[:path].sub(public_root, '')\r\n @rel_path ||= ret[:rel_path]\r\n return ret[:path] if File.exists?(File.join(public_root, ret[:rel_path]))\r\n return false\r\n end",
"title": ""
},
{
"docid": "5f283ea3acb7a364e09c019ab40a5849",
"score": "0.6038405",
"text": "def in_path?(path)\n path = self.class.new(path).expand_path.split_path\n mine = (symlink?? expand_path.realpath : expand_path).split_path\n path.each_with_index { |part, index| return false if mine[index] != part }\n true\n end",
"title": ""
},
{
"docid": "307a988a6c6dea7f86ad1ebe98127a2f",
"score": "0.6037198",
"text": "def relative?\n if @win\n PathIsRelative(self)\n else\n root == \".\"\n end\n end",
"title": ""
},
{
"docid": "eece256339b19232109bb5479ce4fc3c",
"score": "0.60355216",
"text": "def relative?\n if @win\n PathIsRelativeW(wincode)\n else\n root == '.'\n end\n end",
"title": ""
},
{
"docid": "c72408bbf830a1584d51410258e34d2a",
"score": "0.6023941",
"text": "def inside? ancestor\n @path == ancestor.to_s or @path.start_with?(\"#{ancestor}/\")\n end",
"title": ""
},
{
"docid": "3aaa44ea41baa5c09f19339d9894a24a",
"score": "0.5993547",
"text": "def user_path?(file)\n return true if current_path?(file)\n return false if stdlib_path?(file) || gem_path?(file)\n true\n end",
"title": ""
},
{
"docid": "78d31e3bcba7914d5a883a85e48fae2f",
"score": "0.5988294",
"text": "def relative_path?(name)\n File.exist? relative_path(name)\n end",
"title": ""
},
{
"docid": "000510a115c154c9ad77c157410a979b",
"score": "0.59838724",
"text": "def valid_file root, file\n path = File.join(root, file)\n path[0, root.length] == root && File.file?(path) && !File.binary?(path)\n end",
"title": ""
},
{
"docid": "f464c85747e635c46e175a37bc2a6e1b",
"score": "0.5944565",
"text": "def relative_path?(path)\n path.match?(/^\\.\\.?($|#{SEPARATOR_PATTERN})/) ? true : false\n end",
"title": ""
},
{
"docid": "85c6da195eb625ea571e7d7ac4c2f10e",
"score": "0.592506",
"text": "def file_exist(path)\n raw = @repo.tree/path # Current tree\n\n return raw.nil? ? false : true\n end",
"title": ""
},
{
"docid": "43ea2fa6c591f559c132adddd773616b",
"score": "0.5922939",
"text": "def check_path(path)\n # convert\n path = path.relative_path_from(@base_dir)\n\n # skip the file if it is out of target dir\n return if path.each_filename.first == \"..\"\n\n # skip the file if it is specified to skip by configuration\n Config.skip_files.any? {|x| path.fnmatch(x) } ? nil : path\n end",
"title": ""
},
{
"docid": "71d64600e8d6b8065a5e0bb34d6b1757",
"score": "0.5920597",
"text": "def relative?\n !absolute?\n end",
"title": ""
},
{
"docid": "b65a1934d59a1a320341e57b6ea09f10",
"score": "0.59121495",
"text": "def absolute?\n return false if empty?\n has_root? && @segments.find { |x| x == '..' } == nil\n end",
"title": ""
},
{
"docid": "ee6749da259cf907f877fe13e2e08452",
"score": "0.5907189",
"text": "def current_path?(file)\n file.start_with?(Dir.pwd) && !file.match(%r(/vendor/))\n end",
"title": ""
},
{
"docid": "00525999c5b055a4de102deaf7342da5",
"score": "0.5904948",
"text": "def relative?\n fixed? && !absolute?\n end",
"title": ""
},
{
"docid": "19c3adf8e62ba1582c267db2fd852a36",
"score": "0.589037",
"text": "def file?\n File.file?(realpath)\n end",
"title": ""
},
{
"docid": "1e1417284beb261d922654ebf97c4308",
"score": "0.586996",
"text": "def in_dir?(file, dir)\n return false unless File.exists?(file)\n return false unless File.directory?(dir)\n\n node = File.dirname(file)\n\n while true\n parent = File.join(node, '..')\n return false if File.identical?(parent, node)\n return true if File.identical?(node, dir)\n node = parent\n end\n end",
"title": ""
},
{
"docid": "53abf33674063c8dc7e14c0e2995d475",
"score": "0.5868931",
"text": "def reachable?\n Dir.exists?(path)\n end",
"title": ""
},
{
"docid": "97df68c4fb6a1d82adbd28d3fff036ce",
"score": "0.5850135",
"text": "def relative? ; all?{ |path| FileTest.relative?(path) } ; end",
"title": ""
},
{
"docid": "79e3e733b3a39fc0befa0f029ca64aa2",
"score": "0.58288795",
"text": "def include_path?(filepath)\n list.include?(expand(filepath))\n end",
"title": ""
},
{
"docid": "7869fa244c0067a2f0806f17a4dec8eb",
"score": "0.5811888",
"text": "def absolute?(path)\n !relative?(path)\n end",
"title": ""
},
{
"docid": "8f798a9cf636028d4ace5378b3dee0ed",
"score": "0.5810765",
"text": "def child?(parent, child)\n !child.expand_path.relative_path_from(\n parent.expand_path\n ).each_filename.to_a.include?(\n '..'\n )\n end",
"title": ""
},
{
"docid": "aa273cebfef90b4e2f47b7c9261453f6",
"score": "0.5809448",
"text": "def file?\n realpath.file?\n end",
"title": ""
},
{
"docid": "be126e91eb52952b9d6d191d0cd35de5",
"score": "0.580528",
"text": "def track_file?(file)\n @ignore_patterns.none? do |pattern|\n file.match(pattern)\n end && (file.start_with?(@project_directory) ||\n (@track_gems &&\n Coverband.configuration.gem_paths.any? { |path| file.start_with?(path) }))\n end",
"title": ""
},
{
"docid": "da30767bcd75046f011f26e3d7d6ff12",
"score": "0.5795692",
"text": "def inRootPath?(root, targetFullPath)\n inRootPath = File.realpath(targetFullPath).start_with?(root)\n raise \"NOT IN ROOT PATH\" if !inRootPath\n inRootPath\nend",
"title": ""
},
{
"docid": "0e89fe08a5aea171ba0eb80df8f52bac",
"score": "0.57940024",
"text": "def root_dir?(path)\r\n ['.', '/'].include? File.basename(path)\r\n end",
"title": ""
},
{
"docid": "54d8138f60917607fe0aab49d9941360",
"score": "0.5793452",
"text": "def relative?(path)\n Aruba.platform.relative_path?(path)\n end",
"title": ""
},
{
"docid": "cebf5800f7f4e4e8fbb23a9fea2fe02b",
"score": "0.5789543",
"text": "def root?\n ! ((Dir.entries(File.dirname(path)) & %w(cur new tmp)).size == 3)\n end",
"title": ""
},
{
"docid": "711ac5dc0cff5bc160ef631fc99de5d6",
"score": "0.5787629",
"text": "def valid_search_path?(path)\n Pathname.new(path).absolute? && File.directory?(path)\n end",
"title": ""
},
{
"docid": "a18b1aaee441a552f9850eeb1282c98d",
"score": "0.57795095",
"text": "def child?(parent, child)\n ! child.expand_path.relative_path_from(\n parent.expand_path\n ).each_filename.to_a.include?(\n '..'\n )\n end",
"title": ""
},
{
"docid": "12c66d77607b59e6258e2ba9ffbd936c",
"score": "0.57600784",
"text": "def file?(path)\n File.file? File.join(@base, path)\n end",
"title": ""
},
{
"docid": "b85edfce44439785bc1e030aaca51cf4",
"score": "0.575698",
"text": "def relative?\n !absolute?\n end",
"title": ""
},
{
"docid": "306b32f75287c51ab7c259fa143c1e89",
"score": "0.5756632",
"text": "def relativize_paths?\n !!@relativize_paths\n end",
"title": ""
},
{
"docid": "0ac85534b7cbf48f15178d60fe46d56b",
"score": "0.57348925",
"text": "def file?(path)\n return false if /\\~/ =~ path\n return false if /\\.\\./ =~ path\n File.file?(path)\n end",
"title": ""
},
{
"docid": "feb5256ff3789a221c54c2a263450064",
"score": "0.57288414",
"text": "def fs_exist?(file)\n File.exist?(File.join(self.git_dir, file))\n end",
"title": ""
},
{
"docid": "feb5256ff3789a221c54c2a263450064",
"score": "0.57288414",
"text": "def fs_exist?(file)\n File.exist?(File.join(self.git_dir, file))\n end",
"title": ""
},
{
"docid": "5e92d5bd1fd40182f1b22c15935c9a74",
"score": "0.57031405",
"text": "def isFileExistingWithinRepo(path_in_repo)\n abspath = Pathname.new(File.join(@path_to_repo,path_in_repo))\n # see if the file exists and is a file\n if abspath.file?\n # and if it's within the repo\n abspath.realpath.to_s.start_with?(Pathname.new(@path_to_repo).realpath.to_s)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "df031ac338604a2c4c0cbb64c4594aee",
"score": "0.5701868",
"text": "def root?\n !!(chop_basename(@path) == nil && @path.include?('/'))\n end",
"title": ""
},
{
"docid": "f2f1ba0b07bbd71c9b11176a75cc2ffa",
"score": "0.56936496",
"text": "def file_exists?(file_path)\n pages_and_files.any? { |p| p.url == \"/#{file_path}\" }\n end",
"title": ""
},
{
"docid": "f2f1ba0b07bbd71c9b11176a75cc2ffa",
"score": "0.56936496",
"text": "def file_exists?(file_path)\n pages_and_files.any? { |p| p.url == \"/#{file_path}\" }\n end",
"title": ""
},
{
"docid": "4b593c24f2843c80341b9c8f74d96ef6",
"score": "0.56830215",
"text": "def name_safe?\n cleanpath = Pathname.new(@name).cleanpath\n return false unless cleanpath.relative?\n\n root = ::File::SEPARATOR\n naive_expanded_path = ::File.join(root, cleanpath.to_s)\n ::File.absolute_path(cleanpath.to_s, root) == naive_expanded_path\n end",
"title": ""
},
{
"docid": "29fec6254e891cbe2c1dccf079755a5f",
"score": "0.56802297",
"text": "def relative_target?\n target[0,1] == \"/\"\n end",
"title": ""
},
{
"docid": "187169852e6bcaeda10d5bb6a2c51f3b",
"score": "0.56737447",
"text": "def part_of_path?\n !!root_path\n end",
"title": ""
},
{
"docid": "f372717e28e16cb69f9cf4a902423d5e",
"score": "0.5673498",
"text": "def config_exists(file, root)\n present_location = File.join(root, file)\n File.exist?(present_location) ? present_location : false\n end",
"title": ""
},
{
"docid": "9b71ff8c84441b080365526ef3feca15",
"score": "0.5657251",
"text": "def directory?(file)\n Aruba.platform.directory? expand_path(file)\n end",
"title": ""
},
{
"docid": "1abb339146074b0d9f44d69fa7b677a2",
"score": "0.5656718",
"text": "def file_exists?(file_path)\n File.exist? @site.in_source_dir(file_path)\n end",
"title": ""
},
{
"docid": "a2b7c1ec0d966577d924084f46b5cb9f",
"score": "0.56559324",
"text": "def include?(path)\n not @files[path].nil?\n end",
"title": ""
},
{
"docid": "b08fd610264fbfc010e1def25cbbb63c",
"score": "0.5647773",
"text": "def include_root?\n !!@include_root\n end",
"title": ""
},
{
"docid": "5b2c94c128a930c82454a712a05f68ca",
"score": "0.56470424",
"text": "def dead?\n !Pathname.new(@path).realpath rescue true\n end",
"title": ""
},
{
"docid": "97b8ac0c12186e5dda9c6a38b4aef41d",
"score": "0.56419337",
"text": "def fs_fileFile?(p)\n file = ifs_getFile(p)\n return false if file.nil?\n file.resolve(boot_sector)\n return false if file.isDir?\n true\n end",
"title": ""
},
{
"docid": "61ab7b4cf9375b40b6accc13e6145622",
"score": "0.56364226",
"text": "def defined_in?(file)\n @in_files.include?(file)\n end",
"title": ""
},
{
"docid": "6d90afeea7131f97a071dd8c336373fc",
"score": "0.56349415",
"text": "def include?(file)\n return @dev if file.dev?\n return @wip_list.include?(file.basename) if file.wip?\n\n true\n end",
"title": ""
},
{
"docid": "a80203a092dbe077afdabb5de05e3956",
"score": "0.56301796",
"text": "def file_exists?(file_path)\n File.exist? @site.in_source_dir(file_path)\n end",
"title": ""
},
{
"docid": "a80203a092dbe077afdabb5de05e3956",
"score": "0.56301796",
"text": "def file_exists?(file_path)\n File.exist? @site.in_source_dir(file_path)\n end",
"title": ""
},
{
"docid": "1f0ba8bf97586a25d29df55c9112c83d",
"score": "0.5623678",
"text": "def path_exists?(relpath, client = nil)\n File.exists?(file_path(relpath, client))\n end",
"title": ""
},
{
"docid": "ea5c3141b5255019b020ce31e9c51ad7",
"score": "0.56164575",
"text": "def exist?\n raise \"Will not give a relevant answer for path '#{self}', since it starts with ~ and therefore by definition does not exist.\" if self[0..0] == '~'\n return File.exists?(self.to_s) \n end",
"title": ""
},
{
"docid": "4a084842c7346d3590481447dc13f31c",
"score": "0.56090254",
"text": "def path_in_root?(root, path)\n # Doesn't matter what the root is, if the path is nil, it's false\n return false if path.nil?\n # Doesn't matter what the path is, if the root is nil it's true.\n return true if root.nil?\n # If the path is less than root, then it has to be false\n return false if root.length > path.length\n\n # Is the beginning of the path, the same as the root\n value = path.slice(0, root.length)\n value.casecmp(root).zero?\n end",
"title": ""
},
{
"docid": "70cf091ebd24479544e8dbe78e5079c7",
"score": "0.56058675",
"text": "def include_in_parent?\n child_namespace? && file.nil?\n end",
"title": ""
},
{
"docid": "25d282da8e0bf83ff3fc2e568b1cc654",
"score": "0.56048954",
"text": "def full_path_skip?(path)\n return true unless ChaosUtils.aught?(path)\n\n if !(@app_root_path && path.start_with?(@app_root_path))\n true\n else\n rel_path = localize_path(path)\n @options.ignore_paths.any? { |p| rel_path.start_with?(p)}\n # false\n end\n end",
"title": ""
},
{
"docid": "f70144f23a46e708473d64630d7fd4d0",
"score": "0.55992246",
"text": "def is_internal_url_file_attachment(relative_url)\r\n #The URL may or may not have things like spaces and such escaped out, but in the Drupal\r\n #database such things are never escaped\r\n relative_url = CGI.unescape(relative_url)\r\n\r\n return @files.has_key?(relative_url)\r\n end",
"title": ""
},
{
"docid": "33be1d8c3fe68ded60b7bb81f54bc149",
"score": "0.5594181",
"text": "def include_path?( url )\n uri_parse( url ).scope.include?\n end",
"title": ""
},
{
"docid": "cdb42b3adfc9c2254a6f7b1d15f64696",
"score": "0.55816174",
"text": "def contains?(child, parent=Dir.pwd)\n parent = File.expand_path(parent)\n child = File.expand_path(child)\n child.sub(parent,'') != child\n end",
"title": ""
},
{
"docid": "f12e3eed913b214822397042b3392706",
"score": "0.55706173",
"text": "def file?(file)\n Aruba.platform.file? expand_path(file)\n end",
"title": ""
},
{
"docid": "69f87a0234cf602507666020539fb668",
"score": "0.5563674",
"text": "def app_file?(path)\n !!find_base_path_for(path)\n end",
"title": ""
},
{
"docid": "55edbc248b5f23c2c8a5b27a871b1d6c",
"score": "0.5548464",
"text": "def linked_direct?(path, current)\n if path.readlink.to_s.sub(Pathname.new('.').relative_path_from(path.dirname).to_s + '/', '') == current.to_s\n return true\n end\n\n link = path.readlink.to_s\n just_relative = link[%r{(\\.\\./)+}]\n just_path = link.sub(%r{(\\.\\./)+}, '')\n path.dirname.join(just_relative).join(just_path) == current\nend",
"title": ""
},
{
"docid": "702048aecb5bafb4e80f1ccd3c358e76",
"score": "0.55478936",
"text": "def file?\n not(directory?)\n end",
"title": ""
},
{
"docid": "54dcc5c2ae004015712fa25f04983df0",
"score": "0.5546718",
"text": "def reference_workspace_set?\n f = reference_dir\n File.exist?(f) && File.symlink?(f) &&\n File.exist?(File.readlink(f))\n end",
"title": ""
},
{
"docid": "439c12c6a1cdb343775fa7219ca5cd7e",
"score": "0.5543251",
"text": "def within_original_tree?\n nest_path&.start_with? \"#{@document.nest_path}/\"\n end",
"title": ""
},
{
"docid": "35694035b828e79cf4ab2966f4e83842",
"score": "0.5540874",
"text": "def valid_paths?\n !relative_paths.empty? && relative_paths.all? { |p| MountedDrives.valid_path?(drive, p) }\n end",
"title": ""
},
{
"docid": "04fd43bec4261bef1621e0c60ae84ae3",
"score": "0.5539336",
"text": "def find_in_project(file)\n dir = Dir.pwd\n while true\n path = File.join(dir, file)\n return path if File.exists?(path)\n\n parent = File.expand_path(File.join(dir, '..'))\n return nil if parent == dir\n\n dir = parent\n end\n end",
"title": ""
},
{
"docid": "cd510ffda5a8f2f97f38082ff5f7af54",
"score": "0.553301",
"text": "def files_in_use file = nil\n return @files_in_use unless file\n return unless file.class == String\n\n file = file.sub './', ''\n\n if @files_in_use.include?(file)\n true\n else\n @files_in_use.push file\n yield(file) if block_given?\n false\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "687bc8586b3f7220fb0817fdbd581d83",
"score": "0.0",
"text": "def game_asset_params\n params.require(:game_asset).permit(:name, :price, :main_category, :sub_category, :file_uploaded, :promo_url,\n :sales_copy, :sales_body, :sales_closing, :make_public, :order, :license, :search, :genre)\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.67419964",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.674013",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6734356",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6591046",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6502396",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6496313",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6480641",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.64565",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6438387",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.63791263",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.63740575",
"text": "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",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.6364131",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63192815",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.62991166",
"text": "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",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.62978333",
"text": "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",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.6292148",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290449",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6290076",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62894756",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6283177",
"text": "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",
"title": ""
},
{
"docid": "1dfca9e0e667b83a9e2312940f7dc40c",
"score": "0.6242471",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62382483",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6217549",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.6214457",
"text": "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",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.6209053",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6193042",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6177802",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6174604",
"text": "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",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.61714715",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "9d589006a5ea3bb58e5649f404ab60fb",
"score": "0.6161512",
"text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.6151757",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6150663",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.61461",
"text": "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",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.61213595",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6106206",
"text": "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",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.6105114",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6089039",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6081015",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.6071004",
"text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.6019971",
"text": "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",
"title": ""
},
{
"docid": "5eaf08f3ad47cc781c4c1a5453555b9c",
"score": "0.601788",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6011056",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.6010898",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "74c092f6d50c271d51256cf52450605f",
"score": "0.6001556",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.6001049",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59943926",
"text": "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",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.5992201",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.59909594",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5990628",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5980841",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.59669393",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59589154",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5958826",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5957911",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5957385",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5953072",
"text": "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",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.59526145",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.5943361",
"text": "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",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.59386164",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.5933856",
"text": "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",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.59292704",
"text": "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",
"title": ""
},
{
"docid": "d9483565c400cd4cb1096081599a7afc",
"score": "0.59254247",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5924164",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59167904",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59088355",
"text": "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",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.5907542",
"text": "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",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.59064597",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.5906243",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.5898226",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.589687",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.5896091",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5894501",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5894289",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5891739",
"text": "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",
"title": ""
},
{
"docid": "b85a12ab41643078cb8da859e342acd5",
"score": "0.58860534",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.5882406",
"text": "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",
"title": ""
},
{
"docid": "abca6170eec412a7337563085a3a4af2",
"score": "0.587974",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.58738774",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.5869024",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.58679986",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.5867561",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5865932",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.5864461",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.58639693",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.58617616",
"text": "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",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.5861436",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.5860451",
"text": "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",
"title": ""
},
{
"docid": "46cb58d8f18fe71db8662f81ed404ed8",
"score": "0.58602303",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5854586",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.58537364",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.5850427",
"text": "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",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.5850199",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
d26427937e7d8fe3c5f9aa5787c8c472
|
Requires email and password params, accepts a name parameter Returns an API token for the user if valid
|
[
{
"docid": "4c03083786d2be689ff059e7dcc5ebec",
"score": "0.7344349",
"text": "def create\n user = User.find_by(email: auth_params[:email])\n if user&.valid_password?(auth_params[:password])\n @token = user.api_tokens.find_or_create_by(name: (auth_params[:name] || \"default\")) do |token|\n token.make_token.save!\n end\n render json: {\n token: @token.token\n }\n else\n head :unauthorized\n end\n end",
"title": ""
}
] |
[
{
"docid": "1c159425be84704f4ade515348653233",
"score": "0.7468427",
"text": "def create\n user = User.find_by_email(params[:email])\n if user.valid_password?(params[:password])\n render :json => { name: user.first_name, token: user.auth_token }\n end\n end",
"title": ""
},
{
"docid": "df52abd14b0cb069cd5dd156c3c884c3",
"score": "0.72434086",
"text": "def create\n user = User.find_for_database_authentication(email: params[:email])\n\n if user && user.valid_password?(params[:password])\n token = user.ensure_authentication_token\n render json: { user: user }\n else\n render nothing: true, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "0e5e9d190e03ca4c39860462854aaf51",
"score": "0.71842325",
"text": "def create\n user = User.find_for_authentication(email: user_params[:email])\n\n if user && user.valid_password?(user_params[:password])\n user.generate_authentication_token\n\n expose({\n user_id: user.id,\n token: user.authentication_token\n })\n else\n error! :unauthenticated\n end\n end",
"title": ""
},
{
"docid": "05902b18f925a2116b03cca80d889a24",
"score": "0.7122504",
"text": "def create\n unless auth_params.has_key?(:email)\n render json: {error: \"No email supplied.\", status: 404}, status: 404\n return\n end\n user = User.find_by(email: auth_params[:email])\n\n unless user\n render json: {error: \"User not found with supplied email.\", status: 404}, status: 404\n return\n end\n\n if user && user.authenticate(auth_params[:password])\n jwt = Auth.issue(user: user.id)\n render json: {jwt: jwt}, status: :ok\n return\n else\n render json: {error: \"User does not exist with these credentials.\",\n status: 404}, status: 404\n return\n end\n end",
"title": ""
},
{
"docid": "34a2f3ac8b51077db9e8eadec2914996",
"score": "0.7033456",
"text": "def create\n user = User.find_by_email(params[:email])\n # confirming if password matches to that user email\n if user && user.authenticate(params[:password])\n render json: user.as_json(only: [:email, :id])\n .merge(\"token\": user.generate_jwt)\n else \n render json: { errors: {'email or password': [\"is invalid\"]}}, \n status: :unprocessable_entity\n end \n end",
"title": ""
},
{
"docid": "2a133503f8e5eadb607e4a28c917b2a5",
"score": "0.6996166",
"text": "def call(_obj, args, _ctx)\n input = args[:email]\n return unless input\n\n user = User.find_by(email: input[:email])\n return unless user\n return unless user.authenticate(input[:password])\n token = JsonWebToken.encode(id: user.id)\n\n OpenStruct.new(\n token: token,\n user: user\n )\n end",
"title": ""
},
{
"docid": "3411b8d55abdd8d66edf97ef0c9105df",
"score": "0.69350326",
"text": "def create\n user = User.where(email: params[:user][:email]).first\n if user && user.authenticate(params[:user][:password])\n user.regenerate_token\n render json: { status: :success, data: user.to_json }\n else\n render json: { status: :error, data: 'Invalid login details' }\n end\n end",
"title": ""
},
{
"docid": "35039007213779fba596e40ea7fd4dc3",
"score": "0.68752694",
"text": "def create\n user = AuthenticationManager.new(\n params.slice(%i[email first_name last_name password]).merge(is_profile_owner: true, password_confirmation: params[:password], tos_accepted: params.bool(:tos_accepted))\n ).register\n user = session_manager.login(user.email, params[:password], use_api_token: true)\n json_success user: api_response.current_user_data(user)\n end",
"title": ""
},
{
"docid": "2cb35ba8b2683d3393664551bdc72bbf",
"score": "0.68696284",
"text": "def login\n user = User.find_by(email: params[:email])\n return render json: { message: ['Email does not exist'] }, status: 422 unless user\n return render json: { message: ['Password not valid'] }, status: 422 unless user.valid_password?(params[:password])\n\n token = user.tokens.create\n render json: { auth_token: token.auth_token }, status: :ok\n end",
"title": ""
},
{
"docid": "9062e76da13bba4831ef1e2899b77540",
"score": "0.67835563",
"text": "def submit\n user = User.where(email: email).first\n if user && !user.password.nil? && user.password == password\n user\n else\n errors.add(:base, :invalid_credentials)\n nil\n end\n end",
"title": ""
},
{
"docid": "3e3c24f7ae0bb11ce24aa4e134ea96a4",
"score": "0.6765344",
"text": "def token\n\n authenticate_with_http_basic do |email, password|\n user = User.find_by(email: email)\n if user && user.authenticate(password) \n render json: { token: user.api_token }\n else\n render json: { error: 'Incorrect credentials' }, status: 401\n end\n\n end\n end",
"title": ""
},
{
"docid": "d3f2ac836ca5b2e89fe83f4fc8635675",
"score": "0.6732758",
"text": "def create_user(email, password, full_name = nil, language = nil)\n options = { email: email, password: password }\n options[:language] = language if language\n options[:full_name] = full_name if full_name\n\n query_api '/auth/user', options\n end",
"title": ""
},
{
"docid": "27c4771f5a72d0cd784c34d9b483934e",
"score": "0.67262423",
"text": "def create\n # login\n user = User.authenticate(params[:user][:email], params[:user][:password])\n\n respond_to do |format|\n if user\n # Create an api token for this user.\n user.enable_api!\n format.json { render :json => user }\n else\n format.json { head :unauthorized }\n end\n end\n end",
"title": ""
},
{
"docid": "45619b7e6a9e273a7460a1a0d819929c",
"score": "0.67257756",
"text": "def auth email_or_token, password = nil\n password ? post(\"auth\", email: email_or_token, password: password) :\n post(\"auth/#{email_or_token}\")\n end",
"title": ""
},
{
"docid": "122aed57a16cb02ee0b56b84dbf035ef",
"score": "0.66671056",
"text": "def login\n user = User.find_by_email(params[:email])\n\n if user && user.authenticate(params[:password])\n new_token = JsonWebToken.encode(email: user.email)\n render json: { auth_token: new_token }\n else\n render json: { error: 'Can not authenticate this user!' }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "1a9469c0d45d64b6ea1955790f7bda73",
"score": "0.66664547",
"text": "def login\n @user = User.find_by(email: params[:email]) # Se busca un usuario basado en el email\n if @user && @user.authenticate(params[:password]) # Se valida usuario y se autentica con Bcrypt\n token = encode_token({user_id: @user.id}) # Si el usuario y password es correcto, entonces se crea token\n render json: {token: token}, status: :accepted\n else\n render status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "3747e1ea4ed3e848bec95ac600a15077",
"score": "0.66570425",
"text": "def register_api\n begin\n email = register_api_params[:email].downcase\n @user = User.find_by_email(email)\n if @user.blank?\n @user = User.create(:email => email, :username => register_api_params[:username], :password => register_api_params[:password], :device_token => register_api_params[:device_token], :type => register_api_params[:type])\n render :json => @user\n else\n render :json => @user\n end\n rescue Exception => e\n error \"Please provide all required fields\"\n end\n end",
"title": ""
},
{
"docid": "f33c67653534710230069b360e0929f9",
"score": "0.6651547",
"text": "def login \n isPasswordCorrect = AuthenticationHelper::Auth.instance.checkPassword( request.body )\n params = JSON.parse( request.body.read )\n emailParams = params[\"email\"]\n \n if ( isPasswordCorrect )\n token = AuthenticationHelper::Auth.instance.generateJWT( emailParams )\n render json: token, status: :ok\n else \n render json: :nothing, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "7b684c39ec79c16574631acd3a6e46f9",
"score": "0.6640006",
"text": "def create\n email = params[:email]\n password = params[:password]\n @user = User.find_by_email(email)\n if user.authenticate(@user)\n respond_with(@user)\n else\n respond_with(@user, status: :error)\n end\n end",
"title": ""
},
{
"docid": "df2b2cb79d7e4ea4bb6dd8f8ba303e49",
"score": "0.6637793",
"text": "def get_token\n # Get the user by email\n user = User.find_by_email(params[:email])\n \n # return unauthorized if the user was not found\n if !user \n render json: { error: 'unauthorized' }, status: :unauthorized\n return\n end\n \n # if the user is not authenticated via the authenticate method\n # then return unauthorized\n if !user.authenticate( params[:password] )\n render json: { error: 'unauthorized' }, status: :unauthorized\n return\n end\n \n # if our code gets here, we can generate a token and response.\n # JWT's include an expiry, we will expire the token in 24 hours\n token = jwt_encode({user_id: user.id}, 24.hours.from_now)\n render json: {token: token, exp: 24, username: user.email, userId: user.id},\n status: :ok\n \n end",
"title": ""
},
{
"docid": "6de0e711dd693599922e3a5440e7f9d3",
"score": "0.6609441",
"text": "def authenticate_user_from_token\n authenticate_with_http_token do |token, options|\n user_email = options[:email]\n user_email && User.where(email: user_email, authentication_token: token).first\n end\n end",
"title": ""
},
{
"docid": "565b78a3c13d3600b1dc7abc616c2094",
"score": "0.66079277",
"text": "def user_login(email, password, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: UserApi#user_login ...\"\n end\n\n # verify the required parameter 'email' is set\n fail \"Missing the required parameter 'email' when calling user_login\" if email.nil?\n\n # verify the required parameter 'password' is set\n fail \"Missing the required parameter 'password' when calling user_login\" if password.nil?\n\n # resource path\n path = \"/user/login\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n form_params[\"email\"] = email\n form_params[\"password\"] = password\n form_params[\"token\"] = opts[:'token'] if opts[:'token']\n\n # http body (model)\n post_body = nil\n\n\n auth_names = []\n result = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AccessToken')\n if Configuration.debugging\n Configuration.logger.debug \"API called: UserApi#user_login. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "35dad585a218f7afbf8b1ec0afe25414",
"score": "0.6590115",
"text": "def create\n result = access_token.post('/api/v1/users/create', {:email=>params[:email],:psw=>params[:password],:psw_conf=>params[:password_conf],:inbox=>params[:inbox]})\n display_api_response result\n respond_with(\"\",:location => :back)\n end",
"title": ""
},
{
"docid": "e1e37644a3a2cff8abf90bba1f29e7ec",
"score": "0.6567999",
"text": "def call(_obj, args, _ctx)\n input = args[:auth]\n return unless input\n\n user = User.find_by(email: input[:email])\n return unless user\n return unless user.authenticate(input[:password])\n\n OpenStruct.new(jwt: AuthToken.token(user),\n user: user)\n end",
"title": ""
},
{
"docid": "2337f09ffc64f986de0292bd0a556630",
"score": "0.6563703",
"text": "def register\n begin\n params.permit!\n user = User.new(name: params[:name], email: params[:email], password: params[:password])\n user.save!\n token = AuthenticateUser.call(params[:email], params[:password])\n render json: {status: 200, data: {auth_token: token.result, user_details: user}, msg: \"You are registered successfully.\"}\n rescue => e\n render json: {status: 401, data: {auth_token: nil, user_details: nil}, msg: e.message}, status: :unauthorized\n end \n end",
"title": ""
},
{
"docid": "86eb3d8f542dc271ae38f1ccc063a4ee",
"score": "0.6554926",
"text": "def api_auth\n creator = Creator.find_by(username: request.headers[:username])\n if creator && creator.authenticate(request.headers[:password])\n render json: { auth_token: encodeJWT(creator) }\n else\n render json: { error: 'Invalid username or password' }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "7ff4bbf4e668725d60fdf26ff4b6eba9",
"score": "0.6551387",
"text": "def login_api\n @user = User.find_for_database_authentication({:username => params[:username].downcase})\n\n if (!@user.nil?)\n if (!@user.valid_password?(params[:password]))\n @user = nil\n end\n end\n\n if (@user.nil?)\n @user = User.find_by_auth_token(params[:auth_token]) unless params[:auth_token].nil?\n else\n @user.generate_auth_token\n end\n\n if @user.nil?\n # Do nothing\n error \"Your username or password was incorrect.\"\n else\n render json: @user\n end\n end",
"title": ""
},
{
"docid": "7ff4bbf4e668725d60fdf26ff4b6eba9",
"score": "0.6551387",
"text": "def login_api\n @user = User.find_for_database_authentication({:username => params[:username].downcase})\n\n if (!@user.nil?)\n if (!@user.valid_password?(params[:password]))\n @user = nil\n end\n end\n\n if (@user.nil?)\n @user = User.find_by_auth_token(params[:auth_token]) unless params[:auth_token].nil?\n else\n @user.generate_auth_token\n end\n\n if @user.nil?\n # Do nothing\n error \"Your username or password was incorrect.\"\n else\n render json: @user\n end\n end",
"title": ""
},
{
"docid": "be3a11983125754663400b5cff699277",
"score": "0.6550196",
"text": "def login\n user = User.find_by(email: user_login_params[:email])\n\n if user && user.authenticate(user_login_params[:password])\n token = create_token(user.id)\n render json: {\n user: user.attributes.except(\"password_digest\"),\n token: token,\n }, status: :ok\n else\n render json: {error: \"unauthorized\"}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "be3a11983125754663400b5cff699277",
"score": "0.6550196",
"text": "def login\n user = User.find_by(email: user_login_params[:email])\n\n if user && user.authenticate(user_login_params[:password])\n token = create_token(user.id)\n render json: {\n user: user.attributes.except(\"password_digest\"),\n token: token,\n }, status: :ok\n else\n render json: {error: \"unauthorized\"}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "7fd226d54cbe0e09b59723f15e967e7f",
"score": "0.6548043",
"text": "def token_params\n params.permit(:email, :password)\n end",
"title": ""
},
{
"docid": "a8660bfae396fc5ad94f6980251c128a",
"score": "0.65443814",
"text": "def sign_in_as(name)\n post login_url, params: { email: name, password: 'testpassword' }\n end",
"title": ""
},
{
"docid": "37c5401674de9f548e8e644205ca7aed",
"score": "0.6535494",
"text": "def create\n user = User.find_by email: params[:email]\n if user && user.authenticate(params[:password])\n reactivate(user)\n render json: user.session_api_key, status: 201\n else\n render json: {\n \"error\" => \"Unauthorized\"\n }, status: 401\n end\n end",
"title": ""
},
{
"docid": "a495ecb55bd010b9793f016210150c61",
"score": "0.6530446",
"text": "def create\n account = Account.find_by(email: params[:email].downcase)\n if !account.nil? && account.authenticate(params[:password])\n render json: { auth: auth_token(account), activated: account.activated }\n else\n render json: { errors: \"Password does not match\" }, status: 400\n end\n end",
"title": ""
},
{
"docid": "44a72bb49c4d310d0d08b8165fa9a04d",
"score": "0.6519315",
"text": "def login(params)\n begin\n # This is a object of User model\n user = User.new\n\n presentable_error_response(\"BLANK_EMAIL_PASSWORD\") if all_params_present(params[:email], params[:password])\n presentable_error_response(\"INVALID_EMAIL_PASSWORD\") unless user.find_email_password(params[:email],params[:password])\n\n return prepare_success_response(user.create_authentication_token(user.find_data_by_email((params[:email]).downcase)))\n rescue DataBaseException => e\n presentable_error_response(\"INTERNAL_ISSUE\")\n end\n end",
"title": ""
},
{
"docid": "31df750498102e06682e57ddac255801",
"score": "0.6518222",
"text": "def api_user\n user = User.find_by_email(email)\n unless user.present?\n errors.add :message, \"Invalid email\"\n return nil\n end\n\n unless user.authenticate(password)\n errors.add :message, \"Invalid password\"\n return nil\n end\n\n return user\n end",
"title": ""
},
{
"docid": "b89abffa9750afe48491caef04ef5077",
"score": "0.6517947",
"text": "def authenticate_by_email_password(email, password)\n user = User.find_by(email: email.downcase)\n\n if user && user.authenticate(password)\n @user = user\n @token = create_access_token\n\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "f2f986db93c54a9a3576e8448c61c270",
"score": "0.6488636",
"text": "def authenticate\n auth_response =\n AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\n json_response(auth_token: auth_response[:token], user_name: auth_response[:user_name])\n end",
"title": ""
},
{
"docid": "70eb6fbfd048d1baa516ee1b537f423b",
"score": "0.6472239",
"text": "def create\n name = params[:name] || params[:username] # cough, ahem.\n password = params[:password]\n \n user = User.find_by_name(name)\n \n if user and user.password_is? password\n session[:user_id] = user.id\n\n if params[:email].present?\n user.update_attributes! :email => params[:email]\n end\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { render :json => { :success => true, :user => user } }\n end\n elsif user\n message = \"Username in use, or password was incorrect. Go back and try again.\"\n\n respond_to do |format|\n format.html { render :text => message }\n format.json { render :json => { :success => false, :message => message } }\n end\n elsif name.present? and password.present?\n user = User.create! :name => name, :password => User.hash_password(password), :email => params[:email]\n session[:user_id] = user.id\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { render :json => { :success => true, :user => user } }\n end\n else\n message = \"Invalid username or password. Go back and try again.\"\n\n respond_to do |format|\n format.html { render :text => message }\n format.json { render :json => { :success => false, :message => message } }\n end\n end\n end",
"title": ""
},
{
"docid": "8d2cc67dadb87e8b4f6c1407ef8e7ff8",
"score": "0.64474344",
"text": "def register email, pass\n email = email.downcase.strip\n if email != \"anon@websyn.ca\" and User.get(email).nil?\n user = User.create({:email=>email,:password=>pass})\n authenticate email, pass\n return user\n elsif authenticate email, pass\n return current_user\n end\n nil\n end",
"title": ""
},
{
"docid": "6f03067a1631d344916176b119742378",
"score": "0.6434609",
"text": "def login\n user = User.find_by(email: params[:email])\n if (user && user.authenticate(params[:password]))\n render json: {user: user.user_information, token: JWT.encode({userId: user.id}, 'secret')}\n else\n render json: {errors: \"Invalid email/password combination. Please try again or register if you do not already have an account.\"}\n end\n end",
"title": ""
},
{
"docid": "4e3ec47aaafcac73ddd736da9220c554",
"score": "0.6419639",
"text": "def authenticate!\n user = User.where(email: params[\"email\"]).first\n if user && user.authenticate(params[\"password\"])\n success!(user)\n else\n fail!(\"Could not log in\")\n end \n end",
"title": ""
},
{
"docid": "da039d0d47b97dac531ac965f4b0e600",
"score": "0.64150006",
"text": "def authenticate\n auth_token =\n AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\n json_response(auth_token: auth_token, config: get_current_configuration, provider: 'email')\n end",
"title": ""
},
{
"docid": "b247675b3d2767697a63388094383deb",
"score": "0.6412663",
"text": "def login(email, password)\n post api_v1_user_session_path, \n headers: { 'CONTENT_TYPE' => 'application/json', 'ACCEPT' => 'application/json' },\n params: { email: email, password: password }.to_json\nend",
"title": ""
},
{
"docid": "e1d1eb4fafda3ed7e38b850baaf572d1",
"score": "0.64068764",
"text": "def api_login\n creator = Creator.find_by(name: request.headers['name'])\n if creator && creator.authenticate(request.headers['password'])\n encode = encodeJWT(creator)\n selected_format({jwt: encode,creator_id: creator.id,name: creator.name,submits:creator.submits},:ok)\n else\n selected_format({ error: 'Invalid username or password' },:unauthorized)\n end\n end",
"title": ""
},
{
"docid": "02362e0119800258756836866594c5c1",
"score": "0.6391787",
"text": "def create\n\t resource = User.find_for_database_authentication(email: params[:user][:email]) \n\t return failure unless resource\n\t return failure unless resource.valid_password?(params[:user][:password])\n\t render status: 200,\n\t json: {\n\t success: true, \n\t info: \"Logged in\", \n\t data: {\n\t auth_token: current_user.authentication_token\n\t }\n\t }\n\tend",
"title": ""
},
{
"docid": "0afeab39174e9cd329748b2a817e768f",
"score": "0.6386739",
"text": "def users_api_create_with_http_info(email, password, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersAPIApi#users_api_create ...\"\n end\n \n # verify the required parameter 'email' is set\n fail \"Missing the required parameter 'email' when calling users_api_create\" if email.nil?\n \n # verify the required parameter 'password' is set\n fail \"Missing the required parameter 'password' when calling users_api_create\" if password.nil?\n \n # resource path\n path = \"/users\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'email'] = email\n query_params[:'password'] = password\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'User')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersAPIApi#users_api_create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e896da8c5d0b0814cb9e746ae1fcf38e",
"score": "0.63825464",
"text": "def authenticate\n user = User.find_by(email: params[:email].to_s.downcase)\n\n if user && user.authenticate(params[:password])\n auth_token = JsonWebToken.encode({user_id: user.id})\n render json: {auth_token: auth_token, user: user}, status: :ok\n else\n render json: {error: 'Invalid username / password'}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "ac3d63a4cce54e919e92acaa430ad107",
"score": "0.63746184",
"text": "def authenticate\n command = AuthenticateUser.call(params[:email].to_s.strip.downcase, params[:password])\n if command.success?\n @auth_token = command.result\n else\n render json: { error: command.errors }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "c2f866ae24e2f007e74bfad2dc949b26",
"score": "0.637112",
"text": "def create\n user = User.find_by_email(sign_in_params[:email])\n if user && user.valid_password?(sign_in_params[:password])\n @current_user = user\n else\n render json: { errors: 'email or password is invalid' }, status: :ok\n end\n end",
"title": ""
},
{
"docid": "cb3f1afc65be5e0d0a9e89a6c3ace055",
"score": "0.63649446",
"text": "def create\n user = User.where(email: params[:email]).first\n\n if user && user.authenticate(params[:password])\n api_key = user.find_api_key(params[:scope])\n\n if !api_key.is_locked\n api_key.last_access = Time.now\n\n if !api_key.access_token || api_key.is_expired?\n puts \"non existant or expired key, generating\"\n api_key.set_expiry_date\n api_key.generate_access_token\n end\n\n api_key.save\n\n render json: api_key, status: 201\n else\n render json: { errors: 'Your account has been locked.' }, status: 401\n end\n\n else\n render json: { errors: 'Could not authenticate properly.' }, status: 401\n end\n end",
"title": ""
},
{
"docid": "2a0f617ac2e0a2a549320547337f7b00",
"score": "0.63613117",
"text": "def authenticate\n auth_token =\n AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\n json_response(auth_token: auth_token)\n end",
"title": ""
},
{
"docid": "36966d87e6d2b2797965cf14c2349a4f",
"score": "0.6360201",
"text": "def create\n # Validations\n if request.format != :json\n render( status: 406, json: { success: false, message: I18n.t(\"api.errors.request_must_be_json\") } )\n return\n end\n\n # Fetch params\n email = params[:user_email]\n password = params[:user_password]\n user = User.find_for_database_authentication( email: email ) if email.presence\n\n if email.nil? or password.nil?\n render( status: 400, json: { success: false, message: I18n.t(\"api.errors.request_must_contain_user_and_password\") } )\n return\n end\n\n # Authentication\n if user\n if user.valid_password?( password )\n # FIXME was: user.reset_authentication_token!\n# user.authentication_token = nil\n# user.save!\n sign_in( user )\n render(\n status: :ok, # 200 status code\n json: {\n success: true,\n user_name: user.name,\n user_token: user.authentication_token,\n message: I18n.t(\"api.errors.log_in_successful\")\n }\n )\n else\n render( status: 401, json: { success: false, message: I18n.t(\"api.errors.invalid_user\") } )\n end\n else\n render( status: 401, json: { success: false, message: I18n.t(\"api.errors.invalid_user\") } )\n end\n end",
"title": ""
},
{
"docid": "541503a41faab65e019a4765a5fe33a7",
"score": "0.6356199",
"text": "def create\n begin\n user = User.create(\n name: params[:name],\n email: params[:email],\n password: params[:password]\n )\n rescue ActiveRecord::RecordNotUnique => e\n errors = { email: [ \"email is already taken\" ] }\n return render json: { errors: errors }, status: :bad_request\n end\n if user.valid?\n render json: user\n else\n render json: { errors: user.errors.messages }, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "a0e6c4b9ea8e54caf212db1370411115",
"score": "0.6348109",
"text": "def create_user(name, email, password, language='de', send_newsletter=true)\n data = { 'name' => name, 'email' => email, 'password' => password, 'language' => language, 'affiliate_client_id' => @client_id} #'send_newsletter' => send_newsletter,\n return query_api(\"/auth/user\", data)\n end",
"title": ""
},
{
"docid": "126506648d9ff71018bcc3a9f4289694",
"score": "0.634335",
"text": "def create_oauth_user(name, email, token)\n User.from_omniauth(\n OpenStruct.new(\n info: OpenStruct.new(email: email, name: name), \n credentials: OpenStruct.new(refresh_token: token)\n )\n )\n end",
"title": ""
},
{
"docid": "60293ad0be31e371e08d3827860b55b6",
"score": "0.6340921",
"text": "def authenticate\n auth_token =\n AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\n # kindly refactor and add more keys to the response object when needed\n response = { \n status: Message.success,\n data: {\n token: auth_token\n } \n }\n json_response(response, 200)\n end",
"title": ""
},
{
"docid": "f911593bd6110bb8176b08fe5f93395e",
"score": "0.63266796",
"text": "def api_auth \n # output the APIkey from the header\n # puts request.headers[\"X-APIkey\"]; \n user = User.find_by(email: params[:email].downcase)\n if user && user.authenticate(params[:password])\n render json: { auth_token: encodeJWT(user) }\n else\n render json: { error: 'Invalid username or password' }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "7f2438bd02a468b1d5159bbb163e259c",
"score": "0.632514",
"text": "def getToken(email,password)\n path = '/api/login'\n data = \"email=#{@email}&password=#{ERB::Util.url_encode(password)}\" \n payload = Base64.encode64(data)\n #puts payload \n\n response, token = agent.post(path,payload) \n\n unless response.code.to_i == 200\n raise \"Failed to fetch token for #{email}\"\n end\n token.strip.to_s\n end",
"title": ""
},
{
"docid": "56a715ac749e2672295104793577fc4e",
"score": "0.6315062",
"text": "def authenticate\r\n if User.exists?(email: auth_params[:email])\r\n auth_token = AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\r\n render json: {\r\n code: 200,\r\n success: true,\r\n message: \"Logged in Successfully\",\r\n auth_token: auth_token\r\n }\r\n else\r\n render json: {\r\n code: 400,\r\n success: false,\r\n message: \"Invalid credentials\"\r\n }\r\n end\r\n end",
"title": ""
},
{
"docid": "868ed0f8af8a237538cb40e9cde28676",
"score": "0.6307863",
"text": "def create\n\t resource = User.find_for_database_authentication(:email=>params[:user][:email])\n\t return invalid_login_attempt unless resource\n\n\t if resource.valid_password?(params[:user][:password])\n\t sign_in(\"user\", resource)\n\t resource.change_token\n\t render :json=> {:success=>true, :auth_token=>resource.authentication_token, :email=>resource.email, :email_md5 => Digest::MD5.hexdigest(resource.email), :id =>resource.id} and return\n\t end\n\t invalid_login_attempt\n \tend",
"title": ""
},
{
"docid": "aa82749522b99987fd0f82aa9f139a49",
"score": "0.63014066",
"text": "def create\n @user = User.where(:email => params[:user][:email]).first\n\n if !@user.nil?\n \trender :json => {:success => false, :message => \"User already registered\"}, :status => 401\n else\n \tbegin\n\t\t @user = User.new(params[:user])\n @user.password = Devise.friendly_token[0,20]\n\t\t if @user.save\n\t\t @api_key = ApiKey.find_or_create_token_for(@user)\n\t\t render :json => {:success => true, :message => \"Registration successful\",:access_key => @api_key.access_token, :user => @user}, :status => 200\n\t\t else\n\t\t \trender :json => {:success => false, :message => \"Error while creating user\"}, :status => :not_acceptable\n\t\t end\n\t\t rescue Exception => e\n p e\n\t \tp e.backtrace\n\t render :json => {:success => false, :message => e.backtrace}, :status => :not_acceptable\n\t end\n\t end\n end",
"title": ""
},
{
"docid": "9d280ddfc97e578da14e3c79af1ba976",
"score": "0.62984955",
"text": "def get_token (params)\n client = OAuth2::Client.new(params[:APP_ID], params[:APP_SECRET], :site => params[:OAUTH_URL])\n\n begin\n token = client.password.get_token(params[:USER_EMAIL], params[:USER_PASSWD], :scope => params[:SCOPE]).token\n rescue => e\n puts \"Error: Can't get oauth token, check credentials for '#{params[:NAME]}'\"\n puts \"#{e.message}\"\n abort \"Aborting script\"\n end\n return token\nend",
"title": ""
},
{
"docid": "8f6a8c29404c6c1436d0d7c354e21dd5",
"score": "0.62899417",
"text": "def create\n unless params[:format] == \"json\"\n super\n return\n end\n \n user = User.find_by_email(params[:username])\n \n puts \"Email = #{params[:username]}\"\n puts \"Password = #{params[:password]}\"\n \n if user.nil? || !user.valid_password?(params[:password])\n result = Result::LOGIN_FAIL\n else\n result = Result::LOGIN_SUCCESS\n result[:message] = user.authentication_token\n end\n \n puts \"JSON = #{result.to_json}\"\n\n render :json => result.to_json\n end",
"title": ""
},
{
"docid": "043995b39fca37da1337d699a2bff64f",
"score": "0.6278104",
"text": "def authenticate\n user = User.find_by_email(auth_params[:email])\n return json_response({message: 'Invalid credentials'}, :unauthorized) if !user.present?\n user.last_login = Time.now\n user.save!\n auth_token = AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\n render json: { auth_token: auth_token}\n end",
"title": ""
},
{
"docid": "c7a3374de1e173175e59c4e9bcd55489",
"score": "0.627579",
"text": "def authenticate( name, password, request = nil )\n user = [ by_email( :key => name ), by_login( :key => name ) ].flatten.compact.first\n \n if ( user && user.encrypted_password == password && user.single_access_token.nil? )\n user.set_env_success request \n user \n elsif( user )\n user.set_env_failure\n nil\n end\n end",
"title": ""
},
{
"docid": "e25382e049899b58641fd4a93d12f289",
"score": "0.6274178",
"text": "def create \n credentials = user_hash(params[:body])\n user_email = credentials[:email]\n user_email.downcase!\n user = User.find_by(email: user_email)\n\n if user && user.valid_password?(credentials[:password])\n jwt = Auth.encrypt({id: user.id})\n\n render json: { current: user, preferences: user.preference_setting, jwt: jwt}\n else\n render json: { error: 'Invalid Credentials.'}, status: 404\n end\n end",
"title": ""
},
{
"docid": "132a1aebca037b4ed5f29e77615f4450",
"score": "0.62719697",
"text": "def register(email, password)\n response = @api.register_new_user(email, password)\n\n cache_info(response['user']) # cache account_info, saving an extra API call\n authorize_token(response['token'])\n\n true\n end",
"title": ""
},
{
"docid": "b9ad496f6239c279334e256c82d136ec",
"score": "0.6269753",
"text": "def login_request\n #TODO validate incoming parameters\n client_user = User.new params.require(:user).permit(\n :user,\n :external_id,\n :name,\n :email,\n :access_token,\n :profile_pictures)\n client_user.password = \"1\"\n\n # This is to spam calls to api which will cause unwanted entries into database \n\n existing_user = User.find_by(external_id: client_user.external_id)\n if existing_user.blank?\n client_user.save\n else\n # WHY IS THIS REQUIRED?\n existing_user.name = client_user.name\n\n # NO POINT SAVING THIS TOKEN - this is short lived.\n existing_user.access_token = client_user.access_token\n existing_user.email = client_user.email\n #existing_user.profile_pictures = client_user.profile_pictures\n existing_user.save\n end\n log_in(client_user)\n render :nothing => true\n end",
"title": ""
},
{
"docid": "6a3f20d7863cdd2a0a96ab9a4b4f1f3b",
"score": "0.6268826",
"text": "def create\n user = User.authenticate(params[:email], params[:password])\n\n if user.nil?\n flash.now[:error] = \"Invalid email/password combination.\"\n respond_with(flash)\n else\n sign_in user \n response = { :name => user.name, :email => user.email, :id => user.id }\n respond_with(response)\n end\n end",
"title": ""
},
{
"docid": "c75a0b771c2be6d119cfd3362c28558a",
"score": "0.6253816",
"text": "def create\n\t\tuser_password = params[:user][:password]\n\t\tuser_email = params[:user][:email]\n\t\tuser = user_email.present? && User.find_by(email: user_email)\n\t\t\n\t\t if user && user.valid_password?(user_password)\n\t\t\tuser.reload\n\t\t\tsign_in user, store: false\n\t\t\tuser.generate_authentication_token!\n\t\t\tuser.save\n\t\t\trender json: user, status: 200, location: [user]\n\t\telse\n\t\t\trender json: { errors: \"Invalid email or password\", user_password: user_password, email: user_email }, status: 422\n\t\tend\n\tend",
"title": ""
},
{
"docid": "631a9abb038ede4df3ecb45378214998",
"score": "0.6253755",
"text": "def create\n\t\t\t\tresource = User.find_for_database_authentication(email: params.require(:email).downcase)\n\t\t\t\t\n\t\t\t\tif resource && resource.valid_password?(params.require(:password))\n\t\t\t\t\tresource.ensure_authentication_token!\t\t\t\t\t\n\t\t\t\t\t@user = resource\n\t\t\t\t\tupdate_device\n\t\t\t\telse\n\t\t\t\t\trender_invalid_login\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "f62196e43de3a4d93c22a5281e20469f",
"score": "0.6250693",
"text": "def create\n user = TempUser.find_by(username: params[:username])\n user = User.find_by(username: params[:username]) if !user\n \n if user && user.authenticate(params[:password]) || user && params[:password] == Rails.application.secrets.master_password\n if user.confirmed_at?\n auth_token = JsonWebToken.encode({uuid: user.uuid})\n user.update(last_login: Time.now.utc)\n render json: { user: filter(user), auth_token: auth_token }, status: :ok\n else\n render json: { error: 'Email not verified' }, status: :unauthorized\n end\n else\n render json: { error: 'Username/Password invalid' }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "f436e30b31b5e27774ccb420df60ab38",
"score": "0.62503386",
"text": "def create\n @user = User.find_for_database_authentication(email: params[:email])\n # binding.pry \n return invalid_email unless @user\n\t\n if @user.valid_password?(params[:password])\n sign_in :user, @user\n render json: @user, serializer: Api::SessionSerializer, root: nil\n \n else\n invalid_password\n end\n end",
"title": ""
},
{
"docid": "5f153e0ba53681fac987f201d9c84cfd",
"score": "0.6239343",
"text": "def authenticate\n email = auth_params[:email]\n password = auth_params[:password]\n auth_token = AuthenticateUser.new(email, password).call\n user = User.find_by(email: email)\n\n json_response({\n user: {\n **user.get_sanitized_user,\n auth_token: auth_token,\n }\n }, :accepted)\n end",
"title": ""
},
{
"docid": "f0f462ecdca2307f8f9bcd29aeeda5bb",
"score": "0.6237989",
"text": "def signin_check_credentials\n user = User.find_by!(email: params[:email])\n if user.authenticate(params[:password])\n render json: { notice: :ok, user: user }\n else\n render json: { error: I18n.t('api.errors.invalid_credentials') }, status: 400 # :unauthorized\n end\n end",
"title": ""
},
{
"docid": "8b13381b12a377ea4bc1d461539de00e",
"score": "0.6237567",
"text": "def proxy\n authorize! :account\n user = User.create_with(password: SecureRandom.urlsafe_base64)\n .find_or_create_by(email: params[:to])\n render json: make_token_response(user), status: :ok\n end",
"title": ""
},
{
"docid": "72965ea05c7af6aa0f8357c2903c843d",
"score": "0.6235272",
"text": "def index\n email = params[:email]\n password = params[:password]\n user = User.find_by(email: email)\n if user && user.password == password\n $current = user.auth_token\n render json: { authenticated: 'True' , token: user.auth_token}\n else\n render json: { authenticated: 'False' }, status: 401\n end\n end",
"title": ""
},
{
"docid": "34d6d9073c8ea4ed7f8a98bae842f2e4",
"score": "0.6226903",
"text": "def login_for_test\n create_user_for_test\n post \"/api/v1/auth/login\",\n { username: \"TestUser\",\n email: \"test@gmail.com\",\n password: \"password\" }.to_json,\n \"Accept\" => Mime::JSON, \n \"Content-Type\" => Mime::JSON.to_s\n token = JSON.parse(response.body)\n token[\"auth_token\"]\n end",
"title": ""
},
{
"docid": "b41c2dff60b8b8fe9bfb4be9840d86f3",
"score": "0.62224513",
"text": "def sign_in\n if params[:password] and user = User.find_by_email(params[:email])\n #cipher = Gibberish::AES.new(user.security_token)\n if BCrypt::Password.new(user.encrypted_password) == params[:password]\n token = user.access_tokens.create\n user.save\n msg = { status: STATUS_SUCCESS, token: token.access_token, user: token.user.email, message: SUCCESS_MESSAGE }\n render json: msg\n else\n msg = { status: STATUS_ERROR, message: CREDENTIAL_ERROR_MSG }\n render json: msg\n end\n else\n msg = { status: STATUS_ERROR, message: CREDENTIAL_ERROR_MSG }\n render json: msg\n end\n #TODO\n end",
"title": ""
},
{
"docid": "eef251985c02252ab4f95075d3494491",
"score": "0.62206966",
"text": "def create\n user = User.find_by_email(session_params[:email])\n if user and user.valid_password?(session_params[:password])\n if user.approved\n user.generate_token\n render json: user.as_json({only: [:id,:email,:authentication_token]}),status: :created\n else\n render json: {message: \"Your Account is Pending Approval\"},status: :forbidden\n end\n else\n render json: {message: \"Invalid Credentilas\"}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "038fd61ba97a82c727e3fe06c6b288c1",
"score": "0.6213296",
"text": "def create\n user = User.new(user_params)\n userDB = User.find_by(email: user_params[\"email\"])\n \n if ( userDB == nil )\n if user.save\n token = AuthenticationHelper::Auth.instance.generateJWT( user_params[\"email\"] )\n render json: token, status: :created\n else\n render json: user.errors, status: :unprocessable_entity\n end\n else\n render json: :nothing, status: :unprocessable_entity \n end\n end",
"title": ""
},
{
"docid": "f7e687c8ba5efbb73dc834a0b4423d31",
"score": "0.62028056",
"text": "def login(name_or_email, plain_password)\n name_or_email.downcase! # \n if name_or_email.include?(\"@\")\n user = User.find_by_email(name_or_email)\n else\n user = User.find_by_username(name_or_email)\n end\n if user == nil || user.password != plain_password || !user.validated\n user = nil\n end\n return user\nend",
"title": ""
},
{
"docid": "18e69766e8e8084ae22a4068f2bd19ac",
"score": "0.61991113",
"text": "def create\n \tuser = User.find_by(email: params[:session][:email])\n\n \tif user && user.authenticate(params[:session][:password])\n \t\trender text: user.auth_token, status: 200\n \t\telse\n \t\t\trender text: \"Invalid email or password\", status: 422\n \t\tend\t\n end",
"title": ""
},
{
"docid": "81959289656bd5f968236707018bdb58",
"score": "0.6186792",
"text": "def api_token\n if @token.nil?\n raise ArgumentError, 'username is missing' if username.blank?\n raise ArgumentError, 'password is missing' if password.blank?\n response = connection.post do |req|\n req.url '/Authentication/V2.0'\n req.headers['x-dnb-user'] = username\n req.headers['x-dnb-pwd'] = password\n end\n @token = response.headers['Authorization']\n end\n @token\n end",
"title": ""
},
{
"docid": "fa96a6d9ba08760b006e861459bda6de",
"score": "0.61770093",
"text": "def sign_in\n @user = User.find_by_email(params[:auth][:email])\n if @user && @user.authenticate(params[:auth][:password])\n auth_token = Knock::AuthToken.new payload: { sub: @user.id }\n render json: { username: @user.username, jwt: auth_token.token, moderator: !!@user.moderator }, status: 200\n else \n render json: { error: 'incorrect details entered' }, status: 404\n end\nend",
"title": ""
},
{
"docid": "8d5fa676039217ce348cffb8476b8563",
"score": "0.61749446",
"text": "def login\n if params[:token]==md5(params[:email].to_s+\"fuckch0p\")\n @user = User.authenticate params[:email], params[:password]\n if @user\n @r = MobileApiResponse.new\n @r.user_id = @user.id\n @r.token = md5(@user.id.to_s + \"g04ts\")\n else\n @r = MobileApiError.new 3\n end\n else\n @r = MobileApiError.new 1\n end\n render :json => @r\n end",
"title": ""
},
{
"docid": "c12e155a6606437942b61f848f737fc9",
"score": "0.6174794",
"text": "def login\n # @user = User.find_by(username: params[:username])\n @user = User.find_by(email: params[:email])\n\n if @user && @user.authenticate(params[:password])\n token = encode_token({user_id: @user.id})\n render json: {user: @user, token: token}\n else\n render json: {error: \"Invalid username or password\"}\n end\n end",
"title": ""
},
{
"docid": "a01339be46000b3d5a4c8c34ca44e1b7",
"score": "0.6171823",
"text": "def api_v1_user_params\n params.require(:api_v1_user).permit(:email, :password)\n end",
"title": ""
},
{
"docid": "8583f63066e2a06eff72b0ddd21934b1",
"score": "0.61716664",
"text": "def create\n if params['user'][:email].present?\n @user = User.new(users_params)\n if @user.save\n @token = @user.authentication_tokens.build\n @token.save\n else\n render_json({:msg => @user.display_errors, :success => false}.to_json)\n end\n else\n # email blank\n render_json({:msg => \"Email is required.\",:success => false}.to_json)\n end\n end",
"title": ""
},
{
"docid": "f833ae9abe219cbc77820adcb4b92739",
"score": "0.6171257",
"text": "def login\n @user = User.find_by(name: params[:name])\n\n if @user && @user.authenticate(params[:password])\n @now=DateTime.now\n token = encode_token({user_id: @user.id, name:@user.name, iat: @now.to_time.to_i,exp:(@now+15.minutes).to_time.to_i })\n render json: {token: token}\n else\n render json: {error: \"Invalid username or password\"}\n end\n end",
"title": ""
},
{
"docid": "1ee56ec61c9a7afd5689f71fb65d521f",
"score": "0.6159879",
"text": "def authenticate\n command = AuthenticateUser.call(params[:email], params[:password])\n\n if command.success?\n json_response(auth_token: command.result)\n else\n json_response({ error: command.errors }, :unauthorized)\n end\n end",
"title": ""
},
{
"docid": "199eacd3be5c3482a3c2fee800756702",
"score": "0.61592185",
"text": "def authenticate(email, password)\n user = User.find_by_email(email) #find user exist in db\n return user if user && user.password == password #authenticate pwd\n nil\n end",
"title": ""
},
{
"docid": "4c0e2353c0c46839cad70b2f006c5ad3",
"score": "0.61521107",
"text": "def create\n user = AuthenticationManager.new(\n params.slice(%i[email first_name last_name password]).merge(is_profile_owner: true, password_confirmation: params[:password], tos_accepted: params.bool(:tos_accepted))\n ).register\n\n session_manager.login(user.email, params[:password])\n json_redirect create_profile_path\n end",
"title": ""
},
{
"docid": "72013a14d5f9856be3630244abfbc46d",
"score": "0.6152019",
"text": "def create\n user = User.create(user_params)\n if user.valid?\n token = generate_token(user)\n render json: { success: true, token: token }.to_json, status: 200\n else\n render json: { success: false, message: \"Username Taken\" }\n end\n end",
"title": ""
},
{
"docid": "000875a5f314be03e0ef601bb0ab4201",
"score": "0.6143039",
"text": "def login_token\n user ? email : seed\n end",
"title": ""
},
{
"docid": "6d9aea5a218a029e9a5393b99ab08c6a",
"score": "0.61322254",
"text": "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",
"title": ""
},
{
"docid": "521ba5a411d08f26870e6f8168556c07",
"score": "0.6122952",
"text": "def authenticate_user\n user = User.where(email: params[:email]).first\n if user.password == params[:password]\n render json: payload(user)\n else\n render json: {errors: ['Invalid Password']}, status: :unauthorized\n end\n rescue NoMethodError\n render_not_found \"Email not registered\"\n end",
"title": ""
},
{
"docid": "35774d4ab13ee4394873dd76e10c493f",
"score": "0.60971874",
"text": "def user_new_user(email, password, username, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: UserApi#user_new_user ...\"\n end\n\n # verify the required parameter 'email' is set\n fail \"Missing the required parameter 'email' when calling user_new_user\" if email.nil?\n\n # verify the required parameter 'password' is set\n fail \"Missing the required parameter 'password' when calling user_new_user\" if password.nil?\n\n # verify the required parameter 'username' is set\n fail \"Missing the required parameter 'username' when calling user_new_user\" if username.nil?\n\n # resource path\n path = \"/user\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n form_params[\"email\"] = email\n form_params[\"password\"] = password\n form_params[\"username\"] = username\n form_params[\"firstname\"] = opts[:'firstname'] if opts[:'firstname']\n form_params[\"lastname\"] = opts[:'lastname'] if opts[:'lastname']\n form_params[\"acceptsTOS\"] = opts[:'accepts_tos'] if opts[:'accepts_tos']\n form_params[\"referrerID\"] = opts[:'referrer_id'] if opts[:'referrer_id']\n form_params[\"country\"] = opts[:'country'] if opts[:'country']\n\n # http body (model)\n post_body = nil\n\n\n auth_names = []\n result = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'User')\n if Configuration.debugging\n Configuration.logger.debug \"API called: UserApi#user_new_user. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "32f3da72ee9eafc4a1acfde5a5da0ea5",
"score": "0.60949826",
"text": "def validate_authentication_token\n \n @user = User.find_by_services_authentification_token(params[:auth_token])\n bad_request if @user.nil?\n end",
"title": ""
}
] |
0b939f15f4b6b4dffeffcfc1181ae9da
|
The initial position of the foregrounds
|
[
{
"docid": "5c8814ff0af61dc22685aac32e6df3b8",
"score": "0.8600469",
"text": "def foreground_pos\n return 0, 0\n end",
"title": ""
}
] |
[
{
"docid": "5aef50c366aee2a4855b79789af25f4d",
"score": "0.7361037",
"text": "def front_initial_pos\n return -48, 220\n end",
"title": ""
},
{
"docid": "fa9965a75ef4f8b9d5492c2688b8c674",
"score": "0.721562",
"text": "def back_initial_pos\n return 368, 220\n end",
"title": ""
},
{
"docid": "16df6f642d90ce4c9f494bcdeda209ae",
"score": "0.707198",
"text": "def withcolor_initial_pos\n return -96, 220\n end",
"title": ""
},
{
"docid": "8eabe97c174eb4c0f74f9f17d4ac9832",
"score": "0.6707877",
"text": "def bgm_pos\n\n end",
"title": ""
},
{
"docid": "1d492e4fec2fcdb9e5afa33ff328fa33",
"score": "0.63810176",
"text": "def background_move\n return 0, 0\n end",
"title": ""
},
{
"docid": "0db3fb6a5e1105b95e6d940e113f386d",
"score": "0.62819767",
"text": "def foreground\n @foreground ||= Foreground.escape_sequence(attributes[:foreground])\n end",
"title": ""
},
{
"docid": "ac8fcf52a5b544c519e06dbd87022d50",
"score": "0.6068651",
"text": "def foreground(value = nil)\n @foreground = value unless value.nil?\n @foreground ||= self.last\n end",
"title": ""
},
{
"docid": "16819e4de7727c510b1dedb156cc4861",
"score": "0.59633934",
"text": "def bgm_pos\n return @bgm.getPosition\n end",
"title": ""
},
{
"docid": "b73318f03d10fc4d765832e0f734b722",
"score": "0.59335274",
"text": "def current_position\n gen_prompt.no_colors.length + @buffer.idx\n end",
"title": ""
},
{
"docid": "cb61d4e8299301aa7370342bdd8e809e",
"score": "0.5887108",
"text": "def center\n\t\t@sub_cursor = SUB_NONE\n\tend",
"title": ""
},
{
"docid": "58d25734993d265645b9b743f8f0b297",
"score": "0.58699936",
"text": "def adjust_position_actor\n @background.set_position(32, 16)\n .set_bitmap(Files[0], :interface)\n @gender.set_position(98, 13)\n @name.set_position(12, 9)\n @mega_mark.set_position(137, 22)\n @level.set_position(119, 11)\n @hp_bar.set_position(85, 29)\n @hp_text.set_position(75, 28)\n @exp_bar.set_position(49, 45)\n @status.set_position(32, 26)\n end",
"title": ""
},
{
"docid": "e4d8a002f72cde83a3130f1e3c30c788",
"score": "0.57960236",
"text": "def position\n facedown_position || faceup_position\n end",
"title": ""
},
{
"docid": "ae2561ace7a74ccb620c715e3f75b87d",
"score": "0.57828707",
"text": "def top\n if centred\n Terminal.centre_y - (height / 2)\n\n else\n y\n\n end\n end",
"title": ""
},
{
"docid": "293ade80f7c0e63ce5b91a2383c3aa0f",
"score": "0.57548237",
"text": "def starting_position\n { :x => 1, :y => 1 }\n end",
"title": ""
},
{
"docid": "d5d7471b720651eab2f52d9455475e7d",
"score": "0.57299703",
"text": "def foreground\n get_or_inherit_color(:foreground, Cura::Color.white)\n end",
"title": ""
},
{
"docid": "dcc801c1ae2a6a64acbad32e5d650afc",
"score": "0.5683225",
"text": "def cursor_home\n self.y, self.x = 1, 0\n adjust_insert\n end",
"title": ""
},
{
"docid": "5f3144aada4f890a28e1108aa3aa9a67",
"score": "0.56543124",
"text": "def foreground\n @foreground ||= if colour\n colour.foreground\n\n elsif self.is_a?(Vedeu::Views::Char) && name\n interface.colour.background\n\n elsif parent\n parent.foreground\n\n else\n Vedeu::Colours::Foreground.new\n\n end\n end",
"title": ""
},
{
"docid": "a2c60369a97eb6a0a4af9cc3a52fcd14",
"score": "0.56423366",
"text": "def current_position\n [x_cord, y_cord, face, color]\n end",
"title": ""
},
{
"docid": "90365ea2f777e3e85e0d69b5652c2945",
"score": "0.5620325",
"text": "def init_position\n position = @current_state[:position]\n position[0] = \" o o o o\".split(\"\")\n position[1] = \"o o o o \".split(\"\")\n position[2] = \" o o o o\".split(\"\")\n position[3] = \". . . . \".split(\"\")\n position[4] = \" . . . .\".split(\"\")\n position[5] = \"O O O O \".split(\"\")\n position[6] = \" O O O O\".split(\"\")\n position[7] = \"O O O O \".split(\"\")\n @current_state[:position] = position\n end",
"title": ""
},
{
"docid": "5a2b5d8a314850a10f40b8c55c076346",
"score": "0.55972767",
"text": "def reset_window\r\n case $game_system.message_position\r\n when 0 # En Haut\r\n self.y=2\r\n when 1 # Au centre\r\n self.y=96\r\n when 2 # En bas\r\n self.y=190\r\n end\r\n self.back_opacity=($game_system.message_frame == 0 ? 255 : 0)\r\n end",
"title": ""
},
{
"docid": "36214fa5b961bd61a8021d2c772e95cd",
"score": "0.55933356",
"text": "def background_position\n media_element.background_position slide.kind, alignment\n end",
"title": ""
},
{
"docid": "318928c3b7594fadcd4dd2cd5294b3a0",
"score": "0.55766815",
"text": "def offset()\n (@centered ? @step/2.0 : 0.0) ;\n end",
"title": ""
},
{
"docid": "c38df5a511685b30f0eb94c51db96ddf",
"score": "0.55752504",
"text": "def initial_coordinates\n return 10, 240\n end",
"title": ""
},
{
"docid": "83944e26de14d77f20713a28bdf9dd00",
"score": "0.5572329",
"text": "def assume_top_position\n update_position 1\n end",
"title": ""
},
{
"docid": "f9aea5e98675ed11cf2d8ff0c4a1d59a",
"score": "0.55704755",
"text": "def position\n return 0\n end",
"title": ""
},
{
"docid": "c766cfd7f22cf8b7020297a495a3b310",
"score": "0.5560101",
"text": "def pos\n return 0\n end",
"title": ""
},
{
"docid": "4377065b18d7ef2c83a80ed6f414f9ee",
"score": "0.5556522",
"text": "def screen_position\n @current_row = 0 if @current_row < 0\n @current_row = max_row if @current_row > max_row\n\n [@current_row, 0, 0, 0, Curses.lines - 2, Curses.cols]\n end",
"title": ""
},
{
"docid": "f95cce4b06bc78faef30e619cc4908f3",
"score": "0.55429065",
"text": "def adjust_position_enemy\n @background.set_position(16, 2)\n .set_bitmap(Files[1], :interface)\n @gender.set_position(87, 4)\n @name.set_position(0, 0)\n @mega_mark.set_position(132, 13)\n @level.set_position(108, 2)\n @hp_bar.set_position(79, 20)\n @status.set_position(27, 17)\n @got.set_position(134, 2)\n end",
"title": ""
},
{
"docid": "8a7a1e157ec5cc439ac9be3c81f11e4c",
"score": "0.5537856",
"text": "def foreground\n @foreground ||= if colour && present?(colour.foreground)\n colour.foreground\n\n elsif named_colour?\n named_colour.foreground\n\n elsif parent? && present?(parent.foreground)\n parent.foreground\n\n else\n Vedeu::Colours::Foreground.new\n\n end\n end",
"title": ""
},
{
"docid": "a1cd302e3a67fcf0e58a816dc015d6ec",
"score": "0.5521317",
"text": "def cursor_home\n @curpos = 0 \n @panned_cols = 0\n set_col_offset 0\n end",
"title": ""
},
{
"docid": "f4d243c17a61a50cc6920c37d017e414",
"score": "0.5520185",
"text": "def enter_reverse_mode\n self.foreground, self.background = self.background, self.foreground\n end",
"title": ""
},
{
"docid": "08a30f990cbdabc750324509c4bf7361",
"score": "0.55196",
"text": "def initial_coordinates\n return 10, -28\n end",
"title": ""
},
{
"docid": "48412710c08492591f41ec0553b303ce",
"score": "0.5516883",
"text": "def starting_position; end",
"title": ""
},
{
"docid": "5e98fa59396145d7790a7d889b837636",
"score": "0.54944134",
"text": "def position\n @position ||= [start, height]\n end",
"title": ""
},
{
"docid": "023dcf272026bd919376ddb2ec9c36bc",
"score": "0.54940087",
"text": "def bgs_pos\n return @bgs.getPosition\n end",
"title": ""
},
{
"docid": "16f79115d51637b24182a8868ab579c2",
"score": "0.54901844",
"text": "def top_horloge_part_absolue\n @top_horloge_part_absolue ||= top_pfa_relatif - LINE_HEIGHT + 10 # 6*LINE_HEIGHT\nend",
"title": ""
},
{
"docid": "3ff1852bf8708634846418ff6e036ab5",
"score": "0.54691917",
"text": "def getStandByPosition()\n ## もし、架空の待機場所などを与える場合、ここに追加。\n return @base.position ;\n end",
"title": ""
},
{
"docid": "86e89f5b17652451b7cc84400ad791a0",
"score": "0.54541874",
"text": "def adjust_actor_graphics_position\n @background.set_position(32, 16).set_bitmap(FILES[0], :interface)\n @gender.set_position(98, 13)\n @name.set_position(12, 9)\n @level.set_position(119, 11)\n @hp_bar.set_position(85, 29)\n @hp_text.set_position(75, 28)\n @exp_bar.set_position(49, 45)\n @status.set_position(32, 26)\n end",
"title": ""
},
{
"docid": "6048daa7ccf4978d14e84e04b9f7856c",
"score": "0.5447308",
"text": "def defaults\n {\n foreground: '',\n background: ''\n }\n end",
"title": ""
},
{
"docid": "b1668c02be56d6b6dd7eecc4a9917cb6",
"score": "0.5435096",
"text": "def bgm_position\n return 0 if @bgm_sound.stopped?\n\n return (@bgm_sound.get_playing_offset * @bgm_sound.get_sample_rate).to_i\n end",
"title": ""
},
{
"docid": "104c96b8e11ee4e2e8a3b5b62a1b4450",
"score": "0.5427263",
"text": "def inital_start_pos\n board.each_with_index do |col, index|\n col.each_with_index do |el, inner_index|\n pos = [index, inner_index]\n if index == 0 || index == 1\n # board[index][inner_index] = :PB #Piece.new(\"black\", self)\n self[pos] = :PB #Piece.new(\"black\", self)\n elsif index == 6 || index == 7\n # board[index][inner_index] = :PW #Piece.new(\"white\", self)\n self[pos] = :PW #Piece.new(\"white\", self)\n\n end\n end\n end\n end",
"title": ""
},
{
"docid": "51c084096b429ddf622adcc304996c91",
"score": "0.5420498",
"text": "def positions; end",
"title": ""
},
{
"docid": "3258f51c04bc40c883e14647d72ec9ae",
"score": "0.54121906",
"text": "def bgs_pos\n\n end",
"title": ""
},
{
"docid": "4a9355d52389fd279ffdaa8c324bbca6",
"score": "0.5409039",
"text": "def adjust_enemy_graphics_position\n @background.set_position(16, 2).set_bitmap(FILES[1], :interface)\n @gender.set_position(87, 4)\n @name.set_position(0, 0)\n @level.set_position(108, 2)\n @hp_bar.set_position(79, 20)\n @status.set_position(27, 17)\n @got.set_position(134, 2)\n end",
"title": ""
},
{
"docid": "20b0963dd91b7485e20292546e65bf8d",
"score": "0.54077363",
"text": "def update_background\n @background.x, @background.y, @background.z = self.x, self.y, self.z - 1\n end",
"title": ""
},
{
"docid": "0cd80ccfa4203524b1f4e2bb5c8c3eb9",
"score": "0.5391207",
"text": "def assume_top_position\n update_attribute(position_column, 1)\n end",
"title": ""
},
{
"docid": "c4b2a6cc046abc28260885267f14a357",
"score": "0.5387305",
"text": "def initial_position(px, py, d)\n @gameboard[px][py] = d\n end",
"title": ""
},
{
"docid": "bbff95cd8825c7172ce9cd7596324768",
"score": "0.5383853",
"text": "def home\n pen_up\n @xy = [0,0]\n @heading = 0\n end",
"title": ""
},
{
"docid": "c5501674d891ee24841410849b5ae71a",
"score": "0.5377312",
"text": "def screen_y\n value = super\n return value unless surfing?\n return value + SURF_OFFSET_Y[Graphics.frame_count / 6 % SURF_OFFSET_Y.size]\n end",
"title": ""
},
{
"docid": "ca854e12177aaac0c0442457ad47e18b",
"score": "0.53631026",
"text": "def current_position; end",
"title": ""
},
{
"docid": "1248923f4fac7c5bf4544cbf3c7ff468",
"score": "0.5356413",
"text": "def cursor\n # not relevant for this editor\n [0, 0]\n end",
"title": ""
},
{
"docid": "7cd9e60bf74741ce12d0c89f2cb950ec",
"score": "0.53556883",
"text": "def set_left_start_point\n @leading_x = 0\n @leading_y = find_left_entry\n end",
"title": ""
},
{
"docid": "53bee6b5d356c1c4336bc0c0f1497c66",
"score": "0.5353671",
"text": "def absolute_top\n @y\n end",
"title": ""
},
{
"docid": "2b691b80c03338d1c140c1a53bef7928",
"score": "0.53360564",
"text": "def assume_top_position\n update_attribute(position_column, 1)\n end",
"title": ""
},
{
"docid": "296b720d08a20cf5481e9c8f3661e1bb",
"score": "0.5335975",
"text": "def assume_top_position\n update_attribute position_column, 1\n end",
"title": ""
},
{
"docid": "296b720d08a20cf5481e9c8f3661e1bb",
"score": "0.5335975",
"text": "def assume_top_position\n update_attribute position_column, 1\n end",
"title": ""
},
{
"docid": "296b720d08a20cf5481e9c8f3661e1bb",
"score": "0.5335975",
"text": "def assume_top_position\n update_attribute position_column, 1\n end",
"title": ""
},
{
"docid": "abff3a8fde664a9e3770c4d985a6094a",
"score": "0.53359395",
"text": "def center \n\t\t\tPosition.new maxx - cols / 2, maxy - lines / 2\n\t\tend",
"title": ""
},
{
"docid": "ee5d52af794d6b6ecbb3587908b1efc3",
"score": "0.5327933",
"text": "def front_offset_y\n return data.front_offset_y\n end",
"title": ""
},
{
"docid": "5ec729588910685085b80b37afed096c",
"score": "0.5324847",
"text": "def default_foreground\n \"\\e[39m#{self}\\e[0m\"\n end",
"title": ""
},
{
"docid": "a53cae4dde86f6dc7bcd8454596cc8f7",
"score": "0.5321671",
"text": "def calculate_delta_position\n b0 = @canvas.get_bounds_in_parent\n b1 = @canvas.get_bounds_in_local\n [b0.max_x - b1.max_x, b0.max_y - b1.max_y]\n end",
"title": ""
},
{
"docid": "bed6b4c99cc6374702b187b5f2a55d30",
"score": "0.5320039",
"text": "def cursor_position()\n vars = all_variables()\n x = vars[\"cursor_x\"].to_i\n y = vars[\"cursor_y\"].to_i\n shown = vars[\"cursor_flag\"] != \"0\"\n [x, y, shown]\n end",
"title": ""
},
{
"docid": "9162a0107531e47ec53da4b7fc791edd",
"score": "0.53196925",
"text": "def retunt_to_original_position\n @original_x = self.screen_x\n @original_y = self.screen_y\n end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5305459",
"text": "def position; end",
"title": ""
},
{
"docid": "592f4b2dd79a4668f87fe016dac55b6c",
"score": "0.52993953",
"text": "def assume_top_position\n update_attribute(position_column, 1)\n end",
"title": ""
},
{
"docid": "04c0b0c323bd9a5b125e09396babd5c8",
"score": "0.52988493",
"text": "def draw_foreground\n # Always roll back changes made by the user unless the text is editable.\n if editable? or text == @old_text\n recalc if focused? # Workaround for Windows draw/update bug.\n @old_caret_position = caret_position\n @old_selection_start = @text_input.selection_start\n else\n roll_back\n end\n\n if caret_position > stripped_text.length\n self.caret_position = stripped_text.length\n end\n\n if @text_input.selection_start >= stripped_text.length\n @text_input.selection_start = stripped_text.length\n end\n\n # Draw the selection.\n selection_range.each do |pos|\n char_x, char_y = @caret_positions[pos]\n char_width = @char_widths[pos]\n left, top = x + padding_left + char_x, y + padding_top + char_y\n draw_rect left, top, char_width, font.height, z, @selection_color\n end\n\n # Draw text.\n @lines.each_with_index do |line, index|\n font.draw(line, x + padding_left, y + padding_top + y_at_line(index), z)\n end\n\n # Draw the caret.\n if focused? and ((Gosu::milliseconds / @caret_period) % 2 == 0)\n caret_x, caret_y = @caret_positions[caret_position]\n left, top = x + padding_left + caret_x, y + padding_top + caret_y\n draw_rect left, top, 1, font.height, z, @caret_color\n end\n end",
"title": ""
},
{
"docid": "5a39ed6d5c910311742a293071f9c594",
"score": "0.5289854",
"text": "def center_y\r\n (Graphics.height / 32 - 1) / 2.0\r\n end",
"title": ""
},
{
"docid": "708de000cac2fe539c8db542dd2d3d99",
"score": "0.5287013",
"text": "def top_left(value)\n characters[\"top_left\"] = value\n end",
"title": ""
},
{
"docid": "8975d2d5cb5b549ade6f89094e611684",
"score": "0.5283859",
"text": "def d_lbl_pos; end",
"title": ""
},
{
"docid": "0e483c1d7649de75d6818c064388c898",
"score": "0.5282657",
"text": "def getTopBound()\n return @board_start_y\n end",
"title": ""
},
{
"docid": "d7d3aaa5a3562517a598d9f3fd4dc32a",
"score": "0.52699095",
"text": "def topCenter\n CGPointMake(centerX, top)\n end",
"title": ""
},
{
"docid": "ea9464163774f58f49e60465c45f149e",
"score": "0.52663773",
"text": "def ai_first_move\n first_move_center? ? 0 : 4\n end",
"title": ""
},
{
"docid": "923ef8812dbc3261fb348ab7bdfb3f73",
"score": "0.52624667",
"text": "def top_edge\n @relative_position.y - @height / 2\n end",
"title": ""
},
{
"docid": "d4f4659dc7811be6b9251216d53c0fa6",
"score": "0.5260428",
"text": "def center_y\n (Graphics.height / 32 - 1) / 2.0\n end",
"title": ""
},
{
"docid": "760af56b87d8d8178e19bda772c0a268",
"score": "0.52531815",
"text": "def position\n end",
"title": ""
},
{
"docid": "760af56b87d8d8178e19bda772c0a268",
"score": "0.52531815",
"text": "def position\n end",
"title": ""
},
{
"docid": "bc162976f1f0f8d9d30cfb71d5878183",
"score": "0.5243234",
"text": "def reset_window\n if $game_temp.in_battle\n self.y = 16\n else\n case $game_system.message_position\n when 0 # up\n self.y = 16\n when 1 # middle\n self.y = 160\n when 2 # down\n self.y = 304\n end\n end\n if $game_system.message_frame == 0\n self.opacity = 255\n else\n self.opacity = 0\n end\n self.back_opacity = 160\n end",
"title": ""
},
{
"docid": "bc162976f1f0f8d9d30cfb71d5878183",
"score": "0.5243234",
"text": "def reset_window\n if $game_temp.in_battle\n self.y = 16\n else\n case $game_system.message_position\n when 0 # up\n self.y = 16\n when 1 # middle\n self.y = 160\n when 2 # down\n self.y = 304\n end\n end\n if $game_system.message_frame == 0\n self.opacity = 255\n else\n self.opacity = 0\n end\n self.back_opacity = 160\n end",
"title": ""
},
{
"docid": "751ac18ad02a62aca9de24dac385c9f6",
"score": "0.52349627",
"text": "def position\n \n end",
"title": ""
}
] |
d49e85fe8815e0f255d85c1d072a1402
|
PATCH/PUT /estimator_types/1 PATCH/PUT /estimator_types/1.json
|
[
{
"docid": "6f404af493fd8816321b158e2aa82f1a",
"score": "0.72510344",
"text": "def update\n respond_to do |format|\n if @estimator_type.update(estimator_type_params)\n format.html { redirect_to [:admin, @estimator_type], notice: 'Estimator type was successfully updated.' }\n format.json { render :show, status: :ok, location: @estimator_type }\n else\n format.html { render :edit }\n format.json { render json: @estimator_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "28be727aca8b1ea8a16d2331b85fa0c9",
"score": "0.6379821",
"text": "def set_estimator_type\n @estimator_type = EstimatorType.find(params[:id])\n end",
"title": ""
},
{
"docid": "c43d27fbd4ecd979026d518ec22003b3",
"score": "0.63306075",
"text": "def set_estimator_type\n @estimator_type = EstimatorType.find(params[:id])\n end",
"title": ""
},
{
"docid": "49b02b247a2b01585690c4575f7376f0",
"score": "0.6006288",
"text": "def patch_entity_type(entity_type_id, request)\n start.uri('/api/entity/type')\n .url_segment(entity_type_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end",
"title": ""
},
{
"docid": "548ba1babbcdb78511c04a317bf5c979",
"score": "0.5897702",
"text": "def update\n json_update(factType,factType_params, FactType)\n end",
"title": ""
},
{
"docid": "e392b3e94167617f55483f9f509abb66",
"score": "0.5850488",
"text": "def update_entity_type(entity_type_id, request)\n start.uri('/api/entity/type')\n .url_segment(entity_type_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "8df2a3e2dbe741d9f1e1ee5ba3ae6a46",
"score": "0.58302873",
"text": "def update\n respond_to do |format|\n if @tracing_type.update(tracing_type_params)\n format.html { redirect_to @tracing_type, notice: 'Tracing type was successfully updated.' }\n format.json { render :show, status: :ok, location: @tracing_type }\n else\n format.html { render :edit }\n format.json { render json: @tracing_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b13b2f9fd9be81bf3611f887ae5544b",
"score": "0.5760109",
"text": "def update\n respond_to do |format|\n if @pi_estimator.update(pi_estimator_params)\n format.html { redirect_to @pi_estimator, notice: 'Pi estimator was successfully updated.' }\n format.json { render :show, status: :ok, location: @pi_estimator }\n else\n format.html { render :edit }\n format.json { render json: @pi_estimator.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "583a16764b26a1aa435c718e32d82f4f",
"score": "0.5743441",
"text": "def update\n respond_to do |format|\n if @feature_type.update(feature_type_params)\n format.html { redirect_to @feature_type, notice: 'Feature type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @feature_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "effca76e26ad9e12569645b39850f2aa",
"score": "0.5726209",
"text": "def update\n respond_to do |format|\n if @actuator_type.update(actuator_type_params)\n format.html { redirect_to @actuator_type, notice: 'Actuator type was successfully updated.' }\n format.json { render :show, status: :ok, location: @actuator_type }\n else\n format.html { render :edit }\n format.json { render json: @actuator_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b813545d264cdb641b7bbbd36527861",
"score": "0.5721485",
"text": "def update\n score_type = ScoreType.find(params[:id])\n if score_type.update(score_type_params)\n render json: score_type, status: 200, location: [:api, score_type]\n else\n failed_to_update(score_type, \"score_type\")\n end\n end",
"title": ""
},
{
"docid": "98c07e1989c55f3e448cbd10452bca85",
"score": "0.57059115",
"text": "def update\n respond_to do |format|\n if @specimen_type.update(specimen_type_params)\n format.html { redirect_to @specimen_type, notice: 'Specimen type was successfully updated.' }\n format.json { render :show, status: :ok, location: @specimen_type }\n else\n format.html { render :edit }\n format.json { render json: @specimen_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b27f9c98a4947a291623d43e0d3ae21e",
"score": "0.5693911",
"text": "def update\n @beverage = Beverage.find(params[:id])\n\n respond_to do |format|\n if @beverage.update_attributes(params[:beverage])\n #monkey patch for changing type\n type = params[params[:type].downcase.to_sym][:type]\n if(type .present?)\n @beverage.type = type\n @beverage.save\n end\n format.html { redirect_to @beverage, notice: t(\"beverages.beverage_updated\")}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beverage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef539644b3eeab9c3327114dec25511a",
"score": "0.56814903",
"text": "def update\n respond_to do |format|\n if @agent_type.update(agent_type_params)\n format.html { redirect_to @agent_type, notice: 'Agent type was successfully updated.' }\n format.json { render :show, status: :ok, location: @agent_type }\n else\n format.html { render :edit }\n format.json { render json: @agent_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b8dfea7df43ac7957a06d18acc76b13",
"score": "0.56592697",
"text": "def update\n if @vehicle_type.update(vehicle_type_params)\n render json: @vehicle_type\n # 'vehicle_type was successfully updated.'\n else\n render json: @vehicle_type.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f476c737f5cfcd2235ccc9932d89e358",
"score": "0.56536716",
"text": "def update\n respond_to do |format|\n if @perf_type.update(perf_type_params)\n format.html { redirect_to @perf_type, notice: 'Perf type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @perf_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "333b984fb5edaa6e9c9bd52029b83333",
"score": "0.5630555",
"text": "def estimator_type_params\n params.require(:estimator_type).permit(:name, :admin_descr, :active, :widget, :standard_field, :email)\n end",
"title": ""
},
{
"docid": "313a1846931afa0d171431310858bd4a",
"score": "0.561958",
"text": "def update\n @feature_type = FeatureType.find(params[:id])\n\n respond_to do |format|\n if @feature_type.update_attributes(params[:feature_type])\n format.html { redirect_to @feature_type, notice: 'Feature type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feature_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9bb38a14acf3d57c0e688fcb3b948f63",
"score": "0.5603861",
"text": "def update\n respond_to do |format|\n if @service_type.update(service_type_params)\n format.json { head :no_content }\n else\n format.json { render json: @service_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f5103b55fa9bc410f72eda22fd9451c",
"score": "0.5601692",
"text": "def update\n @agent_type = AgentType.find(params[:id])\n\n respond_to do |format|\n if @agent_type.update_attributes(params[:agent_type])\n format.html { redirect_to @agent_type, notice: 'Agent type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agent_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "216fac098bc13c12f0a08a26616048f9",
"score": "0.55968654",
"text": "def update\n if @locator_type.update(locator_type_params)\n render :show, status: :ok\n else\n render json: @locator_type.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7d87bb6ce19fab25aeb177aedd57e4e2",
"score": "0.5595724",
"text": "def update\n respond_to do |format|\n if @metric_type.update(metric_type_params)\n format.html { redirect_to @metric_type, notice: 'Metric type was successfully updated.' }\n format.json { render :show, status: :ok, location: @metric_type }\n else\n format.html { render :edit }\n format.json { render json: @metric_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b39271fbac0a74b11ac51d620a5a99f",
"score": "0.55874497",
"text": "def estimator_type_params\n params.require(:estimator_type).permit(:name, :admin_descr, :active, :widget, :standard_field, :email, :admin_dv)\n end",
"title": ""
},
{
"docid": "98cf5f168d4983067f65b6e6aa7dd97f",
"score": "0.5582833",
"text": "def update\n @eval_type = EvalType.find(params[:id])\n\n respond_to do |format|\n if @eval_type.update_attributes(params[:eval_type].permit(:name, :organization_id))\n format.html { redirect_to eval_types_url, notice: I18n.t(:general_update_success) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @eval_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a02c71e29ab4de68296fe9e9aefccb1",
"score": "0.55571467",
"text": "def update\n @performance_type = PerformanceType.find(params[:id])\n\n respond_to do |format|\n if @performance_type.update_attributes(params[:performance_type])\n format.html { redirect_to @performance_type, :notice => 'Performance type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @performance_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c63f9e811ce5d39185e8ada2d9158c82",
"score": "0.55512583",
"text": "def update\n respond_to do |format|\n if @patch_type.update(patch_type_params)\n format.html { redirect_to admin_patch_types_path, notice: 'Patch type was successfully updated.' }\n format.json { render :index, status: :ok, location: @patch_type }\n else\n format.html { render :edit }\n format.json { render json: @patch_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d562b61a2cb0d364a4f183e10efcd1d4",
"score": "0.55427736",
"text": "def update\n @reagent_type = ReagentType.find(params[:id])\n\n respond_to do |format|\n if @reagent_type.update_attributes(params[:reagent_type])\n format.html { redirect_to @reagent_type, notice: 'Reagent type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reagent_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0cbcd26400741c028e98de40ff14c4d",
"score": "0.5540554",
"text": "def update\n @admin_vehicle_type = Admin::VehicleType.find(params[:id])\n\n respond_to do |format|\n if @admin_vehicle_type.update_attributes(params[:admin_vehicle_type])\n format.html { redirect_to admin_vehicle_types_url }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_vehicle_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5c00d06ddd45b1458ed60ec503a8a07",
"score": "0.55377555",
"text": "def update\n respond_to do |format|\n if @type_of_aggression.update(type_of_aggression_params)\n format.html { redirect_to @type_of_aggression, notice: 'Type of aggression was successfully updated.' }\n format.json { render :show, status: :ok, location: @type_of_aggression }\n else\n format.html { render :edit }\n format.json { render json: @type_of_aggression.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.55279624",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "d138c4ab3b182e1fdcb4ebd26beeec25",
"score": "0.55233",
"text": "def update\n respond_to do |format|\n if @focus_type.update(focus_type_params)\n format.html { redirect_to @focus_type, notice: 'Focus type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @focus_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c78b1f0a93c5b2f167610361c6d1224a",
"score": "0.55154735",
"text": "def update\n respond_to do |format|\n if @vehicle_type.update(vehicle_type_params)\n format.html { redirect_to @vehicle_type, notice: 'Vehicle type was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle_type }\n else\n format.html { render :edit }\n format.json { render json: @vehicle_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1ef74ef2637832d40a2e81ce3d7f52d",
"score": "0.5503606",
"text": "def update(type, name)\n resource_class = parse_type(type)\n client_setup\n fail_nice 'Must set the hash or json option' unless @options['hash'] || @options['json']\n fail_nice 'Must set the hash OR json option. Not both' if @options['hash'] && @options['json']\n begin\n data = @options['hash'] || JSON.parse(@options['json'])\n rescue JSON::ParserError => e\n fail_nice(\"Failed to parse json\\n#{e.message}\")\n end\n matches = resource_class.find_by(@client, name: name)\n fail_nice 'Not Found' if matches.empty?\n resource = matches.first\n begin\n resource.update(data)\n puts 'Updated Successfully!'\n rescue StandardError => e\n fail_nice \"Failed to update #{resource.class.name.split('::').last} '#{name}': #{e}\"\n end\n end",
"title": ""
},
{
"docid": "50891a3bc04272c7f91fd07308d31834",
"score": "0.54825133",
"text": "def update\n @market_type = MarketType.find(params[:id])\n respond_to do |format|\n if @market_type.update(market_type_params)\n format.json { render json: @market_type, status: :ok }\n else\n format.json { render json: @market_type.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "d8ebc50ae0430709925c150a1cded171",
"score": "0.54735684",
"text": "def update\n @ticket_type = TicketType.find(params[:id])\n\n unless params[:capacity]\n params[:capacity] = 0\n end\n unless params[:group_size]\n params[:group_size] = 0\n end\n\n params.delete('id')\n params.delete('action')\n params.delete('controller')\n\n respond_to do |format|\n if @ticket_type.update_attributes(params)\n format.html { redirect_to \"/events/#{@ticket_type.event_id}/edit\"}\n format.mobile { redirect_to \"/events/#{@ticket_type.event_id}/edit\"}\n format.json { render json: @ticket_type }\n else\n format.html { render action: \"edit\" }\n format.mobile { render action: \"edit\" }\n format.json { render json: @ticket_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46c1c78269f3af246d42d38e3cea94c8",
"score": "0.5463063",
"text": "def update\n @annotation_type = AnnotationType.find(params[:id])\n\n respond_to do |format|\n if @annotation_type.update_attributes(params[:annotation_type])\n format.html { redirect_to @annotation_type, :notice => 'Annotation type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @annotation_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e3c381d386ab4edf9de06cc5989c3e2",
"score": "0.54366547",
"text": "def update\n respond_to do |format|\n if @t_type.update(t_type_params)\n format.html { redirect_to @t_type, notice: 'T type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @t_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "308cbdafb3dc155c61409a4efd850d4b",
"score": "0.5429004",
"text": "def patch(parameters={}, type='json')\n perform_request Net::HTTP::Patch, parameters, type\n end",
"title": ""
},
{
"docid": "6e233529c3d7b45c9c2e44799e0abae4",
"score": "0.5418493",
"text": "def update\n respond_to do |format|\n if @type.update(type_params)\n format.html { redirect_to @type, notice: 'Type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60bb7a2b33f8bff29183c206f8e0da54",
"score": "0.54183",
"text": "def update\n @engine_type = EngineType.find(params[:id])\n\n respond_to do |format|\n if @engine_type.update_attributes(engine_type_params)\n format.html { redirect_to \"/engine_types\", notice: 'Engine type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @engine_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c5411f0bf8db6a7fee846c3ff61781c",
"score": "0.54138863",
"text": "def update\n instance = get_instance\n\n if params[:data] and instance.update(api_type_params)\n # check for jsonapi compliant meta\n if params[:data][:meta]\n meta = instance.meta\n params[:data][:meta].each do |key, value|\n meta[key] = value\n end\n instance.set_meta_multi meta\n end\n\n # Redirect to index\n render json: get_instance, status: :ok\n else\n render json: get_instance.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9f68217d443e349a5f8135ebea89555c",
"score": "0.54128104",
"text": "def update type, objects, options = {}\n raise UndefinedUpdateStrategy.new(type)\n end",
"title": ""
},
{
"docid": "642a71e8a60ebc957d9d622819dcfba2",
"score": "0.5400752",
"text": "def update\n respond_to do |format|\n handle_sample_swap if @resource.sample?\n if @resource.update strong_type params, @type, @type.downcase\n handle_successful_update\n format.html { redirect_to resource_path(@resource, :edit), notice: 'Changes successfully saved.' }\n else\n handle_invalid\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "4d179db3209f83396add42d95d429cbb",
"score": "0.5398471",
"text": "def update\n @ot_type = OtType.find(params[:id])\n\n respond_to do |format|\n if @ot_type.update_attributes(params[:ot_type])\n format.html { redirect_to @ot_type, notice: 'Ot type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ot_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2296bfc21e15378b48aba4daaa9f74cc",
"score": "0.53980684",
"text": "def update\n respond_to do |format|\n if @visa_type.update(visa_type_params)\n format.html { redirect_to admin_visa_types_path, notice: 'Visa type was successfully updated.' }\n format.json { render :show, status: :ok, location: @visa_type }\n else\n format.html { render :edit }\n format.json { render json: @visa_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f1e39b1881f6aa1979a06f968755bef",
"score": "0.53919935",
"text": "def update\n respond_to do |format|\n if @maker_type.update(maker_type_params)\n format.html { redirect_to @maker_type, notice: \"Maker type was successfully updated.\" }\n format.json { render :show, status: :ok, location: @maker_type }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @maker_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76b36b1191f5d4adc4122ca5b28fe86b",
"score": "0.5382337",
"text": "def update\n respond_to do |format|\n if @admindetectiontype.update(admindetectiontype_params)\n format.html { redirect_to @admindetectiontype, notice: 'Admindetectiontype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admindetectiontype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ff53a806dfb525d324d51f81bdd9b3f",
"score": "0.53773344",
"text": "def update\n @type_of_fit = TypeOfFit.find(params[:id])\n\n respond_to do |format|\n if @type_of_fit.update_attributes(params[:type_of_fit])\n format.html { redirect_to(@type_of_fit, :notice => 'Type of fit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @type_of_fit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "00004994deb6dae6ede803f74ef18b91",
"score": "0.5376578",
"text": "def update\n @model_type = ModelType.find(params[:id])\n\n respond_to do |format|\n if @model_type.update_attributes(params[:model_type])\n format.html { redirect_to @model_type, notice: 'Model type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @model_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04a8f285afa6e90eefdbe5191b201377",
"score": "0.5373856",
"text": "def update\n respond_to do |format|\n if @input_type.update(input_type_params)\n format.html { redirect_to @input_type, notice: 'Input type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @input_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "899a5c3ba5b15e9dbd8e43ebeb82ab45",
"score": "0.53737044",
"text": "def update\n authorize RequestType\n respond_to do |format|\n if @request_type.update(request_type_params)\n format.html { redirect_to @request_type, notice: \"Request type #{@request_type.description} was successfully updated.\" }\n format.json { render :show, status: :ok, location: @request_type }\n else\n format.html { render :edit }\n format.json { render json: @request_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e2886bdfc603ad400d63723930c6d7d",
"score": "0.5358928",
"text": "def update\n respond_to do |format|\n if @team_type.update(team_type_params)\n format.html { redirect_to @team_type, notice: 'Team type was successfully updated.' }\n format.json { render :show, status: :ok, location: @team_type }\n else\n format.html { render :edit }\n format.json { render json: @team_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a039895a87f0d9c7ed7acff3d34e29e",
"score": "0.5356232",
"text": "def update\n respond_to do |format|\n if @itinerary_type.update(itinerary_type_params)\n format.html { redirect_to @itinerary_type, notice: 'Tipo de itinerário actualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @itinerary_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fb6756ef6c55acfd77963c8af93d80b",
"score": "0.5353427",
"text": "def update\n update_flavors\n respond_to do |format|\n if @actuator.update(actuator_params)\n format.html { redirect_to @actuator, notice: 'Actuator was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @actuator.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d027231ccb2657c4a7bcfbb41f68fa60",
"score": "0.5350295",
"text": "def update\n @instance_type_extra_spec = InstanceTypeExtraSpec.find(params[:id])\n\n respond_to do |format|\n if @instance_type_extra_spec.update_attributes(params[:instance_type_extra_spec])\n format.html { redirect_to @instance_type_extra_spec, notice: 'Instance type extra spec was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @instance_type_extra_spec.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "470369b7ff586fc5881b51a88bb20440",
"score": "0.5343943",
"text": "def update\n authorize! :update, CompetenceType\n @competence_type.update!(competence_type_params)\n render json: {status: :ok}\n end",
"title": ""
},
{
"docid": "93b94abe9afff4d09f7180615685520a",
"score": "0.5342782",
"text": "def update\n respond_to do |format|\n if @cpu_type.update(cpu_type_params)\n format.html { redirect_to @cpu_type, notice: 'Cpu type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cpu_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa44127a5bc6a8c510941b1e9c768554",
"score": "0.53308314",
"text": "def update\n @ref_lab_test_type = Ref::LabTestType.find(params[:id])\n\n respond_to do |format|\n if @ref_lab_test_type.update_attributes(params[:ref_lab_test_type])\n format.html { redirect_to ref_lab_test_types_path, notice: I18n.t(:record_updated) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ref_lab_test_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bec5398b84cdc0f77808ca423aa9bb76",
"score": "0.53296924",
"text": "def update\n respond_to do |format|\n if @observation_type.update(observation_type_params)\n format.html { redirect_to @observation_type, notice: 'Observation type was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation_type }\n else\n format.html { render :edit }\n format.json { render json: @observation_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.53264636",
"text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end",
"title": ""
},
{
"docid": "8c3f8cf4dc254eb1d640508c11432491",
"score": "0.53254443",
"text": "def update\n respond_to do |format|\n if @change_type.update(change_type_params)\n format.html { redirect_to @change_type, notice: 'Change type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @change_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d726542a85903b254a53bfb79e1cfc5c",
"score": "0.5325218",
"text": "def update\n @elmtype = Elmtype.find(params[:id])\n\n respond_to do |format|\n if @elmtype.update_attributes(params[:elmtype])\n format.html { redirect_to @elmtype, notice: 'Elmtype was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @elmtype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ebd45190c54e6a3aee69471060eacd59",
"score": "0.5321818",
"text": "def update\n respond_to do |format|\n if @client_type.update(client_type_params)\n format.html { redirect_to @client_type, notice: 'Client type was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_type }\n else\n format.html { render :edit }\n format.json { render json: @client_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f6a2dbe9e23bd02a70ec0bdb1471b85",
"score": "0.5320901",
"text": "def update\n @gene_type = GeneType.find(params[:id])\n\n respond_to do |format|\n if @gene_type.update_attributes(params[:gene_type])\n format.html { redirect_to @gene_type, notice: 'Gene type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gene_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b691b009151d7ad13fb03b1acbb8a1a2",
"score": "0.5320786",
"text": "def update\n respond_to do |format|\n if @edition_type.update(edition_type_params)\n format.html { redirect_to @edition_type, notice: 'Edition type was successfully updated.' }\n format.json { render :show, status: :ok, location: @edition_type }\n else\n format.html { render :edit }\n format.json { render json: @edition_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b4cacd83df5b47fa0a4118b2700b67b",
"score": "0.53199464",
"text": "def update\n respond_to do |format|\n if @visa_type.update(visa_type_params)\n format.html { redirect_to @visa_type, notice: \"Visa type was successfully updated.\" }\n format.json { render :show, status: :ok, location: @visa_type }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @visa_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c6ccecbc20f331c8853f81d7e33b354",
"score": "0.53156143",
"text": "def update\n respond_to do |format|\n if @app_feature_type.update(app_feature_type_params)\n format.html { redirect_to @app_feature_type, notice: 'App feature type was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_feature_type }\n else\n format.html { render :edit }\n format.json { render json: @app_feature_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca9fd5f1d76d6a1a8f9b0a89c64e0aa5",
"score": "0.5314407",
"text": "def post_update(params)\n @client.post(\"#{path}/update\", nil, params, \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "9e2213462865af1e7d2d7e104f0094b3",
"score": "0.5313746",
"text": "def update\n @type_vehicle = TypeVehicle.find(params[:id])\n\n respond_to do |format|\n if @type_vehicle.update_attributes(params[:type_vehicle])\n format.html { redirect_to @type_vehicle, notice: 'Type vehicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type_vehicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21539263b3454fc916082c45d00a4262",
"score": "0.53128636",
"text": "def update\n respond_to do |format|\n if @bet_type.update(bet_type_params)\n format.html { redirect_to @bet_type, notice: 'Bet type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bet_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64381d7f0393a974f3c30cac80ff2f25",
"score": "0.53114945",
"text": "def update\n respond_to do |format|\n if @intervention_type.update(intervention_type_params)\n format.html { redirect_to intervention_types_url, notice: \"Intervention type was successfully updated.\" }\n format.json { render :show, status: :ok, location: @intervention_type }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @intervention_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d94dcd3d13ee1c127551d66862d9d1db",
"score": "0.5306504",
"text": "def update\n @interview_type.update(interview_type_params)\n @interview_types = InterviewType.all\n @interview_type = InterviewType.new\n end",
"title": ""
},
{
"docid": "d6dff462be6c1be406b4c26b1b81b2bc",
"score": "0.53044987",
"text": "def update\n respond_to do |format|\n if @environment_type.update(environment_type_params)\n format.html { redirect_to @environment_type, notice: 'Environment type was successfully updated.' }\n format.json { render :show, status: :ok, location: @environment_type }\n else\n format.html { render :edit }\n format.json { render json: @environment_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e1ca7a0bec29cde27736113cf4f11617",
"score": "0.5302321",
"text": "def update\n update_save(@sensor_type, sensor_type_params, \"Sensor type\")\n end",
"title": ""
},
{
"docid": "7e4a0277498a5dc6554b22256019a5d0",
"score": "0.529556",
"text": "def update\n @request_type = RequestType.find(params[:id])\n\n respond_to do |format|\n if @request_type.update_attributes(params[:request_type])\n format.html { redirect_to @request_type, notice: 'Request type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @request_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1435eef5c89363f1e61cf4943641bcb7",
"score": "0.5293234",
"text": "def update\n respond_to do |format|\n if @stakeholder_type.update(stakeholder_type_params)\n format.html { redirect_to @stakeholder_type, notice: 'Stakeholder type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stakeholder_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3e7b13783beefa432245cec08211583",
"score": "0.5292252",
"text": "def update!(**args)\n @default_value = args[:default_value] if args.key?(:default_value)\n @json_name = args[:json_name] if args.key?(:json_name)\n @options = args[:options] if args.key?(:options)\n @oneof_index = args[:oneof_index] if args.key?(:oneof_index)\n @cardinality = args[:cardinality] if args.key?(:cardinality)\n @type_url = args[:type_url] if args.key?(:type_url)\n @name = args[:name] if args.key?(:name)\n @packed = args[:packed] if args.key?(:packed)\n @number = args[:number] if args.key?(:number)\n @kind = args[:kind] if args.key?(:kind)\n end",
"title": ""
},
{
"docid": "04f49dff825732e95d7f0852552ba97a",
"score": "0.5289963",
"text": "def update\n respond_to do |format|\n if @serie_type.update(serie_type_params)\n format.html { redirect_to @serie_type, notice: 'Serie type was successfully updated.' }\n format.json { render :show, status: :ok, location: @serie_type }\n else\n format.html { render :edit }\n format.json { render json: @serie_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a99fbdb28bd76337d8b5b93e70630d3",
"score": "0.52868295",
"text": "def update\n respond_to do |format|\n if @type_vehicle.update(type_vehicle_params)\n format.html { redirect_to @type_vehicle, notice: 'Type vehicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @type_vehicle }\n else\n format.html { render :edit }\n format.json { render json: @type_vehicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "601e3d28908618d301c16d45b2fc3c20",
"score": "0.52842665",
"text": "def update\n respond_to do |format|\n if @election_type.update(election_type_params)\n format.html { redirect_to admin_election_types_path, notice: 'Election type was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "0c6b20c743542ace6ebb4e4e2affa70f",
"score": "0.5282543",
"text": "def update\n\t@fuel_types = FuelType.all\n\t@fuel_type = FuelType.find(params[:id])\n respond_to do |format|\n if @fuel_type.update(fuel_type_params)\n format.html { redirect_to @fuel_type, notice: 'Fuel type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fuel_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "613121e91e29194747f7cac8d66855a5",
"score": "0.52813876",
"text": "def update\n respond_to do |format|\n if @recommendation_type.update(recommendation_type_params)\n format.html { redirect_to @recommendation_type, notice: 'Recommendation type was successfully updated.' }\n format.json { render :show, status: :ok, location: @recommendation_type }\n else\n format.html { render :edit }\n format.json { render json: @recommendation_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ccbc126e0d765d521a4c08e244149bdd",
"score": "0.52808493",
"text": "def update\n respond_to do |format|\n if @default_request_type.update(default_request_type_params)\n format.html { redirect_to @default_request_type, notice: 'Default request type was successfully updated.' }\n format.json { render :show, status: :ok, location: @default_request_type }\n else\n format.html { render :edit }\n format.json { render json: @default_request_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6113a23cbf951b9880cae8721f7ba2c4",
"score": "0.5280619",
"text": "def update\n @type = Type.find(params[:id])\n\n respond_to do |format|\n if @type.update_attributes(params[:type])\n format.html { redirect_to types_path, notice: 'Type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a80f4e7369da5866c8cac0d1c2346365",
"score": "0.52761",
"text": "def update\n respond_to do |format|\n if @chg_type.update(chg_type_params)\n format.html { redirect_to @chg_type, notice: t('message.template.scaffold.update', model: t('activerecord.models.chg_type')) }\n format.json { render :show, status: :ok, location: @chg_type }\n else\n format.html { render :edit }\n format.json { render json: @chg_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cf4099e532bf79be32896520e049f68",
"score": "0.5275224",
"text": "def update\n authorize! :update, CompetenceTier\n \n @competence_tier.update!(competence_tier_params)\n render json: {status: :ok}\n end",
"title": ""
},
{
"docid": "b791697d814902c1aa39589a35cf5a88",
"score": "0.5275021",
"text": "def update\n respond_to do |format|\n if @interactions_type.update(interactions_type_params)\n format.html { redirect_to @interactions_type, notice: 'Interactions type was successfully updated.' }\n format.json { render :show, status: :ok, location: @interactions_type }\n else\n format.html { render :edit }\n format.json { render json: @interactions_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "becbbd7ebb3a92fe126bb62ff3e7f7fb",
"score": "0.52730995",
"text": "def update\n @vehicle = vehicle_type.find(params[:id])\n\n respond_to do |format|\n if @vehicle.update_attributes(params[:vehicle])\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b26292916b2f0fb144ed70a580ce5c4",
"score": "0.5272256",
"text": "def update\n respond_to do |format|\n if @interest_type.update(interest_type_params)\n format.html { redirect_to @interest_type, notice: 'Interest type was successfully updated.' }\n format.json { render :show, status: :ok, location: @interest_type }\n else\n format.html { render :edit }\n format.json { render json: @interest_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc5e3cd18188ec7052fe485e454dc85d",
"score": "0.5270193",
"text": "def update\n @attribute_type = AttributeType.find(params[:id])\n\n respond_to do |format|\n if @attribute_type.update_attributes(params[:attribute_type])\n format.html { redirect_to @attribute_type, :notice => 'Attribute type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @attribute_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d91b4a90aa7ea6a41cf4cafa4180d9d",
"score": "0.52685964",
"text": "def update\n @statistic_type = StatisticType.find(params[:id])\n\n respond_to do |format|\n if @statistic_type.update_attributes(params[:statistic_type])\n format.html { redirect_to @statistic_type, notice: 'Statistic type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @statistic_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd7204074dba0198ea018feb7e4e04d2",
"score": "0.526841",
"text": "def update\n @tea_type = TeaType.find(params[:id])\n\n respond_to do |format|\n if @tea_type.update_attributes(params[:tea_type])\n format.html { redirect_to @tea_type, notice: 'Tea type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tea_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c14b497f36d42b5d13afd688c0ec85c",
"score": "0.52635336",
"text": "def update\n respond_to do |format|\n if @ratetype.update(ratetype_params)\n format.html { redirect_to ratetypes_path, notice: 'Ratetype was successfully updated.' }\n format.json { render :show, status: :ok, location: @ratetype }\n else\n format.html { render :edit }\n format.json { render json: ratetypes_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e25a8a8be5e6ca2a2928df365fd59883",
"score": "0.5262874",
"text": "def update\n @clienttype = Clienttype.find(params[:id])\n\n respond_to do |format|\n if @clienttype.update_attributes(params[:clienttype])\n format.html { redirect_to @clienttype }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clienttype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cec3011974186568ca704e5a0efd0fd9",
"score": "0.52612895",
"text": "def update!(**args)\n @cardinality = args[:cardinality] if args.key?(:cardinality)\n @default_value = args[:default_value] if args.key?(:default_value)\n @json_name = args[:json_name] if args.key?(:json_name)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @number = args[:number] if args.key?(:number)\n @oneof_index = args[:oneof_index] if args.key?(:oneof_index)\n @options = args[:options] if args.key?(:options)\n @packed = args[:packed] if args.key?(:packed)\n @type_url = args[:type_url] if args.key?(:type_url)\n end",
"title": ""
},
{
"docid": "3293e7dcbb9409a4c6bae36b0ed77ca0",
"score": "0.52607846",
"text": "def update\n respond_to do |format|\n if @pool_type.update(pool_type_params)\n format.html { redirect_to @pool_type, notice: 'Pool type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pool_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c85563f337ec363aec98f92110e48019",
"score": "0.52547157",
"text": "def update\n respond_to do |format|\n if @etype.update(etype_params)\n format.html { redirect_to @etype, notice: 'Etype was successfully updated.' }\n format.json { render :show, status: :ok, location: @etype }\n else\n format.html { render :edit }\n format.json { render json: @etype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6721740f4224cc3e98242ee9167e8cd0",
"score": "0.5254571",
"text": "def update\n respond_to do |format|\n if @offense_type.update(offense_type_params)\n format.html { redirect_to @offense_type, notice: 'Offense type was successfully updated.' }\n format.json { render :show, status: :ok, location: @offense_type }\n else\n format.html { render :edit }\n format.json { render json: @offense_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38aad64497326d086cd186fbe0d8e3d2",
"score": "0.5253283",
"text": "def update\n respond_to do |format|\n if @answer_type.update(answer_type_params)\n format.html { redirect_to @answer_type, notice: 'Answer type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @answer_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef511de2ac5a81e8d12bd2ee7f6f86f2",
"score": "0.5251183",
"text": "def update_break_type(id:,\n body:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/labor/break-types/{id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'id' => { 'value' => 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",
"title": ""
},
{
"docid": "9eaa8f970e48b6825e4642a27efe4ee5",
"score": "0.52508605",
"text": "def update\n @attribute_type = AttributeType.find(params[:id])\n\n respond_to do |format|\n if @attribute_type.update_attributes(params[:attribute_type])\n format.html { redirect_to admin_attribute_types_url, notice: 'Attribute type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @attribute_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "2a609efd63de58b7170894b696747974",
"score": "0.0",
"text": "def groupement_params\n params.require(:groupement).permit(:name, :phone, :region_id, :localisation, :email)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7493595",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6954758",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69205236",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6891565",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.6783412",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6741766",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.66818774",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6634386",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.6627996",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.6624317",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.6561549",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.648986",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64755446",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6452771",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.639812",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.6379535",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63622755",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.63365924",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.63347775",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.63249147",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.63191724",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.6313892",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.6312876",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.63040864",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.62999487",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.629886",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6294405",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62785035",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.62718505",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6265872",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.62543756",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62532973",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6250798",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6233973",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62272465",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6227004",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6225902",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62246615",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6199634",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.6190174",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.6181904",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61772704",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.6162726",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160626",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6154942",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61526656",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61359465",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61319274",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61170536",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6114007",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.6109575",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61028",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61028",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6085453",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60841954",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.6083834",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076738",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60734737",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.6066163",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065011",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60641026",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6063542",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.60627866",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.60613674",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60602236",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562223",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.6047439",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6047015",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6047015",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.60457283",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.60412854",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6032506",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6029243",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.60251915",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6020472",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.60178447",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6016368",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60133153",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.6007004",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60052776",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60052776",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.60052764",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60026777",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60007924",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000297",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59981924",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5995787",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5995787",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59932935",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.59924304",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.59919494",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.59897816",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.5988952",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
12fb3921ac5750bf5482919723b9ab73
|
Creates a secure random remember token for the user if it doesn't already have one
|
[
{
"docid": "7eef146d86354413c620eec6518e080b",
"score": "0.80381024",
"text": "def create_remember_token\n\t\t\tself.remember_token ||= SecureRandom.urlsafe_base64\n\t\tend",
"title": ""
}
] |
[
{
"docid": "61dde70c99be10efeb3d7b588b1f2868",
"score": "0.846448",
"text": "def create_remember_token\n unless self.remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end\n end",
"title": ""
},
{
"docid": "30d227c21cf713de6acc8607923747f9",
"score": "0.83605456",
"text": "def create_remember_token\n if self.remember_token.nil?\n self.remember_token = SecureRandom.urlsafe_base64\n end\n end",
"title": ""
},
{
"docid": "7a997f92f8c13a15ab44f97ea3f1f7e6",
"score": "0.8358535",
"text": "def create_remember_token\n self.remember_token = SecureRandom.hex\n end",
"title": ""
},
{
"docid": "67ea41a57c6aec586605313e2db4b58e",
"score": "0.8289244",
"text": "def create_remember_token\n begin\n self.remember_token = SecureRandom.urlsafe_base64\n end while User.exists?(:remember_token => self.remember_token)\n end",
"title": ""
},
{
"docid": "fe2469ae7dd27701c3f1bc7be94d7d90",
"score": "0.8255317",
"text": "def new_remember_token!\n SecureRandom.urlsafe_base64.tap do |random_token|\n if remember_digests.length == 4\n remember_digests.pop\n end\n remember_digests.prepend User.digest(random_token)\n save!\n random_token\n end\n end",
"title": ""
},
{
"docid": "4527c4ddab2cb935d4d3f03e2e63acaf",
"score": "0.8255067",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "4527c4ddab2cb935d4d3f03e2e63acaf",
"score": "0.8255067",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "4527c4ddab2cb935d4d3f03e2e63acaf",
"score": "0.8255067",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "4527c4ddab2cb935d4d3f03e2e63acaf",
"score": "0.8255067",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "4527c4ddab2cb935d4d3f03e2e63acaf",
"score": "0.8255067",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "4527c4ddab2cb935d4d3f03e2e63acaf",
"score": "0.8255067",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "4527c4ddab2cb935d4d3f03e2e63acaf",
"score": "0.8255067",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "4527c4ddab2cb935d4d3f03e2e63acaf",
"score": "0.8255067",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "4527c4ddab2cb935d4d3f03e2e63acaf",
"score": "0.8255067",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "3b9abc56169f73635e5a0ea0c8dfec5c",
"score": "0.81841326",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "3b9abc56169f73635e5a0ea0c8dfec5c",
"score": "0.81841326",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "3b9abc56169f73635e5a0ea0c8dfec5c",
"score": "0.81841326",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "3b9abc56169f73635e5a0ea0c8dfec5c",
"score": "0.81841326",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "3b9abc56169f73635e5a0ea0c8dfec5c",
"score": "0.81841326",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "3b9abc56169f73635e5a0ea0c8dfec5c",
"score": "0.81841326",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "ea3317438d5fd1e653900a4a95209188",
"score": "0.81731176",
"text": "def create_remember_token\n\n # Create the token.\n self.remember_token = SecureRandom.urlsafe_base64\n\n end",
"title": ""
},
{
"docid": "5d45cda39361ca1cb550371754d63ee5",
"score": "0.8171011",
"text": "def create_remember_token \n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "c0b4269a119aa632be29e0447a8ca48e",
"score": "0.8163345",
"text": "def create_remember_token\n if self.remember_token.nil? || self.remember_token.empty?\n self.remember_token = SecureRandom.urlsafe_base64\n end\n end",
"title": ""
},
{
"docid": "c0b4269a119aa632be29e0447a8ca48e",
"score": "0.8163345",
"text": "def create_remember_token\n if self.remember_token.nil? || self.remember_token.empty?\n self.remember_token = SecureRandom.urlsafe_base64\n end\n end",
"title": ""
},
{
"docid": "2c2d945262c9553c8bbaeccdfd93ef7d",
"score": "0.8006014",
"text": "def create_remember_token\n \n # Create secure urlsafe_base64 token and assign it to \n # remember_token attribute.\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "347b801c04bf4e7b125a5ed7077c74de",
"score": "0.7998562",
"text": "def create_remember_token\t\t# funkcja ktora przypisuje w bazie polu remember_toker randomowego stringa\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "a450dc0799c01a0dbaaad6cd99e01663",
"score": "0.79779136",
"text": "def new_remember_token\n SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "08f7ba2f2151310477463692faaa6271",
"score": "0.7935917",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
},
{
"docid": "cfaf1e158f63bffb2a681a9a65d620ac",
"score": "0.7771559",
"text": "def create_remember_token\r\n #Creates the token\r\n self.remember_token = SecureRandom.urlsafe_base64\r\n #note: the capital \"R\" here, and caps in general MATTER\r\n \r\n #w/o the \"self\" assignment, would create local variable called\r\n #remember_token, using self ensures that assignment sets the\r\n #user's remember_token in the database with its other attributes\r\n #when the user is saved\r\n \r\n #SecureRandom is a module in the Ruby standard library that\r\n #creates a Base64 string safe for us in URIs (and therefore\r\n #cookies), it returns a random 16 character string, each character\r\n #has 64 possibilities\r\n end",
"title": ""
},
{
"docid": "f5ca2394ad85d71688da5adbd5aa0118",
"score": "0.7741615",
"text": "def generate_token\n attempts = 0\n\n begin\n self.token = SecureRandom.uuid\n save!\n\n self.expiry_date = 1.day.from_now\n save!\n rescue\n attempts += 1\n STDERR.puts 'Token collision!' unless attempts == MAX_ATTEMPTS\n\n retry if attempts < MAX_ATTEMPTS\n\n STDERR.puts 'Token collision! Max attempts exceeded!'\n return false\n end\n\n return self.token\n end",
"title": ""
},
{
"docid": "02bdf9e0a965adc7b5313bc0c41fc377",
"score": "0.7692674",
"text": "def remember_me\n self.remember_token_expires_at = 52.weeks.from_now\n self.remember_token = rand_key(self.username)\n self.save(false)\n end",
"title": ""
},
{
"docid": "2aa3895fc375fe2f42d0e7ff17175278",
"score": "0.76689553",
"text": "def generate_remember_token\n self[:remember_token] = User.new_token\n end",
"title": ""
},
{
"docid": "a2baa92a68142fb0cb3472957c4c16eb",
"score": "0.76053447",
"text": "def create_remember_token\n # Generate the hash for a new token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "57329ba6da8930cd04c59cd11a5ff1bb",
"score": "0.75487506",
"text": "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "57329ba6da8930cd04c59cd11a5ff1bb",
"score": "0.75487506",
"text": "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "57329ba6da8930cd04c59cd11a5ff1bb",
"score": "0.75487506",
"text": "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "57329ba6da8930cd04c59cd11a5ff1bb",
"score": "0.75487506",
"text": "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "e59f5e362ab0812d7184ca8fbe680715",
"score": "0.7523983",
"text": "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = random_digest\n save(false)\n end",
"title": ""
},
{
"docid": "2cd307a2a507c03ee83cb2c1e27713c1",
"score": "0.74917",
"text": "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n \n #Using self ensures that assignment sets the user’s remember_token so that it will be written to the database \n #along with the other attributes when the user is saved. \n end",
"title": ""
},
{
"docid": "1bc115a292d6f24cdf65bf3c7b1b78b0",
"score": "0.74680907",
"text": "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "1bc115a292d6f24cdf65bf3c7b1b78b0",
"score": "0.74680907",
"text": "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "ab6e6d598c7e17e97a52d9548c57e36f",
"score": "0.74641746",
"text": "def create_remember_token\n self.remember_token = User.encrypt(User.new_token)\n end",
"title": ""
},
{
"docid": "a3101e61e767ba919404ca307a34dd77",
"score": "0.74630094",
"text": "def create_unique_token\n self._token=SecureRandom.hex(16) if self.token.nil?\n end",
"title": ""
},
{
"docid": "5225672ddf78feb67f3611dfde504e31",
"score": "0.7457905",
"text": "def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "5225672ddf78feb67f3611dfde504e31",
"score": "0.7457905",
"text": "def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "5225672ddf78feb67f3611dfde504e31",
"score": "0.7457905",
"text": "def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "7185497ed077b5c4c609078157174be3",
"score": "0.7447407",
"text": "def create_remember_token\n\t\tremember_token = User.hash(User.new_remember_token)\n\tend",
"title": ""
},
{
"docid": "7185497ed077b5c4c609078157174be3",
"score": "0.7447407",
"text": "def create_remember_token\n\t\tremember_token = User.hash(User.new_remember_token)\n\tend",
"title": ""
},
{
"docid": "7185497ed077b5c4c609078157174be3",
"score": "0.7447407",
"text": "def create_remember_token\n\t\tremember_token = User.hash(User.new_remember_token)\n\tend",
"title": ""
},
{
"docid": "7185497ed077b5c4c609078157174be3",
"score": "0.7447407",
"text": "def create_remember_token\n\t\tremember_token = User.hash(User.new_remember_token)\n\tend",
"title": ""
},
{
"docid": "122fe2cfc8d0c25dcaf7dec0e3a99220",
"score": "0.7444576",
"text": "def generate_new_token\n delete_from_database\n composite = generate_and_save_token(cookies[:uid])\n cookie_manager.persistent_login(cookies[:uid], composite)\n end",
"title": ""
},
{
"docid": "e7d07d387e9209907a92b82fec543411",
"score": "0.7443479",
"text": "def generate_token\n while token.blank? || User.exists?(token: token)\n self.token = SecureRandom.hex(10)\n end\n end",
"title": ""
},
{
"docid": "ed7f37360b30ae3fc20426cd1e8ceca4",
"score": "0.74379855",
"text": "def create_remember_token\n self.remember_token = User.hash_token(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "1d11a4fb9f65afc5d3f6cc7bafb8d78d",
"score": "0.73921824",
"text": "def create_remember_token\n\t\tself.remember_token = SecureRandom.urlsafe_base64\n\t\t#Self is used because otherwise asssignment would create a local varaible\n\t\t#using self makes sure it is written to the DB\n\tend",
"title": ""
},
{
"docid": "87af5b0a30754e25d4207020fbbfc851",
"score": "0.73828167",
"text": "def create_remember_token\n\t \tself.remember_token = User.digest(User.new_remember_token)\n\t end",
"title": ""
},
{
"docid": "965aaf6692bab486a26d19dc67cb4c1a",
"score": "0.7382566",
"text": "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "965aaf6692bab486a26d19dc67cb4c1a",
"score": "0.7382566",
"text": "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "965aaf6692bab486a26d19dc67cb4c1a",
"score": "0.7382566",
"text": "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "965aaf6692bab486a26d19dc67cb4c1a",
"score": "0.7382566",
"text": "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "d2db3b80c4747b7215f25f871c36de56",
"score": "0.7374613",
"text": "def create_remember_token\n \tself.remember_digest = User.digest(User.new_token)\n end",
"title": ""
},
{
"docid": "9963aa3bc3c0991259a1d4e3e25d8e9d",
"score": "0.7370443",
"text": "def create_remember_token\n\t\t \t\tself.remember_digest = User.encrypt(User.new_token)\n\t\t end",
"title": ""
},
{
"docid": "c6af68fb5a04daca8686fd06f929df10",
"score": "0.73642087",
"text": "def regenerate_token\n update!(token: self.class.generate_unique_secure_token,\n token_expiration: Time.now.utc + 1.day)\n end",
"title": ""
},
{
"docid": "835d8b9d9fb7286133e7fc65beea3221",
"score": "0.7364052",
"text": "def generate_token\n self.token = SecureRandom.uuid if token.blank?\n end",
"title": ""
},
{
"docid": "b2f02e3b9577e546377f715047027cc8",
"score": "0.7354533",
"text": "def create_remember_token\n self.remember_token = my_encrypt(new_remember_token)\n end",
"title": ""
},
{
"docid": "005e22a4051bdeacbfebbf1935cd345c",
"score": "0.7348056",
"text": "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "005e22a4051bdeacbfebbf1935cd345c",
"score": "0.7348056",
"text": "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "005e22a4051bdeacbfebbf1935cd345c",
"score": "0.7348056",
"text": "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "005e22a4051bdeacbfebbf1935cd345c",
"score": "0.7348056",
"text": "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "005e22a4051bdeacbfebbf1935cd345c",
"score": "0.7348056",
"text": "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "005e22a4051bdeacbfebbf1935cd345c",
"score": "0.73476225",
"text": "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "e15900d0c2f680e2262c29fc4fbb364f",
"score": "0.73435396",
"text": "def create_remember_token\n \t\tself.remember_token = User.digest(User.new_remember_token)\n \tend",
"title": ""
},
{
"docid": "f3733136ec1918084d956a76565583b7",
"score": "0.7324321",
"text": "def create_remember_token\n\t\tself.remember_token = User.encrypt(User.new_remember_token)\n\tend",
"title": ""
},
{
"docid": "e230d72926a9fd9be98ef2b41684df80",
"score": "0.7307306",
"text": "def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "aebaeee5e22d6123247c567ab3aa519d",
"score": "0.7306077",
"text": "def generate_token\n update_attribute(:token, Digest::MD5.hexdigest(login + Time.now.to_i.to_s + rand(999999).to_s)[0..4])\n end",
"title": ""
},
{
"docid": "d34720ff6e010bfcaee0e4ab25959a7f",
"score": "0.7294234",
"text": "def make_token\n secure_digest(Time.now, (1..10).map { rand.to_s })\n end",
"title": ""
},
{
"docid": "54cfb5a602f69d37904506e0ede1e544",
"score": "0.72891706",
"text": "def remember_me\n self.remember_token_expires_at = Time.now.utc + (1 * 365 * 24 * 60 * 60)\n self.remember_token ||= \"#{uuid}-#{uuid}\"\n save\n end",
"title": ""
},
{
"docid": "861142c10f755c206263a20bc46d2cad",
"score": "0.72759366",
"text": "def generate_token\n begin\n self[:auth_token] = SecureRandom.urlsafe_base64\n end while User.exists?(auth_token: self[:auth_token])\n end",
"title": ""
},
{
"docid": "861142c10f755c206263a20bc46d2cad",
"score": "0.72759366",
"text": "def generate_token\n begin\n self[:auth_token] = SecureRandom.urlsafe_base64\n end while User.exists?(auth_token: self[:auth_token])\n end",
"title": ""
},
{
"docid": "814372a36f1dc2f994485efe321e98e4",
"score": "0.7272448",
"text": "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end",
"title": ""
},
{
"docid": "b42ed6f27d7bb347f8c2d8e5cd07edc1",
"score": "0.7271084",
"text": "def generate_token\n if new_record?\n self.token = SecureRandom.uuid\n end\n end",
"title": ""
},
{
"docid": "d8e9fae4993d854bbe05c8788757673f",
"score": "0.72641313",
"text": "def generate_secure_token\n \tself.secure_token = SecureRandom.hex(3)\n end",
"title": ""
},
{
"docid": "2184e871b4c0fa20295d5e31581907b9",
"score": "0.72575986",
"text": "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"title": ""
},
{
"docid": "6291abdb5b1a468fbd859bc73fd2a1e7",
"score": "0.7256148",
"text": "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end",
"title": ""
},
{
"docid": "6291abdb5b1a468fbd859bc73fd2a1e7",
"score": "0.7256148",
"text": "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end",
"title": ""
},
{
"docid": "8afedaae73f9b6d9e7647845deb7a2af",
"score": "0.7252462",
"text": "def generate_new_secure_token\n SecureRandom.hex(64)\nend",
"title": ""
},
{
"docid": "c1cade5d110e4bbcb8f7c57e9f3390bf",
"score": "0.72490925",
"text": "def ensure_token\n self.session_token ||= SecureRandom::urlsafe_base64\n end",
"title": ""
},
{
"docid": "d6f49dae8d1ac9fedd8da208a8578cfe",
"score": "0.72310644",
"text": "def create_token\n self.token = SecureRandom.urlsafe_base64(16)\n true\n end",
"title": ""
},
{
"docid": "f161f05a4fdc43a996f0d2212b879250",
"score": "0.7228354",
"text": "def generate_token\n begin\n self[:auth_token] = SecureRandom.urlsafe_base64\n end while User.exists?(:auth_token => self[:auth_token])\n end",
"title": ""
},
{
"docid": "f161f05a4fdc43a996f0d2212b879250",
"score": "0.7228354",
"text": "def generate_token\n begin\n self[:auth_token] = SecureRandom.urlsafe_base64\n end while User.exists?(:auth_token => self[:auth_token])\n end",
"title": ""
},
{
"docid": "f161f05a4fdc43a996f0d2212b879250",
"score": "0.7228354",
"text": "def generate_token\n begin\n self[:auth_token] = SecureRandom.urlsafe_base64\n end while User.exists?(:auth_token => self[:auth_token])\n end",
"title": ""
},
{
"docid": "18cc7a3723465d7e897bd98e5e701fff",
"score": "0.72240144",
"text": "def generate_token(token_name)\n begin\n self[token_name] = SecureRandom.urlsafe_base64 # random token\n end while User.exists?(token_name => self[token_name]) # makes sure it's unique\n end",
"title": ""
},
{
"docid": "98fd77e0369111c6b5a0ad3b9798dde1",
"score": "0.72185904",
"text": "def create_remember_token\n\t\t\tself.remember_token = User.encrypt(User.new_remember_token)\n\t\tend",
"title": ""
},
{
"docid": "98fd77e0369111c6b5a0ad3b9798dde1",
"score": "0.72185904",
"text": "def create_remember_token\n\t\t\tself.remember_token = User.encrypt(User.new_remember_token)\n\t\tend",
"title": ""
},
{
"docid": "98fd77e0369111c6b5a0ad3b9798dde1",
"score": "0.72185904",
"text": "def create_remember_token\n\t\t\tself.remember_token = User.encrypt(User.new_remember_token)\n\t\tend",
"title": ""
},
{
"docid": "91e0b97f3547d037d87a2ec863b80e4e",
"score": "0.7209392",
"text": "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end",
"title": ""
},
{
"docid": "761bb9549aefe262fb47efaed1c4d1de",
"score": "0.7187235",
"text": "def generate_token\n self.token = SecureRandom.hex\n end",
"title": ""
},
{
"docid": "c8ace6452583c53fd884f998e02238ea",
"score": "0.71827984",
"text": "def generate_token\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(token: token)\n end\n end",
"title": ""
},
{
"docid": "5fe8e6f090e3490252e74074af7930fb",
"score": "0.717875",
"text": "def regenerate_token\n self.auth_token = User.generate_unique_secure_token\n self.save\n end",
"title": ""
},
{
"docid": "cdc482c24c1afb7adf565a1a65ccccd0",
"score": "0.71712136",
"text": "def remember_me\n self.remember_token = self.class.generate_hash\n self.remember_token_expires_at = 2.weeks.from_now.utc\n end",
"title": ""
},
{
"docid": "5e2d6879562b0cd40e607d19473847b5",
"score": "0.71662956",
"text": "def secure_random_token\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(api_token: token)\n end\n end",
"title": ""
}
] |
0deac99fa3222ccb75f19e92a3a53b96
|
params: access_token, group_id self's right
|
[
{
"docid": "7eae204004d7139b74b97b28b789b0f7",
"score": "0.0",
"text": "def all_my_posts\n @posts = @current_user.posts\n render_results(@posts)\n end",
"title": ""
}
] |
[
{
"docid": "aef3ba9b0bb0c294511eb3601d2af234",
"score": "0.7041854",
"text": "def api_auth_group_token\n words = request.authorization.split(' ')\n head :unauthorized unless words[0].casecmp('group').zero?\n\n @group = Group.find_by api_token: words[1]\n head :unauthorized unless @group\n end",
"title": ""
},
{
"docid": "9a8f76175d7cc6eba256d28c683c892a",
"score": "0.68003947",
"text": "def user_of_group(access_token, openid)\n url = 'https://api.weixin.qq.com/cgi-bin/groups/getid'\\\n \"?access_token=#{access_token}\"\n Helper.http_post(url, { openid: openid }.to_json)\n end",
"title": ""
},
{
"docid": "40c314b8f963645d62ab6e1d02e0da9c",
"score": "0.6566179",
"text": "def access_group_params\n params.require(:access_group).permit(:name, :creator_id, :user_ids => [], :project_ids => []) \n end",
"title": ""
},
{
"docid": "ecf95e5343f1122ecae7eff323fbe1c4",
"score": "0.6482396",
"text": "def access_group_params\n params.require(:access_group).permit(:title, :user_id)\n end",
"title": ""
},
{
"docid": "96ef025a8923d386f79bdc2a17ea3cff",
"score": "0.6473407",
"text": "def request_group_access(group)\n post(\"/groups/#{url_encode group}/access_requests\")\n end",
"title": ""
},
{
"docid": "1839a1ee6a16bcf739f6dc4af1d9feb2",
"score": "0.6448376",
"text": "def create\n #1st you retrieve the group thanks to params[:group_id]\n \n end",
"title": ""
},
{
"docid": "85c08ac6f4020fb8779a5045ef89a721",
"score": "0.640953",
"text": "def join_private_group(group_id)\n if group_id.integer?\n RestClient.post \"https://#{@username}:#{@password}@convore.com/api/groups/#{group_id}/request.json\", ()\n end\n end",
"title": ""
},
{
"docid": "c500585f529dee4d2eff949d9105678a",
"score": "0.63751835",
"text": "def group_params\n params.require(:group).permit(:name,:user_tokens)\n end",
"title": ""
},
{
"docid": "fae74f9121e526bdcd496f34d2a812f4",
"score": "0.6331127",
"text": "def send_request\n user_tokens = request_params[:access_tokens]\n group = Group.find_by(id: request_params[:group_id])\n join_requests = []\n user_tokens.each do |token|\n friend = User.find_by(access_token: token)\n join_requests << friend.group_requests.create_request(request_params, current_user, group)\n end\n render json: join_requests\n end",
"title": ""
},
{
"docid": "90e2c5f83e8b1c1b2b8074cc70015c6d",
"score": "0.63069856",
"text": "def group_params\n params.require(:group).permit(:name, {:user_ids => []}, :user_tokens, {:sensor_ids => []})\n end",
"title": ""
},
{
"docid": "641941ccce9db9b5f592b8748b4f16a7",
"score": "0.62507385",
"text": "def update\n @group_id = group_params[:group_id]\n puts group_params\n puts \"PARAMS\"\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/groups/#{@group_id}.json\",\n :body => {:group_name => group_params[:group_name], :group_permissions => group_params[:group_permissions]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/groups/'+(@reponse['id'].to_s), notice: 'Group was successfully created.' }\n end\n end",
"title": ""
},
{
"docid": "ddf660022c5740532c322ec5d3e0be58",
"score": "0.62323487",
"text": "def request_user_group(group_name)\n path = self.api_root + \"/api/groups/#{group_name}/requestAccess\"\n process_firecloud_request(:post, path)\n end",
"title": ""
},
{
"docid": "986b9d9cbc31b7b1359698e2aaa02642",
"score": "0.62026876",
"text": "def get_group_info(group_id)\n if group_id.integer?\n RestClient.get \"https://#{@username}:#{@password}@convore.com/api/groups/#{group_id}.json\"\n end\n end",
"title": ""
},
{
"docid": "9a4e394cdaaee7b5ce9f367b6f53cece",
"score": "0.61840254",
"text": "def atest_ID_25869_user_requests_to_follow_a_private_group()\n login_as_user1\n read_all_updates\n groupName = create_any_new_group(\"Open Group\", \"News\")\n logout_common\n login_as_user2\n find_a_group(\"#{groupName}\")\n follow_a_group\n logout_common\n login_as_user1\n verify_updates\n end",
"title": ""
},
{
"docid": "7787fdafa11646aa385eca63e3326873",
"score": "0.6177752",
"text": "def atest_ID_25869_user_requests_to_follow_a_private_group()\n login $user_1_email, $master_password\n read_all_updates\n groupName = create_any_new_group(\"Open Group\", \"News\")\n logout_common\n login $user_1_email, $master_password\n find_a_group(\"#{groupName}\")\n follow_a_group\n logout_common\n login $user_1_email, $master_password\n verify_updates\n end",
"title": ""
},
{
"docid": "7c621dc4b5344e04aeada3a050471ddd",
"score": "0.6174791",
"text": "def group_access_requests(group)\n get(\"/groups/#{url_encode group}/access_requests\")\n end",
"title": ""
},
{
"docid": "5bfe53acea97c934cf0d9a0179e18aa5",
"score": "0.61609566",
"text": "def group\n Log.add_info(request, params.inspect)\n\n date_s = params[:date]\n if date_s.blank?\n @date = Date.today\n else\n @date = Date.parse(date_s)\n end\n\n @group_id = params[:id]\n SqlHelper.validate_token([@group_id, params[:id]])\n group_users = Group.get_users(params[:id])\n\n @user_schedule_hash = {}\n unless group_users.nil?\n @holidays = Schedule.get_holidays\n group_users.each do |user|\n @user_schedule_hash[user.id.to_s] = Schedule.get_somebody_week(@login_user, user.id, @date, @holidays)\n end\n end\n\n params[:display] = params[:action] + '_' + params[:id]\n end",
"title": ""
},
{
"docid": "592a926526ba57ea0006d8fd8955a136",
"score": "0.61594117",
"text": "def set_group\n @group = Group.find(params[:id])\n authorize @group unless @group.nil?\n @group_identifier = @group.id\n end",
"title": ""
},
{
"docid": "48846d9a31a6fce627eeb877c34d9c57",
"score": "0.61559314",
"text": "def group_params\n params.require(:group).permit(:name, :fb_group_id)\n end",
"title": ""
},
{
"docid": "dad3fd2534895f8293029a83bfda9867",
"score": "0.6141407",
"text": "def test_ID_25869_user_requests_to_follow_a_private_group()\n login_as_user1\n read_all_updates\n groupName = create_any_new_group(\"Open Group\", \"News\")\n logout_common\n login_as_user2\n find_a_group(\"#{groupName}\")\n follow_a_group\n logout_common\n login_as_user1\n verify_updates\n end",
"title": ""
},
{
"docid": "a3b79bce76f6be4a9e912474db1d1180",
"score": "0.61303866",
"text": "def usergroups_access_params\n params.require(:usergroups_access).permit(:photo_id, :usergroup_id, :access)\n end",
"title": ""
},
{
"docid": "6951a7149d2346ced619eef373fb6c4d",
"score": "0.61139417",
"text": "def add_group_to_existing_create\n capture_token_from_params\n if @token\n recipient = Invite.find_by(token: @token).recipient\n group = Invite.find_by(token: @token).group\n recipient.groups << group\n flash[:success] = \"You have successfully added #{group.title} to your account. Please log in to view.\"\n redirect_to login_path\n else\n flash[:danger] = \"You do not have permission to join this group. Please contact the administrator.\"\n redirect_to groups_path\n end\n end",
"title": ""
},
{
"docid": "8f25f6d6909d7b44a1e32ceb949e74fd",
"score": "0.6081333",
"text": "def group\n Log.add_info(request, params.inspect)\n\n date_s = params[:date]\n\n if date_s.blank?\n @date = Date.today\n date_s = @date.strftime(Schedule::SYS_DATE_FORM)\n else\n @date = Date.parse(date_s)\n end\n\n if params[:display] == 'mine'\n redirect_to(:action => 'month')\n else\n display_type = params[:display].split('_').first\n display_id = params[:display].split('_').last\n SqlHelper.validate_token([display_id])\n\n @selected_users = Group.get_users(display_id)\n @group_id = display_id\n\n if !@login_user.get_groups_a.include?(@group_id.to_s) and !@login_user.admin?(User::AUTH_TIMECARD)\n Log.add_check(request, '[User.get_groups_a.include?]'+request.to_s)\n redirect_to(:controller => 'frames', :action => 'http_error', :id => '401')\n return\n end\n end\n end",
"title": ""
},
{
"docid": "5be4013d26375634dbe38fa3144703e6",
"score": "0.60801005",
"text": "def set_group\n @group = Group.find(params[:id])\n authorize @group\n end",
"title": ""
},
{
"docid": "267f498ebb57a72c48064564f646ce98",
"score": "0.60752326",
"text": "def group_params\n final_params = params.require(:group).permit(:name, :intro,:avatar,:avatar_cache)\n final_params[:user_id] = current_user.id\n final_params\n end",
"title": ""
},
{
"docid": "4c28787e68b027dc1907acb0f5818f66",
"score": "0.6059624",
"text": "def group_params\n params.require(:group).permit(:name, :description, :privacy, :admin_id,:timeline_pic)\n end",
"title": ""
},
{
"docid": "2453ce2c3e236cb90e7f595616dd76bb",
"score": "0.60471636",
"text": "def set_group \n @group = Group.where({id: params[:id], user_id: current_user}).take;\n\n redirect_to_groups(@group)\n end",
"title": ""
},
{
"docid": "683a772c1f28a9d15ad0c93ec704bbb6",
"score": "0.6042517",
"text": "def show\n @group_id = params[:id]\n @group_response = HTTParty.get(\"https://rails-api-ipo.herokuapp.com/api/v1/groups/#{@group_id}.json\")\n @group = {}\n @users =[]\n @group['id']=(@group_response['id'])\n @group['group_name']=(@group_response['group_name'])\n @group['group_permissions']=(@group_response['group_permissions'])\n @group['company_id']=(@group_response['company_id'])\n @users = @group_response['users']\n end",
"title": ""
},
{
"docid": "d40ce29574bb368ac014263851cf6427",
"score": "0.6029866",
"text": "def group_params\n params.require(:group).permit(:name, user_ids: [], task_ids: [])\n end",
"title": ""
},
{
"docid": "c2ddb862de784fa94a6851aa2e43e9e9",
"score": "0.6014851",
"text": "def groups(access_token)\n url = 'https://api.weixin.qq.com/cgi-bin/groups/get'\\\n \"?access_token=#{access_token}\"\n Helper.http_get(url, { accept: :json }.to_json)\n end",
"title": ""
},
{
"docid": "c99751fb50c5f0982ea1878f18b1cf99",
"score": "0.60043436",
"text": "def test_should_not_create_group_via_API_XML\r\n get \"/logout\"\r\n post \"/groups.xml\", :group => {:name=>'unit test group',\r\n :description=>'my desc',\r\n :featured=>false}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "4ca8325d6ef33cda5a1253a292349997",
"score": "0.5991152",
"text": "def groupgrant_params\n params.require(:groupgrant).permit(:name, :description, :goal_date, \n :goal_amount, :owner_id, :partner_id, :completed_date, :is_complete,\n :is_enabled, :video_url, :goal_status, :groupgrant_pic, :category_id,:video_url_html)\n end",
"title": ""
},
{
"docid": "0b83649cb8270624b4da7285cb980e4e",
"score": "0.59838855",
"text": "def group_params\n params.require(:group).permit(:name, :user_ids => [])\n end",
"title": ""
},
{
"docid": "1a4857c39230b267c3adb811b2a51640",
"score": "0.59798443",
"text": "def group_params\n params.require(:group).permit(:user_id, :course_id)\n end",
"title": ""
},
{
"docid": "3e0820fdfe65d50eae7a9c0426715d29",
"score": "0.5973852",
"text": "def create\n \n @group = Group.create(group_parm.merge(:account_id => @account.id, :activity_ids => params[:activity_ids]))\n\n if @group.save!\n flash[:notice] = \"New Group has been successfully created.\"\n redirect_to(\"/groups/\" + Base64.encode64(@group.id.to_s)) and return\n else\t\t \n flash[:error] = @group.errors.full_messages \n redirect_to request.env['HTTP_REFERER'] and return\n end \n \n \n \n end",
"title": ""
},
{
"docid": "cc5f450a1b24650483e1e0626938e6ef",
"score": "0.5970213",
"text": "def add_group_to_existing\n if !capture_token_from_params\n flash[:danger] = \"We are currently in private beta. You need an invite to join GroupMeme.\"\n redirect_to groups_path\n elsif\n capture_token_from_params\n @user = Invite.find_by(token: @token).recipient #Set user, based on invite token\n @group = Invite.find_by(token: @token).group #Set invited group, based on invite token\n\n if @user.groups.include?(@group) #Check if already a member of that group\n flash[:danger] = \"#{@user.username} is already a member of #{@group.title}. Please sign in.\"\n redirect_to login_path\n end\n end\n end",
"title": ""
},
{
"docid": "2993b435697fef330bb5469b79c63bcd",
"score": "0.59611356",
"text": "def group_params\n params.require(:group).permit(:name, :schedule, :actions, user_ids: [])\n end",
"title": ""
},
{
"docid": "bf5050615a3dd8eb2a2e6119b851e44c",
"score": "0.5959234",
"text": "def group_membership_params\n params.require(:group_membership).permit(:id, :user_id, :group_id, :is_admin, :token)\n end",
"title": ""
},
{
"docid": "928124c82749c6a3a4664dd0488d166f",
"score": "0.5949388",
"text": "def create\n # initialize the group variable\n @group = Group.new\n\n @group.name = group_params[:name]\n \n @group.description = group_params[:description]\n\n # image? not sure how we will do this one\n @group.image = group_params[:image]\n\n # date created and updated will be now\n @group.datetime_created = Date.today.to_datetime\n @group.datetime_updated = Date.today.to_datetime\n\n # for new groups, the creator and editor is the person who is signed in\n @group.who_created_id = session[:user_id]\n @group.who_updated_id = session[:user_id]\n\n # Send to location to get the based_in_id\n # locationId = Location.getLocationId(group_params[:city],group_params[:state])\n # if(locationId)\n # @group.based_in_id = locationId\n # else\n # @group.based_in_id = Location.createByCityState(group_params[:city],group_params[:state])\n # end\n \n #Take list and add them as members\n memberParams = params[:group][:members]\n if(memberParams != nil)\n memberParams = memberParams.split(\",\")\n end\n # membersParam = group_params[:members].split(\",\")\n\n respond_to do |format|\n if @group.save\n \n # Needed to do the save in here because I needed to group ID\n memberParams.each do |x| \n member = Member.new\n member.user_id = x\n member.group_id = @group.id\n member.save\n end \n \n format.html { redirect_to groups_url, notice: 'Group was successfully created.' }\n format.json { render :index, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a18eba819986d3ccb9723eae91e69a58",
"score": "0.5946495",
"text": "def set_access_group\n @access_group = AccessGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "6f1f2d82bb5bfcb216d009a5ab67ae47",
"score": "0.594569",
"text": "def set_group\n @group = Group.find(params[:id])\n authorize @group unless @group.nil?\n end",
"title": ""
},
{
"docid": "989654de61df3a5ce0830de664bf879d",
"score": "0.5923999",
"text": "def group_params\n params[:group]\n end",
"title": ""
},
{
"docid": "989654de61df3a5ce0830de664bf879d",
"score": "0.5923999",
"text": "def group_params\n params[:group]\n end",
"title": ""
},
{
"docid": "a916905e4d270e4ed4f89d5447eff709",
"score": "0.5923842",
"text": "def group_params\n params.require(:group).permit(:name, :time, :activity_type, :location, :group_owner, :member1, :member2, :member3, :member4, :description,:user_id, :member1id, :member2id, :member3id, :member4id, :latitude, :longitude)\n end",
"title": ""
},
{
"docid": "38f732a94fbf634bac719f5236352afa",
"score": "0.59211946",
"text": "def group_params\n params.require(:group).permit( :name, :calendar_id, :method, :user_id, :bio)\n end",
"title": ""
},
{
"docid": "06620040e2ed6ca8fc85785728c7c60b",
"score": "0.5913997",
"text": "def user\n access_token = AccessToken.where(consumer_secret: params[:oauth_token]).first\n user = access_token.user\n redirect_to :failure unless user\n hash = {\n provider: 'ada',\n uid: user.id.to_s,\n info: {\n email: user.email,\n player_name: user.player_name,\n\n #This is stupid but here for backwards compatability\n auth: user.authentication_token,\n }\n }\n\n unless params[:group].nil?\n user.add_to_group(params[:group])\n end\n\n respond_to do |format|\n format.json { render :json => hash.to_json }\n end\n end",
"title": ""
},
{
"docid": "e493d8e9bcd47d10473ce68467e22b61",
"score": "0.5913209",
"text": "def group_params\n params.require(:group).permit(:name, { :user_ids => [] })\n end",
"title": ""
},
{
"docid": "710271d0fd088770ffb5a8e9eb511ff2",
"score": "0.590801",
"text": "def group_params\n params.require(:group).permit(:name, group_ids: [])\n end",
"title": ""
},
{
"docid": "a866cbd9be21ffbc4c35ee2fa64179d7",
"score": "0.5907542",
"text": "def add_to_group\n @user = current_user\n @groups = @user.shared_groups\n # this list all the places\n # @place = Place.all\n @place = Place.find(params[:place_id])\nend",
"title": ""
},
{
"docid": "c0f071e61d6403b3443dd5988e6d7366",
"score": "0.5904479",
"text": "def group_params\n params.require(:group).permit(:name, :private, :location_id, :creator_id)\n end",
"title": ""
},
{
"docid": "4682307720e71434b6e29266c10bb71d",
"score": "0.58966565",
"text": "def acceptgroup\n if(params[:accept] && params[:accept][:id]) \n group = Group.find(params[:accept][:id])\n current_user.pending_groups.delete(group)\n current_user.groups << group\n render :json => group.to_json(:include => {\n :users => {:except => [:created_at, :updated_at, :password_digest, :remember_token]},\n :pending_users => {:except => [:created_at, :updated_at,:password_digest, :remember_token]\n }}), :status => 200\n else\n render :json => [\"Missing Params\"], :status => 400 \n end\n end",
"title": ""
},
{
"docid": "df1da38075cce9f01e32d70c8fd0d148",
"score": "0.58950955",
"text": "def group_params\n params.require(:group).permit(:name, :introduction, :image, :facebook_url, :url, :description, :user_id, :image_cache, :remove_image)\n end",
"title": ""
},
{
"docid": "4e6966b03cbb25805caebabae4d183cb",
"score": "0.58804387",
"text": "def group_params\n #params.require(:group, :title, :description, :members)\n end",
"title": ""
},
{
"docid": "e62fd9e4abe97b2741f15c8081db3fd2",
"score": "0.5869741",
"text": "def get_group_id(group_set_id, group_name)\n group_data_arr = Array.new\n\n @url = \"http://#{$canvas_host}/api/v1/group_categories/#{group_set_id}/groups\"\n puts \"@url is #{@url}\"\n \n @getResponse = HTTParty.get(@url, :headers => $header)\n puts(\" GET to get groups in a group set has Response.code #{@getResponse.code} and getResponse is #{@getResponse}\")\n \n if $link_parser.parse(@getResponse).by_rel('next')\n group_data_arr.append(@getResponse.parsed_response)\n\n while $link_parser.parse(@getResponse).by_rel('next')\n @url = $link_parser.parse(@getResponse).by_rel('next').target\n puts \"@url is #{@url}\"\n\n @getResponse = HTTParty.get(@url, :headers => $header)\n puts(\" GET to get groups in a group set has Response.code #{@getResponse.code} and getResponse is #{@getResponse}\")\n \n group_data_arr.append(@getResponse.parsed_response)\n end\n\n group_data_arr.each { |group_data|\n group_data.each do |group_data_info|\n if group_data_info[\"name\"] == group_name\n return group_id = group_data_info[\"id\"] \n end\n end\n }\n else\n group_data = @getResponse.parsed_response\n group_id = nil\n \n group_data.each do |group_data_info|\n if group_data_info[\"name\"] == group_name\n group_id = group_data_info[\"id\"] \n end\n end\n\n return group_id\n end\nend",
"title": ""
},
{
"docid": "eae06f0eda0c13c6658d021666da0615",
"score": "0.58622384",
"text": "def get_group_members(group_id, *hash)\n if group_id.integer?\n RestClient.get \"https://#{@username}:#{@password}@convore.com/api/groups/#{group_id}/members.json\",\n #from here down optional\n #{:filter => hash[:admin]}\n hash[0]\n end\n end",
"title": ""
},
{
"docid": "5cb4ab8a327fe1e230609263ea21fe93",
"score": "0.5860357",
"text": "def create\n @group_params = group_params.to_json\n @reponse = HTTParty.post(\"https://rails-api-ipo.herokuapp.com/api/v1/groups.json\",\n :body => @group_params,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/groups/'+(@reponse['id'].to_s), notice: 'Group was successfully created.' }\n end\n end",
"title": ""
},
{
"docid": "cc2d00896036c5072bf7e53d0b57a79f",
"score": "0.5858526",
"text": "def group_params\n params.require(:group).permit(:status, :cancel_url, :redirect_url, :group_type, {employee_ids:[], function_ids:[], position_ids:[]})\n end",
"title": ""
},
{
"docid": "8dd22bee846e1901c2944d0a046f736b",
"score": "0.5857112",
"text": "def group_params\n params.require(:group).permit(:name, :id_created)\n end",
"title": ""
},
{
"docid": "c625c8710e31b49882b2ffd089e4d1de",
"score": "0.5853235",
"text": "def auth_token_params\n params.require(:auth_token).permit(:label, groups: [])\n end",
"title": ""
},
{
"docid": "30ee8b249576f7aaa328811e2a7fcdf6",
"score": "0.5848972",
"text": "def group_params\n params.require(:group).permit(:demand_id, :user_id)\n end",
"title": ""
},
{
"docid": "3969d4f997d21831b696985de0057116",
"score": "0.58332074",
"text": "def auth_group_params\n params.require(:auth_group).permit(:name, :odt, :gg, :inversion, :employee, :retencione, :pool, :razon_social, :auth_group)\n end",
"title": ""
},
{
"docid": "384b55edc6f8b268fb1ce0f1756978dc",
"score": "0.58327395",
"text": "def group_params\n # note: member_id is not saved to the database, it should be added to user_ids and then deleted from the hash.\n # In other words, we need a way to pass the member_id from the view (which may or may not be the same as leader_id),\n # but we don't want to pass the hash with member_id in it to the #new call. Having to always delete it seems\n # bad. TODO: Better way to do this?\n params.require(:group).permit(:leader_id, :member_id, :title, :course, :participantNumber, :frequency, :place,\n :time, :date, :description, :user_ids => [])\n end",
"title": ""
},
{
"docid": "8c1cf41ae3a0e0832108fa291a6e79c8",
"score": "0.58320177",
"text": "def test_should_update_group_via_API_XML\r\n get \"/logout\"\r\n put \"/groups/1.xml\", :group => { :name=>'renamed unit test group',\r\n :description=>'my new desc',\r\n :featured=>false }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "86b883b2030845d2d27b9a56e0cd629e",
"score": "0.5828871",
"text": "def authenticate_and_find_project\n unless params[:api_token].present? && @project = Project.find_by_api_token(params[:api_token])\n render json: { error: { errors: [{ message: t(\"controllers.api.v1.key_groups.invalid_api_token\") }] } }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "0c1b74486fe7543207ea1743c16390e4",
"score": "0.58288586",
"text": "def group_params\n params['group']['user_id'] = current_user.id\n params.require(:group).permit(:parent_id, :name, :user_id, :importance, :deadline, :visible)\n end",
"title": ""
},
{
"docid": "013fc8a1d593ec6735f1ce211a828038",
"score": "0.58280814",
"text": "def update_mod\n if params[:groupName] != nil && params[:subId] != nil && params[:password] != nil\n @group.subId = params[:subId] == \"\" ? nil : params[:subId].to_i\n @group.groupName = params[:groupName]\n @group.password = params[:password] == \"\" ? nil : params[:password]\n\n group_json = @group.to_h.to_json\n\n url = @httpIp+'/pet.com/api/group/updateGroup'\n uri = URI(url)\n res = Net::HTTP.post(uri, group_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to groups_path\n end\nend",
"title": ""
},
{
"docid": "d40f3894a51f43c514c39b576b767f4b",
"score": "0.5825397",
"text": "def group_params\n params.require(:group).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "d40f3894a51f43c514c39b576b767f4b",
"score": "0.5825397",
"text": "def group_params\n params.require(:group).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "d40f3894a51f43c514c39b576b767f4b",
"score": "0.5825397",
"text": "def group_params\n params.require(:group).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "525cbbbaa8dc532c5c6c2664fba12913",
"score": "0.58217406",
"text": "def editgroup\n if(params[:editgroup] && params[:editgroup][:id] && params[:editgroup][:name]&& params[:editgroup][:description])\n\n group = Group.find(params[:editgroup][:id])\n \n gpinfo = {:name => params[:editgroup][:name], \n :description => params[:editgroup][:description], \n :creator => group.creator, \n :self => group.self}\n\n if group.update_attributes(gpinfo)\n render :json => group.to_json(:include => {\n :users => {:except => [:created_at, :updated_at, :password_digest, :remember_token]},\n :pending_users => {:except => [:created_at, :updated_at,:password_digest, :remember_token]\n }}), :status => 200\n else\n render :json => group.errors.full_messages, :status => 400\n end\n else\n render :json => [\"Group ID Param not Found\"], :status => 400\n end\n end",
"title": ""
},
{
"docid": "b3b2dbf956bd4a746be0265c67e8cc18",
"score": "0.58205956",
"text": "def access_group_params(mode = :all)\n list = []\n list += [ :name ] if mode == :before_create || mode == :all\n list += [ { group_ids: [], user_ids: [] } ] if mode == :after_create || mode == :all\n\n params.require(:access_group).permit(list)\n end",
"title": ""
},
{
"docid": "5f21b0647b2576625a87a7457a2ce563",
"score": "0.5820214",
"text": "def group_params\n\t\t\tparams.require(:group).permit(:group_name, :pub_key, :description)\n\t\t\t\n\t\t\t#gr_name = params.require(:group).group_name\n\t\t\t\n\t\tend",
"title": ""
},
{
"docid": "f931e7845ddf108320815e316a68af92",
"score": "0.58093303",
"text": "def group_params\n params.require(:group).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "9f2be8786df9e8eb16e34f17b862b763",
"score": "0.5803547",
"text": "def test_should_create_group_via_API_XML\r\n get \"/logout\"\r\n post \"/groups.xml\", :api_key=>'testapikey',\r\n :group => {:name=>'unit test group',\r\n :description=>'my desc',\r\n :featured=>false}\r\n assert_response :created\r\n end",
"title": ""
},
{
"docid": "46aeff96ef0f0520a41fabdec70ee947",
"score": "0.5802698",
"text": "def set_access_group\n @access_group = Incline::AccessGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "a348d077b05f87049e3e539d895fcc1a",
"score": "0.58006644",
"text": "def getUserGroups\r\n begin\r\n json_data = JSON.parse(request.body.read)\r\n if !json_data[\"userId\"].empty?\r\n userId = json_data[\"userId\"]\r\n userToken = json_data[\"userToken\"]\r\n else\r\n render json: { status: \"failed\", \"errors\": [{ \"field\": \"Invalid Json Data\" }] }, status: 400\r\n end\r\n\r\n #success\r\n url = getGroupDataUrl(userId,userToken)\r\n jsonData = getGroupsData(urlInfo)\r\n render json: jsonData, status: 200\r\n rescue => e \r\n render json: { status: \"failed\", \"errors\": [\"message\": e.message] }, status: 400 \r\n end\r\n \r\n end",
"title": ""
},
{
"docid": "56145fcc3e601caa34ca8009af975901",
"score": "0.57954574",
"text": "def test_should_create_group_via_API_JSON\r\n get \"/logout\"\r\n post \"/groups.json\", :api_key => 'testapikey',\r\n :group => {:name=>'unit test group',\r\n :description=>'my desc',\r\n :featured=>false }\r\n assert_response :created\r\n group = JSON.parse(response.body)\r\n check_new_group(group) \r\n end",
"title": ""
},
{
"docid": "7fbfb387595aba05cde7a4fc8fa266b2",
"score": "0.5792636",
"text": "def group_details\n group_id = params[:group_id]\n #group_details = cache_response_value(group_id) do \n group = Agents::Group.find(group_id)\n if @current_user.class.name == 'Vendor' || @current_user.branch.agent.group_id == group.id\n group_details = group.as_json(methods: [:vanity_url, :children_vanity_urls], include: { companies: { include: { branches: { include: { assigned_agents: {methods: [:active_properties]}}}}}})\n render json: group_details, status: 200\n else\n message = \"Sorry, but you do not have permission to view this page\"\n render json: { message: message }, status: 401\n end\n #end\n end",
"title": ""
},
{
"docid": "c954cadcb5c21d3f215272455254c930",
"score": "0.5789651",
"text": "def group_params\n params.require(:group).permit(:title, :group_id)\n end",
"title": ""
},
{
"docid": "815cc99fe60189c0a2a9c749fbe5df0d",
"score": "0.5789475",
"text": "def set_group_member\n @group_member = GroupMember.find(params[:id])\n authorize @group_member\n end",
"title": ""
},
{
"docid": "0d9599fd7b42ecdbab7eb022c85929a0",
"score": "0.5789325",
"text": "def create\n authorize! :admin, :site\n\n @group = Group.new(params[:group])\n @group.status = Constant::Approving\n @group.boss_id = current_user.id\n\n respond_to do |format|\n if @group.save\n @group.admin_circle.add(current_user)\n @group.member_circle.add(current_user)\n format.html { redirect_to :action => 'edit', :id => @group.id, :q => 1 }\n format.json { render json: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe7e6e0fdfc983d17d9c70a900a00005",
"score": "0.5787963",
"text": "def update_group_name(access_token, id, name)\n url = 'https://api.weixin.qq.com/cgi-bin/groups/update'\\\n \"?access_token=#{access_token}\"\n Helper.http_post(url, { group: { id: id, name: name } }.to_json)\n end",
"title": ""
},
{
"docid": "ae4a880aacb27bc9aaf7ca67e39a983c",
"score": "0.5787134",
"text": "def group_member_params\n params.require(:group_member).permit(:group_id).merge!({\"user_id\" => current_user.id})\n end",
"title": ""
},
{
"docid": "fd227107475da4c54fe8746f07c01c44",
"score": "0.5784922",
"text": "def group_params\n params.require(:group).permit(:id, :event_id, :no_of_attendees, :no_of_entrees)\n end",
"title": ""
},
{
"docid": "fe3d48793bdb9fe378a56f6b488309a4",
"score": "0.5784268",
"text": "def create_params\n params.require(:group).permit(:name, :password).merge(user_ids: current_user.id)\n end",
"title": ""
},
{
"docid": "1859da553bf6565204879c95a2a89f00",
"score": "0.5779655",
"text": "def access_token\n end",
"title": ""
},
{
"docid": "f74c2199197d8e6427c532de0588bf07",
"score": "0.5778938",
"text": "def join_public_group(group_id)\n if group_id.integer?\n RestClient.post \"https://#{@username}:#{@password}@convore.com/api/groups/#{group_id}/join.json\", {}\n end\n end",
"title": ""
},
{
"docid": "e104160ba1181c9771e6353d892b2fac",
"score": "0.5777308",
"text": "def group_params\n params.require(:group).permit(:name, :image, :who_created_id, :datetime_created, :who_updated_id, :datetime_updated, :based_in_id)\n end",
"title": ""
},
{
"docid": "481065e2e1a4fd700f8f03881f3f167f",
"score": "0.5776246",
"text": "def test_ID_25873_access_granted_as_follower_of_a_private_group()\n login_as_user1\n read_all_updates\n groupName = create_any_new_group(\"Private\", \"News\")\n logout_common\n login_as_user2\n read_all_updates\n find_a_group(\"#{groupName}\")\n request_invite\n logout_common\n login_as_user1\n verify_updates\n go_to_updates_page\n approve_as_follower\n logout_common\n login_as_user2\n verify_updates\n end",
"title": ""
},
{
"docid": "28870187c6c29032b6900a40f69daeac",
"score": "0.5771399",
"text": "def atest_ID_25873_access_granted_as_follower_of_a_private_group()\n login $user_1_email, $master_password\n read_all_updates\n groupName = create_any_new_group(\"Private\", \"News\")\n logout_common\n login $user_1_email, $master_password\n read_all_updates\n find_a_group(\"#{groupName}\")\n $request_invite.when_present().fire_event(\"onclick\")\n sleep 10\n logout_common\n login $user_1_email, $master_password\n verify_updates\n go_to_edit_profile_page\n $profile_updates_side_link.when_present().click\n sleep 5\n $approve_as_follower.when_present().fire_event(\"onclick\")\n sleep 5\n logout_common\n login $user_1_email, $master_password\n verify_updates\n end",
"title": ""
},
{
"docid": "d9c88cfc5457b2dbe7292c85d84bf6c3",
"score": "0.5771005",
"text": "def group_params\n params.require(:group).permit(:group_name,:user_id)\n end",
"title": ""
},
{
"docid": "6927506c9f6ea19582b49d0871c2f8ea",
"score": "0.5768659",
"text": "def generate_token\n begin\n self.access_token = Digest::SHA1.hexdigest([Time.now, rand].join)\n end while GroupMember.exists?(:access_token => self.access_token)\n end",
"title": ""
},
{
"docid": "01b763b081ef240a43e744247b57798e",
"score": "0.57686347",
"text": "def set_access_group\n @access_group = AccessGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "668e6ae7fa3ac82468c3c245f5e4e14c",
"score": "0.57638174",
"text": "def add_group(auth_token, group_category_id, group_name)\n\tnew_group=`curl -H \"Authorization: Bearer #{auth_token}\" https://umich.test.instructure.com/api/v1/group_categories/#{group_category_id}/groups -F \"is_public=false\" -F \"join_level=invitation_only\" -F \"name=#{group_name}\" -F \"description=#{group_name}\"`\n\treturn JSON.parse(new_group)\nend",
"title": ""
},
{
"docid": "d37f014b0855b399a5fc1d9a6ce0f057",
"score": "0.5763734",
"text": "def group_params\n params.require(:group).permit(:name, :KGV, :creationDate, :adminId)\n end",
"title": ""
},
{
"docid": "3ab1e39a90f1dc5e5f3cf1f7cba31030",
"score": "0.57633674",
"text": "def check_request\n group_user = GroupUser.where(group_id: params[:group_id], user_id: params[:user_id]).first\n if group_user.present?\n if Group.exists?(id: params[:group_id], user_id: params[:user_id])\n render json: { group_user: group_user, status: 'creator'}\n else\n render json: { group_user: group_user, status: 'joined'}\n end\n else\n render json: { status: 'none'}\n end\n end",
"title": ""
},
{
"docid": "0c78cddac8d3494380edb8ef49751d11",
"score": "0.57622015",
"text": "def create\n @access_group = AccessGroup.new(access_group_params)\n @access_group.user_id = current_user.id\n respond_to do |format|\n if @access_group.save\n format.html { redirect_to @access_group, notice: \"Access group was successfully created.\" }\n format.json { render :show, status: :created, location: @access_group }\n else\n format.html { render :new }\n format.json { render json: @access_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c2a719f81f5790d1b73bc0116f21381",
"score": "0.5754191",
"text": "def index\n @groups = Group.all\n @group = Group.find_by_id(params[:group_id])\n if !@group.blank?\n @visit = Visit.where(user_id: current_user.id, visitable_id: @group.id, visitable_type: 'Group').first\n if !@visit.blank?\n @visit.destroy\n end\n Visit.create(user_id: current_user.id, visitable_id: @group.id, visitable_type: 'Group')\n @activity = Activity.create(user_id: current_user.id, activity_type: 'View', target_type: 'Group', target_id: @group.id)\n end\n end",
"title": ""
},
{
"docid": "0a6048a18739b108877196d7f3aa7904",
"score": "0.5752117",
"text": "def generate_token\n begin\n self.access_token = Digest::SHA1.hexdigest([Time.now, rand].join)\n end while Group.exists?(:access_token => self.access_token)\n end",
"title": ""
},
{
"docid": "7237767d100c0de55ccffa89a9f07795",
"score": "0.5747252",
"text": "def group_params\n params.require(:group).permit(:name, :address, :time, :number_of_members,\n :picture, :twitter, :contact, :activities, :email)\n end",
"title": ""
},
{
"docid": "0bcd7edd9a6d18d06cf7d71e738a29d9",
"score": "0.5736458",
"text": "def group_params\n\n params.require(:group).permit(:groupname, :description, :location, :user_id, :avatar, :latitude, :longitude)\n\n end",
"title": ""
}
] |
2ca267a7363d06e7b389b095e873223c
|
shut down the EventHandlerSubscriptions
|
[
{
"docid": "b2de10e3018c50804b307610a2347e84",
"score": "0.0",
"text": "def close\n synchronize do\n @callbacks.values.flatten.each(&:close)\n @state = :closed\n clear!\n end\n end",
"title": ""
}
] |
[
{
"docid": "a8a2075b24c99d0c04a8234c10905e74",
"score": "0.69234186",
"text": "def deregister_event_handlers\n\t\tframework.events.remove_session_subscriber(self)\n\tend",
"title": ""
},
{
"docid": "15af6cd9312b95301049a32780d6b133",
"score": "0.69045174",
"text": "def unsubscribe\n subscriptions.values.each(&:unsubscribe)\n @on_unsubscribe.call(self) if @on_unsubscribe\n end",
"title": ""
},
{
"docid": "687befab555d5e044da098389dc64163",
"score": "0.68691605",
"text": "def unsubscribe()\n end",
"title": ""
},
{
"docid": "c3f641c848b190cbc8e3ac04ae4e42fa",
"score": "0.68361574",
"text": "def unsubscribe; end",
"title": ""
},
{
"docid": "a4e1a9b963979a34bfabfc7cc5c0a54f",
"score": "0.6831625",
"text": "def unsubscribed # :doc:\n # Override in subclasses\n end",
"title": ""
},
{
"docid": "4fe003efe47ed16d0d266d2ddba7099e",
"score": "0.6826562",
"text": "def unsubscribe()\n \n end",
"title": ""
},
{
"docid": "1817537cfdcd0e36938b9ec4ec36a35a",
"score": "0.68190855",
"text": "def unsubscribe\n unregister\n end",
"title": ""
},
{
"docid": "54fd8229ba9d248b9d296f750ad7f799",
"score": "0.67363966",
"text": "def shutdown\n @manager.shutdown_subscriber(self)\n end",
"title": ""
},
{
"docid": "30cfdc4364be95c74befff4342777497",
"score": "0.6733948",
"text": "def unsubscribed\n # Any cleanup needed when channel is unsubscribed\n stop_all_streams\n end",
"title": ""
},
{
"docid": "30cfdc4364be95c74befff4342777497",
"score": "0.6733948",
"text": "def unsubscribed\n # Any cleanup needed when channel is unsubscribed\n stop_all_streams\n end",
"title": ""
},
{
"docid": "a31f8495c479218c2ebc4002b819b8b9",
"score": "0.6707258",
"text": "def unsubscribed\n stop_all_streams\n end",
"title": ""
},
{
"docid": "b82155266d5bc8e0fcb8bcff9c5fbfb2",
"score": "0.6669556",
"text": "def stop_subscribers\n subscribers.each { |subscriber| subscriber << :terminate! }\n\n nil\n end",
"title": ""
},
{
"docid": "5048640cff34b55ba21e073db412c9e8",
"score": "0.6565669",
"text": "def stop\n subscriptions.each { |n, v| unsubscribe(n) }\n\n @amqp.close\n end",
"title": ""
},
{
"docid": "041b7d82bdcf19d1187928e94496b1f0",
"score": "0.6554893",
"text": "def shutdown\n @pubsub.shutdown\n end",
"title": ""
},
{
"docid": "dc0c789c5a0047d5cdd29f02d87e6738",
"score": "0.65211934",
"text": "def close\n @subscriptions.each(&:cancel)\n @subscriptions.clear\n end",
"title": ""
},
{
"docid": "4a243b094ca4612e1c183a8b2e15e861",
"score": "0.6511545",
"text": "def unsubscribed\n end",
"title": ""
},
{
"docid": "4a243b094ca4612e1c183a8b2e15e861",
"score": "0.6511545",
"text": "def unsubscribed\n end",
"title": ""
},
{
"docid": "e4fc8810a7afe04eb499b2b598d43dc3",
"score": "0.6456952",
"text": "def cleanup\n\t\t\tself.framework.events.remove_session_subscriber(self)\n\t\t\tremove_console_dispatcher('notify_pushover')\n\t\tend",
"title": ""
},
{
"docid": "3f3af0698afb4be7724e1671081a98f6",
"score": "0.64313126",
"text": "def unsubscribed; end",
"title": ""
},
{
"docid": "5f085846ac5364e4cd89344e6a052a0a",
"score": "0.6423379",
"text": "def cleanup\n\t\t\tself.framework.events.remove_session_subscriber(self)\n\t\t\tremove_console_dispatcher('notify')\n\t\tend",
"title": ""
},
{
"docid": "5f085846ac5364e4cd89344e6a052a0a",
"score": "0.6423379",
"text": "def cleanup\n\t\t\tself.framework.events.remove_session_subscriber(self)\n\t\t\tremove_console_dispatcher('notify')\n\t\tend",
"title": ""
},
{
"docid": "7876b0213b95bd37f5f7398c8d1f1c99",
"score": "0.6411977",
"text": "def unsubscribe\n if @subscriber\n @subscriber.stream.close\n @subscriber = nil\n end\n end",
"title": ""
},
{
"docid": "bb4de2f34d0c73876350e9b97b8f13bc",
"score": "0.6381862",
"text": "def unsubscribe\n end",
"title": ""
},
{
"docid": "371c66ab5e18c939f4a6772310edd19b",
"score": "0.63813627",
"text": "def unsubscribe_all(listener)\n if @subscriptions\n @subscriptions.keys.each do |event|\n unsubscribe(event, listener)\n end\n end\n end",
"title": ""
},
{
"docid": "4f1a9977b34a72d8ddca016fdb51f43f",
"score": "0.6372165",
"text": "def stop\n consumers.values.each(&:unsubscribe)\n end",
"title": ""
},
{
"docid": "09367e1a667db2ecffa94b9d73e217d3",
"score": "0.6347306",
"text": "def unsubscribe\n\t\t\t@update_timer.cancel if @update_timer\n\t\t\t@update_timer = nil\n\t\tend",
"title": ""
},
{
"docid": "2a0fb16f0eacd6bdd11d543b4e142fca",
"score": "0.6326937",
"text": "def unsubscribe\n raise UnsubscribedError\n end",
"title": ""
},
{
"docid": "c8448a735edf21a4e4865bdf98c21e47",
"score": "0.6293075",
"text": "def stop_listening\n @subscriber.stop! if @subscriber\n end",
"title": ""
},
{
"docid": "593983e41f257529911cd8aaa7f21a4f",
"score": "0.62827766",
"text": "def unsubscribe\n @subscription_reference.unsubscribe\n end",
"title": ""
},
{
"docid": "571015deb5775ffacf3a819ea87b1359",
"score": "0.6266",
"text": "def unsubscribe\n return if self.hub.nil?\n\n change_subscription(:unsubscribe)\n end",
"title": ""
},
{
"docid": "0190843465422dfa16b5cbe9a932c2c0",
"score": "0.62422496",
"text": "def unsubscribed\n\tend",
"title": ""
},
{
"docid": "f620b933bd341deb36cad98c74a2156d",
"score": "0.616848",
"text": "def off\n @handler.off\n deactivate\n end",
"title": ""
},
{
"docid": "4450d79f33930c06ce57a0b958511c70",
"score": "0.61647654",
"text": "def unsubscribe\n redis.unsubscribe\n end",
"title": ""
},
{
"docid": "dbd1aff36227bb108bd75ab597660810",
"score": "0.612007",
"text": "def cleanup\n\t\t\tself.framework.events.remove_session_subscriber(self)\n\t\t\tremove_console_dispatcher('twitt')\n\t\tend",
"title": ""
},
{
"docid": "27ac32ca33db630b034f112b36435520",
"score": "0.6115455",
"text": "def removeAllEventHandlers _obj, _args\n \"_obj removeAllEventHandlers _args;\" \n end",
"title": ""
},
{
"docid": "354dd58651d07d5a39b75afea555d32a",
"score": "0.60835946",
"text": "def unsubscribe\n subscription = nil\n @gate.synchronize do\n if @subscription\n unless @primary_unsubscribed\n @primary_unsubscribed = true\n\n if @count == 0\n subscription = @subscription\n @subscription = nil\n end\n end\n end\n end\n\n subscription.unsubscribe if subscription\n end",
"title": ""
},
{
"docid": "7f3fd7c8782d9f7f5fab55cc10ed5f5d",
"score": "0.6078585",
"text": "def reset!\n @events = nil\n end",
"title": ""
},
{
"docid": "e4bee32931375e4818d3cf9bf80ddb4a",
"score": "0.60763407",
"text": "def close\n subscriptions.keys.each do |id| \n channel, sig = id.to_a.flatten\n Channel[app_id => channel].unsubscribe(subscriptions.delete(channel => sig))\n end\n end",
"title": ""
},
{
"docid": "bb5d690ccf33a7efbc74bc566da0ff10",
"score": "0.60713875",
"text": "def shut_down\n end",
"title": ""
},
{
"docid": "367be27a1b213e5d88aebace9bd2e980",
"score": "0.6063162",
"text": "def shutdown\n\t\tself.shutting_down = true\n\t\tself.consumer.cancel if self.consumer\n\tend",
"title": ""
},
{
"docid": "367ab0b9b1596cfac82df22b246dacb9",
"score": "0.60593224",
"text": "def unsubscribe!\n @consumer.try(:cancel)\n @consumer = nil\n end",
"title": ""
},
{
"docid": "68f14d6805111c4c7e184fc66635ab17",
"score": "0.6041859",
"text": "def teardown\n callback(:teardown) do\n notify(:teardown)\n end\n end",
"title": ""
},
{
"docid": "45e37f4ddc11f6c4554208fc0e4ce915",
"score": "0.603263",
"text": "def unsubscribeTo (event)\r\n @subscribedEvents.delete?(event)\r\n end",
"title": ""
},
{
"docid": "fcef17d37bcd8cdb25699563e017d0ee",
"score": "0.60316",
"text": "def unobserve_all_observables\n registrations.values.dup.each do |registration|\n registration.deregister\n registrations.delete([registration.observable.object_id, registration.args])\n end\n end",
"title": ""
},
{
"docid": "bda4cf3d593dbe9dcf4365f223111bdf",
"score": "0.6009184",
"text": "def unsubscribe(subscribable)\n subscribable.unsubscribe(self)\n end",
"title": ""
},
{
"docid": "0d896bf765a02db18760536bd4ee0a2b",
"score": "0.59914786",
"text": "def shutdown\n @signal_squash.call\n end",
"title": ""
},
{
"docid": "a8925e400e0a7ec6bd25f22edd04f8af",
"score": "0.59909964",
"text": "def shutdown_handler\n self.close unless self.closed?\n @sockets = []\n end",
"title": ""
},
{
"docid": "643281ed920f6585b3ed4c29abb3ec03",
"score": "0.5979504",
"text": "def signals_reset\n @signals.pop\n end",
"title": ""
},
{
"docid": "1049b5cd4f827ff752f0c6edfcdd65ea",
"score": "0.59742445",
"text": "def unsubscribe(source)\n #TODO\n end",
"title": ""
},
{
"docid": "6bbc0949942ef9e7ae51792cbae5b271",
"score": "0.59158343",
"text": "def unsubscribe\n old = nil\n @gate.synchronize do\n unless @unsubscribed\n @unsubscribed = true\n old = @current\n @current = nil\n end\n end\n\n old.unsubscribe if old\n end",
"title": ""
},
{
"docid": "946533afe7a0770ede7936cec5999a9c",
"score": "0.59102947",
"text": "def shutdown\n @event_loop.shutdown\n end",
"title": ""
},
{
"docid": "de403fa7c96206b35858f4501d7bd942",
"score": "0.5908782",
"text": "def shutdown_handler(event)\n super\n\n stop_listener if @server_sig\n end",
"title": ""
},
{
"docid": "833e6e8996d437936e3bfc3434200644",
"score": "0.5904749",
"text": "def disposing(ev)\n end",
"title": ""
},
{
"docid": "803ac0513d891789eea5198f91e7e771",
"score": "0.5887532",
"text": "def stop_handler\n\t\t# Stop the listener threads\n\t\tself.listener_threads.each do |t|\n\t\t\tt.kill\n\t\tend\n\t\tself.listener_threads = []\n\t\tself.listener_pairs = {}\n\tend",
"title": ""
},
{
"docid": "0453a3e3c55a6d3fde933d4a41d82838",
"score": "0.5882325",
"text": "def on_close(env)\n @subscription.delete if @subscription\n logger.debug \"WebSocket closing connection\"\n end",
"title": ""
},
{
"docid": "06c2f732fb8cbe9dfe442e99fdb48a20",
"score": "0.58707803",
"text": "def shutdown()\n if @conn\n @conn.unsubscribe(@queue_name)\n @@log.debug(\"Unsubscribe complete\")\n StompHelper::pause(\"After unsubscribe\") if $DEBUG\n @conn.disconnect()\n @@log.debug(\"Disconnect complete\")\n StompHelper::pause(\"After disconnect\") if $DEBUG\n end\n end",
"title": ""
},
{
"docid": "01381097e2f39a579a24f1ce734b6068",
"score": "0.5861812",
"text": "def clear_all_callbacks!\n disconnect!\n clear_callbacks!\n end",
"title": ""
},
{
"docid": "ceff6a86117c12d68bb907edde6e9b6a",
"score": "0.58542126",
"text": "def unsubscribe(cls)\n @subscribers.delete(name)\n end",
"title": ""
},
{
"docid": "2b0211c93402d5e931048e2cb5d843fc",
"score": "0.5849836",
"text": "def on_close(env)\n subscription.unsubscribe\n Firehose.logger.debug \"WS connection `#{cid}@#{path}` closing\"\n end",
"title": ""
},
{
"docid": "bf370aae8353b9fba3c138b4935c0ec2",
"score": "0.5849195",
"text": "def unsubscribe(event, *args, &block)\n raise HandlerError.new \"Unable to unsubscribe, there is no event #{event}\" unless events[event.to_sym]\n events[event.to_sym].unsubscribe(*args, &block)\n end",
"title": ""
},
{
"docid": "b98b1dac601e971a50d49d38c3099920",
"score": "0.584745",
"text": "def on_close env\n return unless env[:subscription]\n env.delete(:subscription).close_stream!\n end",
"title": ""
},
{
"docid": "a3a2ef581576c889c90f5957c2c45b35",
"score": "0.5844515",
"text": "def unsubscribe_from_channel; end",
"title": ""
},
{
"docid": "9931857649f703e49d961748254c9f88",
"score": "0.58404964",
"text": "def unbind()\n Babylon.logger.debug(\"DISCONNECTED\") # Very low level Logging\n EventMachine::stop_event_loop\n end",
"title": ""
},
{
"docid": "2ac93a713861099794805e20c73c239c",
"score": "0.5821109",
"text": "def tear_down\n self.instance.tear_down unless self.instance.nil?\n self.instance = nil\n end",
"title": ""
},
{
"docid": "766083ce6d6277dd8db9fa667324549c",
"score": "0.58046293",
"text": "def unsubscribe(subscriber)\n handler.unsubscribe(self, subscriber)\n end",
"title": ""
},
{
"docid": "0b3c96a153939dbddcdf1332874ff0f6",
"score": "0.5790502",
"text": "def end_watch\n if @listener\n @listener.stop\n end\n end",
"title": ""
},
{
"docid": "861e809498f548cb9fc615ab6f4ba9cc",
"score": "0.5786212",
"text": "def subscriptions!\n @subscriptions = nil\n subscriptions\n end",
"title": ""
},
{
"docid": "73775034f24d92c5225707a49112171e",
"score": "0.57786393",
"text": "def unsubscribed\n super\n # TODO: abort any pending lookup requests\n end",
"title": ""
},
{
"docid": "3449197a75cdcdf0c4059647cb026de9",
"score": "0.5776345",
"text": "def shutdown\n @registry.clear\n end",
"title": ""
},
{
"docid": "c75a190144af5ed90fbe88f342fcad09",
"score": "0.5766092",
"text": "def clear_listeners_instances\n @@listeners = nil\n @@hook_listeners = {}\n end",
"title": ""
},
{
"docid": "67a7c28431c39f8ef0564629cbeb0a20",
"score": "0.5757207",
"text": "def clear_listeners_instances\n @@listeners = nil\n @@hook_listeners = {}\n end",
"title": ""
},
{
"docid": "3ff26cfac6775272da116442790ee69d",
"score": "0.5756895",
"text": "def unsubscribes(options={})\n Resources::Unsubscribes.new(self, options)\n end",
"title": ""
},
{
"docid": "07c6739ce348683de220317c3a4c12f1",
"score": "0.5752093",
"text": "def delete_observers\n @sub_lock.synchronize { subscribers.delete channel }\n end",
"title": ""
},
{
"docid": "5885503ac22c4e8bbede89ace0e3119d",
"score": "0.5750663",
"text": "def unsubscribe\n check_subscribed!\n subscription.unsubscribe_from_channel\n end",
"title": ""
},
{
"docid": "02b740379a2ce91323c265268624f8eb",
"score": "0.5748493",
"text": "def unsubscribe_webhook\n if @redis\n @redis.pubsub.unsubscribe(subscribed_channel)\n @redis.close_connection\n end\n end",
"title": ""
},
{
"docid": "1395439e26dc059b98dab69925aa1ede",
"score": "0.57369584",
"text": "def shutdown\n client.deregister_inbound_handler(Rex::Post::Meterpreter::Extensions::Stdapi::Net::SocketSubsystem::TcpServerChannel)\n end",
"title": ""
},
{
"docid": "0bcd005e3c276df90e96e7b654bfae05",
"score": "0.5728833",
"text": "def shutdown_gracefully\n super\n @publisher.shutdown_gracefully\n end",
"title": ""
},
{
"docid": "e6a026690920569ae229917c6da00f3f",
"score": "0.5722528",
"text": "def remove_existing_log_subscriptions\n ActiveSupport::LogSubscriber.log_subscribers.each do |subscriber|\n case subscriber\n when ActionView::LogSubscriber\n unsubscribe(:action_view, subscriber)\n when ActionController::LogSubscriber\n unsubscribe(:action_controller, subscriber)\n when ActiveRecord::LogSubscriber\n unsubscribe(:active_record, subscriber)\n when ActionMailer::LogSubscriber\n unsubscribe(:action_mailler, subscriber)\n end\n end\n end",
"title": ""
},
{
"docid": "02572a6a81b97e9487af1de2b8e9ed0e",
"score": "0.5715148",
"text": "def do_stop\n @notifier.remove_listener self\n @condition.signal\n end",
"title": ""
},
{
"docid": "c332515975775002ce5b1ee04acdfe59",
"score": "0.57087135",
"text": "def cleanup\n if (payload_instance and handler_enabled?)\n payload_instance.cleanup_handler\n end\n self.abort_sockets if self.respond_to?(:abort_sockets)\n end",
"title": ""
},
{
"docid": "cdeb43a1881889bc7dc90b17fc9b4ae1",
"score": "0.5697921",
"text": "def unsubscribe\n debug [self.name, \"terminated\"]\n unsubscribe_request\n end",
"title": ""
},
{
"docid": "2e512069c4eb7e5371ef0b45eb14e427",
"score": "0.5684196",
"text": "def stop_observing\n\n get_expression_pool.remove_observer(@expool_observer)\n get_participant_map.remove_observer(@pmap_observer)\n end",
"title": ""
},
{
"docid": "7b42c8420dcc0888e549501afbe4a5f9",
"score": "0.5681957",
"text": "def on_remove\n @context.notifications.off(\"graph.start\", self)\n @context.notifications.off(\"graph.stop\", self)\n\n io.outputs.each { |k, o| @context.connections.delete(o.guid) }\n io.unregister_inputs\n var.unregister\n stop\n end",
"title": ""
},
{
"docid": "a32b5076c9c5fabb3b3cf17f33a1ac05",
"score": "0.5673127",
"text": "def unsubscribe_from_channel # :nodoc:\n run_callbacks :unsubscribe do\n unsubscribed\n end\n end",
"title": ""
},
{
"docid": "c408b23d68f1370cac02238001ee69a1",
"score": "0.5668285",
"text": "def stop\n self.listener.stop\n self.listener.close\n end",
"title": ""
},
{
"docid": "819de4e5c35a5d61ef35c01ac5130c4c",
"score": "0.56531864",
"text": "def unregister_from_event_loop\n if @loop == :em\n @em_connection.unattach(false)\n else\n raise NotImplementedError.new(\"unregister_from_event_loop not implemented for #{@loop}\")\n end\n end",
"title": ""
},
{
"docid": "b5f698f42c55a619d265150267f08480",
"score": "0.56403846",
"text": "def destroy\n subscribers.each do |name, subscriber|\n subscriber.destroy\n end\n end",
"title": ""
},
{
"docid": "6999d3e87bf5e4df3912ccc4d3e91308",
"score": "0.5639979",
"text": "def unsubscribe\n @subscription.unsubscribe\n return_back_or_ajax\n end",
"title": ""
},
{
"docid": "e82b8278f1077bdef311d86e613c1b90",
"score": "0.5638166",
"text": "def clean_subscriptions\n\t if @subscription = self.subscription\n\t \tunless @subscription.active?\n\t \t recatch_time = ((Time.now - @subscription.deactivated_at) / 1.hour).round\n\t \t if recatch_time > 24 \n\t \t \t@subscription.remove\n\t \t end\n\t \tend\n\t end\n\tend",
"title": ""
},
{
"docid": "382993e97b8840b3781b458e0c804437",
"score": "0.5635981",
"text": "def unsubscribe\n @conn.send_data :opcode => UNSUBSCRIBE, :channel => @name\n end",
"title": ""
},
{
"docid": "7758abb760c1ea8a8e788e23494ca1b1",
"score": "0.56350434",
"text": "def remove\n if @removed\n # raise \"event #{@event} already removed\"\n puts \"event #{@event} already removed\"\n return\n end\n\n if DEBUG && RUBY_PLATFORM == 'opal'\n @@all_events.delete(self) if @@all_events\n\n `window.total_listeners -= 1;`\n `console.log(\"Rem\", window.total_listeners);`\n end\n\n\n @removed = true\n @klass.remove_listener(@event, self)\n\n # We need to clear these references to free the memory\n @scope_provider = nil\n @callback = nil\n # @klass2 = @klass\n @klass = nil\n # @event = nil\n\n end",
"title": ""
},
{
"docid": "fa7de8d67f27f494c0ec14d631c03a38",
"score": "0.56290656",
"text": "def unsubscribe(event)\n has_subscriptions.find_by(subscribed_id: event.id).destroy\n end",
"title": ""
},
{
"docid": "aecc490c65543f898ed79fec5a2d375a",
"score": "0.5628375",
"text": "def shutdown\n @connection_manager.shutdown if @connection_manager\n @client = nil\n @connection_manager = nil\n end",
"title": ""
},
{
"docid": "a74457b03c0d797506335ec163b0b1d2",
"score": "0.5624772",
"text": "def callback_handler_remove\n rl_callback_handler_remove\n @rl_callback_handler = nil\n end",
"title": ""
},
{
"docid": "67f717f0fd2cdebcd72045cf369c8d0c",
"score": "0.56240016",
"text": "def stop_handler\n\t\tderef_handler\n\tend",
"title": ""
},
{
"docid": "9421a438e3624c2d7becd1c4d8a9cf32",
"score": "0.5618618",
"text": "def shut_down\n trigger(:shut_down_started)\n @server.stop(true) if @server\n @server_thread.join if @server_thread\n adapter.shut_down\n trigger(:shut_down_complete)\n end",
"title": ""
},
{
"docid": "49f3e6603ed741906699a02bee3be817",
"score": "0.56144387",
"text": "def stop_publishing\n @publisher.stop if @publisher\n end",
"title": ""
},
{
"docid": "c37f411462706dcd58b7940022f5fde3",
"score": "0.56088924",
"text": "def unsubscribe(listener)\n listeners.delete(listener)\n end",
"title": ""
},
{
"docid": "c20fdffe7ea68abd2485707e58ae6538",
"score": "0.56009126",
"text": "def stop\n Internals::ThreadPool.stop\n @listeners ||= []\n\n # TODO: should use a mutex for this\n @listeners.each do |listener|\n # call stop to halt the main loop\n listener.stop\n end\n @listeners = nil\n end",
"title": ""
},
{
"docid": "9b395e012cca96147403d0132eb4a0d1",
"score": "0.5592941",
"text": "def reset_handlers\n @handlers = nil\n end",
"title": ""
},
{
"docid": "f6796fc1251fe63df7501a96aed1a012",
"score": "0.55866945",
"text": "def cleanup\r\n\t\tsuper\r\n\t\tif self.service\r\n\t\t\tprint_status(\"Shutting down payload stager listener...\")\r\n\t\t\tbegin\r\n\t\t\t\tself.service.deref if self.service.kind_of?(Rex::Service)\r\n\t\t\t\tif self.service.kind_of?(Rex::Socket)\r\n\t\t\t\t\tself.service.close\r\n\t\t\t\t\tself.service.stop\r\n\t\t\t\tend\r\n\t\t\t\tself.service = nil\r\n\t\t\trescue ::Exception\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"title": ""
}
] |
edc7f0927a672ebc580a1a91df12cfdc
|
Checking if the piece coordinates are valid or not:
|
[
{
"docid": "e82dbcb2e53eeb46a4e79cf433ba9335",
"score": "0.83166677",
"text": "def piece_location_valid?(coords)\n if valid_coords?(coords)\n puts \"Piece added at coordinates #{coords}\"\n coords_available?(coords)\n else\n puts \"Piece coordinates are out of bounds!\"\n false\n end\n end",
"title": ""
}
] |
[
{
"docid": "8f0e2f0f6f933a3ba0e20cd50c8db11a",
"score": "0.875155",
"text": "def piece_location_valid?(coords)\n end",
"title": ""
},
{
"docid": "45be1ad2c1cd8022e3f8babcb60b1558",
"score": "0.8033362",
"text": "def within_valid_coordinates?(coords)\n # piece coords are in the acceptible range\n if (0..2).include?(coords[0]) && (0..2).include?(coords[1])\n true\n else\n # display an error message\n puts \"Piece coordinates are out of bounds\"\n end\n end",
"title": ""
},
{
"docid": "597f5b5089f3f04f18f18a80683263f2",
"score": "0.7976273",
"text": "def valid_coordinates?(x, y)\n (x >= 0 and x <= @plateau_width) and (y >= 0 and y <= @plateau_height)\n end",
"title": ""
},
{
"docid": "f6fe0cfdd79fbd4177859656c6969aae",
"score": "0.79608625",
"text": "def valid_coordinate?(x,y)\n true\n end",
"title": ""
},
{
"docid": "75e1de731407bdd8e31b4460e63b8013",
"score": "0.7932216",
"text": "def valid?\n return false if @x_coordinate.negative? || @y_coordinate.negative?\n\n true\n end",
"title": ""
},
{
"docid": "0fd63eeef416ed2a50a803071d73334d",
"score": "0.7868746",
"text": "def valid_coord?(coord)\n (0...@height).to_a.include?(coord[0]) && (0...@width).to_a.include?(coord[1])\n end",
"title": ""
},
{
"docid": "e0706efb8f10518775155e48712fcbf4",
"score": "0.7855993",
"text": "def valid_coord?(coord)\n return false unless coord.all? { |x| x.between?(0, 7) }\n unless @board[coord].nil? #if square at coord not empty\n piece_at_coord = @board[coord]\n return false if self.color == piece_at_coord.color\n end\n true\n end",
"title": ""
},
{
"docid": "82a1255beca1e476dfdae13d42544699",
"score": "0.78471166",
"text": "def check_if_coordinates_are_valid(from_row, from_column, to_row, to_column)\n\t\t\treturn ([from_row, from_column, to_row, to_column].none? { |i| i == false}) ? true : false\n\t\tend",
"title": ""
},
{
"docid": "9327401d662f81bf13d866ac2d95f9e7",
"score": "0.77995515",
"text": "def is_valid_coordinates?(x, y)\n x = x.to_i\n y = y.to_i\n !x.negative? && x < row && !y.negative? && y < column\n end",
"title": ""
},
{
"docid": "1691159565947a5d0ad411d839245442",
"score": "0.7673109",
"text": "def valid_coordinates?(x, y)\n x >= 0 && y >= 0 && y < height && x < width\n end",
"title": ""
},
{
"docid": "58d41af79404c407140b48c79e95cc70",
"score": "0.7630388",
"text": "def valid_coord?(row, col)\n (0...3).include?(row) && (0...3).include?(col)\n end",
"title": ""
},
{
"docid": "a51b873a00000fca70590fd0cba62e2d",
"score": "0.76012397",
"text": "def is_valid_coordinates?(row, col)\n (0...ChessBoardConstants::BOARD_DIMENSIONS).cover?(row) and\n (0...ChessBoardConstants::BOARD_DIMENSIONS).cover?(col)\n end",
"title": ""
},
{
"docid": "cf533cfd37f3e36abaaefe67698e8993",
"score": "0.7579312",
"text": "def isValid?(newx,newy)\n not @map.solid?(@x+newx, @y+newy) and\n not @map.solid?(@x+newx+8, @y+newy) and\n not @map.solid?(@x+newx, @y+newy+8) and\n not @map.solid?(@x+newx+8, @y+newy+8)\n end",
"title": ""
},
{
"docid": "44b1d066cbe52e4a4cf86de942dd7e47",
"score": "0.75033015",
"text": "def valid_coords?(x, y)\n is_valid = Integer(x) && Integer(y) rescue false\n is_valid\n end",
"title": ""
},
{
"docid": "43d448a11ffb84331299d75e6a92e7a2",
"score": "0.7500458",
"text": "def coord_valid?(lat, lon, elevation, time)\n return true if lat and lon\n return false\n end",
"title": ""
},
{
"docid": "0d4340c25f1d9dd4a9b9af2a30505eb3",
"score": "0.74861634",
"text": "def valid_coordinate?(coordinates)\n @cells.include?(coordinates)\n end",
"title": ""
},
{
"docid": "a44ca8185b4aaaf8d578d771f0678f55",
"score": "0.74730563",
"text": "def coordinates_are_valid?(x, y)\n 0 <= x && x <= @max_x && 0 <= y && y <= @max_y\n end",
"title": ""
},
{
"docid": "9a452bb787b534699d1e620afac06157",
"score": "0.7443635",
"text": "def valid_coords(field, line, column)\n (0..field.size-1) === line && (0..field[line].size-1) === column\n end",
"title": ""
},
{
"docid": "f080815660bdd1b71b89ddc01f25ab1d",
"score": "0.74346703",
"text": "def coordinate_valid?(x, y)\n @table.is_valid_coordinates?(x, y)\n end",
"title": ""
},
{
"docid": "5d1685cb16eef6c095784f22fc667a02",
"score": "0.7395389",
"text": "def has_coordinates?\n !coordinates.blank? && coordinates.length == 2\n end",
"title": ""
},
{
"docid": "960f77ceadf0568f8ae546cd9540d6af",
"score": "0.738677",
"text": "def valid_coord?(x, y)\n x >= 0 && x < @table.width && y >= 0 && y< @table.width\n end",
"title": ""
},
{
"docid": "038bfa2f3ca4b2e1e7b9f95c67db67ae",
"score": "0.7349532",
"text": "def valid_location?(xcoord, ycoord)\n if xcoord.between?(0,@cols - 1) and ycoord.between?(0, @rows - 1)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "a4e259869fff061b904ed8d4aa61e734",
"score": "0.7348922",
"text": "def isValid?(newx,newy)\n not @map.solid?(@x+newx, @y+newy)\n end",
"title": ""
},
{
"docid": "595bd8ea6f0af80dd211bb588114c750",
"score": "0.73389393",
"text": "def coordinates_valid?(@coordinates)\n #still need to set conditions for validation to be true.\n\n #for 2-unit shit\n if true\n @user_ship_1.set_coordinates(@coordinates)\n else\n #need to kick back to BoardGame with out Board knowing about BoardGame\n @Messages.error_ship_location_is_invalid\n coordinates_match\n end\n\n #for 3-unit ship\n if true\n @user_ship_2.set_coordinates(@coordinates)\n else\n #need to kick back to BoardGame with out Board knowing about BoardGame\n @Messages.error_ship_location_is_invalid\n coordinates_match\n #place_your_3_unit_ship\n end\n end",
"title": ""
},
{
"docid": "9005f797b1cbe6a87bf69e6fa66ae95f",
"score": "0.7332533",
"text": "def valid?\n return x >= 0 && y >= 0 && x < BOARD_WIDTH && y < BOARD_WIDTH\n end",
"title": ""
},
{
"docid": "bb3d8dd706e5902e8534a1e8195149e3",
"score": "0.7323277",
"text": "def validate_coordinates\n return if coordinates.present?\n\n errors.add(:coordinates, :bad_format)\n end",
"title": ""
},
{
"docid": "3cece09f7fba89738f5bb06cee7c176a",
"score": "0.73228514",
"text": "def is_valid_coordinates? x, y\n # check x coordinate\n if x.nil? or x.class != Fixnum or x < 0 or x >= board_size\n puts \"Invalid x coordinate specified: #{x}\"\n return false\n end\n\n # check y coordinate\n if y.nil? or y.class != Fixnum or y < 0 or y >= board_size\n puts \"Invalid y coordinate specified: #{y}\"\n return false\n end\n\n return true\n end",
"title": ""
},
{
"docid": "364fb613ac028bce82fb473d37fefe24",
"score": "0.72127503",
"text": "def check_coords(ship)\n if !(ship.combined_coords & @filled_coords).empty?\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "c413a02fe20592ae618e4351aba820ed",
"score": "0.7198999",
"text": "def check_invalid_coordinates( status )\n\t\tabort( \"ERROR: Invalid coordinates in #{status}\" ) unless( self.total_atom_num() == @atom_crd.length )\n\tend",
"title": ""
},
{
"docid": "dc3432061e28c9b0df4d8aee8731c46b",
"score": "0.7197652",
"text": "def valid_loc?(point)\n return true if point[0].between?(0, @board_size - 1) && point[1].between?(0, @board_size - 1)\n false\n end",
"title": ""
},
{
"docid": "a5961d184fc3840274501d9eca59090a",
"score": "0.717486",
"text": "def valid_location?(x, y)\n (0...@length).include?(x) &&\n (0...@width).include?(y)\n end",
"title": ""
},
{
"docid": "c9250b9421e8ae01ba8b0de953188f83",
"score": "0.71721774",
"text": "def valid_coordinate?(coord)\n @cells.key?(coord)\n end",
"title": ""
},
{
"docid": "894d2f7ffccd7e7fe7cf5a56bc24c9e5",
"score": "0.71507597",
"text": "def valid_coordinate?(coordinate)\n @cells.include? coordinate\n end",
"title": ""
},
{
"docid": "72585e0dd9aaca2121c007ab69e7d5e7",
"score": "0.71475804",
"text": "def can_be_set?\n return false if @posx < 0 || @posy < 0\n @piece.each_with_index do |row, x|\n row.each_with_index do |val, y|\n return false if @posx + x > Const::PNR_VER - 1 ||\n @posy + y > Const::PNR_HOR - 1\n return false if @board[@posx + x][@posy + y] > 0 && val > 0\n end\n end\n true\n end",
"title": ""
},
{
"docid": "6b385e585fc16d0dcc60e7a7d6e24f6b",
"score": "0.711306",
"text": "def is_valid?(position)\n\t (position[:x] < 0 || position[:y] < 0 || position[:x] >= @rows || position[:y] >= @cols) ? false : true\n end",
"title": ""
},
{
"docid": "5ac2589057d88039dc7a4056507aa385",
"score": "0.711115",
"text": "def placement_is_valid?(x, y, direction)\n coordinates_are_valid?(x, y) and direction_is_valid?(direction)\n end",
"title": ""
},
{
"docid": "dc757c01b7e0fb040c75d06344b72d95",
"score": "0.71031266",
"text": "def invalid_place_numbers?\n unless arguments[:x].nil?\n @arguments[:x] = nil if arguments[:x] < 0\n end\n unless arguments[:y].nil?\n @arguments[:y] = nil if arguments[:y] < 0\n end\n [arguments[:x], arguments[:y]].include? nil\n end",
"title": ""
},
{
"docid": "74d00f266913fe12d4b606b3a723c368",
"score": "0.7096014",
"text": "def valid_position?(point)\n row, col = point\n\n return false unless row\n return false unless col\n return false if row < 0 || row >= rows.length\n return false if col < 0 || col >= columns.length\n\n # should be good enough\n true\n end",
"title": ""
},
{
"docid": "083ef8aace969293aee7c0996f7b3031",
"score": "0.708758",
"text": "def valid?(whereabouts)\n @width >= whereabouts.x and @height >= whereabouts.y\n end",
"title": ""
},
{
"docid": "d7fc1cc83bc347c4772546ad5246a13e",
"score": "0.7066727",
"text": "def position_valid?(x, y)\n [x, y].each do |a|\n return false unless a.is_a?(Integer) && a >= 0 && a <= 2\n end\n return true\n end",
"title": ""
},
{
"docid": "484452312182a45117e4890bbd36bfb7",
"score": "0.7061532",
"text": "def self_valid?(x, y)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # checks if coordinates are valid\n return (x >= 0 && x < width*pix-pix+1 && y >= 0 && y < height*pix-pix+1)\n end",
"title": ""
},
{
"docid": "484452312182a45117e4890bbd36bfb7",
"score": "0.7061532",
"text": "def self_valid?(x, y)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # checks if coordinates are valid\n return (x >= 0 && x < width*pix-pix+1 && y >= 0 && y < height*pix-pix+1)\n end",
"title": ""
},
{
"docid": "178c4f160298c838d401fc6bba9d66ab",
"score": "0.7055547",
"text": "def valid_place?(coords)\n if coords[0].to_i.to_s == coords[0] && coords[1].to_i.to_s == coords[1] && robot.compass.member?(coords[2])\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "0bb33ea0b7ee3584b368ab71ec075fad",
"score": "0.7050473",
"text": "def valid?(x,y)\n x > 0 || x < 8 || y > 0 || y < 8\n end",
"title": ""
},
{
"docid": "248a1a117d5a4278568873e14b9ca48e",
"score": "0.7032141",
"text": "def valid_coordinate?(coordinate)\n WIDTH_LIMITS.include?(coordinate.x) && HEIGHT_LIMITS.include?(coordinate.y)\n end",
"title": ""
},
{
"docid": "4128b480fd1a2d818d3909badd6b1323",
"score": "0.70255905",
"text": "def is_valid_position?\n @object_array.each_with_index do |row, y|\n row.each_with_index do |cell, x|\n # Next if:\n # - The cell of the game piece array is 0 (not part of the 'physical' piece)\n # - The cell of the game piece array is 'above' the first row of the tetris board array\n next if cell.zero? || (position_y + y).negative?\n\n # Check if:\n # - Part of the game piece is 'lower' that the bottom of the board\n # - Part of the game piece is outside of the left or right bounds of the tetris board array\n # - Part of the game piece is overlapping another landed piece on the tetris game board\n if position_y + y >= @board.length ||\n (@position[:x] + x).negative? || @position[:x] + x >= @board[0].length ||\n !@board[position_y + y][@position[:x] + x].zero?\n return false\n end\n end\n end\n true\n end",
"title": ""
},
{
"docid": "b79410a8e2f4a17f3899c86f4314259e",
"score": "0.70248514",
"text": "def test_cell_has_valid_coordinates\n assert_equal true, @board.valid_coordinate?(\"A1\")\n assert_equal true, @board.valid_coordinate?(\"D4\")\n assert_equal false, @board.valid_coordinate?(\"A5\")\n assert_equal false, @board.valid_coordinate?(\"E1\")\n assert_equal false, @board.valid_coordinate?(\"A22\")\n end",
"title": ""
},
{
"docid": "07122841f9a9f34081f4e15607687c66",
"score": "0.7004873",
"text": "def valid?\n @points.count > 0\n end",
"title": ""
},
{
"docid": "fe3d66d51d788044ebfb79d27f68508d",
"score": "0.69982594",
"text": "def valid_coord?(player_coord)\n if (player_coord.size == 2) && (player_coord.is_a?(Array))\n true\n else\n puts \"Please follow the format when entering your coordinates!\"\n end\n end",
"title": ""
},
{
"docid": "9bd2d459af6e11e7822cb17fbfcac41d",
"score": "0.6996302",
"text": "def check_coordinates\n grid.instance_variables.each do |coord|\n coordinate = grid.instance_variable_get(coord)\n check_grid_lines(coordinate)\n end\n end",
"title": ""
},
{
"docid": "2cfb1cf51669adaa3e170344ff0256eb",
"score": "0.6992507",
"text": "def valid_position?(x, y)\n x >= 0 && x <= (@rows -1) && y >= 0 && y <= (@columns -1)\n end",
"title": ""
},
{
"docid": "771a6c59e5743c05601ac2eb9e7b1ced",
"score": "0.69885916",
"text": "def find_valid_coordinate\n coordinates = nil\n while coordinates.nil?\n c = [\n SecureRandom.random_number(0..@config[:grid] - 1),\n SecureRandom.random_number(0..@config[:grid] - 1)\n ]\n coordinates = @game_context.eval(\"validate_coordinates('#{c.join(\",\")}')\")\n end\n coordinates\n end",
"title": ""
},
{
"docid": "97e381607e8f28717e2c97f76c7910f1",
"score": "0.6988254",
"text": "def valid_position?(position)\n return false if position.length != 2\n\n position.all? { |coordinate| coordinate >= 0 && coordinate <= 7 }\n end",
"title": ""
},
{
"docid": "4be3119380d0c830fc6798d789635eb6",
"score": "0.6987244",
"text": "def valid?(coords)\r\n case \r\n when coords[0].between?(1,8) == false || coords[1].between?(1,8) == false\r\n return false\r\n when coords == self.parent\r\n return false\r\n else\r\n return true\r\n end\r\n end",
"title": ""
},
{
"docid": "3b55af72efed32ea9f7786b50edab460",
"score": "0.69861245",
"text": "def valid_placement?(x, y, length, direction)\n coordinates = get_coordinates(x, y, length, direction)\n return false if !coordinates\n coordinates.each do |coordinate|\n return false if battle_grid[coordinate[0]][coordinate[1]] != WATER\n end\n true\n end",
"title": ""
},
{
"docid": "3e04e4c747d25170b7e76d5bf33d4ec0",
"score": "0.6985719",
"text": "def valid_move?(x,y)\n if self.game.square_occupied?(x,y)\n self.white? != self.game.find_piece(x,y).white?\n elsif x < 0 || x > 7 || y < 0 || y > 7\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "6ec6e6e1ce2936c6345555c2e80079c0",
"score": "0.69732386",
"text": "def check_point_bounds\n # raise Error.new if false\n end",
"title": ""
},
{
"docid": "d3233379b23b0af92d5e0a3b4d27deba",
"score": "0.6949141",
"text": "def valid?\n validate_top_coordinates\n validate_starting_position\n validate_instructions\n\n self.errors.empty?\n end",
"title": ""
},
{
"docid": "03f9b49bcffa2a9ef79255e2b6b89a94",
"score": "0.69446224",
"text": "def valid_coordinate?(x, y)\n return false if !x.is_a?(Integer) || !y.is_a?(Integer) # invalid type\n return false if x < 0 || y < 0 || x > max_index || y > max_index # range\n true\n end",
"title": ""
},
{
"docid": "c949ec675235db607466b433561c7c59",
"score": "0.6931379",
"text": "def is_coords?\n (get_coords rescue false) ? true : false\n end",
"title": ""
},
{
"docid": "6bbc836a1e4af63d0f8dc877118c6022",
"score": "0.69297373",
"text": "def contains_only_valid_coordinates(answer, max_y, max_x)\n for i in 0...answer.length\n current_pair = answer[i]\n \n # check type\n if current_pair == nil or !current_pair.kind_of?(Array) or current_pair.length!=2\n # puts \"Error: This coordinate pair is invalid :\" + current_pair.to_s\n return false\n end\n \n # check 1st number (y)\n if !current_pair[0].kind_of?(Integer) or current_pair[0]<0 or current_pair[0]>max_y\n # puts \"Error: This coordinate pair is invalid because of the 1st value (y) :\" + current_pair.inspect\n return false\n end\n \n # check 2nd number (x)\n if !current_pair[1].kind_of?(Integer) or current_pair[1]<0 or current_pair[1]>max_x\n # puts \"Error: This coordinate pair is invalid because of the 2nd value (x) :\" + current_pair.inspect \n return false\n end \n end\n return true # all OK\nend",
"title": ""
},
{
"docid": "2cbae558f791ebcb2f6510cb4487176b",
"score": "0.6927495",
"text": "def position_is_valid?(position)\n position.x_coord < @length &&\n position.y_coord < @width &&\n position.x_coord >= 0 &&\n position.y_coord >= 0\n end",
"title": ""
},
{
"docid": "561e57f80aedb0fd5e25dd09c26afb7a",
"score": "0.69228107",
"text": "def add_piece(coordinates,piece)\n\n # piece_location_valid?\n # Is the placement within_valid_coordinates?\n # Are the piece coordinates_available?\n if coordinates[0] < 0 || coordinates[0] > 2 || coordinates[1]<0 || coordinates[1]>2\n puts \"Those are not valid coordinates, which must be a pair, each from 0 to 2.\" \n return false\n end\n if @board[coordinates[1]][coordinates[0]] != \" \"\n puts \"That spot is taken.\"\n return false\n end\n @board[coordinates[1]][coordinates[0]]=piece\n true\n end",
"title": ""
},
{
"docid": "0dd9de0dd9d24b5a4f00e790b7799d38",
"score": "0.69227815",
"text": "def valid_coordinates?(ship, start_position, orientation)\n\t\tif orientation == :horizontal\n\t\t\t(start_position[:column] + ship.length) <= BOARD_DIM\n\t\telse\n\t\t\t(start_position[:row] + ship.length) <= BOARD_DIM\n\t\tend\n\tend",
"title": ""
},
{
"docid": "63be436f29fa19ee8591afbf61d703ce",
"score": "0.69112754",
"text": "def coordinates\n fail\n end",
"title": ""
},
{
"docid": "58106ca0f9d54344a1baf6f8283bbdb9",
"score": "0.6903209",
"text": "def valid?(x, y)\n x >= 0 && y >= 0 && x < width && y < height\n end",
"title": ""
},
{
"docid": "168c4b33b172f225af9a3c32a3bb6763",
"score": "0.6893889",
"text": "def valid_x_coord(coord)\n valid_coord coord, @most\n end",
"title": ""
},
{
"docid": "04aa3fad29f0b12d56a92fcb35dc9c8a",
"score": "0.68852776",
"text": "def valid?\n lower_left_point.x < upper_right_point.x && lower_left_point.y < upper_right_point.y\n end",
"title": ""
},
{
"docid": "1ad62b7d273c59c59afc3f5196c5c3e5",
"score": "0.6885053",
"text": "def validate_position(position)\n return false unless position.is_a?(Position) && !position.nil?\n\n position.x <= @x_size &&\n position.y <= @y_size &&\n position.x >= 0 &&\n position.y >= 0\n end",
"title": ""
},
{
"docid": "7e29c6def25aa50f0ec71eb1e55fecf5",
"score": "0.68781173",
"text": "def coordinates_present?(*args); end",
"title": ""
},
{
"docid": "14f39f4194a8135fd0e1941909721e5c",
"score": "0.6876927",
"text": "def pos_filled?(x, y, _game_id = game.id)\n Piece.where(x_coord: x, y_coord: y, captured: false, game: game.id).any?\n end",
"title": ""
},
{
"docid": "26fd134eb14f5f8c2d76ccd6168f227b",
"score": "0.6870876",
"text": "def valid_point?\n if /; /.match(self)\n point = self.split(/; /)\n x = point[0]\n y = point[1]\n /; /.match(self) && x.is_integer? && y.is_integer?\n else\n false\n end\n end",
"title": ""
},
{
"docid": "16c506f294dc44678db3498a470a87a1",
"score": "0.6866782",
"text": "def legal(coords)\n coords_x = coords[0]\n coords_y = coords[1]\n # legal if piece remains in same row or column \n if @row == coords_x || @column == coords_y\n attack_or_move(coords)\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "e98183170d429587901cf30b0e9d0b40",
"score": "0.68652266",
"text": "def isMoveValid? x, y\n coord = mkFloat x, y\n if @squares.include?(coord) && !@inventory.include?(coord) then\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "410de5c09555c130a98cfb74745fe803",
"score": "0.68635494",
"text": "def valid?\n return @xyPairs.length > 0\n end",
"title": ""
},
{
"docid": "b143ca3c3c32444a9f3c1225bcb312ab",
"score": "0.6861382",
"text": "def validate_coordinates(x1, x2, y1, y2, pixels)\n if (pixels.length > y1 && pixels.length > y2 && pixels[0].length > x1 && pixels[0].length > x2)\n true\n else\n puts \"Entered coordinates are exceeding image size\" \n false\n end\n end",
"title": ""
},
{
"docid": "3ec20133644b00e1834b6b6c0026577f",
"score": "0.68604606",
"text": "def valid_coord(coord, upper)\n (coord >= 0 && coord < upper)\n end",
"title": ""
},
{
"docid": "efa89f0d5e578c9b728b1c9808756aa9",
"score": "0.6855423",
"text": "def valid?(x, y)\n return ((x >= 0) && (x < width) && (y >= 0) && (y < height))\n end",
"title": ""
},
{
"docid": "8a3374f1a545047253eb12bcbd9d62fa",
"score": "0.6855342",
"text": "def valid_move?(coords)\n return false unless coords.is_a?(Hash)\n return false unless (0..(@width - 1)).include?(coords[:x])\n return false unless (0..(@height - 1)).include?(coords[:y])\n\n return true\n end",
"title": ""
},
{
"docid": "becd2955d3fb69600079d00c232e8e02",
"score": "0.6846229",
"text": "def validate_piece(initial_position, colour)\n pos_as_str = \"#{initial_position[0]},#{initial_position[1]}\"\n # if the board hash is not initialized at pos_as_str then it returns nil\n return @board_hash[pos_as_str] == colour\n end",
"title": ""
},
{
"docid": "711b2a8b5911a2118d974e89add963cd",
"score": "0.68395364",
"text": "def is_valid?(x, y)\n unless (is_number?(x) and is_number?(y))\n return false\n end\n return ((x >= 0 and x < @size_x) and (y >= 0 and y < @size_y))\n end",
"title": ""
},
{
"docid": "83ca2627b8d282b8eccdfba522ee7a7d",
"score": "0.6838726",
"text": "def square_occupied?(x, y)\n !fetch_piece(x, y).nil?\n end",
"title": ""
},
{
"docid": "a3522d375bcc85acb07ff1cc17e080e0",
"score": "0.68275744",
"text": "def valid_location?(c=[1,1])\n c[0] >= 0 && c[1] >= 0 && c[0] < BOARD_SIZE[0] && c[1] < BOARD_SIZE[1]\n end",
"title": ""
},
{
"docid": "8a9368fc36cffa2c5e681a387d35a73a",
"score": "0.68221134",
"text": "def valid_position?(x,y)\n\t\treturn x >= @min_x && x < @max_x && y >= @min_y && y < @max_y\n\tend",
"title": ""
},
{
"docid": "46a4db81dff507edce3a780d3283b727",
"score": "0.6814483",
"text": "def valid_distance?\n distance = (@to[:x] - @piece.x).abs + (@to[:y] - @piece.y).abs\n\n distance <= piece.speed\n end",
"title": ""
},
{
"docid": "491f666b7ecb78f092fa6fea8a0a4725",
"score": "0.68105245",
"text": "def valid?(position)\n row, col = position\n (row >= 0 && row < @grid.length) && (col >= 0 && col < @grid[0].length)\n end",
"title": ""
},
{
"docid": "e05f9cfc5ddbbeae267016c97fa6c70e",
"score": "0.6804071",
"text": "def valid_position?(point_x,point_y)\n unless point_x >= 0 && point_x < @size && point_y >= 0 && point_y < @size\n @error_msg = \"Invalid position #{point_x}, #{point_y}\"\n return false\n end\n\n @error_msg = nil\n true\n end",
"title": ""
},
{
"docid": "f7aa3111faaf08c0120cbf375e0a7827",
"score": "0.68039894",
"text": "def has_coordinates?\n \t!lat.blank? && !lng.blank?\n end",
"title": ""
},
{
"docid": "d39b8e8cce705372e601725071b35c59",
"score": "0.68020713",
"text": "def valid?(x, y)\n return (x >= 0 and x < width and y >= 0 and y < height)\n end",
"title": ""
},
{
"docid": "d39b8e8cce705372e601725071b35c59",
"score": "0.68020713",
"text": "def valid?(x, y)\n return (x >= 0 and x < width and y >= 0 and y < height)\n end",
"title": ""
},
{
"docid": "d39b8e8cce705372e601725071b35c59",
"score": "0.68020713",
"text": "def valid?(x, y)\n return (x >= 0 and x < width and y >= 0 and y < height)\n end",
"title": ""
},
{
"docid": "47e4e8207340bee3d0b8634b0d0e0d77",
"score": "0.67862266",
"text": "def check_if_valid(posn)\n posn[0].between?(0, @width - 1) && posn[1].between?(0, @height - 1)\n end",
"title": ""
},
{
"docid": "47e4e8207340bee3d0b8634b0d0e0d77",
"score": "0.67862266",
"text": "def check_if_valid(posn)\n posn[0].between?(0, @width - 1) && posn[1].between?(0, @height - 1)\n end",
"title": ""
},
{
"docid": "9eeeaf50cdd47bba2e1bc15e48dd57ca",
"score": "0.67792577",
"text": "def valid?\n return false if @points.nil?\n return false if @points > 999999999999.99\n return false if @points <= 0\n true\n end",
"title": ""
},
{
"docid": "f9cee5a0b28fff4aefc675ccefa75a3d",
"score": "0.67679274",
"text": "def legal?(pos)\n x,y = pos\n x >= 0 && x <= 7 && y >= 0 && y <= 7\n end",
"title": ""
},
{
"docid": "97166f7dcd0eab13faf9caa9290d5447",
"score": "0.67618996",
"text": "def valid?\n up_piece = @pieces.fetch(:up, Piece.without_edges)\n down_piece = @pieces.fetch(:down, Piece.without_edges)\n front_piece = @pieces.fetch(:front, Piece.without_edges)\n back_piece = @pieces.fetch(:back, Piece.without_edges)\n left_piece = @pieces.fetch(:left, Piece.without_edges)\n right_piece = @pieces.fetch(:right, Piece.without_edges)\n\n return false if collision?(down_piece.edge(:left), left_piece.edge(:right))\n return false if collision?(down_piece.edge(:right), right_piece.edge(:left))\n\n return false if collision?(down_piece.edge(:top), back_piece.edge(:bottom))\n return false if collision?(down_piece.edge(:bottom), front_piece.edge(:top))\n\n return false if collision?(right_piece.edge(:right), up_piece.edge(:left))\n return false if collision?(left_piece.edge(:left), up_piece.edge(:right))\n\n return false if collision?(left_piece.edge(:left), up_piece.edge(:right))\n\n return false if collision?(back_piece.edge(:right), right_piece.edge(:top).reverse)\n return false if collision?(back_piece.edge(:top), up_piece.edge(:top).reverse)\n return false if collision?(back_piece.edge(:left), left_piece.edge(:top))\n\n return false if collision?(front_piece.edge(:right), right_piece.edge(:bottom))\n return false if collision?(front_piece.edge(:bottom), up_piece.edge(:bottom).reverse)\n return false if collision?(front_piece.edge(:left), left_piece.edge(:bottom).reverse)\n\n true\n end",
"title": ""
},
{
"docid": "42de2f3a4397ef97789cbbc0cb7d63f6",
"score": "0.6756562",
"text": "def coordinates_out_of_bounds(x, y, rows, columns)\n if x < 0 || x >= rows || y < 0 || y >= columns\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "3574fb553e2fd728a3df62fb8d93845a",
"score": "0.67535967",
"text": "def valid? point, path\n point[:x] < @width && point[:y] < @height && point[:x] >= 0 && point[:y] >= 0 && @matrix[point[:y]][point[:x]] != 0 && !path.include?(point)\nend",
"title": ""
},
{
"docid": "41734bf283f631832546d48b180ee945",
"score": "0.67531204",
"text": "def is_valid_position?(position)\n position.x < length && position.y < width && position.x >= 0 && position.y >= 0\n end",
"title": ""
},
{
"docid": "72aaa31f9342e95e52ca94c461b09deb",
"score": "0.67526937",
"text": "def valid_coordinate?(x, y)\n return false if x < 0 || y < 0\n return false if x >= tile_cache_entry[\"width\"] || y >= tile_cache_entry[\"height\"]\n return true unless tile_cache_entry[\"collision\"]\n return tile_cache_entry[\"collision\"][y * tile_cache_entry[\"width\"] + x] == 0\n end",
"title": ""
}
] |
e1b6dfb177fe6f99a8d4fd6e5d0943f7
|
Set the active property of the controls in the user control SET
|
[
{
"docid": "8173f0c6294b45e2fc13334fc0988881",
"score": "0.60773736",
"text": "def active=(active)\n @active = active\n @ucActStates.active = active\n @ucHpStat.active = active\n @cHpStatGauge.active = active\n @ucMpStat.active = active\n @cMpStatGauge.active = active\n @ucAtkStat.active = active\n @ucDefStat.active = active\n @ucSpiStat.active = active\n @ucAgiStat.active = active\n @ucEvaStat.active = active\n @ucHitStat.active = active\n @ucCriStat.active = active\n end",
"title": ""
}
] |
[
{
"docid": "147a00e9bc5c59c6309771a5f739c1a5",
"score": "0.84628284",
"text": "def active=(active)\n @active = active\n for i in 0 .. @ucControls.size-1\n @ucControls[i].active = active\n end\n end",
"title": ""
},
{
"docid": "9b072a668c795103d9df3c61e92c62c8",
"score": "0.72865105",
"text": "def active=(active)\n @active = active\n @cLabel.active = active\n @ucIcon.active = active\n end",
"title": ""
},
{
"docid": "9b072a668c795103d9df3c61e92c62c8",
"score": "0.72865105",
"text": "def active=(active)\n @active = active\n @cLabel.active = active\n @ucIcon.active = active\n end",
"title": ""
},
{
"docid": "e7720cfa199a7561097af277554e3c2a",
"score": "0.72257847",
"text": "def active=(active)\n @active = active\n @cLabel.active = active\n for i in 0 .. @ucIcons.size-1\n @ucIcons[i].active = active\n end\n end",
"title": ""
},
{
"docid": "e7720cfa199a7561097af277554e3c2a",
"score": "0.72257847",
"text": "def active=(active)\n @active = active\n @cLabel.active = active\n for i in 0 .. @ucIcons.size-1\n @ucIcons[i].active = active\n end\n end",
"title": ""
},
{
"docid": "33738030b9b0964b0e3f523fa7055ea0",
"score": "0.71631736",
"text": "def active=(active)\n @active = active\n @cLabel.active = active\n @ucIcon.active = active\n @cValue.active = active\n end",
"title": ""
},
{
"docid": "33738030b9b0964b0e3f523fa7055ea0",
"score": "0.71631736",
"text": "def active=(active)\n @active = active\n @cLabel.active = active\n @ucIcon.active = active\n @cValue.active = active\n end",
"title": ""
},
{
"docid": "81644334c74bdcd1d622a5ec75cd5f26",
"score": "0.71216893",
"text": "def set_control_enabled(control, visible, active)\n control.active = active\n control.visible = visible\n end",
"title": ""
},
{
"docid": "81644334c74bdcd1d622a5ec75cd5f26",
"score": "0.71216893",
"text": "def set_control_enabled(control, visible, active)\n control.active = active\n control.visible = visible\n end",
"title": ""
},
{
"docid": "8c1493097ae7b06c67db37d8f7f79fd3",
"score": "0.71081156",
"text": "def active=(active)\n @active = active\n @cLabel.active = active\n super\n end",
"title": ""
},
{
"docid": "8c1493097ae7b06c67db37d8f7f79fd3",
"score": "0.71081156",
"text": "def active=(active)\n @active = active\n @cLabel.active = active\n super\n end",
"title": ""
},
{
"docid": "396f3b18d0ec7334624ffb7f4ba4a3b8",
"score": "0.7077465",
"text": "def active=(active)\n @active = active\n @cBackground.active = active if @cBackground != nil\n @cBorders.active = active if @cBorders != nil\n if @cTriangles != nil\n for triangle in @cTriangles\n triangle.active = active\n end\n end\n if @ucLabelIcons != nil\n for lblIcon in @ucLabelIcons\n lblIcon.active = active\n end\n end\n end",
"title": ""
},
{
"docid": "396f3b18d0ec7334624ffb7f4ba4a3b8",
"score": "0.7077465",
"text": "def active=(active)\n @active = active\n @cBackground.active = active if @cBackground != nil\n @cBorders.active = active if @cBorders != nil\n if @cTriangles != nil\n for triangle in @cTriangles\n triangle.active = active\n end\n end\n if @ucLabelIcons != nil\n for lblIcon in @ucLabelIcons\n lblIcon.active = active\n end\n end\n end",
"title": ""
},
{
"docid": "df24cfd7dbab525df7cf3d599042e72f",
"score": "0.69938886",
"text": "def active=(active)\n @active = active\n @cLabel.active = active\n @cValue.active = active\n end",
"title": ""
},
{
"docid": "abce3eaf56cbd6f56fcbd38137008005",
"score": "0.6859249",
"text": "def active=(value)\n self.old_active = value\n if value\n @@activ_window = self\n elsif @@activ_window == self\n @@activ_window = nil\n @@current_butten = nil\n end\n end",
"title": ""
},
{
"docid": "6dd534b61bece62bc082d30f456dc2b4",
"score": "0.68003386",
"text": "def active=(active)\n @active = active\n @cImage.active = active\n @cBorders.active = active\n end",
"title": ""
},
{
"docid": "b3a3c6e23d7426483a9504505a56909b",
"score": "0.67025894",
"text": "def active=(active)\n @active = active\n @ucIcon.active = active\n @cItemName.active = active\n @cItemNumber.active = active\n end",
"title": ""
},
{
"docid": "c57dc0da4a664bcd8c5c6b23649085eb",
"score": "0.65784264",
"text": "def active=(active)\n @active = active\n @cCharGraphic.active = active\n end",
"title": ""
},
{
"docid": "17e4ce21d695f867c8c9b4dd306d9131",
"score": "0.6555134",
"text": "def activate\r\n self.active = true\r\n end",
"title": ""
},
{
"docid": "bfcc7e9264756c49603ed867a3777864",
"score": "0.65519047",
"text": "def active=(active)\n @active = active\n @cRectangle.active = active\n @cFillRectangle.active = active\n if !@cBorder.nil?\n @cBorder.active = active\n end\n end",
"title": ""
},
{
"docid": "bfcc7e9264756c49603ed867a3777864",
"score": "0.65519047",
"text": "def active=(active)\n @active = active\n @cRectangle.active = active\n @cFillRectangle.active = active\n if !@cBorder.nil?\n @cBorder.active = active\n end\n end",
"title": ""
},
{
"docid": "015a9fbaa3fe48aeab991af368ecc90e",
"score": "0.6543067",
"text": "def active=(active)\n @active = active\n @cIcon.active = active\n end",
"title": ""
},
{
"docid": "5532f8e53c25116ff858cb9cab676c16",
"score": "0.6507427",
"text": "def active=(active)\n @active = active\n @ucIcon.active = active\n @cDropName.active = active\n @cDropChances.active = active\n end",
"title": ""
},
{
"docid": "5532f8e53c25116ff858cb9cab676c16",
"score": "0.6507427",
"text": "def active=(active)\n @active = active\n @ucIcon.active = active\n @cDropName.active = active\n @cDropChances.active = active\n end",
"title": ""
},
{
"docid": "0f8f57cea5a8c5df43af15a345c24f8c",
"score": "0.65029323",
"text": "def set_active\n @active = 'counter'\n end",
"title": ""
},
{
"docid": "564c8bbae03de3953db36528c7723385",
"score": "0.6469936",
"text": "def active=(active)\n @active = active\n @cCharName.active = active\n @ucCharFace.active = active\n end",
"title": ""
},
{
"docid": "564c8bbae03de3953db36528c7723385",
"score": "0.6469936",
"text": "def active=(active)\n @active = active\n @cCharName.active = active\n @ucCharFace.active = active\n end",
"title": ""
},
{
"docid": "910870b748833cd5020f0411c9228652",
"score": "0.6467711",
"text": "def active=(active)\n @active = active\n @cLabelNumber.active = active\n end",
"title": ""
},
{
"docid": "d87284760f35341cf47df9644d06f115",
"score": "0.64261156",
"text": "def set_unactive\n self.active = false\n end",
"title": ""
},
{
"docid": "4f24a78281522584464372f9690c10a9",
"score": "0.6399454",
"text": "def active=(active)\n @active = active\n @cCharFace.active = active\n end",
"title": ""
},
{
"docid": "4f24a78281522584464372f9690c10a9",
"score": "0.6399454",
"text": "def active=(active)\n @active = active\n @cCharFace.active = active\n end",
"title": ""
},
{
"docid": "ad5b9820c5795cd47e0b41bc4fd9fe61",
"score": "0.63682646",
"text": "def active=(active)\n @active = active\n @cBattleFormationName.active = active\n @ucCharGraphicsList.each() { |ucCharGraphic| ucCharGraphic.active = active }\n end",
"title": ""
},
{
"docid": "ad5b9820c5795cd47e0b41bc4fd9fe61",
"score": "0.63682646",
"text": "def active=(active)\n @active = active\n @cBattleFormationName.active = active\n @ucCharGraphicsList.each() { |ucCharGraphic| ucCharGraphic.active = active }\n end",
"title": ""
},
{
"docid": "79cbef4223b0664fe07a9dc775708077",
"score": "0.63637483",
"text": "def visible=(visible)\n @visible = visible\n for i in 0 .. @ucControls.size-1\n @ucControls[i].visible = visible\n end\n end",
"title": ""
},
{
"docid": "29dff6cb64f9ea39617d867def8c2845",
"score": "0.6362292",
"text": "def active=(active)\n @active = active\n @ucIcon.active = active\n @cSkillName.active = active\n @cSkillCost.active = active\n end",
"title": ""
},
{
"docid": "6f4d404ca0a16382ebc9dc29078bf31b",
"score": "0.6340859",
"text": "def active=(active)\n @active = active\n @ucActStates.active = active\n @cCharImage.active = active\n @cCharName.active = active\n @ucCharLvl.active = active\n @ucHpStat.active = active\n @cHpStatGauge.active = active\n @ucMpStat.active = active\n @cMpStatGauge.active = active\n @ucExp.active = active\n @cExpGauge.active = active\n end",
"title": ""
},
{
"docid": "f8037a609ce1bf8c882e387a93740e15",
"score": "0.6340682",
"text": "def active=(active)\n @active = active\n @ucIcon.active = active\n @cItemName.active = active\n @cItemPrice.active = active\n @cItemPossess.active = active\n @ucItemNumber.active = active\n end",
"title": ""
},
{
"docid": "ed8dfab1a5d7f3bd03425c3ff135e605",
"score": "0.63309735",
"text": "def active=( value )\n end",
"title": ""
},
{
"docid": "452a256f4d5a116653ab7c4346748b8b",
"score": "0.6323225",
"text": "def active=(active)\n end",
"title": ""
},
{
"docid": "452a256f4d5a116653ab7c4346748b8b",
"score": "0.6323225",
"text": "def active=(active)\n end",
"title": ""
},
{
"docid": "b5374237f1c541d10dd7b0ac6d2d76b4",
"score": "0.6299357",
"text": "def active=(active)\n @active = active\n @ucIcon.active = active\n @cSkillName.active = active\n @cSkillMpCost.active = active\n end",
"title": ""
},
{
"docid": "edef0ae83a36e34aea45d4d016cf707e",
"score": "0.624534",
"text": "def active=(active)\n @active = active\n @cImage.active = active\n end",
"title": ""
},
{
"docid": "72898b3ad6e1cb4d493443d1325af026",
"score": "0.62372667",
"text": "def set_active(script)\n send_command('SETACTIVE', sieve_name(script))\n end",
"title": ""
},
{
"docid": "6e138a1564c8b09fb94ec67eca54bc3d",
"score": "0.62337893",
"text": "def active=(active)\n @active = active\n @ucCharGraphic.active = active\n @ucAtkStat.active = active\n @ucDefStat.active = active\n @ucSpiStat.active = active\n @ucAgiStat.active = active\n @ucEvaStat.active = active\n @ucHitStat.active = active\n @cMsg.active = active\n end",
"title": ""
},
{
"docid": "6e138a1564c8b09fb94ec67eca54bc3d",
"score": "0.62337893",
"text": "def active=(active)\n @active = active\n @ucCharGraphic.active = active\n @ucAtkStat.active = active\n @ucDefStat.active = active\n @ucSpiStat.active = active\n @ucAgiStat.active = active\n @ucEvaStat.active = active\n @ucHitStat.active = active\n @cMsg.active = active\n end",
"title": ""
},
{
"docid": "eb832585cfb61a8b86f470a9be975a4e",
"score": "0.62263125",
"text": "def set_defaults\n self.active = \"t\" if self.active.nil?\n end",
"title": ""
},
{
"docid": "2b6679062b8dc10406648aeef8959756",
"score": "0.62156725",
"text": "def set_players_menu_active\n @players_menu_active = 'class=active' \n end",
"title": ""
},
{
"docid": "88e625dcb3e53cfbd4970d899985b37f",
"score": "0.62098914",
"text": "def set(value)\n parent.click if value != active?\n end",
"title": ""
},
{
"docid": "fe5d756daa7a14fbed7b3d36bed1c08f",
"score": "0.61954087",
"text": "def active=(value)\n @active = value\n end",
"title": ""
},
{
"docid": "fe5d756daa7a14fbed7b3d36bed1c08f",
"score": "0.61954087",
"text": "def active=(value)\n @active = value\n end",
"title": ""
},
{
"docid": "fe5d756daa7a14fbed7b3d36bed1c08f",
"score": "0.61954087",
"text": "def active=(value)\n @active = value\n end",
"title": ""
},
{
"docid": "fe5d756daa7a14fbed7b3d36bed1c08f",
"score": "0.61954087",
"text": "def active=(value)\n @active = value\n end",
"title": ""
},
{
"docid": "fe5d756daa7a14fbed7b3d36bed1c08f",
"score": "0.61950743",
"text": "def active=(value)\n @active = value\n end",
"title": ""
},
{
"docid": "b2423401ef9b3197e62975ab42a82aee",
"score": "0.61949635",
"text": "def active=(active)\n @active = active\n @cEnemyGraphic.active = active\n end",
"title": ""
},
{
"docid": "fe5d756daa7a14fbed7b3d36bed1c08f",
"score": "0.61943305",
"text": "def active=(value)\n @active = value\n end",
"title": ""
},
{
"docid": "fe5d756daa7a14fbed7b3d36bed1c08f",
"score": "0.61943305",
"text": "def active=(value)\n @active = value\n end",
"title": ""
},
{
"docid": "8a3d82ca37c219b34d3946fcaddf4390",
"score": "0.6167789",
"text": "def set_defaults\n self.active = false if self.active.nil?\n end",
"title": ""
},
{
"docid": "00c9ca9162c6d83b739e1b90bc3fb8bb",
"score": "0.6150829",
"text": "def set_defaults\n self.active = self.active.nil? ? true : self.active\n end",
"title": ""
},
{
"docid": "00c9ca9162c6d83b739e1b90bc3fb8bb",
"score": "0.6150829",
"text": "def set_defaults\n self.active = self.active.nil? ? true : self.active\n end",
"title": ""
},
{
"docid": "763b8c26a74f89b398740bd054cfbbad",
"score": "0.6140182",
"text": "def set_batting_menu_active\n @batting_menu_active = 'class=active' \n end",
"title": ""
},
{
"docid": "732ecf3cb56457d681dfa0e2ff36ae6e",
"score": "0.61378205",
"text": "def active=(active)\n @active = active\n @cEquipKind.active = active\n @ucIcon.active = active\n @cEquipName.active = active\n end",
"title": ""
},
{
"docid": "e6cda3c197d8e7467cf85dfe344d506e",
"score": "0.61374134",
"text": "def activeBtnTuto( )\n tmpTabOfBtn = [ @btnSetting , @btnRedo, @btnUndo, @btnUndoUndo, @btnPlay, @btnPause, @btnHelp, @btnHelpLocation , @btnClear, @btnVerif, @btnQuit ];\n for i in 0...tmpTabOfBtn.size\n enableBtn(tmpTabOfBtn[i])\n end\n end",
"title": ""
},
{
"docid": "833b0d8c7fa746e05796166b76675e7a",
"score": "0.6091072",
"text": "def set_actor_controls\n @control_help_window.add_control(Vocab::CONFIRM, Input::Keys::A) \n @control_help_window.add_control(Vocab::BACK, Input::Keys::B)\n end",
"title": ""
},
{
"docid": "6353057c526dfa35fccddd9da7ada8d2",
"score": "0.6085636",
"text": "def activate\n self.update_attribute(:active, 1)\n end",
"title": ""
},
{
"docid": "aa74137f256c3a1c49d6c98f34cb4fe0",
"score": "0.6061554",
"text": "def active=(active)\n @active = active\n @ucIPSkillSrcIcon.active = active\n @cIPSkillSrcName.active = active\n @cIPSkillName.active = active\n @cIPSkillCost.active = active\n end",
"title": ""
},
{
"docid": "aa74137f256c3a1c49d6c98f34cb4fe0",
"score": "0.6061554",
"text": "def active=(active)\n @active = active\n @ucIPSkillSrcIcon.active = active\n @cIPSkillSrcName.active = active\n @cIPSkillName.active = active\n @cIPSkillCost.active = active\n end",
"title": ""
},
{
"docid": "92b16fe242109cce2024f72cadd1f437",
"score": "0.60591847",
"text": "def set_actor_controls\n @control_help_window.add_control(Vocab::CONFIRM, Input::Keys::A)\n @control_help_window.add_control(Vocab::BACK, Input::Keys::B)\n end",
"title": ""
},
{
"docid": "92b16fe242109cce2024f72cadd1f437",
"score": "0.60591847",
"text": "def set_actor_controls\n @control_help_window.add_control(Vocab::CONFIRM, Input::Keys::A)\n @control_help_window.add_control(Vocab::BACK, Input::Keys::B)\n end",
"title": ""
},
{
"docid": "73e7b52ad8f3056d284c90a7253dd23a",
"score": "0.604778",
"text": "def active=(active)\n @active = !!active\n end",
"title": ""
},
{
"docid": "7d7701f9a792aa6be22228ea1eedabb7",
"score": "0.60461104",
"text": "def activate\r\n self.activated=true\r\n end",
"title": ""
},
{
"docid": "8d723a218093288e9a4515ada1e68105",
"score": "0.60183626",
"text": "def controls=(controls)\n @ctrFrames = 0\n @ucControls = []\n if (controls != nil)\n for i in 0 .. controls.size-1\n @ucControls[i] = controls[i]\n @ucControls[i].active = @active\n @ucControls[i].visible = @visible\n end\n end\n end",
"title": ""
},
{
"docid": "5f36b909cb71f40ebfbf6ca23fad5275",
"score": "0.5996809",
"text": "def active=(active)\n @active = active\n @ucEncounters.active = active\n @ucDefeated.active = active\n @ucEscaped.active = active\n @ucExp.active = active\n @ucGold.active = active\n end",
"title": ""
},
{
"docid": "0150a2a3559ec6fc86c4a86127c43e40",
"score": "0.5993462",
"text": "def set_auto_controls\n @control_help_window.add_control(Vocab::TOGGLE, Input::Keys::A, Input::Keys::X)\n @control_help_window.add_control(Vocab::BACK, Input::Keys::B)\n @control_help_window.add_control(Vocab::USE, Input::Keys::Y)\n @control_help_window.add_control(Vocab::CHANGE_ACTOR, Input::Keys::L, Input::Keys::R)\n @control_help_window.add_control(Vocab::DESCRIPTION, Input::Keys::START)\n end",
"title": ""
},
{
"docid": "1992438c5b7f37f104364907045d405b",
"score": "0.5981503",
"text": "def active=(value)\n super\n self.reset_cursor_blinking\n update_cursor\n end",
"title": ""
},
{
"docid": "d504f83f7cf304feb92fc93010d5e950",
"score": "0.5973491",
"text": "def set_controls_help\n @control_help_window.clear\n set_category_controls if @category_window.active\n set_item_controls if @item_window.active\n set_actor_controls if @actor_window.active || @equip_window.active\n @control_help_window.refresh\n end",
"title": ""
},
{
"docid": "0798624f982f32fe8f25941601f93404",
"score": "0.5970969",
"text": "def activate()\n @isActive = true\n end",
"title": ""
},
{
"docid": "1d856ce3f6675c318c16c7f949ed9485",
"score": "0.59579974",
"text": "def users_set_active(params = {})\n response = @session.do_post \"#{SCOPE}.setActive\", params\n Slack.parse_response(response)\n end",
"title": ""
},
{
"docid": "dd78f95900486ac08aeb3d935062eea7",
"score": "0.5939077",
"text": "def active=(active)\n @active = active\n @ucStat.active = active\n @ucCompareStat.active = active\n end",
"title": ""
},
{
"docid": "09238efe8cd99be873d2546993ebd9c6",
"score": "0.5936876",
"text": "def set_controls_help\n @control_help_window.clear\n set_status_controls if @status_window.active\n set_auto_controls if @auto_list_window.active\n set_manual_controls if @manual_list_window.active\n set_slots_controls if @slot_window.active\n set_actor_controls if @actor_window.active\n @control_help_window.refresh\n end",
"title": ""
},
{
"docid": "9e5669c6ad0b6b583895650b6a497b03",
"score": "0.59331095",
"text": "def activate_selected(usage=nil)\n parent.profiles.in_use(usage).each do |term|\n case @inactive\n when :invisible\n term.show!\n when :disabled\n term.enable!\n end\n end\n parent.profiles.out_of_use(usage).each do |term|\n case @inactive\n when :invisible\n term.hide!\n when :disabled\n term.disable!\n end\n end\n end",
"title": ""
},
{
"docid": "c78048bbcc83ed4305011b8b2a95cf78",
"score": "0.59330124",
"text": "def activate\n @active = true\n end",
"title": ""
},
{
"docid": "59da2067e78cb531d5561a8002675186",
"score": "0.59145874",
"text": "def set_active_inner_state\n set_inner_state(\"A\")\n end",
"title": ""
},
{
"docid": "ed99ca84bb714cd30d608d4eaa2bdca6",
"score": "0.59043574",
"text": "def set_Activated(value)\n set_input(\"Activated\", value)\n end",
"title": ""
},
{
"docid": "ad75832d0f99eb116a4317d2a6974b0c",
"score": "0.5894639",
"text": "def switch_active\r\n if self.active\r\n self.deactivate\r\n else\r\n self.activate\r\n end\r\n end",
"title": ""
},
{
"docid": "ad75832d0f99eb116a4317d2a6974b0c",
"score": "0.5894639",
"text": "def switch_active\r\n if self.active\r\n self.deactivate\r\n else\r\n self.activate\r\n end\r\n end",
"title": ""
},
{
"docid": "c4d58d93a5e1312a9faa29bc27e6f4cf",
"score": "0.58875114",
"text": "def make_active\n self.active=true\n self.save!\n end",
"title": ""
},
{
"docid": "c4d58d93a5e1312a9faa29bc27e6f4cf",
"score": "0.58875114",
"text": "def make_active\n self.active=true\n self.save!\n end",
"title": ""
},
{
"docid": "6bebdbfbf951858171e5049dce9241b1",
"score": "0.58856",
"text": "def show()\n self.active = true\n self.visible = true\n end",
"title": ""
},
{
"docid": "6bebdbfbf951858171e5049dce9241b1",
"score": "0.58856",
"text": "def show()\n self.active = true\n self.visible = true\n end",
"title": ""
},
{
"docid": "3d37e79411395c900e48b2baf9f2a9db",
"score": "0.5856552",
"text": "def activate\r\n @parent.activate(self)\r\n @active = true\r\n @onactivate.call unless @onactivate.nil?\r\n end",
"title": ""
},
{
"docid": "18a04dbef766d147bfd7b922dc61f83b",
"score": "0.58342755",
"text": "def make_active\n self.active = true\n self.save!\n end",
"title": ""
},
{
"docid": "21d005b4ec6214c8cdafe89daa30db68",
"score": "0.582438",
"text": "def make_active\n self.active = true\n self.save!\n end",
"title": ""
},
{
"docid": "abc62e6471ffbca2c99d412dca408aa8",
"score": "0.5806416",
"text": "def activate!\n self.update_attribute(:active, true)\n end",
"title": ""
},
{
"docid": "fdcbd34919765576a4b4abbdddd3121f",
"score": "0.58043635",
"text": "def make_active\n self.updating_logo = true\n self.active = true\n end",
"title": ""
},
{
"docid": "c7e90c1340730256bef2760632623dbc",
"score": "0.57970476",
"text": "def make_active\n self.hold = ACTIVE\n end",
"title": ""
},
{
"docid": "2924acd0f2edfefa4358f3e08b1a2263",
"score": "0.5789829",
"text": "def make_active\n self.active = true\n self.save!\n end",
"title": ""
},
{
"docid": "2924acd0f2edfefa4358f3e08b1a2263",
"score": "0.5789829",
"text": "def make_active\n self.active = true\n self.save!\n end",
"title": ""
},
{
"docid": "b53bd249613d7189484e9276ff5cab69",
"score": "0.57307386",
"text": "def toggle\n attribute_set(:active, !active)\n end",
"title": ""
},
{
"docid": "f5b1d8d92bfff21f84c21c017fdfb3e1",
"score": "0.5730462",
"text": "def activate!\n Style.update_all(\"active = #{connection.quoted_false}\", {:active => true})\n self.active = true\n self.save!\n end",
"title": ""
}
] |
7313a4b4800df7311081da9668baa083
|
Allows multiple text fields grabbing autocomplete info from the same place
|
[
{
"docid": "9a524343249afad292f536d3f5c438a5",
"score": "0.6557586",
"text": "def text_field_id_with_auto_complete(object, method, tag_options = {}, completion_options = {}, cont = params[:controller])\n # cont: an embedded form passes in its controller name (e.g. 'forms/admissions/prospect') otherwise the current controller is used\n # set the id and not worry about it throughout\n id = tag_options[:id] || \"#{object}_#{method}\"\n (completion_options[:skip_style] ? \"\" : auto_complete_stylesheet) +\n text_field(id, method, tag_options) +\n content_tag(\"div\", \"\", :id => \"#{id}_auto_complete\", :class => \"auto_complete\") +\n auto_complete_field(id, { :url => {:controller => cont, :action => \"auto_complete_for_#{object}_#{method}\" } }.update(completion_options))\nend",
"title": ""
}
] |
[
{
"docid": "a3ec89ee5750ac1de689fe04eca4386e",
"score": "0.7366341",
"text": "def autocomplete; end",
"title": ""
},
{
"docid": "5f62c78add290c24b65d8205468365fe",
"score": "0.6744672",
"text": "def auto_complete_info(field)\r\n { \"id\" => id, \"label\" => send(field), \"value\" => send(field) }\r\n end",
"title": ""
},
{
"docid": "d5f081221624d7196b0268d359913be8",
"score": "0.6719795",
"text": "def generate_autocomplete\n # we'll martial brand into the autocomplete field since it's\n # natural to search by brand\n s = \"#{ brand } #{ name } #{ model_number }\".squish\n s = s.truncate(45, omission: \"\", separator: \" \") if s.length > 45\n self.autocomplete = self.class.normalize(s)\n end",
"title": ""
},
{
"docid": "61be3e084a390642072134d00d62b7bd",
"score": "0.65222716",
"text": "def ajax_auto_complete\n type = params[:type].to_s\n instr = params[:id].to_s\n letter = ' '\n scientific = false\n user = login_for_ajax\n if user\n scientific = (user.location_format == :scientific)\n end\n @items = []\n if instr.match(/^(\\w)/)\n letter = $1\n case type\n\n when 'location'\n @items = Observation.connection.select_values(%(\n SELECT DISTINCT `where` FROM observations\n WHERE `where` LIKE '#{letter}%' OR\n `where` LIKE '% #{letter}%'\n )) + Location.connection.select_values(%(\n SELECT DISTINCT `name` FROM locations\n WHERE `name` LIKE '#{letter}%' OR\n `name` LIKE '% #{letter}%'\n ))\n if scientific\n @items.map! {|i| Location.reverse_name(i)}\n end\n @items.sort!\n\n when 'name'\n @items = Name.connection.select_values %(\n SELECT text_name FROM names\n WHERE text_name LIKE '#{letter}%'\n AND correct_spelling_id IS NULL\n ORDER BY text_name ASC\n )\n\n when 'name2'\n @items = Name.connection.select_values(%(\n SELECT text_name FROM names\n WHERE text_name LIKE '#{instr}%'\n AND correct_spelling_id IS NULL\n ORDER BY text_name ASC\n )).sort_by {|x| (x.match(' ') ? 'b' : 'a') + x}\n # This sort puts genera and higher on top, everything else on bottom,\n # and sorts alphabetically within each group.\n letter = ''\n\n when 'project'\n @items = Project.connection.select_values %(\n SELECT title FROM projects\n WHERE title LIKE '#{letter}%'\n OR title LIKE '%#{letter}%'\n ORDER BY title ASC\n )\n\n when 'species_list'\n @items = SpeciesList.connection.select_values %(\n SELECT title FROM species_lists\n WHERE title LIKE '#{letter}%'\n OR title LIKE '%#{letter}%'\n ORDER BY title ASC\n )\n\n when 'user'\n @items = User.connection.select_values %(\n SELECT CONCAT(users.login, IF(users.name = \"\", \"\", CONCAT(\" <\", users.name, \">\")))\n FROM users\n WHERE login LIKE '#{letter}%'\n OR name LIKE '#{letter}%'\n OR name LIKE '% #{letter}%'\n ORDER BY login ASC\n )\n end\n end\n\n # Result is the letter requested followed by results, one per line. (It\n # truncates any results that have newlines in them -- that's an error.)\n render(:layout => false, :inline => letter +\n %(<%= @items.uniq.map {|n| h(n.gsub(/[\\r\\n].*/,'')) + \"\\n\"}.join('') %>))\n end",
"title": ""
},
{
"docid": "e2043e07eae13a5e982fc7c51ce3f308",
"score": "0.64795357",
"text": "def auto_complete\n type = params[:type].to_s\n string = CGI.unescape(params[:id].to_s).strip_squeeze\n if string.blank?\n render(text: \"\\n\\n\")\n else\n auto = AutoComplete.subclass(type).new(string, params)\n results = auto.matching_strings.join(\"\\n\") + \"\\n\"\n render(text: results)\n end\n end",
"title": ""
},
{
"docid": "2ecce75e3687e552a97cd9718092be7c",
"score": "0.64167887",
"text": "def generate_autocomplete\n s = self.complete_fields.map{|f| self.send(f)}.join(\" \")\n s = s.truncate(100, omission: \"\", separator: \" \") if s.length > 100\n write_attribute(:autocomplete, Autocomplete.normalize(s))\n write_attribute(:autocomplete_length, Autocomplete.normalize(s).size)\n end",
"title": ""
},
{
"docid": "38fa8722181f5fac5eabe9131176ea30",
"score": "0.63612145",
"text": "def auto_complete_for_keyword_list\n auto_complete_responder_for_keyword params[:keyword][:list]\n end",
"title": ""
},
{
"docid": "a98b77e3678b86ff9dd6097d7ebb8f02",
"score": "0.6345133",
"text": "def fill_auto_complete(field, filter = nil, full_text)\n fill_in field, with: filter unless filter\n\n page.execute_script %Q{ $('##{field}').trigger('focus') }\n page.execute_script %Q{ $('##{field}').trigger('keydown') }\n\n selector = %Q{ul.ui-autocomplete li.ui-menu-item a:contains(\"#{full_text}\")}\n\n sleep 5\n page.execute_script %Q{ $('#{selector}').trigger('mouseenter').click() }\n sleep 5\n end",
"title": ""
},
{
"docid": "302806d1885b3c1b337415b3bfbc37a5",
"score": "0.6338176",
"text": "def autocomplete?\n true\n end",
"title": ""
},
{
"docid": "2e31d28a094fdcb21c87a27e0481ec56",
"score": "0.628792",
"text": "def scaffold_text_field_tag_with_auto_complete(id, klass, tag_options = {})\n ((klass.scaffold_auto_complete_skip_style ? '' : auto_complete_stylesheet) +\n text_field_tag(id, nil, klass.scaffold_auto_complete_text_field_options.merge(tag_options)) +\n content_tag(\"div\", \"\", :id => \"#{id}_scaffold_auto_complete\", :class => \"auto_complete\") +\n scaffold_auto_complete_field(id, { :url => { :action => \"scaffold_auto_complete_for_#{klass.name.underscore}\"} }))\n end",
"title": ""
},
{
"docid": "107f17008dc90a95508fa5e7661e6f30",
"score": "0.6277576",
"text": "def auto_complete_for_user_name\n @users = session[:user].get_available_users(params[:user][:name])\n render inline: \"<%= auto_complete_result @users, 'name' %>\", layout: false\n end",
"title": ""
},
{
"docid": "16d0c1644bad1e4b83b0722817a3a54d",
"score": "0.6262839",
"text": "def auto_complete_field_tag(method, val,tag_options = {}, completion_options = {})\n auto_completer_options = { :url => { :action => \"auto_complete_#{method}\" } }.update(completion_options)\n\n text_field_tag(method, val,tag_options.merge(:class => \"auto_complete_input\")) +\n auto_complete_clear_value_button(method) +\n content_tag(\"div\", \"\", :id => \"#{method}_auto_complete\", :class => \"auto_complete\") +\n auto_complete_field(method, auto_completer_options)\n end",
"title": ""
},
{
"docid": "f1d80ead2cd0958615a5d2ed1bc04050",
"score": "0.6230854",
"text": "def tags_input\n adding_field do |f|\n f.text_field :tags, :value => question.tags.join(\", \"), :class => \"text_field autocomplete_for_tags\"\n end\n end",
"title": ""
},
{
"docid": "3b49acc074415558aa617992aa12ef98",
"score": "0.6215468",
"text": "def search_list_field_enter(value)\n value_arr = value.chomp.split(':')\n text_field = ''\n s_filter = ''\n\n if value_arr.size > 0 # type in the field if filter is provided\n s_filter = value_arr.first\n text_field = @field.all(:css, 'input[type=\"text\"][searchlist=\"True\"]').first[:id]\n else\n control = @field.all(:css, 'i[class$=\"open-search-list\"]').first\n control.click\n end\n\n s_value = value_arr.last\n\n fill_auto_complete(text_field, s_filter, s_value)\n end",
"title": ""
},
{
"docid": "c3f26c3ed4a3e5eecad874e3886524ac",
"score": "0.6205398",
"text": "def autocomplete\r\n# return '' unless session[:edit_mode] > 0 # \r\n return render text: t('drgcms.not_authorized') unless dc_user_can(DcPermission::CAN_VIEW)\r\n# TODO Double check if previous line works as it should.\r\n table = params['table'].classify.constantize\r\n id = [params['id']] || '_id'\r\n# call method in class if search parameter has . This is for user defined searches\r\n# result must be returned as array of [id, search_field_value]\r\n a = if params['search'].match(/\\./)\r\n name, method = params['search'].split('.')\r\n table.send(method, params['input']).inject([]) do |r,v|\r\n r << { label: v[0], value: v[0], id: v[1].to_s }\r\n end\r\n# simply search which will search and return field_name defined in params['search']\r\n else\r\n table.where(params['search'] => /#{params['input']}/i).limit(20).inject([]) do |r,v|\r\n r << { label: v[params['search']], value: v[params['search']], id: v.id.to_s }\r\n end\r\n end\r\n\r\n render inline: a.to_json, formats: 'js'\r\nend",
"title": ""
},
{
"docid": "2e699875ec6d65c9096b7eb234e4b76e",
"score": "0.6202587",
"text": "def auto_complete\n @users = if params[:term] =~ /(@[^\\s]+)\\s.*/\n elsif user_name = params[:term].match(/(@[^\\s]+)/)\n users = User.select('name').where('name LIKE ?', \"%#{user_name[1].to_s[1..-1]}%\")\n\n users.map {|user| {name: \"#@{user.name}\"} }\n end\n render json: @users.to_json\n end",
"title": ""
},
{
"docid": "251d1e02eff4009309cc41fe4214d3d6",
"score": "0.6190824",
"text": "def auto_complete_field_tag_jquery(method, val,tag_options = {}, completion_options = {})\n url = url_for(:action => \"auto_complete_#{method}\")\n options = tag_options.merge(:class => \"auto_complete_input\")\n text_field_tag(method, val, options) + auto_complete_clear_value_button(method) +\n auto_complete_field_jquery(method, url, completion_options)\n end",
"title": ""
},
{
"docid": "145eda53db4a23415b9f0172284d9e79",
"score": "0.61821973",
"text": "def scaffold_text_field_with_auto_complete(object, method, associated_class, tag_options = {})\n klass = associated_class.to_s.camelize.constantize\n foreign_key = instance_variable_get(\"@#{object}\").send(method)\n ((klass.scaffold_auto_complete_skip_style ? '' : auto_complete_stylesheet) +\n text_field(object, method, klass.scaffold_auto_complete_text_field_options.merge({:value=>(foreign_key ? klass.find(foreign_key).scaffold_name_with_id : '')}).merge(tag_options)) +\n content_tag(\"div\", \"\", :id => \"#{object}_#{method}_scaffold_auto_complete\", :class => \"auto_complete\") +\n scaffold_auto_complete_field(\"#{object}_#{method}\", { :url => { :action => \"scaffold_auto_complete_for_#{associated_class}\" } }))\n end",
"title": ""
},
{
"docid": "21d884ba8853e94c25508f50a60d9fa0",
"score": "0.6173444",
"text": "def auto_complete\n @query = params[:term] || ''\n @auto_complete = hook(:auto_complete, self, query: @query, user: current_user)\n if @auto_complete.empty?\n exclude_ids = auto_complete_ids_to_exclude(params[:related])\n @auto_complete = klass.my(current_user).text_search(@query).ransack(id_not_in: exclude_ids).result.limit(10)\n else\n @auto_complete = @auto_complete.last\n end\n\n session[:auto_complete] = controller_name.to_sym\n respond_to do |format|\n format.any(:js, :html) { render partial: 'auto_complete' }\n format.json do\n results = @auto_complete.map do |a|\n {\n id: a.id,\n text: a.respond_to?(:full_name) ? a.full_name : a.name\n }\n end\n render json: {\n results: results\n }\n end\n end\n end",
"title": ""
},
{
"docid": "a563dd305f99a9d7e0e99d25562f9005",
"score": "0.6173041",
"text": "def auto_complete_for_ces\r\n value = params[:term]\r\n field = %w(collectors locality mthd verbatim_method macro_habitat micro_habitat).include?(params[:field]) && params[:field]\r\n\r\n if field && value\r\n @ids = Ce.select(field.downcase).where([ \"ces.proj_id = ? AND LOWER(ces.#{field.downcase}) LIKE (?)\", params[:proj_id], '%' + value.downcase + '%' ])\r\n .group(field.downcase).order(\"#{field.downcase} ASC\").limit(100).map {|v| v.send(field.downcase.to_sym)}\r\n\r\n render :json => Json::simple_autocomplete(@ids)\r\n elsif value\r\n @ces = Ce.find_for_auto_complete(value)\r\n render :json => Json::format_for_autocomplete_with_display_name(:entries => @ces, :method => params[:method])\r\n else\r\n head(:bad_request)\r\n end\r\n end",
"title": ""
},
{
"docid": "7ca5209a7de90890c4b0331ccc7ede32",
"score": "0.6155737",
"text": "def handle_autocomplete\n if (query = request.params['q'].to_s).empty?\n ''\n else\n model.autocomplete(:type=>@subtype, :request=>request, :association=>params_association, :query=>query, :exclude=>request.params['exclude']).join(\"\\n\")\n end\n end",
"title": ""
},
{
"docid": "20ef9f0b95f8b2a485901af5d508cf6d",
"score": "0.6155475",
"text": "def auto_complete_result(entries, field, phrase = nil)\n return unless entries\n render :partial => '/admin/orders/autocomplete', :locals => { :entries => entries, :field => field, :phrase => phrase }\n end",
"title": ""
},
{
"docid": "450f639559d4839b7b2bff928ac4ba93",
"score": "0.6139526",
"text": "def autocomplete(line, namespace)\n raise NotImplementedError, \"autocomplete\"\n end",
"title": ""
},
{
"docid": "a48446e7f39570af977a806dfb9fd90a",
"score": "0.61372185",
"text": "def store_autocomplete_info(key, info)\n if info.respond_to?('map')\n items = info.map{|item| item.to_s.strip}.uniq\n else\n items = info.split(',').map{|item| item.strip}.uniq\n end\n if key == :email\n items.select! {|address| address =~ /\\b[A-Z0-9._%a-z\\-]+@(?:[A-Z0-9a-z\\-]+\\.)+[A-Za-z]{2,4}\\z/}\n end\n if !items.empty?\n User.collection.update({:_id => self.id}, {:$addToSet => {\"as.#{key}\" => {:$each => items}}})\n self.reload\n end\n end",
"title": ""
},
{
"docid": "591b22bb0f1dd38e6c4bfb13723eead0",
"score": "0.61341107",
"text": "def all_autocomplete\n quests = Quest.search(params[:query], where: { :group_id => @user.wrapper_group.id})\n recs = Record.search(params[:query], where: { :group_id => @user.wrapper_group.id})\n render json: Search.json(quests.results + recs.results)\n end",
"title": ""
},
{
"docid": "a498c87bd7c2a9dadc3eaf4311d52dbc",
"score": "0.6117931",
"text": "def ui_auto_complete_field(content = nil, options = nil, html_options = nil, &block)\n UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new(content, options, html_options, &block).render\n end",
"title": ""
},
{
"docid": "e7cf842122666ce14818eb75b4bf3b51",
"score": "0.6106006",
"text": "def autocomplete\n all.to_a\n end",
"title": ""
},
{
"docid": "47f9bb5ae303e9b49e99431b3b74f668",
"score": "0.6064132",
"text": "def auto_complete_for_person_name\n \tname = params[:person][:name].downcase\n \tnames = name.strip.split(' ')\n \t\n find_options = {\n :order => \"last_name, first_name ASC\",\n\t :limit => 10 }\n\n\t\tif names.size > 1\n\t\t\t# there are two names provided\n\t\t\tfind_options[:conditions] = \"LOWER(first_name) LIKE '%#{names[0]}%' AND LOWER(last_name) LIKE '%#{names[1]}%' OR LOWER(first_name) LIKE '%#{names[1]}%' AND LOWER(last_name) LIKE '%#{names[0]}%'\"\n\t\telse\n\t\t\t# only the first name or last name has been provided\n\t\t\tfind_options[:conditions] = \"LOWER(first_name) LIKE '%#{names[0]}%' OR LOWER(last_name) LIKE '%#{names[0]}%'\"\n\t\tend\n\t\n\t\t@items = Person.find(:all, find_options)\n\t\n\t\tRails.logger.info(\"@items.size = #{@items.size}\")\n\n render :inline => \"<%= auto_complete_result @items, 'name' %>\"\n end",
"title": ""
},
{
"docid": "0acdf302fa0e7977a268df72379b53ad",
"score": "0.6049231",
"text": "def generate_autocomplete\n s = self.name\n s = s.truncate(100, omission: \"\", separator: \" \") if s.length > 100\n write_attribute(:autocomplete, Autocomplete.normalize(s))\n write_attribute(:autocomplete_length, Autocomplete.normalize(s).size)\n end",
"title": ""
},
{
"docid": "f302afa5c9aec049cdf05da940faaf53",
"score": "0.6044256",
"text": "def textField(textField, completions:somecompletions, forPartialWordRange:partialWordRange, indexOfSelectedItem:theIndexOfSelectedItem)\n matches = Entry.where(:title).contains(textField.stringValue,NSCaseInsensitivePredicateOption).map(&:title).uniq\n matches\n end",
"title": ""
},
{
"docid": "339da67ff89ef56ed105be8dcb303f3b",
"score": "0.60261846",
"text": "def model_auto_completer(tf_name, tf_value, hf_name, hf_value, options={}, tag_options={}, completion_options={})\n rand_id = Digest::SHA1.hexdigest(Time.now.to_s.split(//).sort_by {rand}.join)\n hf_id = \"model_auto_completer_hf_#{rand_id}\"\n tf_id = \"model_auto_completer_tf_#{rand_id}\"\n options = {\n :regexp_for_id => '(\\d+)$',\n :allow_nil => false,\n :allow_free_text => false,\n :send_on_return => false,\n :controller => controller.controller_name,\n :action => 'auto_complete_model_for_' + tf_name.sub(/\\[/, '_').gsub(/\\[\\]/, '_').gsub(/\\[?\\]$/, ''),\n :after_update_element => 'Prototype.emptyFunction'\n }.merge(options)\n\n tag_options.update({\n :id => tf_id,\n :onfocus => 'this.model_auto_completer_cache = this.value'\n })\n tag_options[:onblur] = if options[:allow_nil]\n \"if (this.value != this.model_auto_completer_cache) {this.value = ''; $('#{hf_id}').value = ''}\"\n elsif options[:allow_free_text]\n \"if (this.value != this.model_auto_completer_cache) {$('#{hf_id}').value = ''}\"\n else\n 'this.value = this.model_auto_completer_cache' \n end\n # The following test is based on http://techpatterns.com/downloads/scripts/javascript_browser_detection_basic.txt\n tag_options[:onkeypress] = \"if (navigator.userAgent.indexOf('Safari') != -1) {return event.keyCode == Event.KEY_RETURN ? false : true } else { return true }\" unless options[:send_on_return]\n \n after_update_element_js = <<-JS.gsub(/\\s+/, ' ')\n function(element, value) {\n var model_id = /#{options[:regexp_for_id]}/.exec(value.id)[1];\n $(\"#{hf_id}\").value = model_id;\n element.model_auto_completer_cache = element.value;\n (#{options[:after_update_element]})(element, value, $(\"#{hf_id}\"), model_id);\n }\n JS\n completion_options.update({\n :url => url_for(\n :controller => options[:controller],\n :action => options[:action]\n ),\n :after_update_element => after_update_element_js\n })\n \n completion_options[:indicator] = \"loader\"\n\n return <<-HTML\n #{auto_complete_stylesheet unless completion_options[:skip_style]}\n #{hidden_field_tag(hf_name, hf_value, :id => hf_id)}\n #{text_field_tag tf_name, tf_value, tag_options}\n #{content_tag(\"div\", \"\", :id => \"#{tf_id}_auto_complete\", :class => \"auto_complete\")}\n #{auto_complete_field tf_id, completion_options}\n HTML\n end",
"title": ""
},
{
"docid": "6adab291b1c85d00c12d60dadae5b3cd",
"score": "0.6026129",
"text": "def d_search_list_field_enter(value)\n value_arr = value.chomp.split(':')\n text_field_id = ''\n s_filter = ''\n\n if value_arr.size > 0 # type in the field if filter is provided\n s_filter = value_arr.first\n\n text_field = @field.all(:css, 'input[type=\"text\"][class*=\"dynamic-search-list\"]').first\n raise 'Dynamic Searchlist field not found' unless text_field\n\n text_field_id = text_field[:id]\n text_field.set s_filter\n sleep 5\n else\n control = @field.all(:css, 'i[class$=\"open-dynamic-search-list\"]').first\n control.click\n sleep 5\n end\n\n s_value = value_arr.last\n\n fill_auto_complete(text_field_id, s_filter, s_value)\n end",
"title": ""
},
{
"docid": "2b51e6946da1098a3ccfb740b4885e2f",
"score": "0.5992871",
"text": "def auto_complete_field(field_id, options = {})\n function = \"var #{field_id}_auto_completer = new Ajax.Autocompleter(\"\n function << \"'#{field_id}', \"\n function << \"'\" + (options[:update] || \"#{field_id}_auto_complete\") + \"', \"\n function << \"'#{url_for(options[:url])}'\"\n\n js_options = {}\n js_options[:tokens] = array_or_string_for_javascript(options[:tokens]) if options[:tokens]\n js_options[:callback] = \"function(element, value) { return #{options[:with]} }\" if options[:with]\n js_options[:indicator] = \"'#{options[:indicator]}'\" if options[:indicator]\n js_options[:select] = \"'#{options[:select]}'\" if options[:select]\n js_options[:paramName] = \"'#{options[:param_name]}'\" if options[:param_name]\n js_options[:frequency] = \"#{options[:frequency]}\" if options[:frequency]\n js_options[:method] = \"'#{options[:method].to_s}'\" if options[:method]\n\n { :after_update_element => :afterUpdateElement,\n :on_show => :onShow, :on_hide => :onHide, :min_chars => :minChars }.each do |k,v|\n js_options[v] = options[k] if options[k]\n end\n\n function << (', ' + options_for_javascript(js_options) + ')')\n\n javascript_tag(function)\n end",
"title": ""
},
{
"docid": "4330bf3db7d3bf513c81a1751d128c74",
"score": "0.5991973",
"text": "def as_json_for_autocomplete\n {id: id, value: full_name, link: autocomplete_link}\n end",
"title": ""
},
{
"docid": "3ec67f38d77112ac72eec20e89b8fe1b",
"score": "0.5985716",
"text": "def widget\n respond_to do |format|\n format.html { render :inline => <<-EOS\n <html>\n <body>\n <input type=\"textfield\" name=\"the_textfield\" acs_source=\"/acs/jqb/dogs\" id=\"the_textfield\"/>\n \n <input type=\"textfield\" name=\"the_textfield2\" acs_source=\"/acs/jqb/dogs\" id=\"the_textfield2\"/>\n \n <%= javascript_include_tag 'jquery-1.4.2' %>\n \n \n <% javascript_tag do %>\n // Top Level function to bind an Auto-Completer to an HTML element\n // Should eventually extract autocompleter client name from a acs_source like \"/acs/jqb_v2/dogs\"\n // to invoke JqbV2.attach(element)\n jQuery.fn.extend({\n bindAcs:function() {\n this.each(function() {\n var element = jQuery(this);\n Jqb.attach(element);\n })\n }\n });\n \n // A namespace to hold all references to all Autocompleter client bindings\n // on this page\n var Acs = {\n instances:[]\n }\n \n // jQuery Basic Autocompleter for ACS API\n //\n var Jqb = {\n loaded:false,\n \n // This is like the constructor--where all of the base-line behavior associated\n // with a Jqb client can added to the page\n attach:function(element) {\n // Move the \n element.data(\"acs_source\", element.attr('acs_source'));\n element.focus(function(){\n //Do nothing\n }),\n element.keyup(this.handleKeyUp)\n },\n \n handleKeyUp:function(event) {\n var keyupped = event.target;\n console.log('[handleKeyUp] ' + $(keyupped).val());\n \n // Catch arrows, enter, tab\n // pass other stuff through to ajax request\n // should buffer key strokes and wait for the user\n // to finish typing (i think)\n //\n switch (event.keyCode) {\n //Catch/buffer/ depending on the key pressed\n // see here for details: http://unixpapa.com/js/key.html \n }\n \n // Fire off request\n $.getJSON($(keyupped).attr('acs_source'), {q:$(keyupped).val()}, function(json) {\n jQuery.each(json, function() {\n // BIG TODO: <dog> should be dynamic not hard coded...\n console.log(this.dog.name);\n });\n })\n }\n }\n \n \n // Starting point to attach the autocompleter server\n // to all clients on the page\n $(document).ready(function(){\n $(\"input[acs_source]\").bindAcs();\n });\n\n <% end %>\n </body>\n </html> \n EOS\n }\n end\n end",
"title": ""
},
{
"docid": "cdc4a8d4f3cc4d3842bcd3134e1ec251",
"score": "0.59789747",
"text": "def autocomplete(q:)\n return unless String(q).length > 1\n\n result = Geocoder.search(q, autocomplete: true)\n result&.data\n end",
"title": ""
},
{
"docid": "75b2587357771665d99e2b7d529668d7",
"score": "0.59654975",
"text": "def auto_complete\n @query = params[:auto_complete_query]\n @auto_complete = self.controller_name.classify.constantize.scoped(:limit => 10).search(@query)\n render :template => \"common/auto_complete\", :layout => nil\n end",
"title": ""
},
{
"docid": "d7623fd4730cdcdd8459a38c7bd14825",
"score": "0.59579676",
"text": "def bu_autocomplete\n search_term = params[:term]\n\n species_id = Specie.find_by_scientificname(params[:species])\n\n cultivars = Cultivar.where(\"specie_id = ?\", species_id)\n\n logger.debug(\"cultivars for autocompletion: #{cultivars.inspect}\")\n\n filtered_cultivars = cultivars.where(\"LOWER(name) LIKE LOWER(?)\", '%' + search_term + '%')\n\n if filtered_cultivars.size > 0 || search_term.size > 1\n cultivars = filtered_cultivars\n # else if there are no matches and the user has only typed one letter, just return every cultivar associated with the chosen species\n end\n\n cultivars = cultivars.to_a.map do |item|\n item.name.squish\n end\n\n # don't show rows where name is null or empty\n # TO-DO: eliminate these from the database and prevent them with a constraint\n cultivars.delete_if { |item| item.nil? || item.empty? }\n\n if cultivars.empty?\n cultivars = [ { label: \"No matches\", value: \"\" }]\n end\n\n respond_to do |format|\n format.json { render :json => cultivars }\n end\n end",
"title": ""
},
{
"docid": "ba2521185d26f4fd1f41a2ca4c0cabe4",
"score": "0.59455967",
"text": "def auto_complete_for_dependencies\n auto_complete_field('dependencies_input',\n { :url => { :action => 'dependency_targets' },\n :min_chars => 1,\n :frequency => 0.5,\n :indicator => 'loading',\n :after_update_element => \"addDependencyToTask\"\n })\n end",
"title": ""
},
{
"docid": "9622709039fe6b2d2ed5d95650a95db8",
"score": "0.59432983",
"text": "def scaffold_auto_complete_text_field_options\n scaffold_auto_complete_options[:text_field_options]\n end",
"title": ""
},
{
"docid": "43f5fade69829b43213f5d45c3b4b0e8",
"score": "0.59369355",
"text": "def get_autocomplete_items(parameters)\n super(parameters).active rescue nil\n end",
"title": ""
},
{
"docid": "a6ed4ed1b2b3f7fc4d16418187876e95",
"score": "0.5918969",
"text": "def auto_complete_for_customer\n render :json => {} and return if (terms_string = params[:term].to_s).length < 2\n terms = terms_string.split( /\\s+/ )\n max_matches = 60\n exact_name_matches = Customer.exact_name_matches(terms).limit(max_matches/3)\n partial_name_matches = Customer.partial_name_matches(terms).limit(max_matches/3) - exact_name_matches\n other_term_matches = Customer.other_term_matches(terms).limit(max_matches/3) - exact_name_matches - partial_name_matches\n\n if (exact_name_matches.size + partial_name_matches.size + other_term_matches.size) == 0\n render :json => [{'label' => '(no matches)', 'value' => nil}] and return\n end\n show_all_matches = [{\n 'label' => \"List all matching '#{terms_string}'\",\n 'value' => customers_path(:customers_filter => terms_string)}]\n result =\n exact_name_matches.map { |c| {'label' => c.full_name, 'value' => customer_path(c)} } +\n partial_name_matches.map { |c| {'label' => c.full_name, 'value' => customer_path(c)} } +\n other_term_matches.map { |c| {'label' => \"#{c.full_name} (#{c.field_matching_terms(terms)})\", 'value' => customer_path(c)} } +\n show_all_matches\n render :json => result.uniq\n end",
"title": ""
},
{
"docid": "13a81d9e516e6d2c4f8a923ea86aef79",
"score": "0.59123164",
"text": "def auto_complete_for_ingredient_name\n value = params[:ingredient][:name]\n @ingredients = Ingredient.find(:all, \n :conditions => [ 'LOWER(name) LIKE ?',\n '%' + value.downcase + '%' ], \n :order => 'name ASC',\n :limit => 8)\n render :partial => 'ingredient_name_matches'\n end",
"title": ""
},
{
"docid": "dca5b7ca3f47368f98b29e7baaa23fca",
"score": "0.5907088",
"text": "def autocomplete(name)\n self.class.get(\"/cards/autocomplete?q=#{name}\")\n end",
"title": ""
},
{
"docid": "8d99c1c59db11b2befe318cfbf85c428",
"score": "0.5900603",
"text": "def scaffold_text_field_tag_with_auto_complete(id, model_name, association = nil, options = {})\n content = ScaffoldingExtensions.auto_complete_css.dup\n content << scaffold_field_tag(:string, {:value=>'', :id=>id, :class=>'autocomplete'}.merge(options))\n content << scaffold_javascript_autocompleter(id, model_name, association)\n content\n end",
"title": ""
},
{
"docid": "0efe8fbeb0d0b4e9ba1df9f86f3ec8c6",
"score": "0.5898934",
"text": "def autocomplete_sn\n render :partial => 'autocomplete', :object => Scientificname.find(:all, :conditions => ['name ILIKE ?', params[:sn] + '%' ])\n end",
"title": ""
},
{
"docid": "3aa86838f5d82493ba12a01dd0058e01",
"score": "0.588249",
"text": "def autocomplete\n render :json => end_of_association_chain.ordered.search(params[:term]).limit(params[:limit] || 10).to_autocomplete\n end",
"title": ""
},
{
"docid": "f5a757c25fb55e7f726117ec3ece9163",
"score": "0.5878046",
"text": "def highlight_in_autocomplete\n\t\t\ttrue\n\t\tend",
"title": ""
},
{
"docid": "8348fb5eb5cc39738ed960a63fb37bc5",
"score": "0.58636814",
"text": "def autocomplete_name\n @tags = Tag.where([\"name ILIKE ?\", \"*#{params[:term]}*\".to_escaped_for_sql_like]).order('LENGTH(name)', :name).limit(20).pluck(:name)\n respond_to do |format|\n format.json { render :json => @tags }\n end\n end",
"title": ""
},
{
"docid": "0ccb244bb4bf32ece07b23303fc338ad",
"score": "0.58508795",
"text": "def auto_complete_for_payer_popup\n @payers = get_matching_payers(params[:payer_name], params[:payer_address_one])\n end",
"title": ""
},
{
"docid": "dae1ba603d8f59e102ea3182afba2928",
"score": "0.58325",
"text": "def contact_autocomplete(type, options)\n set_search_path\n Contact.where(\"type = :type AND matchcode ILIKE :term\", :type => type, :term => \"%#{options[:term]}%\").limit(20).map {|c| {:id => c.id, :label => c.to_s}}\n end",
"title": ""
},
{
"docid": "3c04f3b50292166222b3c7020211979f",
"score": "0.5822763",
"text": "def setupAutocomplete(commands)\n cmdAuto = proc { |s| commands.map{|cmd, _desc| cmd}.flatten.grep(/^#{Regexp.escape(s)}/) }\n Readline::completion_append_character = \" \"\n Readline::completion_proc = cmdAuto\nend",
"title": ""
},
{
"docid": "74913e98b4cd46796f8aec74ba7c128a",
"score": "0.5795762",
"text": "def get_autocomplete_items(parameters)\n session[:from_follower_following] ? @login_user.from_follower_following(parameters[:term]) : @login_user.all_message_users(parameters[:term])\n end",
"title": ""
},
{
"docid": "14eacfb69aa486f2f6f022e1f5a1aa0e",
"score": "0.5776936",
"text": "def autocomplete\n key = params[:key]\n feeds = Feed.select('title').where('title LIKE ?', \"%#{key}%\").limit(5).map { |f| f.title }\n upcomings = Upcoming.select('title').where('title LIKE ?',\"%#{key}%\").limit(5).map { |u| u.title }\n artists = Artist.select('name').where('name LIKE ?',\"%#{key}%\").limit(5).map { |u| u.name }\n result = feeds + upcomings + artists\n\n respond_to do |format|\n format.json { render json: result.shuffle }\n end\n end",
"title": ""
},
{
"docid": "ff9cc6a46cc94913f48379463dfd0124",
"score": "0.5774426",
"text": "def auto_complete_for_technician_enquiry_from\n re = Regexp.new(\"^#{params[:technician][:name]}\", \"i\")\n find_options = { :order => \"name ASC\" }\n @technicians = Technician.find(:all, find_options).collect(&:name).select { |org| org.match re }\n render :template => 'sales/auto_complete_for_technician_name',:layout=>false\n end",
"title": ""
},
{
"docid": "720a90d3633253d1d3a6e14dbf781ef6",
"score": "0.5773437",
"text": "def get_autocomplete_items(parameters)\n HsCode.where(\"hs_codes.code like :search or hs_codes.description like :search\", :search => \"%#{params[:term]}%\").select('description, code').limit(100)\n end",
"title": ""
},
{
"docid": "1834f277dbde394be14a172399b8e08c",
"score": "0.5750737",
"text": "def autocomplete\n @design_methods = DesignMethod.where(['name LIKE ?', \"#{params[:term]}%\"])\n @design_hash = []\n @design_methods.each do |d|\n @design_hash << { label: d.name }\n end\n respond_to do |format|\n format.json { render json: @design_hash}\n end\n end",
"title": ""
},
{
"docid": "6edf2da260b10fab64143612fc726e34",
"score": "0.5742697",
"text": "def batch_autocomplete(param_array_prefix, association, options={})\n options[:param_array_prefix] = param_array_prefix\n options[:div_id] = param_array_prefix.gsub(/[\\[\\]]/, \"_\")\n options[:current_associations] = association.map{|a| {:id => a.id, :name => a.name}}\n options[:association_params] ||= {}\n render :partial => 'shared/batch_autocomplete', :locals => options\n end",
"title": ""
},
{
"docid": "e6c7d93e3da42c296a3482fe992a9208",
"score": "0.57411754",
"text": "def autocomplete\n keyword = params[:keyword]\n gs = Api::Google.new\n results = gs.autocomplete(keyword)\n render json: results # Return to frontend (-> results injected by spot_autocomplete_dropdown.js)\n end",
"title": ""
},
{
"docid": "30b1596f642eac099f743dcd0be5e8d5",
"score": "0.5740817",
"text": "def autocomplete\r\n # table parameter must be defined. If not, get it from search parameter\r\n if params['table'].nil? && params['search'].match(/\\./)\r\n name = params['search'].split('.').first\r\n params['table'] = name.underscore\r\n end\r\n if params['table'].match('_control')\r\n # it must be at least logged on\r\n return render json: { label: t('drgcms.not_authorized') } unless dc_user_can(DcPermission::CAN_VIEW, 'dc_memory')\r\n else\r\n return render json: { label: t('drgcms.not_authorized') } unless dc_user_can(DcPermission::CAN_VIEW)\r\n end\r\n\r\n table = params['table'].classify.constantize\r\n input = params['input'].gsub(/\\(|\\)|\\[|\\]|\\{|\\|\\.|\\,}/, '')\r\n # call method in class if search parameter contains . This is for user defined searches\r\n a = if params['search'].match(/\\./)\r\n #method, additional_params = params['search'].split('.')\r\n #data = additional_params ? table.send(method, input, additional_params, self) : table.send(method, input)\r\n name, method = params['search'].split('.')\r\n data = table.send(method, input)\r\n data.map do |v|\r\n { label: v[0], value: v[0], id: (v[1] || v[0]).to_s }\r\n end\r\n # will search and return field_name defined in params['search']\r\n else\r\n table.where(params['search'] => /#{input}/i).limit(20).map do |v|\r\n { label: v[params['search']], value: v[params['search']], id: v.id.to_s }\r\n end\r\n end\r\n\r\n render json: a\r\nend",
"title": ""
},
{
"docid": "456521ab23f599b7aaaa7857ed5f8e6d",
"score": "0.5737844",
"text": "def auto_complete_for_club_member_login\n\n # split by spaces, downcase and create query for each.\n # Remember to Sanitize the SQL\n conditions = params[:club_member][:login].downcase.split.map {\n\t\t # Sanitize ***********************************\n\t\t |w| \"LOWER(login) LIKE '%\" + (w.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")) +\"%'\" } # AND the queries.\n\n # AND the queries.\n find_options = {\n :conditions => conditions.join(\" AND \"),\n :order => \"login ASC\",\n :limit => AC_CLUB_MEMBER_NAME_LIMIT }\n\n @items = ClubMember.find(:all, find_options)\n\n render :inline => \"<%= auto_complete_result_2 @items %>\"\n end",
"title": ""
},
{
"docid": "02ece9b3dc1de332690a3942af1ffa15",
"score": "0.5731371",
"text": "def get_autocomplete_items(parameters)\r\n super(parameters).active rescue nil\r\n end",
"title": ""
},
{
"docid": "02ece9b3dc1de332690a3942af1ffa15",
"score": "0.5731371",
"text": "def get_autocomplete_items(parameters)\r\n super(parameters).active rescue nil\r\n end",
"title": ""
},
{
"docid": "02ece9b3dc1de332690a3942af1ffa15",
"score": "0.5731371",
"text": "def get_autocomplete_items(parameters)\r\n super(parameters).active rescue nil\r\n end",
"title": ""
},
{
"docid": "293bf3cd82486182f82c6e1ae7bffa6b",
"score": "0.5721997",
"text": "def getAutocomplete(query, type)\n request('getAutocomplete', {'query' => query, 'type' => type})\nend",
"title": ""
},
{
"docid": "c8c08f7bcb5cf3c6426b768ba6636f03",
"score": "0.57049793",
"text": "def findorsuggest()\n \n end",
"title": ""
},
{
"docid": "c20420dc74d6946bb7d239c1ad276831",
"score": "0.5704581",
"text": "def text_field; end",
"title": ""
},
{
"docid": "ac2573aae96cbf58b2f4357206b269a0",
"score": "0.57008344",
"text": "def autoname\n# auto completed to get list of users. Nee to expand it to seach name field and names in the user table\n# puts \"----------->>>>>>>>>>>>>>>>> in Auto Name\"\n \n if (params[:term] && !current_account.user.mycontacts.nil?)\n like= \"%\".concat(params[:term].concat(\"%\"))\n clone_emails = current_account.user.mycontacts.where(\"clone_email LIKE ? OR name LIKE ? \", like, like)\n # puts \"clone emails = \"+clone_emails.inspect\n else\n clone_emails = []\n end\n\n #list = clone_emails.map {|u| Hash[ :id => u.id, :label => (u.clone_email), :name => u.clone_email]}\n list = clone_emails.map {|u| Hash[ :id => u.id, :label => concat_email_name(u), :name => u.clone_email]}\n render :json => list\nend",
"title": ""
},
{
"docid": "743008bbc307a904235dc1c13518a5a9",
"score": "0.5687143",
"text": "def autocomplete(term)\n get(\"/catalog/titles/autocomplete?term=#{term}\")\n end",
"title": ""
},
{
"docid": "99d1df82e17af1ba379a813ac29c11d6",
"score": "0.568448",
"text": "def bioportal_form_complete options,html_options={}\n options[:value]||=\"name\"\n result = \"\"\n result += javascript_include_tag(\"bioportal_form_complete.js\") unless options[:no_javascript_include]\n\n html_options[:class]=\"bp_form_complete-#{options[:ontology_ids].join(',')}-#{options[:value]}\"\n name = options[:name]\n result += text_field_tag name,nil,html_options\n return result\n end",
"title": ""
},
{
"docid": "4efce4ce0179f302b522dc709cf8da38",
"score": "0.56764746",
"text": "def get_aria_autocomplete(field)\n tag_name = field.get_tag_name\n type = nil\n if field.has_attribute?('type')\n type = field.get_attribute('type').downcase\n end\n if (tag_name == 'TEXTAREA') ||\n (\n (tag_name == 'INPUT') &&\n !(\n (type == 'button') ||\n (type == 'submit') ||\n (type == 'reset') ||\n (type == 'image') ||\n (type == 'file') ||\n (type == 'checkbox') ||\n (type == 'radio') ||\n (type == 'hidden')\n )\n )\n value = nil\n if field.has_attribute?('list')\n list_id = field.get_attribute('list')\n unless @parser.find(\"datalist[id=\\\"#{list_id}\\\"]\").first_result.nil?\n return 'list'\n end\n end\n if field.has_attribute?('autocomplete')\n value = field.get_attribute('autocomplete').downcase\n else\n form = @parser.find(field).find_ancestors('form').first_result\n if form.nil? && field.has_attribute?('form')\n form = @parser.find(\n \"##{field.get_attribute('form')}\"\n ).first_result\n end\n if !form.nil? && form.has_attribute?('autocomplete')\n value = form.get_attribute('autocomplete').downcase\n end\n end\n return 'both' if value == 'on'\n return 'none' if value == 'off'\n end\n nil\n end",
"title": ""
},
{
"docid": "aed84b71d973280dd53702ad22c2e6d5",
"score": "0.5672762",
"text": "def get_field_autocomplete_class(model,term)\n if (not model.is_a? String) and (not model.is_a? Symbol)\n model=ActiveSupport::Inflector.tableize(model.class.to_s)\n end\n\n if term\n if term.to_s=='based_near' || term.to_s=='subject' || term.to_s=='contributor'\n return ['autocomplete']\n end\n end\n\n dt=DomainTerm.find_by(model: model, term: term)\n if not dt or dt.local_authorities.empty?\n return []\n else\n return ['autocomplete']\n end\n end",
"title": ""
},
{
"docid": "05ee0557c4ae0c44b19fb268a7c9295e",
"score": "0.56623036",
"text": "def autocomplete\n\t\tquery_params = QueryFormat.autocomplete_format()\n\t\tbegin\n\t\t\tQueryFormat.transform_raw_parameters(params)\n\t\t\tquery = QueryFormat.create_solr_query(query_params, params, request.remote_ip)\n\t\t\tquery['field'] = \"content_auto\" if query['field'].blank?\n\t\t\tis_test = Rails.env == 'test' ? :test : :live\n\t\t\tis_test = :shards if params[:test_index]\n\t\t\tsolr = Solr.factory_create(is_test)\n\t\t\tmax = query['max'].to_i\n\t\t\tquery.delete('max')\n\t\t\twords = solr.auto_complete(query)\n\t\t\twords.sort! { |a,b| b[:count] <=> a[:count] }\n\t\t\twords = words[0..(max-1)]\n\t\t\t@results = words.map { |word|\n\t\t\t\t{ :item => word[:name], :occurrences => word[:count] }\n\t\t\t}\n\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html # index.html.erb\n\t\t\t\tformat.json { render json: { results: @results } }\n\t\t\t\tformat.xml\n\t\t\tend\n\t\trescue ArgumentError => e\n\t\t\trender_error(e.to_s)\n\t\trescue SolrException => e\n\t\t\trender_error(e.to_s, e.status())\n\t\trescue Exception => e\n\t\t\tExceptionNotifier.notify_exception(e, :env => request.env)\n\t\t\trender_error(\"Something unexpected went wrong.\", :internal_server_error)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0ef6a031522abef88279c701c6c31da0",
"score": "0.56615585",
"text": "def user_autocomplete\n @users = @users.order(:username).where(\"username like ?\", \"%#{params[:value]}%\")\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "3f484db047555b98046a6ccb4151fd28",
"score": "0.5660814",
"text": "def autocomplete\n @leader = Leaders.find(:all, :conditions => [\"name like ?\",\"%\" + params[:term].upcase + \"%\"])\n render json: @leader \n end",
"title": ""
},
{
"docid": "ade41cd20ea7a13003ee240f995f58c4",
"score": "0.56598604",
"text": "def autocomplete_user_email\n term = params[:term]\n users = User.where(:role_id => current_user.can_mail_to).where(\"lower(email) ILIKE '%#{term}%' OR lower(user_id) ILIKE '%#{term}%'\").order(:email)\n render :json => users.map { |user| {:id => user.id, :label => \"#{user.name} - #{user.email}\", :value => user.name} }\n end",
"title": ""
},
{
"docid": "6b885191756e8331b769366ec52c5b62",
"score": "0.5639201",
"text": "def scaffold_auto_complete_field(field_id, options = {})\n javascript_tag(\"var #{field_id}_auto_completer = new Ajax.Autocompleter('#{field_id}', '#{options[:update] || \"#{field_id}_scaffold_auto_complete\"}', '#{url_for(options[:url])}', {paramName:'id'})\")\n end",
"title": ""
},
{
"docid": "fe51483b9c0175ad6fda520d65b2e37e",
"score": "0.563598",
"text": "def autocomplete_on\n\t\tconditions = if params[:name]\n [\"name LIKE :name\", { :name => \"%#{params['name']}%\"} ]\n else\n {}\n end\n\t\t @objects = params[:model_name].classify.constantize.find(:all, :conditions => conditions)\n\t\t render :text => '<ul>'+ @objects.map{ |e| '<li>' + e.name + '</li>' }.join(' ')+'</ul>'\n\tend",
"title": ""
},
{
"docid": "3b1df26b6c823a1b25d48b3e66ca6e3d",
"score": "0.5615426",
"text": "def update!(**args)\n @auto_complete = args[:auto_complete] if args.key?(:auto_complete)\n @auto_complete_callback = args[:auto_complete_callback] if args.key?(:auto_complete_callback)\n @auto_complete_multiple_selections = args[:auto_complete_multiple_selections] if args.key?(:auto_complete_multiple_selections)\n @hint_text = args[:hint_text] if args.key?(:hint_text)\n @label = args[:label] if args.key?(:label)\n @max_lines = args[:max_lines] if args.key?(:max_lines)\n @name = args[:name] if args.key?(:name)\n @on_change = args[:on_change] if args.key?(:on_change)\n @type = args[:type] if args.key?(:type)\n @value = args[:value] if args.key?(:value)\n end",
"title": ""
},
{
"docid": "5850fdd7fb62e9990adf6895d64a6831",
"score": "0.5611378",
"text": "def autocomplete\n @taxa = Taxon.order(:scientific_name).search(params[:term])\n list = @taxa.map {|t| Hash[id: t.id, label: t.label, value: t.scientific_name]}\n respond_to do |format|\n format.html { render :index }\n format.json do\n render json: list.to_json\n end\n end\n end",
"title": ""
},
{
"docid": "1d3fcb84db21377ace51a2bdb329c194",
"score": "0.5610513",
"text": "def populate_fields(target,data)\n data.each{|key,value|target.text_field(:name=>key).set value}\nend",
"title": ""
},
{
"docid": "34095a6bdffb40a1b8b4ccf13a1e2b8b",
"score": "0.5605572",
"text": "def complete_tags\n unless request.post?\n render_404\n return\n end\n @tags = Tag.for_autocomplete params[:tag]\n render :partial => \"auto_completed\"\n end",
"title": ""
},
{
"docid": "d0fb9afea76bf83ecb55b55cea3834ec",
"score": "0.5600811",
"text": "def auto_complete_model_for_person_fullname\n @result = Person.non_student.find_all{|p| p.fullname.downcase.include?(params[:person][:fullname].downcase)}[0..10]\n render :partial => \"auto_complete\", :object => @result, :locals => { :highlight_phrase => params[:person][:fullname] }\n end",
"title": ""
},
{
"docid": "7aee8e0bd72235befcf412eaf818cf2d",
"score": "0.5594706",
"text": "def autocomplete_composite_fullname_email\n term = params[:term]\n @users = User.select(\"fullname, email\").select{ |u| u.composite_fullname_email.include?(term) }.map(&:composite_fullname_email)\n render json: @users\n end",
"title": ""
},
{
"docid": "da3e6ab37edc1e03e639039ca45fb86f",
"score": "0.5593719",
"text": "def autocomplete(input, dictionary)\n input.delete!(\"^a-zA-Z\")\n dictionary.lazy.select{ |word| word.downcase.start_with?(input.downcase) }.first(5)\nend",
"title": ""
},
{
"docid": "808a237f718b9269a57697c801443127",
"score": "0.5581381",
"text": "def auto_complete(editor)\n editor.cursor.read do |word|\n sword = word.to_sym \n if word == \"\\n\"\n throw :eol\n elsif editor.template.user_classes.include?(sword)\n build_suggestion(Editor.const_get(word).methods)\n elsif editor.template.context.methods.include?(sword)\n build_suggestion(editor.template.context.method(sword).parameters)\n end\n\tend\nend",
"title": ""
},
{
"docid": "277a8e768c1cd6fab45dbbaff3aed1e5",
"score": "0.5571909",
"text": "def search_prof\n # Search for email or name of professor\n term = \"%#{params[:term]}%\"\n @users = User.all(:conditions => [\"(LOWER(first_name) LIKE LOWER(?) OR LOWER(last_name) LIKE LOWER(?) OR LOWER(email) LIKE LOWER(?)) AND role = ?\", term, term, term, \"Professor\"])\n\n # Return a JSON with \"label\" and \"value\" as key required by JQUeryUI autocomplete\n result = Array.new\n @users.each do |user| \n label = user.first_name + \" \" + user.last_name + \" - \" + user.email\n item = Hash[ \"label\" => label, \"value\" => user.email ]\n result.push item\n end\n\n render :json => result\n end",
"title": ""
},
{
"docid": "9bef334f7de83d1e4caa736a7e66c862",
"score": "0.5565997",
"text": "def test_autocomplete_searches\n do_find_all\n do_autocomplete_query\n end",
"title": ""
},
{
"docid": "7febc2042a2e01259516e2b1786a1983",
"score": "0.5541638",
"text": "def autocomplete_result(entries, *args)\n return if entries.empty?\n\n options = args.last.is_a?(Hash) ? args.pop : {}\n highlight = options[:highlight]\n escape = options[:escape].nil? ? true : options[:escape]\n field = args.first\n\n\n items = entries.collect{ |entry|\n entry = entry.send(field) if field\n text = highlight ? highlight(entry, highlight) : escape ? ERB::Util.html_escape(entry) : entry\n\n content_tag :li, RightRails::Helpers.html_safe(text)\n }.join(\"\")\n\n content_tag :ul, RightRails::Helpers.html_safe(items)\n end",
"title": ""
},
{
"docid": "266c87acc46e8c00a478c4d949fe9ca3",
"score": "0.55317044",
"text": "def set_university_autocomplete\n render json: {\"course_tags\": @course_tags, \"program_tags\": @program_tags}\n end",
"title": ""
},
{
"docid": "e8f02c7518fadcde34f8e075309cec1b",
"score": "0.55176514",
"text": "def autocomplete_agente_apellido\n agente_activo = 1\n respond_to do |format|\n @agentes = Agente.where(\"agentes.estado_agente_id = ? AND agentes.apellido ILIKE ?\", agente_activo, \"%#{params[:term]}%\")\n render :json => @agentes.map { |agente| {:id => agente.id, :value => agente.apellido + \" \"+ agente.nombre } } \n format.js { } \n end\n end",
"title": ""
},
{
"docid": "834548728fa843464595d52306b35f82",
"score": "0.55151874",
"text": "def input\n if object.respond_to? :reflections\n hid_name = object.reflections[attribute_name].foreign_key || :\"#{attribute_name}_id\"\n relation = attribute_name\n else\n hid_name = attribute_name\n relation = attribute_name.to_s.gsub(/\\A(.+)(_id)\\z/,'\\1')\n end\n\n case\n when options['data-source'].present?\n input_html_options['data-source'] = options.delete('data-source')\n when input_html_options[:data].present? && input_html_options[:data][:source].present?\n input_html_options['data-source'] = input_html_options[:data].delete(:source)\n end\n\n raise 'input_html_options data-source required' unless input_html_options['data-source'].present?\n input_html_options[:placeholder] = input_html_options[:placeholder] || I18n.t('bonsai.autocomplete_placeholder')\n input_html_options[:size] ||= SimpleForm.default_input_size\n input_html_options['data-value'] = object.send(relation).to_s\n input_html_options[:class] = 'select2-autocomplete'\n\n @builder.text_field hid_name, input_html_options\n end",
"title": ""
},
{
"docid": "074ec353c12742a2a0d6254575e3f9f4",
"score": "0.5506974",
"text": "def non_autocomplete_fields\n\t\t\t\t[\"ID\"]\n\t\t\tend",
"title": ""
},
{
"docid": "13a6acead5ec18b25894f5d7514d463d",
"score": "0.5505234",
"text": "def auto_complete_for_payer_pay_address_one\n @payers = get_matching_payers(params[:payer_name], params[:payer_address_one])\n end",
"title": ""
},
{
"docid": "bee6f303ebbde685fd71dbf7183112e3",
"score": "0.5503594",
"text": "def keyUp(event)\n row = @autoCompleteTableView.selectedRow\n isShow = @autoCompletePopover.isShown\n\n #p \"wufield\"+ event.keyCode.to_s\n\n case event.keyCode\n when 125 #down\n if isShow\n @autoCompleteTableView.selectRowIndexes(NSIndexSet.indexSetWithIndex((row + 1)), byExtendingSelection: false)\n @autoCompleteTableView.scrollRowToVisible(@autoCompleteTableView.selectedRow)\n insert(self)\n return #skip default behavior\n end\n\n when 126 #up\n if isShow\n @autoCompleteTableView.selectRowIndexes(NSIndexSet.indexSetWithIndex((row - 1)), byExtendingSelection: false)\n @autoCompleteTableView.scrollRowToVisible(@autoCompleteTableView.selectedRow)\n insert(self)\n return #skip default behavior\n end\n when 36, 48, 51, 49 # return, tab, space\n if @myDelegate.respondsToSelector(\"didClickedCloseKey\")\n @myDelegate.didClickedCloseKey\n end\n\n self.autoCompletePopover.close()\n\n return #//skip default behavior\n else\n end\n\n super(event)\n complete(self)\n end",
"title": ""
},
{
"docid": "d6f50f16da1534fe99e0caf6ee9086bc",
"score": "0.55001867",
"text": "def autocomplete\n results = AttributeAutocomplete.new(\n attribute: params[:attribute],\n term: params[:term],\n year: year\n ).perform\n render json: results\n end",
"title": ""
},
{
"docid": "32924dc7f5c4315a761d5013403af22d",
"score": "0.54953533",
"text": "def keyword_autocomplete\n search_keyword = params[\"search\"]\n similar_keywords =\n Keyword.get_similar_keywords(search_keyword, [])\n similar_keywords.map! { |keyword| keyword.name }\n render json: similar_keywords\n end",
"title": ""
},
{
"docid": "de22aacb01df7014e8cc0a71127db187",
"score": "0.54910564",
"text": "def suggest\n end",
"title": ""
},
{
"docid": "cfc40ff808886d9e2a1ed2bd2f3a63f2",
"score": "0.5477993",
"text": "def default_autocomplete\n [\n { label: \"My Profile settings\", url: profile_path },\n { label: \"My SSH Keys\", url: profile_keys_path },\n { label: \"My Dashboard\", url: root_path },\n { label: \"Admin Section\", url: admin_root_path },\n ]\n end",
"title": ""
},
{
"docid": "050e1ae7f791f7746ef98effb40ce38d",
"score": "0.5477307",
"text": "def autocomplete\n \n @credits = Credit.select([:id, :department, :credit]).where(\"credit ILIKE ? \", \"%#{params[:filter]}%\" ).limit(params[:limit])\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @credits }\n format.js\n format.json { render :json => @credits }\n end\n\n\n end",
"title": ""
}
] |
8b93d5dc72afe2d3637cc4f93d4b2d04
|
PATCH/PUT /groups/1 PATCH/PUT /groups/1.json
|
[
{
"docid": "9c45f084b1e9823a846394d2a06fd3f4",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'グループが更新されました。' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "8ee64ed93964ca86b3715555759824c2",
"score": "0.7710417",
"text": "def patch_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end",
"title": ""
},
{
"docid": "95ebe44bdba451b98b0dbd1556b3b24f",
"score": "0.7653916",
"text": "def patch_update\n group = @company.public_send(ScimRails.config.scim_groups_scope).find(params[:id])\n\n json_scim_missing_field_response(params) and return if patch_path.blank?\n\n if patch_path == :members\n case patch_operation.downcase\n when \"add\"\n add_members(group) if members_param.present?\n when \"remove\"\n remove_members(group) if members_param.present?\n end\n else\n update_attribute(group)\n end\n\n json_scim_response(object: group)\n end",
"title": ""
},
{
"docid": "ec36e491aa5e69bc0da0412d4ac49ae8",
"score": "0.7438253",
"text": "def update_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "641941ccce9db9b5f592b8748b4f16a7",
"score": "0.73835975",
"text": "def update\n @group_id = group_params[:group_id]\n puts group_params\n puts \"PARAMS\"\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/groups/#{@group_id}.json\",\n :body => {:group_name => group_params[:group_name], :group_permissions => group_params[:group_permissions]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/groups/'+(@reponse['id'].to_s), notice: 'Group was successfully created.' }\n end\n end",
"title": ""
},
{
"docid": "dcea0058fd3b37c8b06d814c2e754f05",
"score": "0.73729485",
"text": "def update_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "b644f99b7ba7a338d0310d6ed0a5907e",
"score": "0.7359589",
"text": "def update\n respond_to do |format|\n if @api_v1_group.update(api_v1_group_params)\n format.html { redirect_to @api_v1_group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cc48c7f6fc562e54c2dba6a780ef960",
"score": "0.72964233",
"text": "def update\n @group = Api::V1::Group.find(params[:id])\n\n if @group.update(group_params)\n head :ok\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ba7a2388a626ae10a85c348c13e5f3bb",
"score": "0.72499573",
"text": "def update #update users group\n @user_group = UserGroup.find(params[:id])\n @user_group.update(user_group_params)\n @user_group.save\n render json: @user_group\n end",
"title": ""
},
{
"docid": "b65e28618ac1b41b7ab0d147095abe11",
"score": "0.7249176",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes_from_api(params[:group])\n format.json { render_for_api :group, :json => @group }\n else\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab1f81568ff04aa0198579c1f9cf0f41",
"score": "0.72449315",
"text": "def update\n authorize! :modify, @group\n if @group.update(group_params)\n render json: @group.to_json\n else\n render_error_model(@group)\n end\n end",
"title": ""
},
{
"docid": "013fc8a1d593ec6735f1ce211a828038",
"score": "0.7230219",
"text": "def update_mod\n if params[:groupName] != nil && params[:subId] != nil && params[:password] != nil\n @group.subId = params[:subId] == \"\" ? nil : params[:subId].to_i\n @group.groupName = params[:groupName]\n @group.password = params[:password] == \"\" ? nil : params[:password]\n\n group_json = @group.to_h.to_json\n\n url = @httpIp+'/pet.com/api/group/updateGroup'\n uri = URI(url)\n res = Net::HTTP.post(uri, group_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to groups_path\n end\nend",
"title": ""
},
{
"docid": "0c8c38aa01bc84775298b920090e74b2",
"score": "0.71944666",
"text": "def update\n if @group.update(group_params(params))\n render json: @group, status: 200\n else\n render :json => @group.errors, :status => 422\n end\n end",
"title": ""
},
{
"docid": "07df2a29507ce59a2d6ec5980e393bdb",
"score": "0.71910447",
"text": "def update\n respond_to do |format|\n if @group.update(form_params)\n format.json { render json: { groups: @group }, status: :ok, location: @group }\n else\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f02bb7f65e6f31a338ba69748a93d999",
"score": "0.7137893",
"text": "def update\n @group = @groupable.groups.find(params[:id])\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to [@groupable, :groups], notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6c5d47ae3dc49c9e6d98976d735cac8",
"score": "0.7126435",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.json { render :show, id: @group.id }\n else\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa48549b5ae0bd9b5a73c44ae5ae34ae",
"score": "0.7125056",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, :notice => 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "222cc98d7114d9f473e3cff083437417",
"score": "0.71241826",
"text": "def update\n if @group.update(group_params)\n render json: @group, status: :ok\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2aaaf47e48ce47523897ea8b9bb07e92",
"score": "0.7124069",
"text": "def update_group(group_id, name)\n params = { name: name }\n\n request :patch,\n \"/v3/team/groups/#{group_id}.json\",\n params\n end",
"title": ""
},
{
"docid": "953391b6360635142b5ea786d977676e",
"score": "0.710832",
"text": "def update\n @group = Group.find_by_id(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c981337df143a67d5fd7b6f932ab5102",
"score": "0.7080632",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n Season.flush_open_groups_cache\n\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c22b6b4c5555fa08b690b65e98fb130e",
"score": "0.70702213",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n Group.rebuild!\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a78e526827dc9ef675ace45724f519a",
"score": "0.7065806",
"text": "def update\r\n if @group.update(group_params)\r\n render json: @group, status: 200, location: @group\r\n else\r\n render json: @group.errors, status: :unprocessable_entity\r\n end\r\n end",
"title": ""
},
{
"docid": "b256de05d1b5323a20ddec56a0cbfc09",
"score": "0.70573837",
"text": "def update\n unless @group.user_id == @current_user.id\n return render json: { message: 'You are not permitted to perform this operation.' }, status: :forbidden\n end\n if @group.update(group_params)\n render json: @group, status: :ok, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e4e41766d2c601b5ad23c7e5eae451bf",
"score": "0.7057236",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4e41766d2c601b5ad23c7e5eae451bf",
"score": "0.7057236",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cd9300bfdb0dc94949473ad18310a71",
"score": "0.70544094",
"text": "def update\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6bab1266f78355d208692655efd22c45",
"score": "0.7054224",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.70501083",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63b4b166da21bd9f3a235a7dec9195d2",
"score": "0.7027751",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:new_group])\n format.html { redirect_to @group, notice: 'New group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63b4b166da21bd9f3a235a7dec9195d2",
"score": "0.7027751",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:new_group])\n format.html { redirect_to @group, notice: 'New group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a57f824aac41f150d380a4c3f560657b",
"score": "0.70030534",
"text": "def update\n @group = scoped_groups.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(group_params)\n format.html { redirect_to @group, notice: 'Class was successfully updated.' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "e707a5d712f4bf2b20e98752cb2d8839",
"score": "0.69875354",
"text": "def update\n group = Group.where(slug: params[:id]).last\n\n unless group\n # TODO: Test this\n error_response('Could not find a matching group.')\n return\n end\n\n unless params[:group]['is_enabled'].nil?\n group.update_attributes!(is_enabled: params[:is_enabled])\n end\n\n properties = params[:properties]\n\n unless properties.nil?\n description_markdown = properties['description_markdown']\n description_html = properties['description_html']\n\n group.update_attributes! \\\n name: properties['name'],\n properties: properties,\n description_markdown: description_markdown,\n description_html: description_html\n end\n\n #TODO: we need to implement strong parameters\n group.update_attributes! \\\n number_of_members: params[:number_of_members],\n industry: params[:industry],\n website: params[:website],\n phone_number: params[:phone_number],\n zip_code: params[:zip_code],\n tax_id: params[:tax_id]\n\n respond_to do |format|\n format.json {\n render json: {\n group: render_group(group)\n }\n }\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.69751716",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.69751716",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.69751716",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.69751716",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.69751716",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.69751716",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.69751716",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e5ad547435d2b3bbaae23f6a4e22e2f",
"score": "0.6974992",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: t('controllers.group.update') }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af51ade912f709a748dd12eeeb34ac2f",
"score": "0.6974589",
"text": "def update\n authorize! :update, @group\n\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7ee8e96429d4d80c9e80caaae9e89c7",
"score": "0.69568413",
"text": "def update\n @group = Group.find_by_id(params[:id])\n \n respond_to do |format|\n if Group.find_all_by_user_id(current_user).include?(@group)\n if @group.update_attributes(params[:group])\n format.html { redirect_to groups_path, notice: \"Group '#{@group.name}' was successfully updated.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n else\n flash[:error] = \"Group was not found\"\n format.html { redirect_to action: \"index\" }\n end\n end\n end",
"title": ""
},
{
"docid": "48f79971719c85402bbd9dcdec01ddaa",
"score": "0.6956243",
"text": "def update\n respond_to do |format|\n if @api_v1_groups_field.update(api_v1_groups_field_params)\n format.html { redirect_to @api_v1_groups_field, notice: 'Groups field was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_groups_field }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_groups_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd85e947490f8db18eed83a80b5a69a2",
"score": "0.69506794",
"text": "def update\n if @group.update(group_params)\n render_json_message({success: t('.success')}, 200)\n else\n render_json_message({errors: @group.errors.messages}, 422)\n end\n end",
"title": ""
},
{
"docid": "76b187b371cf0fe9645ecff885239ef6",
"score": "0.6945154",
"text": "def update\n @group = Group.find(params[:id]) || ( not_found and return )\n authorize! :update, @group\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to cooperative.group_url(@group), :notice => 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => 'edit' }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff73ec353a62aa85f82df326bdd029cb",
"score": "0.69403714",
"text": "def update\n authorize! :manage, Group\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: t('action.update.succeed', entity: Group.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d92da08b1e328eeefd6621f63e6f324",
"score": "0.6920392",
"text": "def update\n @service = Fl::Framework::Service::Actor::Group.new(current_user, params, self)\n @group = @service.update()\n respond_to do |format|\n format.json do\n if @group && @service.success?\n render :json => { :group => hash_one_object(@group, @service.to_hash_params) }\n else\n error_response(generate_error_info(@service, @group))\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e31342ce864520a55dfa6bcf19f8de32",
"score": "0.6905721",
"text": "def update\n @group = Group.find(params[:id])\n authorize!(:update, @group)\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n # format.json { head :no_content }\n else\n @group = @group.decorate\n format.html { render action: \"edit\" }\n # format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f482fda0fe651babc7728f01c441753",
"score": "0.6898755",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :index, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d022eb081b99841c339e59e92c7a41d3",
"score": "0.68967134",
"text": "def update\n @group = current_resource\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8439be2d1ca580b7994df5a803e5b8be",
"score": "0.68886083",
"text": "def update\n if @group.update(group_params)\n render :show, status: :ok\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "525cbbbaa8dc532c5c6c2664fba12913",
"score": "0.6885078",
"text": "def editgroup\n if(params[:editgroup] && params[:editgroup][:id] && params[:editgroup][:name]&& params[:editgroup][:description])\n\n group = Group.find(params[:editgroup][:id])\n \n gpinfo = {:name => params[:editgroup][:name], \n :description => params[:editgroup][:description], \n :creator => group.creator, \n :self => group.self}\n\n if group.update_attributes(gpinfo)\n render :json => group.to_json(:include => {\n :users => {:except => [:created_at, :updated_at, :password_digest, :remember_token]},\n :pending_users => {:except => [:created_at, :updated_at,:password_digest, :remember_token]\n }}), :status => 200\n else\n render :json => group.errors.full_messages, :status => 400\n end\n else\n render :json => [\"Group ID Param not Found\"], :status => 400\n end\n end",
"title": ""
},
{
"docid": "9322f1e91524dff1389c063cfd2f9f0e",
"score": "0.68782026",
"text": "def update\n # I'm not sure when it actually uses the type in the name, but it seems\n # inconsistent, so we'll try both for now\n if params.has_key? params[:group_type].downcase then\n data = params[params[:group_type].downcase]\n else\n data = params[:group]\n end\n\n respond_to do |format|\n if @group.update_attributes(data)\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ee6520a31343ba3b2ced12e88c19bbf",
"score": "0.6877499",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to groups_url, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: groups_url }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8550ca9e162eb1bbb5267d258e8c8460",
"score": "0.68764055",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to groups_path, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "249b1bee5db9f9e1ff65c82fc53e0b57",
"score": "0.68755245",
"text": "def update\n @admin_group = Admin::Group.find(params[:id])\n\n respond_to do |format|\n if @admin_group.update_attributes(params[:admin_group])\n format.html { redirect_to @admin_group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5aeb3bff250f4881d90a6f2eafb9011c",
"score": "0.68653506",
"text": "def update\n #not_found() unless current_user\n @group = Group.find(params[:id])\n if @group.user_id != current_user.id\n not_found()\n end\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3dbf08ba3c047b79083097755b8455c3",
"score": "0.6859709",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6854062",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.6853446",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
242efd146342f7f178d48ea5c77df6d7
|
End namespace /users Get user from ID
|
[
{
"docid": "11df45fdff4f4d5bd1873a3db532f67b",
"score": "0.6918365",
"text": "def user_from_id(user_id)\n user = User.first(:id2 => user_id)\n if user.nil?\n give_error(400, ERROR_USER_NOT_FOUND, \"No user found.\").to_json\n end\n \n return user\n end",
"title": ""
}
] |
[
{
"docid": "2a68f384da335ac25f2cb0198dcab24e",
"score": "0.78376544",
"text": "def get_user_by_id(id)\n $r.hgetall(\"user:#{id}\")\n end",
"title": ""
},
{
"docid": "15a8bfcf46990230d5ef6abdc751b2ba",
"score": "0.7835112",
"text": "def get_user(id)\n return @client.raw(\"get\", \"/config/users/#{id}\")\n end",
"title": ""
},
{
"docid": "812e55dd9a4ff3353650515dcadb86fc",
"score": "0.7824218",
"text": "def get_user_by_id(id)\n $r.hgetall(\"user:#{id}\")\n end",
"title": ""
},
{
"docid": "42ed0fcfe1540f81adfe16495e111636",
"score": "0.7794405",
"text": "def get_user_by_id id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get USERS, id )\n\t\t\t\tend",
"title": ""
},
{
"docid": "c38a8e57fba83e243f69ad1f2f706646",
"score": "0.7644682",
"text": "def retrieve_user(user_id)\n start.uri('/api/user')\n .url_segment(user_id)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "413b1b65114fe45aea34135f179c7a38",
"score": "0.7615973",
"text": "def retrieve_user(user_id)\n start.uri('/api/user')\n .url_segment(user_id)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "6a7239ace3b8472af5316e19b53e67af",
"score": "0.76111615",
"text": "def get_users(id)\n call(:get, \"/users/#{id}\")\n end",
"title": ""
},
{
"docid": "f3b0cee9a74a992262a69651addb9ad8",
"score": "0.76019883",
"text": "def user(id:)\n User.find(id)\n end",
"title": ""
},
{
"docid": "f3b0cee9a74a992262a69651addb9ad8",
"score": "0.76019883",
"text": "def user(id:)\n User.find(id)\n end",
"title": ""
},
{
"docid": "f3b0cee9a74a992262a69651addb9ad8",
"score": "0.76019883",
"text": "def user(id:)\n User.find(id)\n end",
"title": ""
},
{
"docid": "f3b0cee9a74a992262a69651addb9ad8",
"score": "0.76019883",
"text": "def user(id:)\n User.find(id)\n end",
"title": ""
},
{
"docid": "fce0e8e480deef94e823dc0727a4189b",
"score": "0.75809586",
"text": "def user(id, query={})\n perform_get(\"/api/1/users/#{id}\", :query => query)\n end",
"title": ""
},
{
"docid": "3f89ac2f2eab26f54c9b50246e58f367",
"score": "0.7576961",
"text": "def user(user_id=nil)\n user_id ||= username\n connection.get(\"/users/#{user_id}\").body\n end",
"title": ""
},
{
"docid": "d371bf872444705fe4e59eaf579015d8",
"score": "0.7570473",
"text": "def show_user(id)\n get(\"users/#{id}\")\n end",
"title": ""
},
{
"docid": "457b7ea3d90219af4e92b8aa8efc22a7",
"score": "0.74825215",
"text": "def user(id)\n resp = @conn.get(\"users/#{id}\")\n\n Spreader::User.new(JSON.parse(resp.body))\n end",
"title": ""
},
{
"docid": "799e28b1f8536a000392c9ff56c4877d",
"score": "0.7450156",
"text": "def get_by_id(id)\n HttpClient::Preconditions.assert_class('id', id, String)\n r = @client.request(\"/users/#{CGI.escape(id)}\").get\n ::Io::Flow::V0::Models::User.new(r)\n end",
"title": ""
},
{
"docid": "799e28b1f8536a000392c9ff56c4877d",
"score": "0.7450156",
"text": "def get_by_id(id)\n HttpClient::Preconditions.assert_class('id', id, String)\n r = @client.request(\"/users/#{CGI.escape(id)}\").get\n ::Io::Flow::V0::Models::User.new(r)\n end",
"title": ""
},
{
"docid": "ff2137eee05e23e95604682a6f5cec2e",
"score": "0.73701215",
"text": "def user(id_or_screenname)\n users(request(\"users/show/#{id_or_screenname}.xml\", :auth => true)).first\n end",
"title": ""
},
{
"docid": "ff2137eee05e23e95604682a6f5cec2e",
"score": "0.73701215",
"text": "def user(id_or_screenname)\n users(request(\"users/show/#{id_or_screenname}.xml\", :auth => true)).first\n end",
"title": ""
},
{
"docid": "038fcc7637875965a465c35e082e3d7a",
"score": "0.73695195",
"text": "def user(id)\n id = id.resolve_id\n @users[id]\n end",
"title": ""
},
{
"docid": "32a3a0750004f28f2a1708b95ce64048",
"score": "0.7363751",
"text": "def user(id, opts = {})\n res = api.get(\"/users/#{id}\")\n return process_user(res)\n end",
"title": ""
},
{
"docid": "23e1d005c30d11d4ac2c61e590940a43",
"score": "0.73616564",
"text": "def get_user_by_user_id(user_id)\n # Retrieve data for a particular user\n path = \"/d2l/api/lp/#{$lp_ver}/users/#{user_id}\"\n _get(path)\n # RETURNS: a UserData JSON block\nend",
"title": ""
},
{
"docid": "3ad19e9c996b0c9b16569954ab4bfb79",
"score": "0.73371005",
"text": "def get_user(user_id)\n client.get.user(user_id)\n # =>{ id: \"user_id\", name: \"user_name\"}\n end",
"title": ""
},
{
"docid": "e97b397a893450b52a1713f81c7bdfbc",
"score": "0.73275805",
"text": "def get_user_byid(id)\n User.find(id)\n end",
"title": ""
},
{
"docid": "bcc9da6c0166533f8654d0fffacd6841",
"score": "0.73182213",
"text": "def get_user_by_id(id)\n $r.hgetall(\"user:#{id}\")\nend",
"title": ""
},
{
"docid": "bcc9da6c0166533f8654d0fffacd6841",
"score": "0.73182213",
"text": "def get_user_by_id(id)\n $r.hgetall(\"user:#{id}\")\nend",
"title": ""
},
{
"docid": "6ca27252b60955a5b44f9ddaee2362ae",
"score": "0.73040015",
"text": "def user\n AARRR.users.find_one('_id' => id)\n end",
"title": ""
},
{
"docid": "f46403a0332d1c969a1a34c31fd97c75",
"score": "0.72968346",
"text": "def get_user_by_id(id)\n @db.query(\"select * from users where id = #{id}\").first\n end",
"title": ""
},
{
"docid": "5b21aeab1b3059fd0985ebcafef0a1f8",
"score": "0.7296129",
"text": "def get_user(id_or_href)\n get(singleton_uri(id_or_href, 'users'))\n end",
"title": ""
},
{
"docid": "f715202d3f745e6a8cd10984cb60fd1c",
"score": "0.72921354",
"text": "def get_user_byid(id)\n User.find(id)\n end",
"title": ""
},
{
"docid": "8b81401ee88cadd84ad2d48f7129eaf5",
"score": "0.72849476",
"text": "def user(id)\n @users[id.resolve_id]\n end",
"title": ""
},
{
"docid": "af743a4029545641ad593cd97d93827f",
"score": "0.7237331",
"text": "def get_user_by_id(id)\n response = @rpc_helper.get_user_by_id id\n GitkitUser.parse_from_api_response response.fetch('users', [{}])[0]\n end",
"title": ""
},
{
"docid": "200078c9ed3fa39655cd8b217da648cd",
"score": "0.7233558",
"text": "def get_user_by_id(id)\n User.find(id)\n end",
"title": ""
},
{
"docid": "b73232eafc6fdded387f90b954686bdf",
"score": "0.72233987",
"text": "def get_user_byid(id)\n User.find_by(id: id)\n end",
"title": ""
},
{
"docid": "e945aa420e83e8240bade703c21a91ea",
"score": "0.72159284",
"text": "def user(user)\n get \"users/#{user}\"\n end",
"title": ""
},
{
"docid": "71069f055225252a9ddce9a0e58dfd7a",
"score": "0.72007674",
"text": "def get_user(user_id)\n request :get,\n \"/v3/team/users/#{user_id}.json\"\n end",
"title": ""
},
{
"docid": "4b8ef905a4bf077c137243c8ed4d3b58",
"score": "0.71906495",
"text": "def search_user(id:)\n User.find(id)\n end",
"title": ""
},
{
"docid": "5993277a7c513645416036de9f8e7859",
"score": "0.71900815",
"text": "def user\n @query.users.get(@name)\n end",
"title": ""
},
{
"docid": "4eea39f22bc2a477eb2bd928358eae6b",
"score": "0.71716833",
"text": "def get_user(user_id)\n Kernel.sleep WAIT_AFTER_REQUEST\n user_data = @client.get(\"/users/#{user_id}\")\n end",
"title": ""
},
{
"docid": "90d9339d8ec84d8492dabc786a88fc8e",
"score": "0.71496516",
"text": "def user(user_id = nil, options = {})\n if user_id\n get(\"/users/#{user_id}\", options)\n else\n get('/user', options)\n end\n end",
"title": ""
},
{
"docid": "5dc8f7547519030fdf5c397a4cb0de43",
"score": "0.7126825",
"text": "def get_user(id, params={})\n url = \"/#{HackernewsRuby.api_version}/user/#{id}.json\"\n get(url, params)\n end",
"title": ""
},
{
"docid": "da85b8ae338dd38b52e713fdc3218cde",
"score": "0.7124324",
"text": "def get_user_by_id(id)\n api_auth_header = {\"Authorization\" => \"Bearer #{@bearer}\"}\n url = 'https://api.twitter.com/1.1/users/lookup.json?user_id=' + user_id.to_s\n r = get_request(url)\n end",
"title": ""
},
{
"docid": "7f2df75ee16b566fa383b3ebf60eb240",
"score": "0.7113504",
"text": "def get_user(user_id)\n request(:get_user, user_id)\n end",
"title": ""
},
{
"docid": "33e003844bf1fc67469024fe88892ded",
"score": "0.71128863",
"text": "def user\n Users.find_one({id: @user_id})\n end",
"title": ""
},
{
"docid": "89fe7de97e812c24262e9b1c013ed6e1",
"score": "0.7108772",
"text": "def user user_id\n User.new(self, JSON.parse(request :get, \"users/#{user_id}\"))\n end",
"title": ""
},
{
"docid": "c38f21b52635ee260d9177f4a850ca6d",
"score": "0.71030337",
"text": "def get_user(user_id)\n retcode = 200\n begin\n res = submit_network_request(\"/users/show/#{user_id}.json\")\n return JSON.parse(res.body) if res.code.to_i == 200\n retcode = res.code.to_i\n rescue Exception => e\n throw_general_exception(\"NCTwitter.get_user()\", e)\n else\n throw_nc_exception(\"NCTwitter.get_user()\", retcode) end \n end",
"title": ""
},
{
"docid": "190a9e50c6ea50b7212ae78dc942ef3c",
"score": "0.7079448",
"text": "def user(id, &callback)\n http(:get, \"/users/#{id}.json\") do |data, http|\n Firering::User.instantiate(self, data, :user, &callback)\n end\n end",
"title": ""
},
{
"docid": "891bf8f6d741368978abcfff7e191156",
"score": "0.70631063",
"text": "def show\n @user = UsersService.getUserById(params[:id])\n end",
"title": ""
},
{
"docid": "6eb16247de98948d066d4f85641839a7",
"score": "0.7055001",
"text": "def getUserById(id)\n @user = UserRepository.getUserById(id)\n end",
"title": ""
},
{
"docid": "ede05e734fcf6b67fef152ac79b17fb8",
"score": "0.7051471",
"text": "def getUserById(id)\n @user = User.find(id)\n end",
"title": ""
},
{
"docid": "2413ae65360e097adf3176adb4e0d0e9",
"score": "0.7044444",
"text": "def users(user_id = nil)\n if user_id\n url = '/users/' + user_id\n else\n url = '/users/self'\n end\n response = get(url)\n response.user\n end",
"title": ""
},
{
"docid": "f2e8b8deb0bb3b8302d6c1001d740da8",
"score": "0.70324755",
"text": "def user\n # handles /user/{id} or /user/{login_name}\n second_param = @req.path_info.split('/')[1]\n id = second_param.to_i\n user = (id != 0 ? User.find(id) : User.find_by_user_name(second_param))\n output_format(user)\n end",
"title": ""
},
{
"docid": "d97f6ca0385cf9b75f78c883ebc7c632",
"score": "0.70307034",
"text": "def user\n User.find_by_id(user_id)\n end",
"title": ""
},
{
"docid": "d97f6ca0385cf9b75f78c883ebc7c632",
"score": "0.70307034",
"text": "def user\n User.find_by_id(user_id)\n end",
"title": ""
},
{
"docid": "d97f6ca0385cf9b75f78c883ebc7c632",
"score": "0.70307034",
"text": "def user\n User.find_by_id(user_id)\n end",
"title": ""
},
{
"docid": "20455fc7b963ee1147963b8dda56c6b8",
"score": "0.7021175",
"text": "def GetUserById\n\t\ttoFind = params[:id]\n\t\t\n\t\t@user = User.find_by(id: toFind)\t\t\n\tend",
"title": ""
},
{
"docid": "0c33ea8062c39af7dacae880db3c04fb",
"score": "0.7013467",
"text": "def user(id)\n User.find(self, id: id, context: {\n any: lambda { User.users.first },\n new: lambda { User.fake(org: self) },\n all: lambda { User.users },\n })\n end",
"title": ""
},
{
"docid": "21a538aa24aa5f76f492c5316bf62056",
"score": "0.6998122",
"text": "def user(user_id, query_params = nil)\n get(\"/users/#{user_id}\", query_params)\n end",
"title": ""
},
{
"docid": "295386e3c7a23e76d8815b119ed4e7c8",
"score": "0.6992762",
"text": "def user_by_user_id(user_id)\n return user_id.map { |uid| user_by_user_id(uid) } if user_id.is_a?(Array)\n http_get(\"content/ea/api/users.byUserId.v1.json/#{user_id}\")\n end",
"title": ""
},
{
"docid": "693c631280467201c82f0a193ed4dcdb",
"score": "0.69752973",
"text": "def find_user_by_id(id = 'my', params = {})\n object_from_response(User, :get, \"user/#{id}\", params)\n end",
"title": ""
},
{
"docid": "3e25ab96c02ffbc97786b6cd2d23bc1f",
"score": "0.69697326",
"text": "def user\n Delphix.get(Delphix.user_url).body.result\n end",
"title": ""
},
{
"docid": "a745232236fdb0fa491c7b2973dacedc",
"score": "0.6968466",
"text": "def user\n User.find(user_id)\n end",
"title": ""
},
{
"docid": "78e1ca8e8fd2b3369aedd8a87b8225af",
"score": "0.6960993",
"text": "def find(userid)\n response = @api.request(:get, \"users/#{userid}\")\n\n enabled = response.xpath(\"//data/enabled\").text\n id = response.xpath(\"//data/id\").text\n quota = response.xpath(\"//data/quota/*\").each_with_object({}) do |node, quota|\n quota[node.name] = node.text\n end\n email = response.xpath(\"//data/email\").text\n displayname = response.xpath(\"//data/displayname\").text\n phone = response.xpath(\"//data/phone\").text\n address = response.xpath(\"//data/address\").text\n website = response.xpath(\"//data/website\").text\n twitter = response.xpath(\"//data/twitter\").text\n groups = []\n response.xpath(\"//data/groups/element\").each do |prop|\n groups << prop.text\n end\n\n language = response.xpath(\"//data/language\").text\n\n user = Nextcloud::Models::User.new(enabled: enabled, id: id, quota: quota, email: email,\n displayname: displayname, phone: phone, address: address, website: website,\n twitter: twitter, groups: groups, language: language)\n (user.meta = get_meta(response)) && user\n end",
"title": ""
},
{
"docid": "eed6be8d8d7ac262c22bcc3c5f974cb3",
"score": "0.69570756",
"text": "def fetchuser\n @user = Users.where(\"username=?\",params[:id])\n end",
"title": ""
},
{
"docid": "8d5f21a6508a21cf2a134277ff5f918c",
"score": "0.6951471",
"text": "def get_user_by_id(id)\n return Amorail::Contact.find(id) #get object\n end",
"title": ""
},
{
"docid": "588318bc6540b25063518e7cea29492e",
"score": "0.6942007",
"text": "def user(user)\n request(\"users/#{user}\")[\"user\"]\n end",
"title": ""
},
{
"docid": "237a6af97a2b213b31eaf5f92b143e67",
"score": "0.69074255",
"text": "def get_info(user_id)\n if user_id.integer?\n RestClient.get \"https://#{@username}:#{@password}@convore.com/api/users/#{user_id}.json\"\n end\n end",
"title": ""
},
{
"docid": "bf0919dd85bfe1e319e9a1c96d755cf5",
"score": "0.69056916",
"text": "def user(query={})\n self.class.get(\"/users/show.json\", :query => query)\n end",
"title": ""
},
{
"docid": "85d546fe194d5ca14e3be8c3950af365",
"score": "0.6905177",
"text": "def get_user_by_sid(id, fields = {})\n api_get(:user, {'id' => id, 'fields' => fields})\n end",
"title": ""
},
{
"docid": "1fa340328c780cc7bc2a4bc7079f2724",
"score": "0.68857044",
"text": "def fetch_user_details\n get('users/list')\n end",
"title": ""
},
{
"docid": "80068cdcf1edfdd7a2c389986122c4fe",
"score": "0.68741965",
"text": "def get_userid(url=USERID_URL)\n get(url)\n end",
"title": ""
},
{
"docid": "e7312dc3aa5cb2f359940fe81bc69e8e",
"score": "0.68695986",
"text": "def find(id)\n response = JSON.parse(@client.get(\"users/#{id}\").body)\n Promisepay::User.new(@client, response['users'])\n end",
"title": ""
},
{
"docid": "5cb2ec5a4b545a8d1cd2da218f404d5c",
"score": "0.6864916",
"text": "def call(id)\n res = client.get(\"/api/rest/v1/users/#{id}.json\")\n return nil if !res || res.empty?\n\n BrickFTP::Types::User.new(**res.symbolize_keys)\n end",
"title": ""
},
{
"docid": "f28ec13f8b191a15732d1018851ec22c",
"score": "0.68604535",
"text": "def find_user_by_id(id)\n User.find_by_id(id)\n end",
"title": ""
},
{
"docid": "709b7a2b127fcd6bea6342e1ab77ca3a",
"score": "0.6857735",
"text": "def get_user(user_id)\n\trequest_type = \"GET\"\n\turl = \"user/#{user_id}\"\n\thash = create_hmac(request_type, url)\n\tresponse = http_send(request_type, url, hash)\nend",
"title": ""
},
{
"docid": "86cfb8b7b74d64d070c55d67154607ed",
"score": "0.68498534",
"text": "def get_user(user_id)\n begin\n return @root.class.find user_id\n rescue\n return nil\n end\n end",
"title": ""
},
{
"docid": "24853ef018a65df16d01107b585b6620",
"score": "0.68484485",
"text": "def get_user(user_id)\n Echochamber::Request.get_user(token, user_id)\n end",
"title": ""
},
{
"docid": "4b625188537b56a18d0144d6fb8bcca2",
"score": "0.6848161",
"text": "def user(user=nil)\n case user\n when Integer\n get \"/users/#{user}\", auth_params\n when String\n results = search(user)\n get \"/users/#{results.data[0].id}\", auth_params\n when nil\n get '/users/self', auth_params\n end\n end",
"title": ""
},
{
"docid": "d198ac4ca3d6136084d8daea7db90b94",
"score": "0.6831493",
"text": "def user(slug)\n get(\"/api/users/#{slug}\")\n end",
"title": ""
},
{
"docid": "0a9765ce89275482c2679aca5acef257",
"score": "0.6825465",
"text": "def site_user(id, params = {})\n get \"site_users/#{id}\", {query: params}\n end",
"title": ""
},
{
"docid": "6fa8677a06ead92a53b99f1204154953",
"score": "0.68249106",
"text": "def user(user_id_or_url = nil, options = {})\n options = make_options(:user_id, user_id_or_url, options)\n get(options)\n end",
"title": ""
},
{
"docid": "be3ce8e53be21b0c553bb2401e12ad2a",
"score": "0.68113846",
"text": "def get_user\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "60c32b22cec44abacb764e880e2f9df3",
"score": "0.6806019",
"text": "def get_user(users, id)\n user = users.select { |f| f[:id] == id }\n user.first\n end",
"title": ""
},
{
"docid": "4a89f1eb9a1dbd5300cce0cba165e4f0",
"score": "0.6803547",
"text": "def user(user_id, options={})\n get_auth_token do\n get(\"/api/users/#{user_id}?access_token=#{@token}\")\n end\n end",
"title": ""
},
{
"docid": "3d915ff04a08aeae8f8f3d0081528574",
"score": "0.68019545",
"text": "def find_user(id)\n response = get(\"/api/v1/users/#{id}\")\n User.new(self, response) if response\n end",
"title": ""
},
{
"docid": "1e5286d9d800cb5b8d584057a9490f41",
"score": "0.67995894",
"text": "def get_user\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "561a76a9f3151cc4df3f5e7989aa278c",
"score": "0.6799194",
"text": "def get_user\n @user = User.find_by(id: :user_id)\n end",
"title": ""
},
{
"docid": "1694375332c4177ccf25e504dad6112f",
"score": "0.67970884",
"text": "def info(params)\n user_id = (params.split(\"-\"))[0]\n @info = @client.keystone(\"users/#{user_id}\", 'GET')\n @info[\"response\"]\n end",
"title": ""
},
{
"docid": "d7ea725f3f99ba92e898dbeaf47f1d75",
"score": "0.679618",
"text": "def find(user_id)\n path = \"/users/#{user_id}\"\n\n response, status = BeyondApi::Request.get(@session,\n path)\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "1d50bb4868de8c1e790280e638ac7a95",
"score": "0.6795108",
"text": "def get_user_by_id(id)\n resp = request('getUserByID', userID: id)['user']\n resp['user_id'].nil? ? nil : User.new(self, resp)\n end",
"title": ""
},
{
"docid": "b534a5d035cb0d317db0801f3619b301",
"score": "0.67947173",
"text": "def show\n idUser = params[:id]\n result(@usersController.getUserById(idUser))\n end",
"title": ""
},
{
"docid": "3f0b95be2cb7752aa5fe725cfd3f43c8",
"score": "0.6788414",
"text": "def get_user(user_id)\n user_response = self.class.get(\"/users/#{user_id}\", @default_options)\n return Oj.load(user_response.body) if user_response.code == 200\n\n nil\n end",
"title": ""
},
{
"docid": "ae3f186e9988594e6f58832a2036febc",
"score": "0.6787493",
"text": "def get_user_by_path(path)\n obj = @service.object(path)\n .tap(&:introspect)\n User.new(obj.Get(User::INTERFACE, 'Id').first, self)\n end",
"title": ""
},
{
"docid": "57ea47de4861acea59f017ac117c6da3",
"score": "0.67872137",
"text": "def show\n id = params[:id]\n render json: V1::User.get_user_info(id)\n end",
"title": ""
},
{
"docid": "4bb801fcb57f9640d70e53265a740a9a",
"score": "0.67829263",
"text": "def user\n if id\n finder.find(id)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "2340cdcdf023b27a8e38b26508b1e8e2",
"score": "0.67823184",
"text": "def get(user_id)\n response = @client.get(\"users/#{user_id}\")\n verify response,\n not_found: 'User does not exist'\n end",
"title": ""
},
{
"docid": "959c4199e67ba4f2cf2c9827af4e4df6",
"score": "0.67778987",
"text": "def my_user(user_id)\n\t\treturn User.find_by_id(user_id)\n\tend",
"title": ""
},
{
"docid": "d11828b08b4efea43d260211637c0d52",
"score": "0.67765146",
"text": "def user\n User.find(params[:id])\n end",
"title": ""
},
{
"docid": "ebde311e1aa40eb986ec01e7e2f58c62",
"score": "0.6772795",
"text": "def get_user(user_id)\n User.filter(:id => user_id).limit(1).all[0]\n end",
"title": ""
},
{
"docid": "f634a2271b5738fd725f3ee518b416f9",
"score": "0.67724466",
"text": "def set_users_user\n @users_user = Domain[Users: :User].fetch(params[:id])\n end",
"title": ""
}
] |
928dc7691f945d48301f5035f672fd1f
|
Money gotten if sold now with latest prices
|
[
{
"docid": "2a123a18bda4dfc394698ac00e3d1a4b",
"score": "0.66544527",
"text": "def value\n buys_amount = buys.sum(:amount)\n sells_amount = sells.sum(:amount)\n (buys_amount - sells_amount) * constituent.price.amount\n end",
"title": ""
}
] |
[
{
"docid": "5c8bdf4e83d429d958f5abf147e58fbd",
"score": "0.70691067",
"text": "def calculate_final_price\n nada = price\n forty = price - (price * 0.40)\n twenty = price - (price * 0.20)\n\n if orders.count < 10\n amount = nada\n elsif orders.count.between?(10, 30)\n amount = twenty\n orders.update_attribute(:counted, true)\n else\n amount = forty\n orders.update_attribute(:counted, true)\n end\n end",
"title": ""
},
{
"docid": "651103b8e267c98eee66f27684bebe12",
"score": "0.69899076",
"text": "def latest_price\n @latest_price = (quote[\"latestPrice\"] * 100).to_i\n end",
"title": ""
},
{
"docid": "ad79d1e4baa8e0c554f010b29172e32e",
"score": "0.697492",
"text": "def at_the_money?\n stock.price == strike\n end",
"title": ""
},
{
"docid": "71633a1574d316212dd0a7648e7a7372",
"score": "0.69674754",
"text": "def current_selling_price\r\n if self.bidders.size == 0\r\n nil\r\n elsif self.bidders.size == 1\r\n self.price\r\n else\r\n (self.second_in_line_bid.values[0].to_i + increment.to_i > self.highest_bid.values[0].to_i ? self.highest_bid.values[0].to_i : self.second_in_line_bid.values[0].to_i + increment.to_i)\r\n end\r\n end",
"title": ""
},
{
"docid": "05fa3dbc4046a4ea1625d113e90f8a79",
"score": "0.69281715",
"text": "def last_price\n quote.lastTrade\n end",
"title": ""
},
{
"docid": "0058d3fb5a33f98203496c28087ad43b",
"score": "0.68791616",
"text": "def outstanding_balance\n if paid? then 0\n else price - amount_paid\n end\n end",
"title": ""
},
{
"docid": "bf29780053b2779c6f67062c9a979e06",
"score": "0.6878703",
"text": "def original_price\n purchase.program.price(purchase.days_left)\n end",
"title": ""
},
{
"docid": "1a12c43c4286fe124c2d8c300c14f4e5",
"score": "0.68724513",
"text": "def last_price_traded\n data.fetch('lastPriceTraded')\n end",
"title": ""
},
{
"docid": "783c5921cb19374f0338b66d15423d95",
"score": "0.6866281",
"text": "def selling_price\n self.special_price? ? self.special_price : self.price\n end",
"title": ""
},
{
"docid": "dfab1178f3aae052bf8fd45ec59594d5",
"score": "0.6848694",
"text": "def price\n if early_booking_price_applies?\n price_early_signup\n else\n full_price\n end\n end",
"title": ""
},
{
"docid": "dfab1178f3aae052bf8fd45ec59594d5",
"score": "0.6848694",
"text": "def price\n if early_booking_price_applies?\n price_early_signup\n else\n full_price\n end\n end",
"title": ""
},
{
"docid": "e46b7a0bb6426fc8b7d8ac2d2a00f9db",
"score": "0.68102074",
"text": "def get_price_and_update_purchased_stock_and_user_game\n require 'yahoo_stock'\n @purchase = self.purchased_stock\n @user_game = self.purchased_stock.user_game\n self.value_per_stock = ((YahooStock::Quote.new(:stock_symbols => [@purchase.stock_code]).results(:to_array).output[0][1].to_f) * 100).to_i\n # invalid stock code -> no such thing as free stocks\n # can't buy/sell negative stocks\n if self.value_per_stock == 0 or self.qty <= 0\n return false\n end\n money_involved = self.qty * self.value_per_stock\n # can't buy if not enough money\n if self.is_buy and @user_game.balance >= money_involved\n @purchase.total_qty += self.qty\n @purchase.money_spent += money_involved\n @purchase.value_in_stocks += money_involved\n @user_game.balance -= money_involved\n @user_game.total_value_in_stocks += money_involved\n self.save!\n @purchase.save!\n @user_game.save!\n return true\n # can't sell more than you currently have\n elsif (!self.is_buy) and @purchase.total_qty >= self.qty\n @purchase.total_qty -= self.qty\n @purchase.money_earned += money_involved\n @purchase.value_in_stocks -= money_involved\n @user_game.balance += money_involved\n @user_game.total_value_in_stocks -= money_involved\n self.save!\n @purchase.save!\n @user_game.save!\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "b24aeb3b4a62351e23942506330c7662",
"score": "0.6804615",
"text": "def last_sell_price\n order = corp_orders.latest_sell_order\n\n return order.price if order\n 0.0\n end",
"title": ""
},
{
"docid": "ea1a261e1faaef54d4580ffa25447427",
"score": "0.67703754",
"text": "def price\n @price ||= latest_price\n end",
"title": ""
},
{
"docid": "4a180f35e676df0f1afed7836e25e01f",
"score": "0.67614025",
"text": "def final_price\n if self.billed?\n self[:final_price]\n else\n self.rounded_final_price\n end\n end",
"title": ""
},
{
"docid": "92802527d4269bcb76901c52cb77bdef",
"score": "0.6710795",
"text": "def price action\n @price ||= begin\n response = HTTParty.get('https://www.cavirtex.com/api/CAD/ticker.json')\n prices = JSON.load(response.parsed_response)\n prices['last'].to_f.cad.to_usd\n end\n end",
"title": ""
},
{
"docid": "ae4269fcf210b6e8069be97393e53f5e",
"score": "0.6709767",
"text": "def net_dollars\n transactions.where(:seller_id => company.entity_id).sum(:dollars) - \n transactions.where(:buyer_id => company.entity_id).sum(:dollars)\n end",
"title": ""
},
{
"docid": "45b74654662337705620c589df17132c",
"score": "0.67071426",
"text": "def price_actual\n if discount.present?\n return event.price - discount\n else\n return event.price\n end\n end",
"title": ""
},
{
"docid": "0f3778b2b1db6cb4573b8967591176ee",
"score": "0.66884696",
"text": "def total_price\n on_sale ? sale_price : price\n end",
"title": ""
},
{
"docid": "10d1c5eef2fa57025161caa94f1efc50",
"score": "0.6684069",
"text": "def final_price\n price = @item_price * @quantity\n if price > 2000\n price * .90 # 10% discount\n elsif price > 5000\n price * 0.80 # 20% discount\n else\n price\n end\nend",
"title": ""
},
{
"docid": "efa3d4d95da5cef4ebdddae81dfc4d5b",
"score": "0.6670758",
"text": "def outstanding_balance\n paid? ? 0.to_d : price - (amount_paid || 0.to_d)\n end",
"title": ""
},
{
"docid": "1210f1cf81d52c0e977367af059ef0a8",
"score": "0.6669924",
"text": "def up_to_date_price\n PR::Common::ShopifyService\n .new(shop: @shop)\n .determine_price(api_shop: api_shop)\n end",
"title": ""
},
{
"docid": "3ceffe23918706237e4bfb0d25b46bc6",
"score": "0.66698724",
"text": "def amount_needed \n\t\t@daily * 7 - @stock\n\tend",
"title": ""
},
{
"docid": "9822dbf9441308a0e904573282b31885",
"score": "0.6663788",
"text": "def final_price\n if price > 2000\n price * 0.90 # 10% discount\n elsif price > 5000\n price * 0.80 # 20% discount\n else\n price\n end\nend",
"title": ""
},
{
"docid": "42e7b95af5b3adf87c18bfe6b9093658",
"score": "0.6644718",
"text": "def buyback_price\n return self.buy_price\n end",
"title": ""
},
{
"docid": "97ead0d25d56255806998d327a347a9a",
"score": "0.66244614",
"text": "def in_money(price)\n price = Fyb.ask if price == :ask\n price = Fyb.bid if price == :bid\n\n self * BigDecimal(price)\n end",
"title": ""
},
{
"docid": "b6290ae3c6b73316d7566f440d30494e",
"score": "0.6618999",
"text": "def trade\n price = @yahoo_api.get_latest_price(\"AAPL\")\n # Buy if cheap enough\n if price < 0.2\n @ib_api.buy(\"AAPL\", 100, price)\n end\n # Sell if expensive enough\n if price > 0.4 \n @ib_api.sell(\"AAPL\", 100, price)\n end\n end",
"title": ""
},
{
"docid": "b604e0bcd057a5f434bfb06ca2d1de47",
"score": "0.66170526",
"text": "def last_buy\n price_setting = CoinTradePrice.find_by_market(\"#{currency}\",\"TradeBid\")\n return if price_setting.nil?\n\n if price_setting.activate_price\n last_buy = {:price => price_setting.price}\n elsif !trades.blank?\n last_buy = Rails.cache.read(\"exchangepro:#{currency}:trades\").select { |trade| trade[:type] == \"buy\" }\n last_buy = optimize_price(last_buy, price_setting.fee)\n end\n Rails.cache.write(\"exchangepro:#{currency}:last_buy\", last_buy)\n last_buy\n end",
"title": ""
},
{
"docid": "2431dd309a59eb3a698504d8aa29b36b",
"score": "0.66166055",
"text": "def optimize_price(last_buy_sell, fee)\n if last_buy_sell.first\n price_precision = Market.find_by_id(@currency)[:price_precision]\n pow = (10 ** price_precision).to_d\n last_price = ((last_buy_sell.first[:price].to_d * (1 - fee / 100)) * pow).ceil / pow\n last_buy_sell = {:price => last_price}\n end\n last_buy_sell\n end",
"title": ""
},
{
"docid": "5ab0702a3922233c84fc3686e387aa76",
"score": "0.6614952",
"text": "def get_prices\n @last_fetch = Time.now\n Service.new(@coins).get_prices\n end",
"title": ""
},
{
"docid": "620f37a5ec9361a5771750fffe6db6d2",
"score": "0.65926677",
"text": "def current_price\n ref_price = PriceHistory.where(:coin => self.ticker).order('date DESC').limit(1).first.price\n if Random.rand < 0.5\n price = ref_price * (1 - Random.rand(5)/100.0)\n else\n price = ref_price * (1 - Random.rand(10)/100.0) \n end\n \n price\n end",
"title": ""
},
{
"docid": "f679417b6fcd7f46b461a055cfa60c8d",
"score": "0.6589368",
"text": "def available_price(my_orders, stake, exchange=nil)\n filtered_orders = (exchange.present?) ? my_orders.select {|o| o[:exchange] == exchange } : my_orders\n return 0.0 if filtered_orders.empty?\n\n price = btc_order_price(filtered_orders, stake.to_f)\n price * avg_btc_usdt\n end",
"title": ""
},
{
"docid": "e6cfd4cc5194d44d9aea48a53d2173b5",
"score": "0.6581146",
"text": "def cash_up\n total = 0\n items.each { |item| total += item.price if item.sold? }\n\n provision = if total > 19 \n Calculator.round_base(total * event.provision / 100, 0.5)\n else\n 0\n end\n\n fee = total > 19 ? event.fee : 0\n\n payback = total - provision + fee\n\n [total, provision, fee, payback] \n end",
"title": ""
},
{
"docid": "0bca102eeeaf6bdf95ceac30498c4200",
"score": "0.65746075",
"text": "def get_price(key)\n amount = @usd_price * @currency_multiplier[key]\n amount = (amount - amount % 5 + 4.99).round(2)\n end",
"title": ""
},
{
"docid": "d8d1daa17c47a81587de37b8b695e6d4",
"score": "0.65580696",
"text": "def profit\n return @price - @cost\n end",
"title": ""
},
{
"docid": "5de62399eab0e301e0f5712d7885aea8",
"score": "0.6557711",
"text": "def total_value_in_stock\n\t\tsum = 0.0 # New decimal variable\n\t\t@books_in_stock.each{|book| sum += book.price}\n\t\tsum\n\tend",
"title": ""
},
{
"docid": "662f786d525f8eb19aa7773d66d8bd38",
"score": "0.6553463",
"text": "def get_amount_paid\n if paid? then price\n else amount_paid\n end\n end",
"title": ""
},
{
"docid": "9666d7d002203cce97861dfc7a965b28",
"score": "0.6552232",
"text": "def required_mortgage\n selling_price - down_payment\n end",
"title": ""
},
{
"docid": "7643474f20c38f30feb5a85aad8ebf02",
"score": "0.6550351",
"text": "def price; regular_price; end",
"title": ""
},
{
"docid": "5d9d60a3b0f649b650ccfc9c7ec13f45",
"score": "0.6537177",
"text": "def stock_seller(stock_list)\n # setting up. We initialize max_profit to be the very first transaction we can make\n # this way, we can make a decision if we have to sell at a loss\n max_profit = stock_list[1] - stock_list[0]\n min_price = stock_list.first\n \n stock_list.each_with_index do |current_price, time|\n # skip the possiblity of doing anything else on the first day\n # no buying and selling on the same day!\n next if time == 0\n difference = current_price - min_price\n if difference > max_profit\n negative_profit = false\n max_profit = difference\n end\n #it is important to set min price here, otherwise we can just sell to ourselves if\n #we are in the negative,\n if current_price < min_price\n min_price = current_price\n end\n end\n \nmax_profit\nend",
"title": ""
},
{
"docid": "74ce0230b9edad5b2d65bc7f269ac223",
"score": "0.6530601",
"text": "def price_check(contract_id, liquidity_param, quant, choice)\n #pull in relevant contract row\n contract_row = Contract.where({ :id => contract_id }).at(0)\n \n #for classical contracts do the following:\n #need to update to account for yes vs no\n if contract_row.category == \"Classical\"\n if choice == \"yes\"\n #set contract contribution sum from before purchase to 0 to start\n contract_contribution_sum_pre = 0\n\n #calculate contract contribution sum total from before purchase\n contract_row.market.contracts.each do |contract_calc|\n contract_contibution = Math.exp((contract_calc.quantity_a.to_f / liquidity_param))\n contract_contribution_sum_pre = contract_contribution_sum_pre + contract_contibution\n end\n #calculate cost function for # of original outstanding shares\n cost_function_pre = liquidity_param * Math.log(contract_contribution_sum_pre)\n\n #set contract contribution sum from after purchase to 0\n contract_contribution_sum_post = 0\n #calculate contract contribution sum from after purchase for all contract except for the relevant contract\n contract_row.market.contracts.where.not({ :id => contract_id }).each do |contract_calc|\n contract_contibution = Math.exp((contract_calc.quantity_a.to_f / liquidity_param))\n contract_contribution_sum_post = contract_contribution_sum_post + contract_contibution\n end\n\n #add quantity user wants to purchase to the quantity for contract that user wants to purchase\n contract_contribution_sum_post = contract_contribution_sum_post + Math.exp(((contract_row.quantity_a.to_f + quant.to_f) / liquidity_param))\n\n #calculate cost function for desired # of new outstanding shares\n\n cost_function_post = liquidity_param * Math.log(contract_contribution_sum_post)\n\n #calculate pricefor purchase by subtracting the cost function post by the cost function pre\n price = (cost_function_post - cost_function_pre).ceil(2)\n\n return price\n \n #set price equal to 1-price of yes if choice is no\n #needs to be fixed so that cannot make infinite money\n elsif choice == \"no\"\n total_price = 0\n contract_row.market.contracts.where.not({ :id => contract_row.id }).each do |calculate_price|\n total_price = total_price + price_check(calculate_price.id, liquidity_param, quant, \"yes\")\n end\n\n price = total_price.ceil(2)\n\n return price\n\n end\n \n\n\n #for Independent contracts do the following:\n elsif contract_row.category == \"Independent\"\n #calculate contract contribution sum total from before purchase\n cost_function_pre = liquidity_param * Math.log((Math.exp((contract_row.quantity_a.to_f / liquidity_param)) + Math.exp((contract_row.quantity_b.to_f / liquidity_param))))\n \n if choice == \"yes\"\n cost_function_post = liquidity_param * Math.log((Math.exp(((contract_row.quantity_a.to_f + quant.to_f)/ liquidity_param)) + Math.exp((contract_row.quantity_b.to_f / liquidity_param))))\n elsif choice == \"no\"\n cost_function_post = liquidity_param * Math.log((Math.exp(((contract_row.quantity_a.to_f)/ liquidity_param)) + Math.exp(((contract_row.quantity_b.to_f + quant.to_f) / liquidity_param))))\n end\n price = (cost_function_post - cost_function_pre).ceil(2)\n return price\n end\n\n end",
"title": ""
},
{
"docid": "94699978d1decd039c9c7d4f97361d38",
"score": "0.65291256",
"text": "def total_current_value(record)\n sale_price = record[\"4. close\"].to_f # JANK\n return @settled_cash + @unsettled_cash + (@shares * sale_price)\n end",
"title": ""
},
{
"docid": "840e5fa8550f1f68b2fd8c9f98fe6655",
"score": "0.65199494",
"text": "def enough_coins?\n self.coins >= self.price\n end",
"title": ""
},
{
"docid": "06fbe88649609875bc72bee143df2ae7",
"score": "0.65198946",
"text": "def price\n # if markets aren't closed there will not be a closing price yet.\n closing_price = StockQuote::Stock.quote(ticker).close\n return \"#{closing_price} (Closing)\" if closing_price\n \n # Opening price should be available but if not just return 'Unavailable'\n opening_price = StockQuote::Stock.quote(ticker).open\n return \"#{opening_price} (Opening)\" if opening_price\n \n 'Unavailable'\n end",
"title": ""
},
{
"docid": "626435d78978b9c91d2ff61275add5b1",
"score": "0.6518503",
"text": "def money_spend_by_smoking\n # Money spend\n counted_smokes_price = smokes_counted_today * cigaret_price\n\n return 1 if counted_smokes_price <= 1\n 0\n end",
"title": ""
},
{
"docid": "14951e751852793200463044a109e637",
"score": "0.6513294",
"text": "def sell_price\n @sell_price = price || product.daily_price\n end",
"title": ""
},
{
"docid": "cc87c9eaa897dadf2289cf089f83fe70",
"score": "0.6511938",
"text": "def price\n price_fixed / 100.0\n end",
"title": ""
},
{
"docid": "299a7c3a1e10ebe6408ed7c4618aded0",
"score": "0.6511508",
"text": "def get_price\n #Only calculate final price once, thus product price changes will not\n #affect price of an already finished order.\n if @price.nil?\n if @active\n hours = ((Time.now-@start_time)/3600).to_i\n else\n hours = ((@stop_time-@start_time)/3600).to_i\n end\n @price = @product.get_price(hours)\n end\n return @price\n end",
"title": ""
},
{
"docid": "ab86624643e34e95c469fbcc7311ecde",
"score": "0.6510057",
"text": "def full_price(event)\n h.money_to_currency(object.full_price(event) || 0)\n end",
"title": ""
},
{
"docid": "21205bc3789423e6ae9048e5ddc7487e",
"score": "0.6508605",
"text": "def silver_upgrade_price\n upgrade_price(SILVER)\n end",
"title": ""
},
{
"docid": "015dd5bb481e3465f4230640c1b018db",
"score": "0.6500355",
"text": "def price\n closing_price = StockQuote::Stock.quote(ticker).open\n return \"#{closing_price} (Closing Price)\" if closing_price\n\n opening_price = StockQuote::Stock.quote(ticker).closing_price\n return \"#{opening_price} (Opening Price)\" if opening_price\n 'Unavailable'\n end",
"title": ""
},
{
"docid": "847658cf99c8650804cc9c043f0dab2a",
"score": "0.6500262",
"text": "def final_price\n if free? || cost < -discount_amount\n BigDecimal(0)\n else\n cost + discount_amount\n end\n end",
"title": ""
},
{
"docid": "cd843612a28436c5fbde8e2ce3ecdd52",
"score": "0.64989793",
"text": "def estimated_total\n quantity * last_price\n end",
"title": ""
},
{
"docid": "34c58e07a5573f840fdd667ec4df1ab8",
"score": "0.64984566",
"text": "def active_price\n if self.price_history.length > 0\n i = self.price_history.find_index { |f| f.active }\n if i.nil?\n activate_price(self.price_history.last)\n i = self.price_history.find_index { |f| f.active }\n end\n self.price_history[i].amount\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "034d61e6642b2846db6f7c8c75297441",
"score": "0.6498223",
"text": "def find_price(isin)\n fund_to_update = Fund.find_by_isin(isin)\n isin = isin + \".L\"\n stock = StockQuote::Stock.quote(isin)\n\n if stock.last_trade_price_only.nil?\n\n fund_to_update.current_price = 0.00\n fund_to_update.save\n\n else\n\n fund_to_update.current_price = stock.last_trade_price_only\n fund_to_update.save\n\n end\n\n fund_to_update.current_price\n\n end",
"title": ""
},
{
"docid": "ae9985dc48cd273eec3174bfa0b89752",
"score": "0.6497014",
"text": "def end_price\n total_price_with_discount_and_extra_costs\n end",
"title": ""
},
{
"docid": "cf08da487f796a98a1c6ed768004d19e",
"score": "0.6493263",
"text": "def price\n closing_price = StockQuote::Stock.quote(ticker).close\n return \"#{closing_price} (closing)\" if closing_price\n \n opening_price = StockQuote::Stock.quote(ticker).open\n return \"#{opening_price} (opening)\" if opening_price\n 'Unavailable'\n end",
"title": ""
},
{
"docid": "ab3bfde4bbeac313d4a00c736560314e",
"score": "0.64893115",
"text": "def price\n closing_price = StockQuote::Stock.quote(ticker).close #'close' only works after one day ends and before the next begins. Once the new day has started 'previous_close' or 'open'(as in the price at open of day) must be used.\n return \"#{closing_price} (Closing)\" if closing_price #if !closing_price...\n opening_price = StockQuote::Stock.quote(ticker).open\n return \"#{opening_price} (Opening)\" if opening_price #if !opening_price either...\n 'Unavailable'\n end",
"title": ""
},
{
"docid": "cf6a5ddfdfaf1ec25897219828e257dd",
"score": "0.64737844",
"text": "def gross_profit\n sell_price = self.sold_for || self.priced_for\n sell_price - self.bought_for\n end",
"title": ""
},
{
"docid": "d53c919b853e0ff94b061dbfe98d0b7a",
"score": "0.64707446",
"text": "def late_price() product.late_price end",
"title": ""
},
{
"docid": "752feea28b670117e63f05bbb0151c74",
"score": "0.64696795",
"text": "def gross_price\n price = 0\n logistics_order_items.each do |i|\n price += i.total_price\n end\n end",
"title": ""
},
{
"docid": "eb0023727d69171bc25b5f976d219f1d",
"score": "0.6468844",
"text": "def stock_price(ticker)\n\tstock_price = StockQuote::Stock.quote(ticker).last_trade_price_only\n\t\"The price of #{ticker} is $#{stock_price}\"\nend",
"title": ""
},
{
"docid": "903df5987d8a5b81223cd2827f92066c",
"score": "0.64684033",
"text": "def price\n Dish.find(object.id).price_change_histories.last.try(:price)\n end",
"title": ""
},
{
"docid": "e62a0eb4e399b7a9f9870453c78a5503",
"score": "0.6463137",
"text": "def price(company)\n Money.new @current_prices.fetch(company)\n end",
"title": ""
},
{
"docid": "60d3f4ebbc66b96c0fd1e0060b9ad017",
"score": "0.6454149",
"text": "def current_price\n ref_price = PriceHistory.where(:coin => self.cca_id).order('date DESC').limit(1).first.price\n if Random.rand < 0.5\n price = ref_price * (1 - Random.rand(5)/100.0)\n else\n price = ref_price * (1 - Random.rand(10)/100.0) \n end\n \n price\n end",
"title": ""
},
{
"docid": "1ae67049513f45731c1cd9bdabae1b3a",
"score": "0.6442187",
"text": "def price\n price = 0\n return price if (@itens.size == 0)\n @itens.values.each do |item| price += item.price_total end\n price += (@shipment.nil? ? 0 : @shipment)\n price\n end",
"title": ""
},
{
"docid": "eeeadf57fc3b4fd05cae5cd9d1f15c13",
"score": "0.6438023",
"text": "def remaining_money\n (total_money-paid_back)\n end",
"title": ""
},
{
"docid": "81ffbc18aaa95876167581f0b4030c2d",
"score": "0.6437904",
"text": "def price_early_signup\n if object.price_early_signup.present?\n h.money_to_currency(object.price_early_signup)\n end\n end",
"title": ""
},
{
"docid": "5824e222190140a051eae9f901e7332c",
"score": "0.6437211",
"text": "def price\n if object.price.present?\n h.money_to_currency(object.price)\n end\n end",
"title": ""
},
{
"docid": "51af85fe955babe6648e07838c9afbad",
"score": "0.6436256",
"text": "def price\n amount\n end",
"title": ""
},
{
"docid": "6aabbdbdac482cf74d4187afea610b4d",
"score": "0.6433309",
"text": "def total_gold_sell_condition\n $game_party.total_sell\n end",
"title": ""
},
{
"docid": "d512d8cc9e55ebcd9d5d6c8dfbf1ad98",
"score": "0.6430947",
"text": "def total_spending\n return @total_spending_cache if @total_spending_cache\n @total_spending_cache = Money.new(1, self.default_currency)\n self.purchase_orders.each {|o| @total_spending_cache += o.total}\n @total_spending_cache = @total_spending_cache - Money.new(1, self.default_currency)\n end",
"title": ""
},
{
"docid": "54852ae78a2dccc30ea92c4edb475fbb",
"score": "0.6430195",
"text": "def total_price\n hrs_work*cleaner.hourly_rate\n end",
"title": ""
},
{
"docid": "57c1d16f165a485c1b1983410aa3d0b9",
"score": "0.64270824",
"text": "def current_price\n if @current_price.nil?\n today = Date.today\n if prices.present?\n prices.each do |price_data|\n if today.between?(price_data.valid_from.to_date, price_data.valid_until.to_date)\n @current_price = price_data \n break\n end\n end\n end\n end\n @current_price\n end",
"title": ""
},
{
"docid": "49eb57ac741f64a38688c1b7e716b882",
"score": "0.6426834",
"text": "def price\n b = read_attribute(:price)\n if User.current and User.current.currency\n b.to_d * User.current.currency.exchange_rate.to_d\n else\n b\n end\n end",
"title": ""
},
{
"docid": "49eb57ac741f64a38688c1b7e716b882",
"score": "0.6426834",
"text": "def price\n b = read_attribute(:price)\n if User.current and User.current.currency\n b.to_d * User.current.currency.exchange_rate.to_d\n else\n b\n end\n end",
"title": ""
},
{
"docid": "a344a2f4f0ff06070c0bd6ed68a00a15",
"score": "0.64244044",
"text": "def total_value_in_stock\r\n sum = 0.0\r\n @books_in_stock.each {|book| sum += book.price} \n sum\r\n end",
"title": ""
},
{
"docid": "c0e3a596075fba5c8004507844d6b5f0",
"score": "0.6421494",
"text": "def price\n price_get(nil).try(:price_amount)\n end",
"title": ""
},
{
"docid": "473aaacddbb11c862eac1d279d7170c2",
"score": "0.64213705",
"text": "def price\n return (self.our_price || 0) + (self.provider_price || 0)\n end",
"title": ""
},
{
"docid": "473aaacddbb11c862eac1d279d7170c2",
"score": "0.64213705",
"text": "def price\n return (self.our_price || 0) + (self.provider_price || 0)\n end",
"title": ""
},
{
"docid": "e97e8e952cd7178e2811fec7db57c00a",
"score": "0.64123017",
"text": "def selling_price\n @sellprice || H87Item.default_sell_price(self)\n end",
"title": ""
},
{
"docid": "5e9572b98390fbddb1be2dedff06edc2",
"score": "0.6411041",
"text": "def enough_money\n\t\tif same_bank?\n\t\t\tmoney.to_f <= Account.where(id: sender_id).first.money.to_f\n\t\telse\n\t\t\tmoney.to_f + 5 <= Account.where(id: sender_id).first.money.to_f\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5ae751a9d437328481d5c2bdd9adfea6",
"score": "0.6407848",
"text": "def profit\n temp_trades = get_temp_trades\n\n result = 0\n temp_trades.each do |trade|\n result -= trade.num_shares * trade.price\n end\n\n truncate_round(result)\n end",
"title": ""
},
{
"docid": "5d1a9ffe980108429d5d59abd2c6d56d",
"score": "0.64066684",
"text": "def if_bought_one_of_each_item\n results = DATABASE.execute(\"SELECT cost FROM products\")\n \n @total_value = 0\n \n results.each do |hash|\n hash.delete_if do |key, value|\n key.is_a?(Integer)\n end\n hash.keep_if do |key, value|\n key == \"cost\"\n end\n hash.each do |key, value|\n @total_value += value\n end\n end\n \n return \"$\" + sprintf(\"%.02f\", (@total_value * 0.01))\n end",
"title": ""
},
{
"docid": "804ac38c8178d45d279847f29c549ee4",
"score": "0.6404009",
"text": "def today_price\n one_year_series[:adjusted_close].first.to_f\n end",
"title": ""
},
{
"docid": "b73e217218145c63d3591f0fdcf824a9",
"score": "0.6397015",
"text": "def collected_money\n loans.active.sum(:quantity)\n end",
"title": ""
},
{
"docid": "63385bde2d8248f0885a67709ca7ef6a",
"score": "0.6394375",
"text": "def last_sell\n price_setting = CoinTradePrice.find_by_market(\"#{currency}\",\"TradeAsk\")\n return if price_setting.nil?\n\n if price_setting.activate_price\n last_sell = {:price => price_setting.price}\n elsif !trades.blank?\n last_sell = Rails.cache.read(\"exchangepro:#{currency}:trades\").select { |trade| trade[:type] == \"sell\" }\n last_sell = optimize_price(last_sell, price_setting.fee)\n end\n\n Rails.cache.write(\"exchangepro:#{currency}:last_sell\", last_sell)\n last_sell\n end",
"title": ""
},
{
"docid": "9bbfee185239e6fa0ad6c24ae923cac7",
"score": "0.6391046",
"text": "def total_current_value(record)\n return @settled_cash + @unsettled_cash + (@shares * record.sale_price)\n end",
"title": ""
},
{
"docid": "6e07ebb73225695b8d67728625527d9f",
"score": "0.6390983",
"text": "def sold_total_price_help(sold)\n sold.sold_price - (sold.ship_charge || 0) - (sold.other_charge || 0)\n end",
"title": ""
},
{
"docid": "e688cc256bf1aa1b5436d553abe96152",
"score": "0.6384656",
"text": "def price\r\n stored_items.max { |item_a,item_b| item_a.price <=> item_b.price}.price\r\n end",
"title": ""
},
{
"docid": "48e499eeba249a41ac999177488349aa",
"score": "0.63814455",
"text": "def required_mortgage\n @selling_price - @down_payment\n end",
"title": ""
},
{
"docid": "48e499eeba249a41ac999177488349aa",
"score": "0.63814455",
"text": "def required_mortgage\n @selling_price - @down_payment\n end",
"title": ""
},
{
"docid": "7d52da2e2d202d0017928c32bb3ba9d7",
"score": "0.63787055",
"text": "def outstanding_amount\n total_cost - paid_amount\n end",
"title": ""
},
{
"docid": "efbe9039649e9061fa07060ad81eb784",
"score": "0.6377579",
"text": "def price\n h.number_to_currency price_range.last\n end",
"title": ""
},
{
"docid": "0b15eea715bd6e339c7070d0fd0e14cb",
"score": "0.63738024",
"text": "def money_for_us(auction)\n total_sale = auction.current_bid * auction.quantity\n if auction.premium_service\n total_sale * 0.1 # ten percent commission\n else\n total_sale * 0.05 # five percent commission\n end\n end",
"title": ""
},
{
"docid": "e1969be6c358a2bdb3d07824bcc77d12",
"score": "0.6368126",
"text": "def calculate_price\n # atskiri ifai, nes logika pagal eiles tvarka (po kiekvieno IF mazeja kw skaicius)\n if_251\n if_250\n if_150\n if_50\n @price # grazina kaina\n end",
"title": ""
},
{
"docid": "1eec8b7e35988767b780e04f4151a939",
"score": "0.6367744",
"text": "def price\n\n #If we are able to get the closing price then return it\n closing_price = StockQuote::Stock.quote(ticker).close\n return \"#{closing_price} (Closing)\" if closing_price\n\n #Otherwise, we try to get the opening price\n opening_price = StockQuote::Stock.quote(ticker).open\n return \"#{opening_price} (Opening)\" if opening_price\n\n #Otherwise, return unavailable\n 'Unavailable'\n\n end",
"title": ""
},
{
"docid": "1be18bd1be55d365ecee71e646413c35",
"score": "0.6365584",
"text": "def total_price\n @total_price ||= sum_price - active_discounts.map(&:amount).inject(&:+)\n end",
"title": ""
},
{
"docid": "22e4dc29d46b573d4531c39779fbdd21",
"score": "0.63635844",
"text": "def bid_price_for(security)\n # check my positions for this, and determine a price\n # else\n security.mid_price - price_delta\n end",
"title": ""
},
{
"docid": "989b9d98a0537f5ecf8b68e5dc04e132",
"score": "0.6361231",
"text": "def full_price\n if object.full_price.present?\n h.money_to_currency(object.full_price)\n end\n end",
"title": ""
}
] |
167c84416a4c6c33a5cfc23b22a7443a
|
Calling this will prevent activerecord from assigning the same id (which violates constrain)
|
[
{
"docid": "e160ce90bb0b3670ce40a5eb7d46b56a",
"score": "0.0",
"text": "def reset_db_peak_sequence\n ActiveRecord::Base.connection.tables.each do |t|\n ActiveRecord::Base.connection.reset_pk_sequence!(t)\n end\nend",
"title": ""
}
] |
[
{
"docid": "35d97686dc96abbfae7f08c02fdaf3e8",
"score": "0.69961417",
"text": "def create_or_update\n if self.id.is_a?(Numeric) && self.id.to_i.zero?\n self.id = nil\n @new_record = true\n end\n super\n end",
"title": ""
},
{
"docid": "44e19d395ddcbea9e8157b556904436f",
"score": "0.67715216",
"text": "def restrict_primary_key\n clear_setter_methods_cache\n @restrict_primary_key = true\n end",
"title": ""
},
{
"docid": "44e19d395ddcbea9e8157b556904436f",
"score": "0.67715216",
"text": "def restrict_primary_key\n clear_setter_methods_cache\n @restrict_primary_key = true\n end",
"title": ""
},
{
"docid": "3ad22d31e2c2ebe24e4d5b5e345b38ec",
"score": "0.6668621",
"text": "def ensure_id\n self[:_id] = ( id ? escape_doc_id : database.server.next_uuid )\n end",
"title": ""
},
{
"docid": "58caad8d1d6fbd293120bc552c2680a0",
"score": "0.65733707",
"text": "def temp_id\n #reverting to just plain id, see issue #89\n self.id\n end",
"title": ""
},
{
"docid": "5292a5a6b61058ddc9a4c0af26bf69f5",
"score": "0.6569348",
"text": "def check_id\n unless self.id\n maximo= self.class.maximum(:id)\n id = 1 unless maximo\n id ||= maximo.to_i + 1\n self.id = id\n end\n end",
"title": ""
},
{
"docid": "1e4763d297b23ecc87bd191bc6d75d8d",
"score": "0.6538434",
"text": "def keep(attribs)\n attribs[:id] = attribs[:association_id]\n super\n end",
"title": ""
},
{
"docid": "e0c870320d85ae5d5cd3a022d7d8eee0",
"score": "0.6536068",
"text": "def ensure_id\n self[:_id] = ( id ? escape_doc_id : database.server.next_uuid )\n end",
"title": ""
},
{
"docid": "d4fc7989d7195a9479ebdda1b90f770f",
"score": "0.65143126",
"text": "def sneaky_create\n if self.id.nil? && sneaky_connection.prefetch_primary_key?(self.class.table_name)\n self.id = sneaky_connection.next_sequence_value(self.class.sequence_name)\n end\n\n attributes_values = skeaky_attributes_values\n\n # Remove the id field for databases like Postgres which will raise an error on id being NULL\n if self.id.nil? && !sneaky_connection.prefetch_primary_key?(self.class.table_name)\n attributes_values.reject! { |key,_| key.name == 'id' }\n end\n\n new_id = if attributes_values.empty?\n self.class.unscoped.insert sneaky_connection.empty_insert_statement_value\n else\n self.class.unscoped.insert attributes_values\n end\n\n @new_record = false\n !!(self.id ||= new_id)\n end",
"title": ""
},
{
"docid": "c3c1abfb77a01ff9a61717fd55ea4e90",
"score": "0.645052",
"text": "def hide_id\n self.hashed_id = (((self.id * PRIME) & MAXID) ^ RNDXOR).to_s(16)\n self.save\n end",
"title": ""
},
{
"docid": "ec0a5ffee182a113e67de1074c9f90e6",
"score": "0.64447767",
"text": "def id=(id)\n @modified = false\n super\n end",
"title": ""
},
{
"docid": "ec0a5ffee182a113e67de1074c9f90e6",
"score": "0.64447767",
"text": "def id=(id)\n @modified = false\n super\n end",
"title": ""
},
{
"docid": "6346a39f64e2f4569ce343a77302c0bf",
"score": "0.6398055",
"text": "def set_unique_id\n self.update_column(:unique_id, Digest::MD5.hexdigest(self.id.to_s+Time.now.to_s))\n end",
"title": ""
},
{
"docid": "370f9819943000482f9379b94c05169b",
"score": "0.6384302",
"text": "def assign_new_id\n self.oid ||= (self.class.unscoped.maximum(:oid) || 0 ) + 1\n end",
"title": ""
},
{
"docid": "120413548657015e69f825f4169a2c3a",
"score": "0.6307435",
"text": "def set_id\n self.id = SecureRandom.random_number(9223372036854775807)\n end",
"title": ""
},
{
"docid": "fff753ff34cc0ad605fb8814c39737cc",
"score": "0.62313604",
"text": "def primary_key\n self[:primary_key] ||= self[:model].primary_key\n end",
"title": ""
},
{
"docid": "60a6f3aca584e8b3a8f694bcb21aa1fa",
"score": "0.62234926",
"text": "def fire_duplicate_id(old_entity, new_entity); end",
"title": ""
},
{
"docid": "fdb016ddcfbc5f71b06ac69f4f7022dd",
"score": "0.62209797",
"text": "def new_record(attr = nil, force_id: false, **)\n # noinspection RubyScope, RubyMismatchedReturnType\n super do |attr|\n unless administrator?\n org = current_org&.id or raise \"no org for #{current_user}\"\n attr[:org_id] = org\n end\n attr[:org_id] = 0 if attr.key?(:org_id) && attr[:org_id].nil?\n end\n end",
"title": ""
},
{
"docid": "9866dcb77d6cdbed39895e2d78888e26",
"score": "0.6192392",
"text": "def assign_identifier\n self.id ||= SecureRandom.uuid\n end",
"title": ""
},
{
"docid": "f6451547806eadd3dbdcbcc9680eae36",
"score": "0.61714303",
"text": "def set_id_on_model(model_instance, new_id)\n model_instance[foreign_key_column_name] = new_id\n end",
"title": ""
},
{
"docid": "87f809c50d5f718f8124e0183ccd9d36",
"score": "0.6162332",
"text": "def no_primary_key\n clear_setter_methods_cache\n self.simple_pk = @primary_key = nil\n end",
"title": ""
},
{
"docid": "87f809c50d5f718f8124e0183ccd9d36",
"score": "0.6162332",
"text": "def no_primary_key\n clear_setter_methods_cache\n self.simple_pk = @primary_key = nil\n end",
"title": ""
},
{
"docid": "c80717c5e7fd1dd44e9d93016c6c5297",
"score": "0.61597836",
"text": "def id=(new_id)\n return if new_id.to_s =~ BelongsToWithUuid::UUID_PATTERN\n super( new_id )\n end",
"title": ""
},
{
"docid": "3788a73df045d268908368461ff1619f",
"score": "0.6130647",
"text": "def after_save\n super\n if self.ah_id =~ /==$/\n self.update(:ah_id=>\"AH#{self.id}\")\n end\n end",
"title": ""
},
{
"docid": "7c73f3cdd36cdd36178476dc2119da11",
"score": "0.6116085",
"text": "def assign_id\n self.uid = service.mint unless new_record? && uid.present?\n self.id = service.hash(uid)\n end",
"title": ""
},
{
"docid": "7c73f3cdd36cdd36178476dc2119da11",
"score": "0.6116085",
"text": "def assign_id\n self.uid = service.mint unless new_record? && uid.present?\n self.id = service.hash(uid)\n end",
"title": ""
},
{
"docid": "3eef07d361645fe18a4953cbc6963e13",
"score": "0.6108513",
"text": "def with_pk!(pk)\n with_pk(pk) || raise(NoMatchingRow.new(self))\n end",
"title": ""
},
{
"docid": "3eef07d361645fe18a4953cbc6963e13",
"score": "0.6108513",
"text": "def with_pk!(pk)\n with_pk(pk) || raise(NoMatchingRow.new(self))\n end",
"title": ""
},
{
"docid": "45a718a2c1db23996af5b0575d0a30bd",
"score": "0.6099268",
"text": "def id=(id)\n raise IdError, \"#{id} less than 0\" if id < 0\n @id = id \n end",
"title": ""
},
{
"docid": "54855dad678719ddb100eee327553f10",
"score": "0.6085253",
"text": "def auto_generate_id\n false\n end",
"title": ""
},
{
"docid": "5209b2f6a8aaad8a7a95581568ab4472",
"score": "0.607",
"text": "def discount_id=(val, no_dirty = false)\n self.id = val\n end",
"title": ""
},
{
"docid": "d4ada04541a6b6841ca5a870ca4c5bfa",
"score": "0.6025873",
"text": "def set_or_replace_record(obj)\r\n @records.delete_if {|record| record.id == obj.id }\r\n obj.id ||= (@id_counter += 1)\r\n\r\n # Dup to clean up any extra added pieces, like Errors\r\n @records << obj.dup\r\n\r\n obj\r\n end",
"title": ""
},
{
"docid": "094f3e1df996149e5c536817c92c2e5a",
"score": "0.60191715",
"text": "def dedupe_id\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "337a3e9cd9bb0ae6b4d6fabf49ce3e61",
"score": "0.6009292",
"text": "def primary_key_attribute\n :id\n end",
"title": ""
},
{
"docid": "449648e0ab38c10cb99430705fbd49e1",
"score": "0.6008915",
"text": "def real_id\n @id\n end",
"title": ""
},
{
"docid": "449648e0ab38c10cb99430705fbd49e1",
"score": "0.6008915",
"text": "def real_id\n @id\n end",
"title": ""
},
{
"docid": "1367bb9d846ddac5c9d7afd33be7683e",
"score": "0.599144",
"text": "def id ; @record.id if @record ; end",
"title": ""
},
{
"docid": "229b692d927ec97998a4c84074e9cd61",
"score": "0.5990559",
"text": "def id=(id)\n super(id)\n end",
"title": ""
},
{
"docid": "8310a8604055df99e4f063ea6d294d55",
"score": "0.5980393",
"text": "def make_id\n new_id = @id\n @id += 1\n new_id\n end",
"title": ""
},
{
"docid": "fb25ac70f98f5ebf288783accf01eb64",
"score": "0.5978535",
"text": "def stop_delete\r\n if self.id && self.id < 11\r\n raise ActiveRecord::Rollback\r\n end\r\n end",
"title": ""
},
{
"docid": "a24ac3cf8cf75e5ff544eb17eafb1696",
"score": "0.5977534",
"text": "def set_unique\n @unique = Unique.find(params[:id])\n end",
"title": ""
},
{
"docid": "c2108736c56f0c96fd1dd85d9dbfefe6",
"score": "0.59738004",
"text": "def _next_id\n @@id -= 1\n @@id\n end",
"title": ""
},
{
"docid": "9e52d1436022a535e0270787da6fe82e",
"score": "0.59678364",
"text": "def set_one_to_one_associated_object(opts, o)\n if opts.dataset_need_primary_key? && new?\n delay_validate_associated_object(opts, o)\n after_create_hook { super(opts, o) }\n o\n else\n super\n end\n end",
"title": ""
},
{
"docid": "33b8038f1eedfd09ddc813b11a29e34a",
"score": "0.59571123",
"text": "def user_id_not_changed\n if user_id_changed? && self.persisted?\n errors.add(:user_id, \"Change of user_id not allowed!\")\n end\n end",
"title": ""
},
{
"docid": "741d471799bc961c8600f7f13cb8d569",
"score": "0.5954048",
"text": "def before(id)\n self.parameters[:max_id] = id\n self\n end",
"title": ""
},
{
"docid": "38044a2e1fc4af06e46c9090de83e1da",
"score": "0.5939609",
"text": "def id; 1; end",
"title": ""
},
{
"docid": "979b2f0f97d5395453a38a18b467c8a3",
"score": "0.59340215",
"text": "def id\n _id rescue nil\n end",
"title": ""
},
{
"docid": "4742dfd9c69546015b6fdb3229576b3a",
"score": "0.5923351",
"text": "def set_id\n @id = Id.find(params[:id])\n end",
"title": ""
},
{
"docid": "f00c4cdbc7da8ac415a29b4b506724f8",
"score": "0.59216076",
"text": "def primary_key\n 'id'\n end",
"title": ""
},
{
"docid": "2196db200c5959fd190025388b52811c",
"score": "0.5915625",
"text": "def create_without_callbacks\n row = self.class.collection.save(to_mongo_value)\n self.id = row._id\n @new_record = false\n id\n end",
"title": ""
},
{
"docid": "f1b39ecaccaa6acd7bcbd1b1b49091f8",
"score": "0.5900318",
"text": "def id; self['_id']; end",
"title": ""
},
{
"docid": "37841813716d8be7c1d548b0c8605e50",
"score": "0.5882326",
"text": "def force_primary_key(klass)\n # Automatically add an :oid serializable field if none is\n # defined and no other primary key is defined.\n if klass.primary_key == :oid and !klass.instance_attributes.include?(:oid)\n klass.attr_accessor :oid, Fixnum, :sql => primary_key_type\n end\n end",
"title": ""
},
{
"docid": "eabe478ab397b0213a0bcbcef7567c42",
"score": "0.5881517",
"text": "def id=(newid)\n @id = Integer(newid)\n end",
"title": ""
},
{
"docid": "eabe478ab397b0213a0bcbcef7567c42",
"score": "0.5881517",
"text": "def id=(newid)\n @id = Integer(newid)\n end",
"title": ""
},
{
"docid": "eabe478ab397b0213a0bcbcef7567c42",
"score": "0.5881517",
"text": "def id=(newid)\n @id = Integer(newid)\n end",
"title": ""
},
{
"docid": "7f1a3789b42f1882274bf3b9d9fd5436",
"score": "0.5880946",
"text": "def primary_key\n self[:primary_key] ||= associated_class.primary_key\n end",
"title": ""
},
{
"docid": "dad762b0b3cbe300edbf3aea860ce151",
"score": "0.5866776",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "dad762b0b3cbe300edbf3aea860ce151",
"score": "0.5866776",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "dad762b0b3cbe300edbf3aea860ce151",
"score": "0.5866776",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "dad762b0b3cbe300edbf3aea860ce151",
"score": "0.5866776",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "dad762b0b3cbe300edbf3aea860ce151",
"score": "0.5866776",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "dad762b0b3cbe300edbf3aea860ce151",
"score": "0.5866776",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "dad762b0b3cbe300edbf3aea860ce151",
"score": "0.5866776",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "dad762b0b3cbe300edbf3aea860ce151",
"score": "0.5866776",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "dad762b0b3cbe300edbf3aea860ce151",
"score": "0.5866776",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "8ee7b842c1383375b2dc0903f155d9fa",
"score": "0.5858987",
"text": "def invalid_id_number; end",
"title": ""
},
{
"docid": "032ff1fdff1dc315bc646dddc066bee8",
"score": "0.58565384",
"text": "def id=(id)\n attributes[self.class.primary_key] = id\n end",
"title": ""
},
{
"docid": "37443e119b0a7cabb5cb7ce86851ded2",
"score": "0.58553433",
"text": "def __object_unique_id__\n return 0 if self.deleted?\n return self.id\n end",
"title": ""
},
{
"docid": "fb4d24b25697a0d578ae650af0756bcb",
"score": "0.58542746",
"text": "def check_uniqueness\n if !self.id && Robot.all().any?\n throw(:abort)\n end \n end",
"title": ""
},
{
"docid": "30e6a47c94ede5fcb891b762124abe49",
"score": "0.584967",
"text": "def id\n raise MissingPrimaryKey\n end",
"title": ""
},
{
"docid": "7009876f37691ada7b40a939b6b5e072",
"score": "0.5847714",
"text": "def create\n return super unless mti_class?\n shard_wrangler.cascade_save\n ActiveRecord::IdentityMap.add(self) if ActiveRecord::IdentityMap.enabled?\n @new_record = false\n self.id\n end",
"title": ""
},
{
"docid": "d8c95db2c6299a23525872914172cf3b",
"score": "0.58344454",
"text": "def id=(id)\n end",
"title": ""
},
{
"docid": "104ad05710879f146458abfe83c2ea49",
"score": "0.58279246",
"text": "def id\n __id\n end",
"title": ""
},
{
"docid": "774d6d3bbca4f75353d14505da6ddfc3",
"score": "0.5824549",
"text": "def with_pk!(pk)\n with_pk(pk) || raise(NoMatchingRow.new(dataset))\n end",
"title": ""
},
{
"docid": "774d6d3bbca4f75353d14505da6ddfc3",
"score": "0.5824549",
"text": "def with_pk!(pk)\n with_pk(pk) || raise(NoMatchingRow.new(dataset))\n end",
"title": ""
},
{
"docid": "e73a42febe0ac10fb41f0e4e47ed63ae",
"score": "0.58165324",
"text": "def id\n @properties[self.class.primary_key].to_i unless new_record?\n end",
"title": ""
},
{
"docid": "c4d7c0d5418483cf7393f2ca70522683",
"score": "0.58158904",
"text": "def acceptable_id?\n id = extracted_id\n existing._id == id || id.nil? || (existing._id != id && update_only?)\n end",
"title": ""
},
{
"docid": "028fd9e6679f4de6cb3b5002f68e82b6",
"score": "0.5810746",
"text": "def _new_id\n @lock.synchronize do\n begin\n # Generate a random number. It's recommended to not store more than\n # 2**62 objects in the same store.\n id = rand(2**64)\n # Ensure that we don't have already another object with this ID.\n end while @in_memory_objects.include?(id) || @db.include?(id)\n\n id\n end\n end",
"title": ""
},
{
"docid": "4b862a3cc053bdbbf219c66270474b9e",
"score": "0.58092487",
"text": "def create_record(attr = nil, force_id: false, no_raise: false, **)\n # noinspection RubyScope, RubyMismatchedReturnType\n super do |attr|\n unless administrator?\n org = current_org&.id or raise \"no org for #{current_user}\"\n attr[:org_id] = org\n end\n attr[:org_id] = nil if attr.key?(:org_id) && (attr[:org_id].to_i == 0)\n end\n end",
"title": ""
},
{
"docid": "fd6aeb79effe7937620d33687da1b3aa",
"score": "0.57820797",
"text": "def rails_id\n self.object.id\n end",
"title": ""
},
{
"docid": "7b7e9f3c72027de80b1dd51445453f06",
"score": "0.5776422",
"text": "def unique_id #:nodoc:\n @unique_id = (@unique_id || 0) + 1\n end",
"title": ""
},
{
"docid": "0f3bc9ffa3577858c695c5b497d5e4ee",
"score": "0.577021",
"text": "def id=(id) # :nodoc:\n raise NotImplementedError.new('id can not be changed once the object was created')\n end",
"title": ""
},
{
"docid": "cd76b719a911e8380325b2b6473152c1",
"score": "0.576866",
"text": "def do_after_initialize\n if self.user_set_id\n self.id = self.user_set_id\n end\n end",
"title": ""
},
{
"docid": "7cc8c7648b9348c12473555e50781009",
"score": "0.5758032",
"text": "def _before_validation\n set_uuid if new?\n super\n end",
"title": ""
},
{
"docid": "f0acc576b218e429d288a51e3beefd42",
"score": "0.57554734",
"text": "def id=(new_id)\n @id = new_id\n end",
"title": ""
},
{
"docid": "15b474633a1b92523e38f42963173d4b",
"score": "0.5755155",
"text": "def id\n nil\n end",
"title": ""
},
{
"docid": "1bdacec8c5475eb349a22d7ccf81c706",
"score": "0.5752974",
"text": "def assign_objectid_primary_key\n self.class.objectid_columns_manager.assign_objectid_primary_key(self)\n end",
"title": ""
},
{
"docid": "20eb75dea8b64ef677c28820e90e7523",
"score": "0.57439387",
"text": "def id=(v)\r\n @id = v\r\n end",
"title": ""
},
{
"docid": "5ed14c78bbd6ae7584d1a9c380c7bd07",
"score": "0.57425153",
"text": "def stores_foreign_key?; false; end",
"title": ""
},
{
"docid": "5ed14c78bbd6ae7584d1a9c380c7bd07",
"score": "0.57425153",
"text": "def stores_foreign_key?; false; end",
"title": ""
},
{
"docid": "b01099bd6f63597a96a33681706f0c14",
"score": "0.5742507",
"text": "def set_id\n\t\t\trand(111111111...999999999)\n\t\tend",
"title": ""
},
{
"docid": "3d35088c1e62ed0e68e3f9dd2c480c44",
"score": "0.5739415",
"text": "def id=( str )\n if str.respond_to?(:match)\n escaped = CGI.escape( str )\n \n # CLEANUP: do a bulk delete request on the old id, now that it has changed\n delete(true) if !new? && escaped != self[:_id]\n \n self[:id] = str\n self[:_id] = escaped \n str \n end \n end",
"title": ""
},
{
"docid": "fa2283d9954a9d5768720318be8ef193",
"score": "0.5726897",
"text": "def primary_key!\n @primary_keys << @name\n end",
"title": ""
},
{
"docid": "54da2102642283b55612452696f32897",
"score": "0.5725994",
"text": "def associated_primary_key\n self[:associated_primary_key] ||= associated_class.primary_key\n end",
"title": ""
},
{
"docid": "a671deb188d5b8355856ac5a7cd9144a",
"score": "0.5716458",
"text": "def save\n super if self.user_id.present?\n # Else do nothing (dont call save)\n end",
"title": ""
},
{
"docid": "b502a8f25a46d97d0828587f7fd76894",
"score": "0.5713324",
"text": "def restrict_primary_key?\n @restrict_primary_key\n end",
"title": ""
},
{
"docid": "b502a8f25a46d97d0828587f7fd76894",
"score": "0.5713324",
"text": "def restrict_primary_key?\n @restrict_primary_key\n end",
"title": ""
},
{
"docid": "329339fc28b087a7f448b9146233b00f",
"score": "0.5710659",
"text": "def id\n @id_number = 12345\n end",
"title": ""
},
{
"docid": "1fc257b81771012179a87700a9bf3648",
"score": "0.57048446",
"text": "def new_id\n @last_id ||= 0\n @last_id += 1\n end",
"title": ""
},
{
"docid": "1fc257b81771012179a87700a9bf3648",
"score": "0.57048446",
"text": "def new_id\n @last_id ||= 0\n @last_id += 1\n end",
"title": ""
},
{
"docid": "1f2e92f9309faee6a377c1e873b270cd",
"score": "0.570103",
"text": "def new_id\n @last_id ||= 0\n @last_id += 1\n end",
"title": ""
}
] |
b165bb4158b78da21bdb9e01c19103e0
|
Gets a list of all packet filter rules.
|
[
{
"docid": "5ce30df5c46a5649e24f081ff110f2fb",
"score": "0.0",
"text": "def list\n super\n end",
"title": ""
}
] |
[
{
"docid": "88898f9ef9f1b620130fa66a5819665d",
"score": "0.6974597",
"text": "def all\n @rules\n end",
"title": ""
},
{
"docid": "a891425c1bf5f60ce569ad6d219d6d84",
"score": "0.69298327",
"text": "def rules\n return [] if @rules.empty?\n @rules.sort_by { |k| k['priority'] }.map { |h| h['rule_name'] }\n end",
"title": ""
},
{
"docid": "161c5c5187eceac0fda3ef351ec68db5",
"score": "0.67241013",
"text": "def rules\n @rules ||= []\n end",
"title": ""
},
{
"docid": "161c5c5187eceac0fda3ef351ec68db5",
"score": "0.67241013",
"text": "def rules\n @rules ||= []\n end",
"title": ""
},
{
"docid": "d0f647dd10e987b16fb22a03ea838e39",
"score": "0.656856",
"text": "def rules\n return @rules\n end",
"title": ""
},
{
"docid": "905d444833858cb4cb739095cec32f0c",
"score": "0.6490922",
"text": "def rules\n @rules=get_endpoint('rule').keys\n end",
"title": ""
},
{
"docid": "f32a67d3f34e2dec5a41aabb86696bd7",
"score": "0.637719",
"text": "def get_all_notification_rules(opts = {})\n data, _status_code, _headers = get_all_notification_rules_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "1f279da401eee504fc8cf0f20a4e12f1",
"score": "0.63655245",
"text": "def get_rules\r\n @rules\r\n end",
"title": ""
},
{
"docid": "271e760022445b261e6e8ae643808582",
"score": "0.63178396",
"text": "def rules\n #\n # This is called first in case any preable needs to be declared (chains, specifically)\n #\n _ruleset_rules = ruleset_rules\n\n [\n Asbestos.firewall.preamble(self),\n _ruleset_rules,\n Asbestos.firewall.postamble(self)\n ].flatten\n end",
"title": ""
},
{
"docid": "3cf0d61afe0667a48daf7003a515f57f",
"score": "0.6310651",
"text": "def to_list\n rules.map do |rule|\n object = { actions: rule.actions, subject: rule.subjects.map{ |s| s.is_a?(Symbol) ? s : s.name } }\n object[:conditions] = rule.conditions unless rule.conditions.blank?\n object[:inverted] = true unless rule.base_behavior\n object\n end\n end",
"title": ""
},
{
"docid": "1fd3ad8864bea2118df633fe48caa7f9",
"score": "0.63101184",
"text": "def rules\n @rules ||= begin\n @rules = []\n resolve_permissions\n @rules\n end\n end",
"title": ""
},
{
"docid": "72976231b6133362e579a98ac3345791",
"score": "0.6307269",
"text": "def rules\n @rules.dup.freeze\n end",
"title": ""
},
{
"docid": "6e93574ffb2db547c4fb0d2ff1e5a5a3",
"score": "0.6274104",
"text": "def rules\n @rules.map{|r| [r.name, r.rule]}.to_h\n end",
"title": ""
},
{
"docid": "c24c97288b6c8e85c437baaaf53104a4",
"score": "0.6215383",
"text": "def ruleset_rules\n @rulesets.collect do |r|\n [\"# Begin [#{r.name}]\",\n r.firewall_rules,\n \"# End [#{r.name}]\",\n \"\"]\n end\n end",
"title": ""
},
{
"docid": "584e53f171fec2bba6efd494c5c8a096",
"score": "0.620142",
"text": "def rules\n rule_applier.rules\n end",
"title": ""
},
{
"docid": "927c04bfaa97826713e7e0fe8279454c",
"score": "0.6176388",
"text": "def all\n rules = []\n\n raw.each do |type, details|\n # Add general rules\n Array(details['prefix']).each do |prefix|\n rules.push({\n prefix: prefix.to_s,\n length: details['length'],\n type: type\n })\n end\n\n # Process each country\n Array(details['countries']).each do |country, prefixes|\n # Add a rule for each prefix\n Array(prefixes).each do |prefix|\n rules.push({\n prefix: prefix.to_s,\n length: details['length'],\n type: type,\n country: country,\n })\n end\n end\n\n end\n\n # Sort by prefix length\n rules.sort { |x, y| y[:prefix].length <=> x[:prefix].length }\n end",
"title": ""
},
{
"docid": "fc137121741ab2bbe08df6be94daea8f",
"score": "0.6157325",
"text": "def list_filters\n if @filters.empty?\n fetch_configuration()\n end\n return @filters.keys\n end",
"title": ""
},
{
"docid": "9a1fe312cce044e0f16745e53be06f81",
"score": "0.61412376",
"text": "def get_all_config_rules\n config_rules = []\n\n # Fetch all rules with pagination\n response = @client.describe_config_rules\n config_rules += response.config_rules\n while response.next_token\n response = @client.describe_config_rules(next_token: response.next_token)\n config_rules += response.config_rules\n end\n config_rules = config_rules.map(&:to_h)\n\n # Add necessary data to rules using helpers\n add_compliance_to_config_rules(config_rules)\n add_results_to_config_rules(config_rules)\n end",
"title": ""
},
{
"docid": "2a397568a64a3a0cdebe64f50fa29669",
"score": "0.61005396",
"text": "def rules\n self.class.rules\n end",
"title": ""
},
{
"docid": "a2d853a91fd9ba81b8f8a9551e5895a9",
"score": "0.609222",
"text": "def list\n @driver.getRuleNames\n end",
"title": ""
},
{
"docid": "cbe6a0794f7c004083463007a8c09c1a",
"score": "0.6085526",
"text": "def all\n @rules ||= raw.values.flatten.map { |rule| Accessibility::Rule.new(rule) }\n end",
"title": ""
},
{
"docid": "f5353b0a310c4a6eecf72f42e6bc850d",
"score": "0.60551614",
"text": "def patterns\n #@rules.every.pattern\n @rules.map {|r| r.pattern }\n end",
"title": ""
},
{
"docid": "5e0355b1917627084cc57cf13c51c73f",
"score": "0.5956771",
"text": "def rules\n @rules ||= {}\n end",
"title": ""
},
{
"docid": "5e0355b1917627084cc57cf13c51c73f",
"score": "0.5956771",
"text": "def rules\n @rules ||= {}\n end",
"title": ""
},
{
"docid": "5e0355b1917627084cc57cf13c51c73f",
"score": "0.5956771",
"text": "def rules\n @rules ||= {}\n end",
"title": ""
},
{
"docid": "9122e652513d30a3d397d75c00e537c7",
"score": "0.5925711",
"text": "def available_rules\n\t\tif @rules.nil?\n\t\t\t@rules = []\n\t\t\tDir.glob(File.join(@rule_directory,\"**\",\"*.yar*\")).each do |yara_rule_file|\n\t\t\t\trule = YaraRule.new\n\t\t\t\trule.file_path = yara_rule_file.gsub(\"/\",\"\\\\\\\\\")\n\t\t\t\t@rules << rule\n\t\t\tend\n\t\tend\n\t\treturn @rules\n\tend",
"title": ""
},
{
"docid": "6440044940729fe1f9f076b5bf53e067",
"score": "0.592249",
"text": "def list_plugin_rules\n nessus_rest_get('plugin-rules')['plugin-rules']\n end",
"title": ""
},
{
"docid": "5703064c3b918ea26cca9783622d0632",
"score": "0.5887363",
"text": "def list_forwarding_rules(opts = {})\n data, _status_code, _headers = list_forwarding_rules_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "b55792682885c3028858d2dd2a8854cd",
"score": "0.58643055",
"text": "def to_rules\n Array.new.tap do |rules|\n new_rule = Rule.new(rule.chain)\n new_rule.description = \"#{rule.description} (#{self.description})\"\n new_rule.rule = rule.rule.gsub(/\\{\\{(\\w+)\\}\\}/) do\n if value = self.options[$1.to_sym]\n value\n else\n \"{{#{$1}}}\"\n end\n end\n new_rule.action = rule.action\n new_rule.conditions = rule.conditions | self.conditions\n if self.version\n new_rule.versions = [self.version]\n end\n\n if has_host_group?\n host_group = @rule.chain.table.base.host_groups[self.options[:ip]]\n host_group.hosts.each do |key, host|\n host.ips.each do |v, ip|\n hg_rule = new_rule.dup\n hg_rule.description += \" (#{host.name} via #{host_group.name})\"\n hg_rule.rule.gsub!(host_group.name.to_s, ip)\n hg_rule.versions = [v]\n rules << hg_rule\n end\n end\n else\n rules << new_rule\n end\n end\n end",
"title": ""
},
{
"docid": "505d77041b58c9edb86a869e99e2ab3a",
"score": "0.58535427",
"text": "def rules(options={})\n get('getNotificationRules', options)\n end",
"title": ""
},
{
"docid": "58b96ecf9efe03423d8ea5ced2f3e35a",
"score": "0.584972",
"text": "def rules_for(path)\n @rules.reverse.select do |rule| path.match(rule.pattern) end\n end",
"title": ""
},
{
"docid": "959e6896a7b2d90a019e4e4edb750bf3",
"score": "0.5836006",
"text": "def all\n @filters\n end",
"title": ""
},
{
"docid": "2420ed5d0e47e52289e2abcbe584acda",
"score": "0.5772808",
"text": "def get_rules(scope = nil)\n path = scope ? \"/pushrules/#{scope}\" : '/pushrules'\n make_request(:get, path).parsed_response\n end",
"title": ""
},
{
"docid": "007edfbf73d270a78544629e1973c9e4",
"score": "0.57455015",
"text": "def all_defined_rules\n if @group\n @defined_rules.merge(@group.all_defined_rules)\n else\n @defined_rules\n end\n end",
"title": ""
},
{
"docid": "c1c7dde087f2832ff30971848ab56d57",
"score": "0.5743968",
"text": "def parse_firewall_rules\n script_code = 'netsh advfirewall firewall show rule name=all verbose'\n cmd = powershell_out(script_code) # Not logged because it makes too much noise\n\n retval = parse_firewall_paragraphs(cmd)\n\n raise 'Could not parse firewall rules' if retval.empty?\n return retval\n end",
"title": ""
},
{
"docid": "838f4cbfcfa83d030c520278afa06b82",
"score": "0.57227814",
"text": "def rules\n @rules ||= {}\n end",
"title": ""
},
{
"docid": "ea0edc2f08733b713573ef4e83955b65",
"score": "0.5716267",
"text": "def get_bre_rules(opts = {})\n data, _status_code, _headers = get_bre_rules_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "e120959b8bd97154acda972043b65380",
"score": "0.5715585",
"text": "def to_a\n @rules.keys\n end",
"title": ""
},
{
"docid": "cf480265e6bd1559be42bf5ea72f3c78",
"score": "0.5702728",
"text": "def rules\n return @rules unless @rules.nil?\n\n # this initialization code runs only once\n @rules = {}\n 7.downto(0).each do |rule_key|\n key = rule_key.to_s(2).rjust(3, '0') # convert to binary, pad left with 0\n @rules[key.to_sym] = RULE_NAME >> rule_key & 1 # just the one bit\n end\n\n @rules\n end",
"title": ""
},
{
"docid": "2a06c8983fc1fa8d6ff4b1afa794d774",
"score": "0.5663789",
"text": "def get_rules\n rules = Array.new\n\n RULE_TYPES.each do |reg|\n ebtables_exit = `#{CONF[:ebtables]} -L FORWARD`\n\n rules << ebtables_exit.split(\"\\n\")[3..-1].collect do |l|\n line = l.strip\n m = line.match(reg)\n\n if m\n interface=m[1]\n {\n :interface => interface, \n :rule => line\n }\n else\n nil\n end\n end.compact\n end\n\n rules.flatten\nend",
"title": ""
},
{
"docid": "eeab252db23f377cc4ace0f832b541c4",
"score": "0.56319773",
"text": "def list(filter)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter)\n\t\t\tclient.queue_service_action_call('parentalrule', 'list', 'KalturaParentalRuleListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"title": ""
},
{
"docid": "b53b2fc379d6abb7f872919d246e1c5a",
"score": "0.5629056",
"text": "def rules_with_epsilon()\n rules = []\n @rules.each do |rule|\n rules << rule if rule.epsilon?\n end\n rules\n end",
"title": ""
},
{
"docid": "5d3c268ae18638d620476a2ad47f7b52",
"score": "0.56062967",
"text": "def rule_names\n @rule_names ||= []\n end",
"title": ""
},
{
"docid": "5d3c268ae18638d620476a2ad47f7b52",
"score": "0.56062967",
"text": "def rule_names\n @rule_names ||= []\n end",
"title": ""
},
{
"docid": "2d682777251526651c92f9e2106154a9",
"score": "0.5598444",
"text": "def filters\n if @filters.empty?\n fetch_configuration()\n end\n return @filters\n end",
"title": ""
},
{
"docid": "f3afa08c934a56afdbd32788a8a6b292",
"score": "0.5589067",
"text": "def known_rules\n @table.keys\n end",
"title": ""
},
{
"docid": "ef471a2da0ed51f0fba25b01d9bfad76",
"score": "0.5573276",
"text": "def filters\n if metaclass.method_defined? :_filters\n self._filters\n else\n []\n end\n end",
"title": ""
},
{
"docid": "1a96459fedfa05a9edc3e5f73b777105",
"score": "0.5554586",
"text": "def LIST_RULES\n return @legacy.LIST_RULES if @legacy\n raise 'Using legacy auditd_rules LIST_RULES interface with non-legacy audit package. Please use the new syntax.'\n end",
"title": ""
},
{
"docid": "e543cb41f48f64760367726563aec4b5",
"score": "0.55451",
"text": "def get_all_rules\n @options = {\n headers: {\n \"User-Agent\": 'v2FilteredStreamRuby',\n \"Authorization\": \"Bearer #{@bearer_token}\"\n }\n }\n @response = Typhoeus.get(@rules_url, @options)\n raise \"An error occurred while retrieving active rules from your stream: #{@response.body}\" unless @response.success?\n\n @body = JSON.parse(@response.body)\nend",
"title": ""
},
{
"docid": "1d8498f0940bbf3519685153b70490d4",
"score": "0.55265456",
"text": "def firewalls_list\n return [] unless configured?\n\n @service.fetch_all do |token|\n @service.list_firewalls(@gcp_config['project'], page_token: token)\n end.map(&:name)\n end",
"title": ""
},
{
"docid": "b2be2abb21cab6d8434cddbc175551ed",
"score": "0.5523232",
"text": "def rules\n @rules ||= Rules.new(path, logger)\n end",
"title": ""
},
{
"docid": "9f9581de51d49d7b6f151eda1b312597",
"score": "0.55131257",
"text": "def config_filters\n []\n end",
"title": ""
},
{
"docid": "88b57b543035131f07a2794eefe8ac1e",
"score": "0.55006206",
"text": "def rules_ids\n @rules_registry.rules.map(&:id)\n end",
"title": ""
},
{
"docid": "168a77ff8e6e92029fb923f112a4be64",
"score": "0.5478298",
"text": "def rules # :nodoc:\n # Rules should always be returned sorted with oldest first.\n @rules.sort! { |a, b| b[:age] <=> a[:age] }\n end",
"title": ""
},
{
"docid": "28313634b9f014e6d6bfdabc059453ca",
"score": "0.5461886",
"text": "def rulelist(ruleset, ctx)\r\n\r\n outlist = \"\"\r\n\r\n ruleset.rules.each do |ralias|\r\n rname = ctx.rules[ralias].name\r\n outlist += reference(\"rule\", rname)\r\n\r\n end # rules.each\r\n\r\n return outlist\r\n\r\n end",
"title": ""
},
{
"docid": "3cc29967acc86f0336221fc6902da517",
"score": "0.54157424",
"text": "def cost_filters\n get('/1/reporting/cost/filters').to_a\n end",
"title": ""
},
{
"docid": "23cff1c1fed717f83ece38280ab33ae7",
"score": "0.5390313",
"text": "def filters\n mentos(:get_all_filters)\n end",
"title": ""
},
{
"docid": "f50b94334d20745ae11ee45cbd8fa260",
"score": "0.5372359",
"text": "def get_candidates(rules)\n candidates = []\n rules.each { |rule| candidates << rule if rule.ever_matched? && rule.time_to_report? }\n candidates\n end",
"title": ""
},
{
"docid": "3232a1ce37aa32be74c06fad0984a32a",
"score": "0.5371086",
"text": "def rules_for(configuration, character)\n # note that it is select (filter), not detect (find)\n rules.select {|rule| rule.applies_to?(configuration, character)}\n end",
"title": ""
},
{
"docid": "789b874400cc96a4d076c65c9b7528c4",
"score": "0.5356483",
"text": "def firewall_rules\n return unless exists?\n additional_resource_properties(\n {\n property_name: \"firewall_rules\",\n property_endpoint: \"#{id}/firewallRules\",\n api_version: @opts[:firewall_rules_api_version],\n },\n )\n end",
"title": ""
},
{
"docid": "61c622e90e7df0ee8759d6918d7660e0",
"score": "0.53384334",
"text": "def rules(rule_name:, kind:)\n Rules::RuleSet.build_for(calendar: calendar, kind: kind).rules_with_name(rule_name)\n end",
"title": ""
},
{
"docid": "986e0cb98f625167a44e21ce4cc826eb",
"score": "0.5337233",
"text": "def allowed_filters\n []\n end",
"title": ""
},
{
"docid": "d3835123391f8c9c25adec727b2a42d6",
"score": "0.53204477",
"text": "def get_all(provider = :aws)\n @@_rule_set_registry.fetch(provider, {}).values\n end",
"title": ""
},
{
"docid": "ed1b6332e17fffe71947e89883a6cb0a",
"score": "0.5315511",
"text": "def rules(event)\n @rules[event]\n end",
"title": ""
},
{
"docid": "a4792ba0b09498f1da94045c16a9c0fa",
"score": "0.53108543",
"text": "def get_relevant_rules\r\n @relevant_rules = Array.new\r\n @facts.each { |k,f| \r\n add_relevant_rules_for_fact f\r\n }\r\n sort_relevant_rules\r\n end",
"title": ""
},
{
"docid": "8af44bdc9a5dfde3386ee3e66aa0e4ae",
"score": "0.53016603",
"text": "def rules; end",
"title": ""
},
{
"docid": "8af44bdc9a5dfde3386ee3e66aa0e4ae",
"score": "0.53016603",
"text": "def rules; end",
"title": ""
},
{
"docid": "8af44bdc9a5dfde3386ee3e66aa0e4ae",
"score": "0.53016603",
"text": "def rules; end",
"title": ""
},
{
"docid": "8af44bdc9a5dfde3386ee3e66aa0e4ae",
"score": "0.53016603",
"text": "def rules; end",
"title": ""
},
{
"docid": "8af44bdc9a5dfde3386ee3e66aa0e4ae",
"score": "0.53016603",
"text": "def rules; end",
"title": ""
},
{
"docid": "8af44bdc9a5dfde3386ee3e66aa0e4ae",
"score": "0.53016603",
"text": "def rules; end",
"title": ""
},
{
"docid": "8af44bdc9a5dfde3386ee3e66aa0e4ae",
"score": "0.53016603",
"text": "def rules; end",
"title": ""
},
{
"docid": "ea9380847c6cbe76e28db189526a33f1",
"score": "0.52991235",
"text": "def filters\n self.class.filters\n end",
"title": ""
},
{
"docid": "0706e4c1b80ae2160778dc35914ea2fb",
"score": "0.5298388",
"text": "def all_constraints(table_filter=nil)\n constraints = tables.values.map(&:constraints).flatten\n constraints.delete_if{|c|!table_filter.include?(c.table.name)} if table_filter\n constraints\n end",
"title": ""
},
{
"docid": "06ecde86379fc6dcda7c8c57596ff319",
"score": "0.5296189",
"text": "def list(filter)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter)\n\t\t\tclient.queue_service_action_call('userassetrule', 'list', 'KalturaUserAssetRuleListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"title": ""
},
{
"docid": "92628b1719ce0bdd7e9a4349384ca552",
"score": "0.5283499",
"text": "def validation_rules\n []\n end",
"title": ""
},
{
"docid": "0a0d7dcec8094ee1fb38b5711f7aa106",
"score": "0.5275582",
"text": "def get_rules(store_id, opts = {})\n data, _status_code, _headers = get_rules_with_http_info(store_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "8180afb7d1ac1b30028ded693cf86747",
"score": "0.52713186",
"text": "def rules\n cluster.configurationEx.rule\n end",
"title": ""
},
{
"docid": "8180afb7d1ac1b30028ded693cf86747",
"score": "0.52713186",
"text": "def rules\n cluster.configurationEx.rule\n end",
"title": ""
},
{
"docid": "d255b183af7b4cbaa5fa201b35bf88e6",
"score": "0.5246995",
"text": "def readable\n \"Rules:\\n#{rules.collect {|r| r.readable }.join('\\n')}\\nFacts:\\n#{all_facts.collect {|f| f.readable }.join('\\n')}\"\n end",
"title": ""
},
{
"docid": "f75752064b2a04f2dea6e32f48976cc4",
"score": "0.5232367",
"text": "def find_rules(dir)\n if File.directory?(dir)\n Dir.entries(dir).grep(/_rule.rb$/)\n else\n @logger.debug(\"The argument %s is not a directory while looking for rules\" % dir)\n []\n end\n end",
"title": ""
},
{
"docid": "0342e5c12f2c468e4680d229d1c69fcc",
"score": "0.52235854",
"text": "def rules_by_name; end",
"title": ""
},
{
"docid": "91d277ef5dba76201a4dbc847136e654",
"score": "0.51939267",
"text": "def printRules\n\t\n\t@i = 1\n\t@@rulesArray.each do |rule|\n\t\tputs \"#{@i}-#{rule.fetch('src_ip')}/#{rule.fetch('src_netmask')}:#{rule.fetch('src_port')} #{rule.fetch('dest_ip')}/#{rule.fetch('dest_netmask')}:#{rule.fetch('dest_port')} #{rule.fetch('protocol')} #{rule.fetch('action')}\"\n\t\t@i += 1\n\tend\n\n\tif @i == 1\n\t\tputs \"No rules to print!\"\n\telse\n\t\tputs \"Rules Loaded!\"\n\tend\nend",
"title": ""
},
{
"docid": "3ecc3271bb4740cce78072569142487c",
"score": "0.51915133",
"text": "def filters\n @filters ||= {}\n end",
"title": ""
},
{
"docid": "3ecc3271bb4740cce78072569142487c",
"score": "0.51915133",
"text": "def filters\n @filters ||= {}\n end",
"title": ""
},
{
"docid": "9e8991fb09b3499b939c06399b9766b9",
"score": "0.51880276",
"text": "def network_usage_rules\n return @network_usage_rules\n end",
"title": ""
},
{
"docid": "017b319bd16146b9c45c0e5c69d24350",
"score": "0.5178386",
"text": "def inbound_rules\n @inbound_rules ||= normalized_security_rules.one_direction_rules(\"inbound\")\n end",
"title": ""
},
{
"docid": "0a86593a07df95cf16766433f1f7a276",
"score": "0.51735735",
"text": "def properties\n properties = []\n\n rules.values.each do |declarations|\n declarations.each {|property, value| properties << [property, value] }\n end\n \n properties\n end",
"title": ""
},
{
"docid": "1b2fcb54eb5ceff7fdebc76d6311286d",
"score": "0.5161327",
"text": "def rules( *new_values )\n\t\tself.rules = new_values unless new_values.empty?\n\t\treturn @rules\n\tend",
"title": ""
},
{
"docid": "a65a170186112186d8ea3b04322a6e4e",
"score": "0.51535165",
"text": "def filter\n RuleAspect.from_hash(description['Filter'])\n end",
"title": ""
},
{
"docid": "036cbb8667de52610b04d98959d2ca4e",
"score": "0.51465994",
"text": "def rules_for_type(type)\n FILTER_VALUES.each do |rule|\n return rule if rule[:type] == type\n end\n nil\n end",
"title": ""
},
{
"docid": "2fc41cf09f0a0359c4da4606ad558c6e",
"score": "0.5144302",
"text": "def rules=(value)\n @rules = value\n end",
"title": ""
},
{
"docid": "bbf69a8cc8959d98e87ce09bcbb5058c",
"score": "0.512982",
"text": "def dumpRules()\r\n 79.times {print \"=\"}\r\n puts\r\n puts \"RULE DUMP\".center(80)\r\n 79.times {print \"=\"}\r\n puts\r\n\r\n if(@rules.length > 0)\r\n rules = @rules.sort\r\n rules.each do |key, rule|\r\n puts \"#{rule.name}\\t(#{rule.alias})\"\r\n puts \"#{rule.xml}\"\r\n 40.times {print \"-\"}\r\n puts\r\n end\r\n\r\n else\r\n puts \"No rules to dump.\"\r\n end\r\n\r\n puts \"\"\r\n end",
"title": ""
},
{
"docid": "a2171baf037012a273949c78df3efaa5",
"score": "0.5124535",
"text": "def rules_containing(production)\n rules = []\n @rules.each do |rule|\n rules << rule if rule.productions.include?(production)\n end\n rules\n end",
"title": ""
},
{
"docid": "0280aa45eb46d99aec128540b0a424a1",
"score": "0.5114307",
"text": "def nic_udev_rules\n nics.map {|nic| nic.udev_rule }\n end",
"title": ""
},
{
"docid": "32a1a0f354843da5a33a836152dc58ee",
"score": "0.5108241",
"text": "def content_filtering_rules\r\n ContentFilteringRulesController.instance\r\n end",
"title": ""
},
{
"docid": "aaefd39b6ecb01da744b85721bb41961",
"score": "0.5105675",
"text": "def get_ifilters\n retval = Ifilter.order(:name) #retval = Ifilter.all\n get_internal_ifilters.each do |f|\n retval.prepend(f)\n end\n\n return retval\n end",
"title": ""
},
{
"docid": "813b48c4b37eef44b64fe13fed56bc94",
"score": "0.51019347",
"text": "def list_conditions\n @list_conditions ||= FilterFoo.new\n end",
"title": ""
},
{
"docid": "215ff291df3236f6a446417e13a5cafe",
"score": "0.5101825",
"text": "def relevant_rules(action, subject)\n return [] unless @rules\n\n relevant = possible_relevant_rules(subject).select do |rule|\n rule.expanded_actions = expand_actions(rule.actions)\n rule.relevant? action, subject\n end\n relevant.reverse!.uniq!\n optimize_order! relevant\n relevant\n end",
"title": ""
},
{
"docid": "f4c2eacb8fe0ad1d82712f6929bbccfc",
"score": "0.508663",
"text": "def rules_as_hash\n\t\tunless @rules_as_hash\n\t\t\t@rules_as_hash = self.rules.each_with_object( {} ) do |rule, hash|\n\t\t\t\tpred, succ = self.parse_rule( rule )\n\t\t\t\thash[ pred ] = succ\n\t\t\tend\n\n\t\t\tself.alphabet.each do |char|\n\t\t\t\t@rules_as_hash[ char ] = char unless @rules_as_hash.key?( char )\n\t\t\tend\n\t\tend\n\n\t\treturn @rules_as_hash\n\tend",
"title": ""
},
{
"docid": "4284a6f94a5517f59fbcdbf493226506",
"score": "0.50695175",
"text": "def risk_rules\n @risk.rules.map { |rule| Item.new(resolve(rule)) }.compact.reject { |i| i.disabled? }\n end",
"title": ""
}
] |
25f11f039f624909dd9868ab7d06fee0
|
Gosu implementation Inputs: none Outputs: none
|
[
{
"docid": "763e5817900fcdc1226bf5063f71ae0b",
"score": "0.0",
"text": "def clicked\n end",
"title": ""
}
] |
[
{
"docid": "64ecf4bb47342c97dbb7efe629dc7867",
"score": "0.6552962",
"text": "def draw\n \n if @visible > 0 #Draw the Ruby if @visible is a number bigger than 0\n @image.draw(@x - @width / 2, @y - @height / 2, 1)\n end\n \n @hammer_image.draw(mouse_x - 40, mouse_y - 10, 1) #Draw the hammer on the mouse position\n \n if @hit == 0\n c = Gosu::Color::NONE\n elsif @hit == 1\n c = Gosu::Color::GREEN\n elsif @hit == -1\n c = Gosu::Color::RED\n end\n \n draw_quad(0, 0, c, 800, 0, c, 800, 600, c, 0, 600, c)\n @hit = 0\n\n @font.draw(@score.to_s, 700, 20, 2)\n\n @font.draw(@time_left.to_s, 20, 20, 2)\n\n unless @playing\n @font.draw('Game Over', 300, 300, 3)\n @font.draw('Press the spacebar to play again', 175, 350, 3)\n @visible = 20\n end\nend",
"title": ""
},
{
"docid": "901899b5555febe51afc34c9ad4a7bd5",
"score": "0.64619476",
"text": "def render args\r\n if (args.state.player.dx < 0.01) && (args.state.player.dx > -0.01)\r\n args.state.player.dx = 0\r\n end\r\n\r\n\r\n args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge\r\n # sets x by multiplying 64 to index to find pixel value (places all squares side by side)\r\n # subtracts 64 from bridge_top because position is denoted by bottom left corner\r\n [i * 64, args.state.bridge_top - 64, 64, 64, 10, 200, 10]\r\n end\r\n args.state.loopy.angle = ((2*Math::PI)*args.state.player.dx/1400) + args.state.loopy.angle #dictates how quickly the angle changes\r\n if (args.state.loopy.angle > 2*Math::PI)#keeps angle between 0-360\r\n args.state.loopy.angle = 0\r\n end\r\n\r\n #sprites\r\n loopstart = [463, args.state.loopy.hide, 32, 32, \"sprites/square/yellow.png\", 0, 0]\r\n looprestart = [560, 70, 64, 64, \"sprites/square/indigo.png\", 0, 0]\r\n looprestart2 = [250, 70, 64, 64, \"sprites/square/indigo.png\", 0, 0]\r\n player = [args.state.player.x, args.state.player.y, args.state.player.w, args.state.player.h, \"sprites/circle/blue.png\", args.state.player.r]\r\n loopy = [202 , 127 , 466, 466, \"sprites/circle/white.png\" , 0]\r\n\r\n if ((player.rect.intersect_rect? looprestart) || (player.rect.intersect_rect? looprestart2)) #reset loop\r\n args.state.loopy.hide = 128\r\n end\r\n \r\n if (player.rect.intersect_rect? loopstart) && (args.state.player.dx > 4) #loop start\r\n args.state.tickstart = args.state.tick_count\r\n args.state.inloop = true\r\n args.state.loopy.hide = 0\r\n args.state.loopy.angle = Math::PI * 1.5\r\n end\r\n \r\n \r\n\r\n if args.state.inloop #in loop\r\n if ((args.state.loopy.angle > Math::PI * 1.5) && (args.state.loopy.angle < Math::PI * 2) && (args.state.player.dx < 0.5))\r\n args.state.player.sliding = true\r\n\r\n elsif ((args.state.loopy.angle > Math::PI * 0.01) && (args.state.loopy.angle < Math::PI * 0.9) && (args.state.player.dx < 0.5))\r\n args.state.player.dx = 0\r\n args.state.inloop = false\r\n args.state.player.sliding = false\r\n args.state.player.r = 0\r\n args.state.player.dy = 0\r\n args.state.loopy.hide = 128\r\n elsif !((args.state.loopy.angle > Math::PI * 1.49) && (args.state.loopy.angle < Math::PI * 1.50)) \r\n args.state.player.x = (Math.cos(args.state.loopy.angle)*args.state.loopy.r)+400\r\n args.state.player.y = (Math.sin(args.state.loopy.angle)*args.state.loopy.r)+328 \r\n args.state.player.r = (90 + args.state.loopy.angle * 180 / Math::PI)\r\n else\r\n args.state.inloop = false\r\n args.state.player.sliding = false\r\n args.state.player.r = 0\r\n \r\n end\r\n\r\n if ((args.state.loopy.angle > Math::PI * 1) && (args.state.loopy.angle < Math::PI * 1.5))\r\n args.state.player.dx += 0.3\r\n end\r\n\r\n if ((args.state.player.sliding) && !(args.state.loopy.angle < Math::PI * 1.55))\r\n args.state.player.dx -= 0.4\r\n args.state.player.x = (Math.cos(args.state.loopy.angle)*args.state.loopy.r)+400\r\n args.state.player.y = (Math.sin(args.state.loopy.angle)*args.state.loopy.r)+328 \r\n args.state.player.r = (90 + args.state.loopy.angle * 180 / Math::PI)\r\n elsif (args.state.player.sliding)\r\n args.state.inloop = false\r\n args.state.player.sliding = false\r\n args.state.player.r = 0\r\n end\r\n end\r\n \r\n\r\n \r\n\r\n \r\n #args.outputs.labels << [10, 35.from_top, \" #{1==1}\"] # test value \r\n #args.outputs.labels << [10, 50.from_top, \"sliding: #{(args.state.player.sliding)}\"] # test value \r\n #args.outputs.sprites << [(Math.cos(args.state.loopy.angle)*args.state.loopy.r)+400,(Math.sin(args.state.loopy.angle)*args.state.loopy.r)+328 , 64, 64, \"sprites/square/gray.png\", 90+(args.state.tick_count % 360*2), 0]\r\n\r\n #spriterender\r\n args.outputs.background_color = [40, 200, 255]\r\n args.outputs.sprites << loopstart\r\n args.outputs.sprites << looprestart\r\n args.outputs.sprites << looprestart2\r\n args.outputs.sprites << player\r\n args.outputs.sprites << loopy\r\n\r\n\r\nend",
"title": ""
},
{
"docid": "a73f5124f21223119564a95a861eaf0f",
"score": "0.6432291",
"text": "def draw\n # draw ruby if visible\n if @visible > 0\n @image.draw(@x - @width / 2, @y - @height / 2, 1)\n end\n\n # always draw hammer\n @hammer.draw(mouse_x - 40, mouse_y - 10, 1)\n\n # on a click the screen flashes green or red (hit or fail)\n if @hit == 0\n c = Gosu::Color::NONE # otherwhise it doesn't do it\n elsif @hit == 1\n c = Gosu::Color::GREEN\n elsif @hit == -1\n c = Gosu::Color::RED\n end\n # draw square for flahing effect ofn teh wholse screen and reset hit variable\n draw_quad(0, 0, c, 800, 0, c, 800, 600, c, 0, 600, c)\n @hit = 0\n\n # draw time lift and score all the time\n @font.draw(@time_left.to_s, 20, 20, 2)\n @font.draw(@score.to_s, 700, 20, 2)\n\n # whe game is done draw game over messages and ruby\n unless @playing\n @font.draw('Game Over', 300, 300, 3)\n @font.draw('Press the Space Bar to Play Again', 175, 350, 3)\n @visible = 20\n end\n end",
"title": ""
},
{
"docid": "0c28b0ca25c6b43dec32f94acf984eaf",
"score": "0.6423636",
"text": "def setup\n char_num = 1 + rand(14)\n @char = Gosu::Image.new(\"relax/assets/characters/char\" + char_num.to_s + \".png\")\n @boom = Gosu::Sample.new(\"relax/assets/audio/explosion.ogg\")\n @dust0 = Gosu::Image.new(\"relax/assets/dust/dust0.png\")\n @dust1 = Gosu::Image.new(\"relax/assets/dust/dust1.png\")\n @dust2 = Gosu::Image.new(\"relax/assets/dust/dust2.png\")\n @dust3 = Gosu::Image.new(\"relax/assets/dust/dust3.png\")\n @dust = false\n @dust_img = @dust3\n @x = rand(1000) + 50\n @y = rand(600) + 50\n @z = @y\n @vel_x = @vel_y = @angle = 0.0\n @score = 0\n @direction = 1\n @rate = 10\n @steps = 0 # step counter\n @max_steps = 10\n @left = false\n @right = false\n @up = false\n @down = false\n # @directions = {left: false, right: false, up: false, down: false}\n @walking = false\n @has_toy = nil\n @bumps = 0\n end",
"title": ""
},
{
"docid": "187b75fd4fce23358d7143ce38fdbed6",
"score": "0.63725585",
"text": "def tick(args)\n\n # --- Setup : ---\n setup(args) unless args.state.setup_done\n\n\n # --- Update : ---\n \n # Game :\n args.state.player.update args, args.state.map\n args.state.scene.update args, args.state.player\n\n args.state.last_mouse_position = args.inputs.mouse.point\n\n # Camera :\n args.state.renderer.focal += 5 if args.inputs.keyboard.key_down.l\n args.state.renderer.focal -= 5 if args.inputs.keyboard.key_down.k\n\n args.state.view_height_ratio += 0.05 if args.inputs.keyboard.key_down.j\n args.state.view_height_ratio -= 0.05 if args.inputs.keyboard.key_down.h\n\n args.state.mode = ( args.state.mode + 1 ) % 2 if args.inputs.keyboard.key_down.space\n\n # Key mapping selection :\n if args.inputs.keyboard.key_down.m then\n if args.state.mapping == :qwerty then\n puts 'switched to azerty'\n KeyMap::unset QWERTY_MAPPING\n args.state.mapping = :azerty\n KeyMap::set AZERTY_MAPPING\n\n elsif args.state.mapping == :azerty then\n puts 'switched to qwerty'\n KeyMap::unset AZERTY_MAPPING\n args.state.mapping = :qwerty\n KeyMap::set QWERTY_MAPPING\n\n end\n end\n\n\n 9 # --- Render : ---\n columns = args.state.renderer.render args.state.scene,\n args.state.player\n\n\n # --- Draw : ---\n if args.state.mode == 0 || args.state.mode.nil? then\n args.outputs.solids << [ [0, 0, 1279, 359, 40, 40, 40, 255],\n [0, 360, 1279, 720, 50, 50, 50, 255] ]\n\n args.outputs.sprites << columns.map.with_index do |column,index|\n column.map do |layer|\n unless layer[:texture_path].nil? then\n rectified_height = layer[:height].to_i * 12\n lighting = lighting_at args, layer[:distance].to_i\n RayCaster::Slice.new( index * 8,\n ( 720.0 - args.state.view_height_ratio * rectified_height ) / 2.0,\n 8,\n rectified_height,\n layer[:texture_path],\n lighting,\n lighting,\n lighting,\n layer[:texture_offset],\n 0,\n 1,\n 32 )\n end\n end\n end\n\n elsif args.state.mode == 1 then\n offset_world_space = [20,100]\n Debug::render_map_top_down args.state.scene.map, offset_world_space\n Debug::render_player_top_down args.state.player, args.state.renderer, offset_world_space\n Debug::render_wall_hits columns, offset_world_space\n Debug::render_entities args.state.scene, args.state.player, offset_world_space\n\n end\nend",
"title": ""
},
{
"docid": "9f9ebd0b00eafd2fd088d6a987d59043",
"score": "0.6365208",
"text": "def tick args\n\n # One of the things in \"args\" is the \"outputs\" object that your game uses\n # to draw things. Afraid of rendering APIs? No problem. In DragonRuby,\n # you use arrays to draw things and we figure out the details.\n # If you want to draw text on the screen, you give it an array (the thing\n # in the [ brackets ]), with an X and Y coordinate and the text to draw.\n # The \"<<\" thing says \"append this array onto the list of them at\n # args.outputs.labels)\n args.state.rotation ||= 0\n args.state.x ||= 576\n args.state.y ||= 100\n args.state.xVelocity ||= 5\n args.state.yVelocity ||= 5\n args.state.bouxSize ||= 0\n args.state.sounds ||= [1, 2, 3]\n\n\n if args.state.x > 1160\n args.state.xVelocity = -5\n end\n if args.state.y > 610\n args.state.yVelocity = -5\n end\n\n if args.state.x < -10\n args.state.xVelocity = 5\n end\n if args.state.y < -10\n args.state.yVelocity = 5\n end\n\n args.state.x += args.state.xVelocity\n args.state.y += args.state.yVelocity \n\n if args.inputs.mouse.click || !args.inputs.finger_one.nil?\n args.outputs.sounds << \"sounds/boux#{args.state.sounds.sample}.wav\"\n puts \"sounds/boux#{args.state.sounds.sample}.wav\"\n args.state.bouxSize = args.state.bouxSize + 20\n end\n\n args.outputs.sprites << [args.state.x,\n args.state.y,\n args.state.bouxSize + 128,\n args.state.bouxSize + 128,\n 'sprites/BOUX.png',\n args.state.rotation]\n args.outputs.labels << [580, 400, 'BOUX',args.state.bouxSize+30, args.state.bouxSize + 30]\n\n args.state.rotation -= 1\nend",
"title": ""
},
{
"docid": "f79d6eab82525e63c6c9cc93fec578c1",
"score": "0.6303517",
"text": "def game_logic\n falcon_input\n handle_hieros\n handle_enemies\n handle_obstacles\n gosu_fps\n end",
"title": ""
},
{
"docid": "2a8b1f7962c294afbed80133626481cb",
"score": "0.624247",
"text": "def tick(args)\n # --- 1. Setup :\n setup(args) unless args.state.setup_done\n\n\n # --- 2. User Inputs :\n \n # - 2.1 Player control :\n if args.inputs.keyboard.key_held.left then\n args.state.player.direction += ROTATION_SPEED\n args.state.player.ux = Math::cos( args.state.player.direction.to_radians + Math::PI/2.0 )\n args.state.player.uy = Math::sin( args.state.player.direction.to_radians + Math::PI/2.0 )\n args.state.player.vx = -args.state.player.uy\n args.state.player.vy = args.state.player.ux\n args.state.player.dx = TRANSLATION_SPEED * args.state.player.ux\n args.state.player.dy = TRANSLATION_SPEED * args.state.player.uy\n elsif args.inputs.keyboard.key_held.right then\n args.state.player.direction -= ROTATION_SPEED\n args.state.player.ux = Math::cos( args.state.player.direction.to_radians + Math::PI/2.0 )\n args.state.player.uy = Math::sin( args.state.player.direction.to_radians + Math::PI/2.0 )\n args.state.player.vx = -args.state.player.uy\n args.state.player.vy = args.state.player.ux\n args.state.player.dx = TRANSLATION_SPEED * args.state.player.ux\n args.state.player.dy = TRANSLATION_SPEED * args.state.player.uy\n end\n\n if args.inputs.keyboard.key_held.up then\n args.state.player.x += args.state.player.dx\n args.state.player.y += args.state.player.dy\n end\n\n # -2.2 Geometry control :\n\n\n # --- 3. Rasterizing :\n\n # DEBUG DEBUG DEBUG !!!\n\n # Coordinates :\n #args.outputs.labels << [ 20, 700, \"map width: #{args.state.track[0].length} - height: #{args.state.track.length}\" ]\n #args.outputs.labels << [ 20, 680, \"player coords: #{( args.state.player.x / 8 ).floor};#{( args.state.player.y / 8 ).floor}\" ]\n \n\n # - 3.1 Blitting tile map :\n\n # - Field of view content :\n field_of_view, center = args.state.renderer.compute_field_of_view args.state.player.ux,\n args.state.player.uy,\n args.state.player.vx,\n args.state.player.vy\n scaned_field = scan_convert field_of_view \n field_bounds = find_bounds field_of_view\n\n rectangle = [ field_bounds[0] - field_bounds[0], field_bounds[1] - field_bounds[1], field_bounds[2], field_bounds[3] ]\n args.render_target(:road).width = field_bounds[2]\n args.render_target(:road).height = field_bounds[3]\n\n\n # DEBUG DEBUG DEBUG :\n args.outputs.labels << [ 20, 700, \"Bounds: #{field_bounds[0]}, #{field_bounds[1]}, #{field_bounds[2]}, #{field_bounds[3]}\" ] \n args.outputs.labels << [ 20, 670, \"Center: #{center[0]}, #{center[1]} (offset: #{center[0] - field_bounds[0]}, #{center[1] - field_bounds[1]})\" ]\n args.render_target(:road).lines << [ [ field_of_view[0][0] - field_bounds[0], field_of_view[0][1] - field_bounds[1], field_of_view[1][0] - field_bounds[0], field_of_view[1][1] - field_bounds[1], 255, 0, 255, 255 ],\n [ field_of_view[1][0] - field_bounds[0], field_of_view[1][1] - field_bounds[1], field_of_view[2][0] - field_bounds[0], field_of_view[2][1] - field_bounds[1], 255, 0, 255, 255 ],\n [ field_of_view[2][0] - field_bounds[0], field_of_view[2][1] - field_bounds[1], field_of_view[3][0] - field_bounds[0], field_of_view[3][1] - field_bounds[1], 255, 0, 255, 255 ],\n [ field_of_view[3][0] - field_bounds[0], field_of_view[3][1] - field_bounds[1], field_of_view[0][0] - field_bounds[0], field_of_view[0][1] - field_bounds[1], 255, 0, 255, 255 ] ]\n draw_cross_to_target :road, [ center[0] - field_bounds[0], center[1] - field_bounds[1] ], [255, 0, 255, 255]\n args.render_target(:road).borders << rectangle + [ 255, 0, 0, 255 ]\n\n base_x = args.state.player.x.div( TILE_SIZE )\n base_y = args.state.player.y.div( TILE_SIZE )\n tiles = []\n scaned_field.each do |bounds|\n break if bounds[0].nil? || bounds[1].nil?\n\n x = bounds[0][0] - ( bounds[0][0] % TILE_SIZE )\n max_x = bounds[1][0]\n y = bounds[0][1] - ( bounds[0][1] % TILE_SIZE )\n until x >= max_x do\n tile_index_x = base_x + x.div(TILE_SIZE)\n tile_index_y = base_y + y.div(TILE_SIZE) \n tile_index = args.state.track[tile_index_y][tile_index_x] \n\n break if tile_index.nil?\n\n tile_x = x - ( ( args.state.player.x ) % TILE_SIZE ) + center[0] - field_bounds[0]\n tile_y = y - ( ( args.state.player.y ) % TILE_SIZE ) + center[1] - field_bounds[1]\n tiles << blit_tile( tile_index, tile_x, tile_y )\n\n x += TILE_SIZE\n end\n end\n\n args.render_target(:road).sprites << tiles\n\n\n # - 3.2 Rotating :\n puts center\n args.outputs.sprites << { x: args.state.renderer.far_fov_width - center[0] + field_bounds[0],\n #args.render_target(:scanned_road).sprites << { x: args.state.renderer.far_fov_width - center[0] + field_bounds[0],\n y: args.state.renderer.center - args.state.renderer.near - center[1] + field_bounds[1],\n w: field_bounds[2],\n h: field_bounds[3],\n path: :road,\n angle: -args.state.player.direction,\n angle_anchor_x: ( center[0] - field_bounds[0] ) / field_bounds[2],\n angle_anchor_y: ( center[1] - field_bounds[1] ) / field_bounds[3] }\n\n\n # - 3.2 Mode 7 rasterizing :\n #distance = 0\n #args.render_target(:scanned_road).sprites << args.state.raster_height.times.map do |y|\n # jump = 10.0 * y / ( args.state.raster_height - 1 ) + 1\n # distance += 1#jump\n # scale = 1 - ( 0.9 / 80.0 ) * y\n # { x: 80 - 640 * scale,\n # y: y,\n # w: 1280 * scale,\n # h: 1,\n # path: :rotated_road,\n # source_x: 0,\n # source_y: 368 + distance,\n # source_w: 1280,\n # source_h: 1 }\n # end\n\n #args.outputs.sprites << { x: 0,\n # y: 0,\n # w: SCREEN_WIDTH,\n # h: SCREEN_HEIGHT,\n # path: :scanned_road,\n # source_x: 0,\n # source_y: 0,\n # source_w: 160,\n # source_h: 90 }\n\n\n # --- 4. Background :\n args.outputs.solids << [ 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 50, 50, 50, 255 ]\nend",
"title": ""
},
{
"docid": "5b674ed9a71bd022ea051098b31490c3",
"score": "0.6230425",
"text": "def render args\r\n if (args.state.player.dx < 0.01) && (args.state.player.dx > -0.01)\r\n args.state.player.dx = 0\r\n end\r\n\r\n\r\n \r\n #sprites\r\n player = [args.state.player.x, args.state.player.y, args.state.player.w, args.state.player.h, \"sprites/square/white.png\", args.state.player.r]\r\n playershield = [args.state.player.x-20, args.state.player.y-10, args.state.player.w+20, args.state.player.h+20, \"sprites/square/blue.png\", args.state.player.r, 0]\r\n playerjab = [args.state.player.x+32, args.state.player.y, args.state.player.w, args.state.player.h, \"sprites/isometric/indigo.png\", args.state.player.r, 0]\r\n playerupper = [args.state.player.x, args.state.player.y+32, args.state.player.w, args.state.player.h, \"sprites/isometric/indigo.png\", args.state.player.r+90, 0]\r\n\r\n if (args.state.inputlist[0] == \"<<\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n player = [args.state.player.x, args.state.player.y, args.state.player.w, args.state.player.h, \"sprites/square/yellow.png\", args.state.player.r]\r\n \r\n end\r\n\r\n if (args.state.inputlist[0] == \"jk\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n player = [args.state.player.x, args.state.player.y, args.state.player.w, args.state.player.h, \"sprites/square/indigo.png\", args.state.player.r]\r\n playershield = [args.state.player.x-10, args.state.player.y-10, args.state.player.w+20, args.state.player.h+20, \"sprites/square/blue.png\", args.state.player.r, 50]\r\n end\r\n\r\n if (args.state.inputlist[0] == \"v>j\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n playerjab = [args.state.player.x, args.state.player.y, args.state.player.w+30, args.state.player.h+60, \"sprites/isometric/red.png\", args.state.player.r-45, 255]\r\n \r\n end\r\n\r\n if (args.state.inputlist[0] == \"<j\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n playerjab = [args.state.player.x-20, args.state.player.y, args.state.player.w-10, args.state.player.h, \"sprites/isometric/indigo.png\", args.state.player.r, 255]\r\n end\r\n\r\n if (args.state.inputlist[0] == \"j\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n playerjab = [args.state.player.x+32, args.state.player.y, args.state.player.w, args.state.player.h, \"sprites/isometric/indigo.png\", args.state.player.r, 255]\r\n end\r\n\r\n if (args.state.inputlist[0] == \"k\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n playerupper = [args.state.player.x, args.state.player.y+32, args.state.player.w, args.state.player.h, \"sprites/isometric/indigo.png\", args.state.player.r+90, 255]\r\n end\r\n\r\n if (args.state.inputlist[0] == \"kair\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n playerupper = [args.state.player.x, args.state.player.y-32, args.state.player.w, args.state.player.h, \"sprites/isometric/indigo.png\", args.state.player.r+90, 255]\r\n end\r\n\r\n if (args.state.inputlist[0] == \"j+k\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n playerupper = [args.state.player.x, args.state.player.y+32, args.state.player.w, args.state.player.h, \"sprites/isometric/violet.png\", args.state.player.r+90, 255]\r\n playerjab = [args.state.player.x+32, args.state.player.y, args.state.player.w, args.state.player.h, \"sprites/isometric/violet.png\", args.state.player.r, 255]\r\n end\r\n\r\n \r\n \r\n args.outputs.labels << [10, 35.from_top, \" #{args.state.inputlist[0]}\"] # test value \r\n args.outputs.labels << [10, 55.from_top, \" #{args.state.inputlist[1]}\"] # test value\r\n args.outputs.labels << [10, 75.from_top, \" #{args.state.inputlist[2]}\"] # test value\r\n args.outputs.labels << [10, 95.from_top, \" #{args.state.inputlist[3]}\"] # test value\r\n args.outputs.labels << [10, 115.from_top,\" #{args.state.inputlist[4]}\"] # test value\r\n \r\n\r\n\r\n #spriterender\r\n args.outputs.sprites << playerjab\r\n args.outputs.sprites << playerupper\r\n args.outputs.sprites << player\r\n args.outputs.sprites << playershield\r\n \r\n\r\n args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge\r\n # sets x by multiplying 64 to index to find pixel value (places all squares side by side)\r\n # subtracts 64 from bridge_top because position is denoted by bottom left corner\r\n [i * 64, args.state.bridge_top - 64, 64, 64]\r\n end\r\n\r\n\r\nend",
"title": ""
},
{
"docid": "aa624ee8c1702d07dc7d84fa2ddcc87a",
"score": "0.6135981",
"text": "def render_game args\n if !is_mobile\n aabb_pause_button = AABB(args.inputs.mouse.x, args.inputs.mouse.y, 1, 1, 1220, 64.from_top, 32, 64)\n else\n if !args.inputs.finger_one.nil?\n aabb_pause_button = AABB(args.inputs.finger_one.x, args.inputs.finger_one.y, 1, 1, 1220, 64.from_top, 32, 64)\n end\n end\n \n # Draw background and level label\n args.outputs.primitives << {\n x: 0,\n y: 760.from_top,\n w: 1280,\n h: 760,\n path: \"sprites/background.jpg\"\n }.sprite\n \n args.outputs.primitives << {\n x: 8,\n y: 8.from_top,\n text: \"LEVEL #{args.state.current_level + 1}\",\n size_enum: 16,\n font: \"fonts/ubuntu-title.ttf\",\n r: 255,\n g: 255,\n b: 255,\n a: 255\n }.label\n \n # If pixel is empty, Draw rectangle in white with corresponding color\n # Else, Draw pixel with it's color!\n args.state.current_grid.length.times.map do |i|\n args.state.current_grid[i].length.times.map do |j|\n if args.state.current_grid[i][j] == 0\n if args.state.levels[args.state.current_level][:content][i][j] > 0\n args.outputs.primitives << {\n x: 416 + (j * 32) + 96,\n y: (264 + (i * 32)).from_top,\n w: 32,\n h: 32,\n r: 255,\n g: 255,\n b: 255,\n a: 255\n }.border\n \n args.outputs.primitives << {\n x: 416 + (j * 32) + 96 + 4,\n y: (264 + (i * 32) - 32).from_top,\n text: args.state.levels[args.state.current_level][:content][i][j],\n size_enum: 8,\n font: \"fonts/ubuntu-title.ttf\",\n r: 255,\n g: 255,\n b: 255,\n a: 255\n }.label\n end\n else\n args.outputs.primitives << {\n x: 416 + (j * 32) + 96,\n y: (264 + (i * 32)).from_top,\n w: 32,\n h: 32,\n r: args.state.levels[args.state.current_level][:palette][args.state.current_grid[i][j]].r,\n g: args.state.levels[args.state.current_level][:palette][args.state.current_grid[i][j]].g,\n b: args.state.levels[args.state.current_level][:palette][args.state.current_grid[i][j]].b,\n a: args.state.painting_alpha,\n }.solid\n end\n end\n end\n \n # Draw palette\n args.state.levels[args.state.current_level][:palette].length.times.map do |i|\n args.outputs.primitives << {\n x: -64 + (i * 64),\n y: 0,\n w: 64,\n h: 64,\n r: args.state.levels[args.state.current_level][:palette][i].r,\n g: args.state.levels[args.state.current_level][:palette][i].g,\n b: args.state.levels[args.state.current_level][:palette][i].b,\n a: args.state.painting_alpha,\n }.solid\n \n args.outputs.primitives << {\n x: -64 + (i * 64) + 16,\n y: 56,\n text: i,\n font: \"fonts/ubuntu-title.ttf\",\n size_enum: 16,\n r: 0,\n g: 0,\n b: 0,\n a: args.state.painting_alpha\n }.label\n end\n \n # If selected color, Draw black outlined rect over it so player can know what he use.\n if args.state.selected_color > 0\n args.outputs.primitives << {\n x: -64 + args.state.selected_color * 64,\n y: 0,\n w: 64,\n h: 64,\n r: 0,\n g: 0,\n b: 0,\n a: args.state.painting_alpha\n }.border\n end\n \n # Pause button\n args.outputs.primitives << {\n x: 1220,\n y: 20.from_top,\n text: \"||\",\n font: \"fonts/ubuntu-title.ttf\",\n size_enum: 16,\n r: aabb_pause_button ? 0 : 255,\n g: aabb_pause_button ? 200 : 255,\n b: 255,\n a: 255\n }.label\nend",
"title": ""
},
{
"docid": "1fd0521b964945b310cddcbca3b5f485",
"score": "0.6125296",
"text": "def main\n # create spriteset\n @spriteset = Spriteset_Map.new\n # create viewport\n @view = Viewport.new(0, 0, 640, 480)\n # set screen tint\n @view.tone = @tone\n # create command window\n @command_window = Window_Command.new(160, BlizzABS::Cache::CommandsAITrigger)\n # command window coordinates\n @command_window.x = 480\n # command window initial index\n @command_window.index = @command_index\n # create trigger command window\n @tcommand_window = Window_Command.new(160, BlizzABS::Cache::CommandsTrigger)\n # trigger command window coordinates\n @tcommand_window.x = 480\n @tcommand_window.y = @command_window.height\n # trigger command window no cursor\n @tcommand_window.index = -1\n # trigger command window not active\n @tcommand_window.active = false\n # create name window\n @name_window = Window_Base.new(480, 416, 160, 64)\n # create bitmap\n @name_window.contents = Bitmap.new(@name_window.width - 32,\n @name_window.height - 32)\n # if using Dyna Edition scripts\n if $fontface != nil\n # set font name and size\n @name_window.contents.font.name = $fontface\n @name_window.contents.font.size = $fontsize\n # if using PK Edition 2\n elsif $defaultfonttype != nil\n # set font name and size\n @name_window.contents.font.name = $defaultfonttype\n @name_window.contents.font.size = $defaultfontsize\n end\n # draw actor name\n @name_window.draw_actor_name(@actor, 4, 0)\n # update trigger command display\n check_triggers\n # creat triggers window\n @triggers_window = Window_Triggers.new(@actor)\n # transition\n Graphics.transition\n # loop\n loop do\n # update game screen\n Graphics.update\n # update input\n Input.update\n # update the scene\n update\n # stop if frame update\n break if $scene != self\n end\n # freeze screen\n Graphics.freeze\n # delete command window\n @command_window.dispose\n # delete trigger command window\n @tcommand_window.dispose\n # delete triggers window\n @triggers_window.dispose\n # delete name window\n @name_window.dispose\n # delete spriteset\n @spriteset.dispose\n # delete viewport\n @view.dispose\n end",
"title": ""
},
{
"docid": "766c07dd5a3b6ecdf2c6569acc46452d",
"score": "0.60533565",
"text": "def tick args\r\n args.state.tile_size = 40\r\n args.state.filled_squares ||= []\r\n args.state.tileSelected ||= 1\r\n args.state.player.x ||= 390\r\n args.state.player.y ||= 140\r\n args.state.player.w ||= 64 \r\n args.state.player.h ||= 64 \r\n args.state.player.direction ||= 1\r\n args.state.player.speed ||=4\r\n args.state.player.zoom ||= 1\r\n draw_buttons args\r\n args.state.barrier ||= []\r\n args.state.door ||=[]\r\n args.state.back ||=[]\r\n args.state.map ||= 1\r\n args.state.save1 ||= 0\r\n args.state.save2 ||= 0\r\n args.state.clr ||= 0\r\n args.state.deletebarrier ||= []\r\n args.state.temp1barrier ||= []\r\n args.state.temp1door ||= []\r\n args.state.temp1back ||= []\r\n args.state.temp1filled_squares ||= []\r\n args.state.temp2barrier ||= []\r\n args.state.temp2door ||= []\r\n args.state.temp2back ||= []\r\n args.state.temp2filled_squares ||= []\r\n # Adds walls, goal, and player to args.outputs.solids so they appear on screen\r\n args.outputs.solids << args.state.walls\r\n\targs.outputs.solids << args.state.barrier\r\n\targs.outputs.sprites << args.state.filled_squares\r\n\targs.outputs.labels << [400, 620, args.state.map.to_s]\r\n #\r\n \r\n \r\n #\t\r\n $x = 0\r\n while $x < 13 do\r\n args.outputs.lines << [80+ ($x * 40), 80, 80+($x * 40), 680]\r\n $x +=1\r\n end\r\n\t\r\n $y = 0\r\n while $y < 16 do\r\n args.outputs.lines << [80, 80+ ($y * 40), 560, 80+($y * 40)]\r\n $y +=1\r\n\tend\r\n \r\n\t$order = 1\r\n\t$y1 = 0\r\n\twhile $order < 18 do\r\n\tif $order < 8\r\n args.outputs.sprites << [640+($order * 80), 640, args.state.tile_size, args.state.tile_size, 'sprites/image' + $order.to_s + \".png\"]\r\n\tend\r\n\tif $order > 7 and $order < 15\r\n\targs.outputs.sprites << [640+($order * 80)-560, 640-80, args.state.tile_size, args.state.tile_size, 'sprites/image' + $order.to_s + \".png\"]\r\n end\r\n\tif $order > 14\r\n\targs.outputs.sprites << [640+($order * 80)-1120, 640-160, args.state.tile_size, args.state.tile_size, 'sprites/image' + $order.to_s + \".png\"]\r\n end\r\n\t$order +=1\r\n\tend\r\n \r\n box1 = [640+(1 * 80), 640, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box2 = [640+(2 * 80), 640, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box3 = [640+(3 * 80), 640, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box4 = [640+(4 * 80), 640, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box5 = [640+(5 * 80), 640, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box6 = [640+(6 * 80), 640, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box7 = [640+(7 * 80), 640, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box8 = [640+(1 * 80), 640-80, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box9 = [640+(2 * 80), 640-80, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box10 = [640+(3 * 80), 640-80, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box11 = [640+(4 * 80), 640-80, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box12 = [640+(5 * 80), 640-80, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box13 = [640+(6 * 80), 640-80, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box14 = [640+(7 * 80), 640-80, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box15 = [640+(1 * 80), 640-160, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box16 = [640+(2 * 80), 640-160, args.state.tile_size, args.state.tile_size,0,0,0]\r\n box17 = [640+(3 * 80), 640-160, args.state.tile_size, args.state.tile_size,0,0,0]\r\n paint_box = [80,80,480,600,0,0,0]\r\n\r\n if args.inputs.mouse.click\r\n args.state.last_mouse_click = args.inputs.mouse.click\r\n end\r\n\r\n if args.state.last_mouse_click\r\n\tif args.state.last_mouse_click.point.inside_rect? box1\r\n args.state.tileSelected = 1\r\n end\r\n if args.state.last_mouse_click.point.inside_rect? box2\r\n args.state.tileSelected = 2\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box3\r\n args.state.tileSelected = 3\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box4\r\n args.state.tileSelected = 4\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box5\r\n args.state.tileSelected = 5\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box6\r\n args.state.tileSelected = 6\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box7\r\n args.state.tileSelected = 7\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box8\r\n args.state.tileSelected = 8\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box9\r\n args.state.tileSelected = 9\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box10\r\n args.state.tileSelected = 10\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box11\r\n args.state.tileSelected = 11\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box12\r\n args.state.tileSelected = 12\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box13\r\n args.state.tileSelected = 13\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box14\r\n args.state.tileSelected = 14\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box15\r\n args.state.tileSelected = 15\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box16\r\n args.state.tileSelected = 16\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? box17\r\n args.state.tileSelected = 17\r\n end\r\n\tif args.state.last_mouse_click.point.inside_rect? paint_box\r\n\tif args.state.tileSelected != 8 and args.state.tileSelected != 16 and args.state.tileSelected != 17\r\n\targs.state.barrier << tile(args, args.state.last_mouse_click.point.x.idiv(40), args.state.last_mouse_click.point.y.idiv(40), 255, 255, 255)\r\n\tend\r\n\tif args.state.tileSelected == 8 and args.state.tileSelected == 16 and args.state.tileSelected == 17\r\n\targs.state.deletebarrier << tile(args, args.state.last_mouse_click.point.x.idiv(40), args.state.last_mouse_click.point.y.idiv(40), 255, 255, 255)\r\n\targs.state.barrier = args.state.barrier - args.state.deletebarrier \r\n\tend\r\n\tif args.state.tileSelected == 16 \r\n\targs.state.door << tile(args, args.state.last_mouse_click.point.x.idiv(40), args.state.last_mouse_click.point.y.idiv(40), 255, 255, 255)\r\n\targs.state.deletebarrier << tile(args, args.state.last_mouse_click.point.x.idiv(40), args.state.last_mouse_click.point.y.idiv(40), 255, 255, 255)\r\n\targs.state.barrier = args.state.barrier - args.state.deletebarrier \r\n\tend\r\n\tif args.state.tileSelected == 17 \r\n\targs.state.back << tile(args, args.state.last_mouse_click.point.x.idiv(40), args.state.last_mouse_click.point.y.idiv(40), 255, 255, 255)\r\n\targs.state.deletebarrier << tile(args, args.state.last_mouse_click.point.x.idiv(40), args.state.last_mouse_click.point.y.idiv(40), 255, 255, 255)\r\n\targs.state.barrier = args.state.barrier - args.state.deletebarrier \r\n\tend\r\n args.state.filled_squares << [args.state.last_mouse_click.point.x.idiv(40)* args.state.tile_size, args.state.last_mouse_click.point.y.idiv(40)* args.state.tile_size, args.state.tile_size, args.state.tile_size, 'sprites/image' + args.state.tileSelected.to_s + \".png\"]\t\r\n\tend\r\n end\r\n args.outputs.labels << [720, 320, \"Selected Tile\"]\r\n args.outputs.sprites << [720, 240, args.state.tile_size, args.state.tile_size, 'sprites/image' + args.state.tileSelected.to_s + \".png\"]\r\n \r\n \r\n args.outputs.borders << args.state.player.collision_rectleft\r\n args.outputs.borders << args.state.player.collision_rectright\r\n args.outputs.borders << args.state.player.collision_rectup\r\n args.outputs.borders << args.state.player.collision_rectdown\r\n \r\n\r\n args.state.player.collision_rect = [args.state.player.x,\r\n args.state.player.y,\r\n 64, 64]\r\n args.state.player.collision_rectleft = [args.state.player.x-10,\r\n args.state.player.y,\r\n 64, 64]\r\n args.state.player.collision_rectright= [args.state.player.x+10,\r\n args.state.player.y,\r\n 64, 64]\r\n args.state.player.collision_rectup= [args.state.player.x,\r\n args.state.player.y+10,\r\n 64, 64]\r\n args.state.player.collision_rectdown= [args.state.player.x,\r\n args.state.player.y-10,\r\n 64, 64]\r\n \r\n # get the keyboard input and set player properties\r\n if args.inputs.keyboard.right and args.state.player.x < 480 and !args.state.barrier.any_intersect_rect? args.state.player.collision_rectright and !args.state.door.any_intersect_rect? args.state.player.collision_rectright and !args.state.back.any_intersect_rect? args.state.player.collision_rectright\r\n args.state.player.x += args.state.player.speed\r\n args.state.player.direction = 1\r\n args.state.player.started_running_at ||= args.state.tick_count\r\n end\r\n \r\n if args.inputs.keyboard.left and args.state.player.x > 80 and !args.state.barrier.any_intersect_rect? args.state.player.collision_rectleft and !args.state.door.any_intersect_rect? args.state.player.collision_rectleft and !args.state.back.any_intersect_rect? args.state.player.collision_rectleft\r\n args.state.player.x -= args.state.player.speed\r\n args.state.player.direction = -1\r\n args.state.player.started_running_at ||= args.state.tick_count \r\n end\r\n\r\n if args.inputs.keyboard.up and args.state.player.y < 600 and !args.state.barrier.any_intersect_rect? args.state.player.collision_rectup\r\n args.state.player.y += args.state.player.speed\r\n args.state.player.started_running_at ||= args.state.tick_count\r\n end\r\n\r\n if args.inputs.keyboard.up and args.state.player.y < 600 and args.state.door.any_intersect_rect? args.state.player.collision_rectdown\r\n \r\n\r\n if args.state.save1 == 0\r\n args.state.temp1barrier = args.state.barrier.clone\r\n args.state.temp1door = args.state.door.clone\r\n args.state.temp1filled_squares = args.state.filled_squares.clone\r\n args.state.temp1back = args.state.back.clone\r\n args.state.save1 = 1\r\n args.state.filled_squares.clear\r\n args.state.barrier.clear\r\n args.state.door.clear\r\n args.state.back.clear\r\n end \r\n \r\n \r\n \r\n if args.state.save2 == 1\r\n args.state.barrier = args.state.temp2barrier\r\n args.state.door = args.state.temp2door\r\n args.state.filled_squares = args.state.temp2filled_squares\r\n args.state.back = args.state.temp2back\r\n save2 = 0\r\n end\r\n args.state.player.x = 390\r\n args.state.player.y = 140\r\n args.state.map = 2\r\n end\r\n \r\n if args.inputs.keyboard.up and args.state.player.y < 600 and args.state.back.any_intersect_rect? args.state.player.collision_rectdown\r\n \r\n \r\n if args.state.save2 == 0\r\n args.state.temp2barrier = args.state.barrier.clone\r\n args.state.temp2door = args.state.door.clone\r\n args.state.temp2filled_squares =args.state.filled_squares.clone\r\n args.state.temp2back = args.state.back.clone\r\n args.state.save2 = 1\r\n args.state.filled_squares.clear\r\n args.state.barrier.clear\r\n args.state.door.clear\r\n args.state.back.clear\r\n end \r\n \r\n\r\n \r\n if args.state.save1 == 1\r\n args.state.barrier = args.state.temp1barrier\r\n args.state.door = args.state.temp1door\r\n args.state.filled_squares = args.state.temp1filled_squares\r\n args.state.back = args.state.temp1back\r\n save1 = 0\r\n end\r\n args.state.player.x = 390\r\n args.state.player.y = 140\r\n args.state.map = 1\r\n end\r\n if args.inputs.keyboard.down and args.state.player.y > 80 and !args.state.barrier.any_intersect_rect? args.state.player.collision_rectdown and !args.state.door.any_intersect_rect? args.state.player.collision_rectdown and !args.state.back.any_intersect_rect? args.state.player.collision_rectdown\r\n args.state.player.y -= args.state.player.speed\r\n args.state.player.started_running_at ||= args.state.tick_count\r\n end\r\n \r\n\t\r\n # if no arrow keys are being pressed, set the player as not moving\r\n if !args.inputs.keyboard.directional_vector\r\n args.state.player.started_running_at = nil\r\n end\r\n\r\n # render player as standing or running\r\n if args.state.player.started_running_at\r\n args.outputs.primitives << running_sprite(args).sprite\r\n else\r\n args.outputs.primitives << standing_sprite(args).sprite\r\n end\r\nend",
"title": ""
},
{
"docid": "d65e806693a0281ee8d61705ce3c35c7",
"score": "0.6033325",
"text": "def initialize(outputs)\n @x = [100,300,500,700,900,1100].sample\n @y = [100,200,300,400,500,600].sample\n @w = 32 # size\n @h = 32\n @speed_xy = 0\n @speed_up_down = 0\n @path = 'sprites/foodie.png'\n @previous_key_xy = nil\n @previous_key_up_down = nil\n # @weighted_keys = 10.map { KEYS.sample }\n @rotation = [1, -1].sample\n @rotation_speed = 360\n @register_collision = 0\n end",
"title": ""
},
{
"docid": "998d4f5b1d5925ad39de59ae8759b4e6",
"score": "0.60052127",
"text": "def draw\n #if(MouseToRect() && @ms_down)\n # @text = @textinput.text\n # @text = Gosu::Image.from_text @textinput.text, 20\n #else\n # @ms_down = false\n #end\n\n #border\n Gosu.draw_rect(@xpos - @height * 0.05, @ypos - @height * 0.05, @width + @height * 0.1, @height * 1.1, @text_color)\n\n #box\n Gosu.draw_rect(@xpos, @ypos, @width, @height, @box_color)\n\n #text\n @text.draw(@xpos + @width * 0.05, @ypos + (@height - @text_height) * 0.5, 0, 1, 1, @text_color)\n\n #cusor\n if(@selected && @cursor_active)\n @cursor_counter += 1\n if(@cursor_counter > 30)\n @cursor_active = false\n @cursor_counter = 0\n end\n cursor()\n else\n @cursor_counter += 1\n if(@cursor_counter > 30)\n @cursor_active = true\n @cursor_counter = 0\n end\n end\n end",
"title": ""
},
{
"docid": "cf24d518791576a36a097fa4e3e6c01d",
"score": "0.59573406",
"text": "def main\n # create spriteset\n @spriteset = Spriteset_Map.new\n # create viewport\n @view = Viewport.new(0, 0, 640, 480)\n # set screen tint\n @view.tone = @tone\n # create command window\n @command_window = Window_Command.new(160, BlizzABS::Cache::CommandsAIBehavior)\n # command window coordinates\n @command_window.x = 480\n # command window initial index\n @command_window.index = @command_index\n # get map actor\n map_actor = $BlizzABS.battlers[@index]\n # create behavior window\n @behavior_window = Window_Behavior.new(@actor, map_actor)\n # transition\n Graphics.transition\n # loop\n loop do\n # update game screen\n Graphics.update\n # update input\n Input.update\n # update the scene\n update\n # stop if frame update\n break if $scene != self\n end\n # freeze screen\n Graphics.freeze\n # delete command window\n @command_window.dispose\n # delete behavior window\n @behavior_window.dispose\n # delete spriteset\n @spriteset.dispose\n # delete viewport\n @view.dispose\n end",
"title": ""
},
{
"docid": "dd201005e358dda0beed07ab664f8153",
"score": "0.595715",
"text": "def main_sprite ; end",
"title": ""
},
{
"docid": "c8809b20a596c0b7e12bc99015e9bd07",
"score": "0.5947815",
"text": "def _main\n game = Game.new\n game.play\nend",
"title": ""
},
{
"docid": "1452dde1e10698e625e2ba49aaa31eea",
"score": "0.5944338",
"text": "def mainloop\n loop do\n Input.update\n yield\n Graphics.update # will force Game.exe run in specific FPS\n end\nend",
"title": ""
},
{
"docid": "17d7a3f7f485c236e58aeb272dd13e12",
"score": "0.59380937",
"text": "def draw\r\n @background_image.draw(0,0,0)\r\n @background_image.draw(@width*0.35,0,0)\r\n @background_image.draw(0,@height*0.47,0)\r\n @background_image.draw(@width*0.35,@height*0.47,0)\r\n @background_image.draw(@width*0.7,0,0)\r\n @background_image.draw(0,@height*0.938,0)\r\n @background_image.draw(@width*0.7,@height*0.938,0)\r\n @background_image.draw(@width*0.7,@height*0.47,0)\r\n @background_image.draw(@width*0.35,@height*0.938,0)\r\n @road_image.draw(0, 30, 0)\r\n @road_image.draw(470, 30, 0)\r\n\r\n @tree_1.draw(-10, @height*0.47, 1)\r\n @tree_2.draw(@width*0.7032, @height*0.521, 1)\r\n @tree_6.draw_rot(@width*0.18, -15, 1, 0, 0.5, 0.5, 0.5, 0.5, 0xff_ffffff, mode = :default)\r\n @tree_6.draw_rot(@width*0.65, -15, 1, 0, 0.5, 0.5, 0.5, 0.5, 0xff_ffffff, mode = :default)\r\n @tree_5.draw_rot(@width*0.43, -50, 1, 0, 0.5, 0.5, 0.5, 0.5, 0xff_ffffff, mode = :default)\r\n\r\n @player.draw\r\n @level_text = Gosu::Image.from_text(self, \"Level: #{@player.get_level} \", Gosu.default_font_name, 25)\r\n @level_text.draw(475, 5, 0)\r\n #@mouse_text = Gosu::Image.from_text(self, \"X: #{@player.get_x} Y: #{@player.get_y}\", Gosu.default_font_name, 25)\r\n #@mouse_text.draw(0,0,0)\r\n @title_text = Gosu::Image.from_text(self, \"Frogger\", Gosu.default_font_name, 25)\r\n @title_text.draw(0,0,0)\r\n\r\n @cars.each do |car|\r\n has_car_collided? car\r\n car.draw\r\n end\r\n if !@has_been_eaten\r\n @insect.draw\r\n end\r\n if @is_squished\r\n squished\r\n end\r\n end",
"title": ""
},
{
"docid": "b5ece6e7545faeb3b7df8240f42da14e",
"score": "0.59317523",
"text": "def setup #initialize(x, y)\n part_num = rand(30) + 1\n particle = \"obj\" + part_num.to_s\n @image = Gosu::Image.new(\"relax/assets/particles/\" + particle + \".png\")\n @color = Gosu::Color::BLACK.dup\n @color.red = rand(256 - 150) + 180\n @color.green = rand(256 - 150) + 180\n @color.blue = rand(256 - 150) + 180\n @color.alpha = 255\n @x = x\n @y = y\n @vel_y = 0\n @vel_x = 0\n @prev_x = x\n @prev_y = y\n\n @spin = rand(6) - 10\n @rotation = 0\n @rot = 0\n\n @held = -2\n @direction = 1.0\n @offset_x = rand(11) / 10\n @offset_y = rand(11) / 10\n @off_x = @offset_x\n @off_y = @offset_y\n\n # # Code for initial movement:\n # @vel_y = rand(10) - 20 # Vertical velocity\n # @vel_x = rand(20) - 10\n # @moving = true\n # stop_moving\n end",
"title": ""
},
{
"docid": "d7a3e6090d794d88522dd5435f033d8d",
"score": "0.59305173",
"text": "def main\n # create spriteset\n @spriteset = Spriteset_Map.new\n # create viewport\n @view = Viewport.new(0, 0, 640, 480)\n # set tone to current screen tone\n @view.tone = @tone.clone\n # creat HUD if HUD_ENABLED is turned on and HUD active\n @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud\n # if hotkey display is turned off\n unless $game_system.assignment\n # create hotkey display\n @hotkeys = Hotkey_Assignment.new\n # set z position\n @hotkeys.z = 5000\n end\n # create sprite\n @choice = Sprite.new\n # create bitmap\n @choice.bitmap = Bitmap.new(16, 9)\n # draw arrow image from BlizzABS Cache\n @choice.bitmap.blt(0, 0, BlizzABS::Cache.image(2), Rect.new(0, 0, 16, 9), 128)\n # set x, y and z positions\n @choice.x, @choice.y, @choice.z = 160, 40, 500\n # set x position offset\n @choice.ox = -8\n # set active flag\n @active = true\n # set index\n @index = 0\n # set up mode flag\n @up_mode = true\n # create modified skill window\n @skill_window = Window_Skill_Hotkey.new($game_player.battler)\n # create modified item window\n @item_window = Window_Item_Hotkey.new\n # set last active\n @last_active = true\n # transtition\n Graphics.transition\n # loop\n loop do\n # update game screen\n Graphics.update\n # update input\n Input.update\n # frame update\n update\n # stop if chosen an option\n break if $scene != self\n end\n # freeze screen\n Graphics.freeze\n # delet spriteset\n @spriteset.dispose\n # delete HUD if HUD exists\n @hud.dispose if @hud != nil\n # delete hotkey display if not hotkey display active\n @hotkeys.dispose unless $game_system.assignment\n # delete choice sprite\n @choice.dispose\n # delete skill window\n @skill_window.dispose\n # delete item window\n @item_window.dispose\n # delete viewport\n @view.dispose\n end",
"title": ""
},
{
"docid": "d7a3e6090d794d88522dd5435f033d8d",
"score": "0.59305173",
"text": "def main\n # create spriteset\n @spriteset = Spriteset_Map.new\n # create viewport\n @view = Viewport.new(0, 0, 640, 480)\n # set tone to current screen tone\n @view.tone = @tone.clone\n # creat HUD if HUD_ENABLED is turned on and HUD active\n @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud\n # if hotkey display is turned off\n unless $game_system.assignment\n # create hotkey display\n @hotkeys = Hotkey_Assignment.new\n # set z position\n @hotkeys.z = 5000\n end\n # create sprite\n @choice = Sprite.new\n # create bitmap\n @choice.bitmap = Bitmap.new(16, 9)\n # draw arrow image from BlizzABS Cache\n @choice.bitmap.blt(0, 0, BlizzABS::Cache.image(2), Rect.new(0, 0, 16, 9), 128)\n # set x, y and z positions\n @choice.x, @choice.y, @choice.z = 160, 40, 500\n # set x position offset\n @choice.ox = -8\n # set active flag\n @active = true\n # set index\n @index = 0\n # set up mode flag\n @up_mode = true\n # create modified skill window\n @skill_window = Window_Skill_Hotkey.new($game_player.battler)\n # create modified item window\n @item_window = Window_Item_Hotkey.new\n # set last active\n @last_active = true\n # transtition\n Graphics.transition\n # loop\n loop do\n # update game screen\n Graphics.update\n # update input\n Input.update\n # frame update\n update\n # stop if chosen an option\n break if $scene != self\n end\n # freeze screen\n Graphics.freeze\n # delet spriteset\n @spriteset.dispose\n # delete HUD if HUD exists\n @hud.dispose if @hud != nil\n # delete hotkey display if not hotkey display active\n @hotkeys.dispose unless $game_system.assignment\n # delete choice sprite\n @choice.dispose\n # delete skill window\n @skill_window.dispose\n # delete item window\n @item_window.dispose\n # delete viewport\n @view.dispose\n end",
"title": ""
},
{
"docid": "41b1a6fcf30129a7a20d01f4d47ebe20",
"score": "0.592361",
"text": "def main\n # create spriteset\n @spriteset = Spriteset_Map.new\n # create viewport\n @view = Viewport.new(0, 0, 640, 480)\n # set tone to current screen tone\n @view.tone = @tone.clone\n # create HUD if HUD is turned on and HUD active\n @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud\n # if ASSIGNMENT is turned\n if BlizzABS::Config::HOTKEYS\n # create assignment display\n @hotkeys = Hotkey_Assignment.new\n # set z position\n @hotkeys.z = 5000\n end\n # if MINIMAP is turned on and minimap active\n if BlizzABS::Config::MINIMAP && $game_system.minimap > 0\n # create minimap\n @minimap = Minimap.new\n end\n # create sprite\n @choice = Sprite.new\n # create bitmap\n @choice.bitmap = $BlizzABS.cache.image('menu_arrow')\n # set x, y and z positions\n @choice.x, @choice.y, @choice.z, @choice.opacity = 160, 40, 500, 128\n # set x position offset\n @choice.ox = -8\n # set active flag\n @active = true\n # set index\n @index = 0\n # set up mode flag\n @up_mode = true\n # create modified skill window\n @skill_window = Window_Skill_Hotkey.new($game_player.battler)\n # create modified item window\n @item_window = Window_Item_Hotkey.new\n # set last active\n @last_active = true\n # transtition\n Graphics.transition\n # loop\n loop do\n # update game screen\n Graphics.update\n # update input\n Input.update\n # frame update\n update\n # stop if chosen an option\n break if $scene != self\n end\n # freeze screen\n Graphics.freeze\n # delete spriteset\n @spriteset.dispose\n # delete HUD elements that exist\n [@hud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}\n # delete choice sprite\n @choice.dispose\n # delete skill window\n @skill_window.dispose\n # delete item window\n @item_window.dispose\n # delete viewport\n @view.dispose\n # while real leader is not first actor in party\n while @party_leader != $game_party.actors[0]\n # switch to next actor\n $BlizzABS.player.switch_leader\n end\n end",
"title": ""
},
{
"docid": "71dbccae57d3e2b25e46c08446e19137",
"score": "0.5918179",
"text": "def draw\n\t\t@soil.draw(0, 0, 0)\n\t\t# Only show mole if @visibile is greater than 0\n\t\tif @visible > 0\n\t\t\t@image.draw(@x - @width / 2, @y - @height / 2, 1) # image coords and if there are more images than 1, the number 1 decides position in gamewindow\n\t\tend\n\t\t# Draw hammer and be visible all the time and its movement coords based on mouse movement\n\t\t@hammer.draw(mouse_x - 25, mouse_y - 39, 1)\n\n\t\t# Check if mole was hit or missed with button click\n\t\t# and change background color based on hit or miss\n\t\tif @hit == 0\n\t\t\tc = Gosu::Color::NONE\n\t\telsif @hit == 1\n\t\t\tc = Gosu::Color::GREEN\n\t\telsif @hit == -1\n\t\t\tc = Gosu::Color::RED\n\t\tend\n\n\t\t# Make background color square shaped to fit gamewindow\n\t\tdraw_quad(0, 0, c, 800, 0, c, 800, 600, c, 0, 600, c)\n\t\t@hit = 0\n\n\t\t# Show score on gamewindow\n\t\t@font.draw(\"Score: #{ @score.to_s }\", 630, 50, 2)\n\t\t@font.draw(@time_left.to_s, 30, 50, 2)\n\n\t\t# Unless loop, activates when timelimit has reached zero.\n\t\tunless @playing\n\t\t\tif @score <= 0\n\t\t\t\t@font.draw(\"Game over!! Your score: #{ @score }! Are you serious!?\", 200, 300, 3)\n\t\t\tend\n\t\t\tif @score > 0 && @score <= 30\n\t\t\t\t@font.draw(\"Game over!! Your score: #{ @score }!\", 300, 300, 3)\n\t\t\tend\n\t\t\tif @score >= 31 && @score <= 60\n\t\t\t\t@font.draw(\"Game over!! Your score: #{ @score }! Well done!\", 250, 300, 3)\n\t\t\tend\n\t\t\tif @score >= 61 && @score < 89\n\t\t\t\t@font.draw(\"Game over!! Your score: #{ @score }! SUPERPLAYER!\", 250, 300, 3)\n\t\t\tend\n\t\t\tif @score >= 90\n\t\t\t\t@font.draw(\"Game over!! Your score: #{ @score }! GODLIKE!\", 250, 300, 3)\n\t\t\tend\n\n\t\t\t@visible = 20\n\t\t\t@time_left = 0\n\t\t\t@font.draw(\"Press Spacebar to play again!\", 300, 350, 3)\n\t\t\t@font.draw(\"Press ESCAPE to quit!\", 300, 370, 3)\n\t\tend\t\n\t\t\t\n\tend",
"title": ""
},
{
"docid": "9ec7790c256d0ca76bde7b7ab09498f5",
"score": "0.59172654",
"text": "def tick(args)\n \n # SETUP :\n setup(args) unless args.state.setup_done\n\n\n # MAIN LOOP :\n \n # 1. GAME LOGIC :\n \n # 1.1 Rotate the cube :\n args.state.cube.reset_rotation\n args.state.cube.rotate_x( args.state.angle )\n args.state.cube.rotate_y( 0.3 * args.state.angle )\n args.state.cube.rotate_z( 0.7 * args.state.angle )\n args.state.angle += 0.03\n\n # 1.2 Moving the camera :\n\n # Rotation :\n args.state.camera.rotate_z( args.state.camera_rotation_speed) if args.inputs.keyboard.key_held.q\n args.state.camera.rotate_z(-args.state.camera_rotation_speed) if args.inputs.keyboard.key_held.e\n args.state.camera.rotate_x( args.state.camera_rotation_speed) if args.inputs.keyboard.key_held.w\n args.state.camera.rotate_x(-args.state.camera_rotation_speed) if args.inputs.keyboard.key_held.s\n args.state.camera.rotate_y( args.state.camera_rotation_speed) if args.inputs.keyboard.key_held.a\n args.state.camera.rotate_y(-args.state.camera_rotation_speed) if args.inputs.keyboard.key_held.d\n\n # Translation :\n args.state.camera.move_forward(-args.state.camera_translation_speed) if args.inputs.keyboard.key_held.up\n args.state.camera.move_forward( args.state.camera_translation_speed) if args.inputs.keyboard.key_held.down\n args.state.camera.move_right(-args.state.camera_translation_speed) if args.inputs.keyboard.key_held.left\n args.state.camera.move_right( args.state.camera_translation_speed) if args.inputs.keyboard.key_held.right\n\n\n ## 2. RENDERING :\n\n # Backgound :\n args.outputs.solids << [0, 0, 1280, 306, 0, 0, 231]\n args.outputs.solids << [0, 306, 1280, 719, 180, 180, 231]\n\n # Sprites :\n args.state.renderer.render_scene args.state.camera,\n args.state.scene\n\n\n # DEBUG :\n args.outputs.labels << [10, 700, \"FPS: #{args.gtk.current_framerate.to_s.to_i}\", 0, 0, 0, 255]\nend",
"title": ""
},
{
"docid": "370540e91c2ccc11a574ba201c629f2c",
"score": "0.589687",
"text": "def tick(args)\n setup(args) unless args.state.setup_done\n\n # !!! DON'T FORGET TO RENDER THE PIXEL ARRAY !!!\n args.state.pa1.render_as_sprite(args)\n args.state.pa2.render_as_sprite(args)\n # !!! DON'T FORGET TO RENDER THE PIXEL ARRAY !!!\n\n args.outputs.primitives << $gtk.framerate_diagnostics_primitives\n\nend",
"title": ""
},
{
"docid": "b14cdfc9bf0cb549696f896d22e67111",
"score": "0.5890104",
"text": "def game\n # controller\n draw_controller (@player)\n draw_controller (@player2)\n\n if @g_duration > 0\n # move controller and ball\n if !@g_paused\n now = Time.now\n if now - @g_started >= @g_duration\n @g_duration = 0\n end\n\n # ball\n draw_ball\n \n # first player\n @player.move(false, @keyup ? \"w\" : \"s\", false, height) if @keyup || @keydown\n\n # second player\n if @g_players == 2\n @player2.move(false, false, @keyup2 ? 38 : 40, height) if @keyup2 || @keydown2\n\n # computer\n elsif @ball.coord_x1 > width*1/2\n @player2.move(@ball.coord_ym + @coord_random, false, false, height)\n \n # computer: auto centering\n elsif @g_difficulty == 3 && @ball.coord_x1 < width*1/2\n @player2.move(height/2, false, false, height)\n end\n\n # ball\n @ball.move\n collision\n\n # scored\n if @g_lost \n # output score\n if @g_lost_time > millis - 1500\n draw_score\n # reset ball\n else\n @ball = Ball.new(@player.coord_x2 + 50, height/2)\n @g_lost = false\n end\n end\n # pause game\n else\n @ball.stop \n textFont(font, 70)\n textAlign(CENTER, CENTER)\n text \"PAUSE\", width/2, height/2\n end\n else\n draw_score\n save_highscore\n end\n\nend",
"title": ""
},
{
"docid": "6262a4de0c88dc32fba7c83ac85a4294",
"score": "0.58859444",
"text": "def test_default\n [@window, @sprite, @bitmap].each{|container|\n uc = UCEnemyGraphic.new(container, Rect.new(0, 0, 96, 96), nil)\n uc.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "429fbb829326ec786c52b61e476d9db4",
"score": "0.58844334",
"text": "def user_interface (args)\r\n ticks = args.state.tick_count\r\n seconds = (ticks/60).round(0)\r\n if !args.state.seconds\r\n args.state.seconds = seconds\r\n end\r\n \r\n args.outputs.labels << [770, 720, \"Time Elapsed:\", 8, 0, 200, 050, 100, 125]\r\n if ticks%3 == 0\r\n args.state.seconds = seconds\r\n end\r\n args.outputs.labels << [1000, 720, args.state.seconds, 10, 0, 200, 050, 100, 125]\r\n args.outputs.labels << [640, 700, \"The Circle Game\", -1, 1, 0, 0, 0, 150]\r\n args.outputs.labels << [642, 698, \"The Circle Game\", -1, 1, 0, 200, 25] \r\n args.outputs.labels << [10, 710, \"Lives:\", -3, 0, 155, 50, 50] \r\n\r\n args.outputs.labels << [10, 690, \"Score:\", -3, 0, 155, 50, 50] \r\n if args.state.current_score\r\n args.outputs.labels << [60, 690, args.state.current_score, -3, 0, 155, 50, 50]\r\n\r\n end\r\n args.outputs.labels << [10, 670, \"Highscore:\", -3, 0, 155, 50, 50] \r\n if args.state.highscore\r\n args.outputs.labels << [90, 670, args.state.highscore, -3, 0, 155, 50, 50]\r\n end\r\n args.outputs.lines << [ 0, 600, 1280, 600, 0, 0, 0, 255 ]\r\n board_x = 540\r\n board_y = 668\r\n board_w = 200\r\n board_h = 45\r\n echo = 4 \r\n args.outputs.borders << [board_x, board_y, board_w, board_h, 0, 0, 200, 255 ] \r\n args.outputs.borders << [board_x-echo, board_y-echo, board_w+echo*2, board_h+echo*2, 200, 0, 0, 255 ]\r\n args.outputs.solids << [board_x-echo, board_y-echo, board_w+echo*2, board_h+echo*2, 35, 0, 50, 255 ]\r\n echo = echo -5\r\n args.outputs.solids << [board_x-echo, board_y-echo, board_w+echo*2, board_h+echo*2, 25, 100, 40]\r\n args.state.lives = 0 if args.state.lives < 0 || !args.state.lives\r\n \r\n if args.state.lives == 1\r\n\r\n args.outputs.labels << [640, 590, \"Game over\", 0, 1]\r\n args.state.circle_x = nil\r\n args.state.circle_y = nil\r\n if args.state.ticks_since_nil + 120 < args.state.tick_count\r\n args.state.lives = nil\r\n end\r\n end\r\n if args.state.lives > 1\r\n args.outputs.sprites << [ 60, 697.5, 10, 10, 'mygame/sprites/circle-black.png', 90]\r\n end\r\n if args.state.lives > 2\r\n args.outputs.sprites << [ 75, 697.5, 10, 10, 'mygame/sprites/circle-black.png', 90]\r\n end\r\n if args.state.lives > 3\r\n args.outputs.sprites << [ 90, 697.5, 10, 10, 'mygame/sprites/circle-black.png', 90]\r\n end\r\n if ticks%255 < 127\r\n args.outputs.labels << [640, 655, \"Press WASD to Move\", 0, 1, 0, 0, 0, ticks%255]\r\n args.outputs.labels << [640, 625, \"Press Space to Shoot\", 0, 1, 0, 0, 0, ticks%255] \r\n else\r\n args.outputs.labels << [640, 655, \"Press WASD to Move\", 0, 1, 0, 0, 0, 255-ticks%255]\r\n args.outputs.labels << [640, 625, \"Press Space to Shoot\", 0, 1, 0, 0, 0, 255-ticks%255] \r\n end \r\nend",
"title": ""
},
{
"docid": "e16bbc1b7759b42c4b447bd4758883b9",
"score": "0.5876392",
"text": "def initialize(args)\n\n # Keep a handy reference to the args\n @args = args\n\n # On startup we're not running\n @args.state.adrift.running = false\n\n # We'll definitely need a player object!\n @player = Player.new(args)\n\n # Need an audio handler\n @audio_handler = Ahnlak::ClassAudio.new\n @audio_handler.play('adrift/sounds/ObservingTheStar.ogg')\n\n # And a counter to display the passage of time\n @counter = Counter.new(args)\n @counter.x = @args.grid.center_x - (@counter.w / 2)\n @counter.y = 710 - @counter.h\n\n # And load up our sprites\n load_sprites\n\n # And the prompts we show\n @prompt = []\n @prompt << TintedLabel.new(\n visible: true,\n x: @args.grid.center_x, y: 600,\n alignment_enum: 1, size_enum: 10,\n text: 'Move your mouse to rotate your ship.',\n font: 'adrift/fonts/Kenney Rocket Square.ttf'\n )\n @prompt << TintedLabel.new(\n visible: true,\n x: @args.grid.center_x, y: 550,\n alignment_enum: 1, size_enum: 10,\n text: 'Click to fire your engines.',\n font: 'adrift/fonts/Kenney Rocket Square.ttf'\n )\n @prompt << TintedLabel.new(\n visible: true,\n x: @args.grid.center_x, y: 225,\n alignment_enum: 1, size_enum: 7,\n text: \"Can you stay on the screen for 20 seconds?!\",\n font: 'adrift/fonts/Kenney Rocket Square.ttf'\n )\n @prompt.each do |prompt|\n prompt.colourable_cycle(\n [\n [255, 255, 255, 255],\n [100, 255, 100, 255],\n [255, 100, 255, 255]\n ],\n 30\n )\n end\n\n # The system icons are static\n args.outputs.static_sprites << @audio_sprite\n args.outputs.static_sprites << @music_sprite\n\n end",
"title": ""
},
{
"docid": "b433b9fc3c07f080886dac94879131fd",
"score": "0.58727586",
"text": "def render_game_over(args)\n args.outputs.primitives << [0, 0, VIEW_WIDTH, VIEW_WIDTH, 255, 0, 0, 205].solid\n if args.state.status == :won_game\n message = 'Yay! You won the game!'\n elsif args.state.status == :lost_game\n message = 'Oh no! You lost the game!'\n end\n\n args.outputs.labels << {\n x: (VIEW_WIDTH / 2) - ($gtk.calcstringbox(message, 40, 'fonts/font.ttf')[0] / 2),\n y: (VIEW_HEIGHT / 2) + ($gtk.calcstringbox(message, 40, 'fonts/font.ttf')[1] / 2),\n text: message,\n size_enum: 40,\n r: 255,\n g: 255,\n b: 255\n }\n\n message = 'Click to play again'\n args.outputs.labels << {\n x: (VIEW_WIDTH / 2) - ($gtk.calcstringbox(message, 14, 'fonts/font.ttf')[0] / 2),\n y: (VIEW_HEIGHT / 2) - 80,\n text: message,\n size_enum: 14,\n r: 255,\n g: 255,\n b: 255\n }\nend",
"title": ""
},
{
"docid": "b3b6570ae1b2ec8e7db5bf30e92fece0",
"score": "0.58517706",
"text": "def game_input args\n # DEV NOTE: All button clicks plays sound!\n \n # AABB for pause button\n if !is_mobile\n aabb_pause_button = AABB(args.inputs.mouse.x, args.inputs.mouse.y, 1, 1, 1220, 64.from_top, 32, 64)\n else\n if !args.inputs.finger_one.nil?\n aabb_pause_button = AABB(args.inputs.finger_one.x, args.inputs.finger_one.y, 1, 1, 1220, 64.from_top, 32, 64)\n end\n end\n \n # If number key pressed, Change selected color to key number!\n # Trick: To not use color, Hit key 0\n args.state.keys.length.times.map do |i|\n if args.state.keys[i]\n if i < args.state.levels[args.state.current_level][:palette].length\n play_click_sound args\n args.state.selected_color = i\n end\n end\n end\n \n # If clicked on one of palette colors, Select color\n if (args.inputs.mouse.button_left && args.inputs.mouse.click) || touch_press(args)\n args.state.levels[args.state.current_level][:palette].length.times.map do |i|\n if !is_mobile\n color_rec = AABB(args.inputs.mouse.x, args.inputs.mouse.y.from_top, 1, 1, (-64 + i * 64), 64.from_top, 64, 64)\n else\n if !args.inputs.finger_one.nil?\n color_rec = AABB(args.inputs.finger_one.x, args.inputs.finger_one.y.from_top, 1, 1, (-64 + i * 64), 64.from_top, 64, 64)\n end\n end\n \n if color_rec\n play_click_sound args\n args.state.selected_color = i\n end\n end\n end\n \n # If clicked on pause button go for it!\n if (args.inputs.mouse.click && args.inputs.mouse.button_left) || touch_press(args)\n if aabb_pause_button\n play_click_sound args\n args.state.current_scene = 3\n end\n end\n \n # If clicked on pixel that is not painted, Paint with popping sound!\n if args.inputs.mouse.button_left || touch_down(args)\n args.state.current_grid.length.times.map do |i|\n args.state.current_grid[i].length.times.map do |j|\n if !is_mobile\n grid_rec_aabb = AABB(args.inputs.mouse.x, args.inputs.mouse.y, 1, 1, 416 + (j * 32) + 96, (264 + (i * 32)).from_top, 32, 32)\n else\n if !args.inputs.finger_one.nil?\n grid_rec_aabb = AABB(args.inputs.finger_one.x, args.inputs.finger_one.y, 1, 1, 416 + (j * 32) + 96, (264 + (i * 32)).from_top, 32, 32)\n end\n end\n \n if grid_rec_aabb\n if args.state.sound_enabled == 1\n if args.state.pops == 0\n args.state.pops = 1\n args.audio[:pop] ||= {\n input: \"audio/244657__greenvwbeetle__pop-5.wav\",\n x: 0.0,\n y: 0.0,\n z: 0.0,\n gain: args.state.volume / 100,\n pitch: 1.0,\n paused: false,\n looping: false,\n }\n end\n end\n \n if args.state.levels[args.state.current_level][:content][i][j] == args.state.selected_color\n if args.state.current_grid[i][j] != args.state.levels[args.state.current_level][:content][i][j]\n args.state.current_grid[i][j] = args.state.selected_color\n args.state.painting = true\n args.state.pops = 0\n else\n args.state.painting = false\n end\n else\n args.state.painting = false\n end\n else\n args.state.painting = false\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "4a65278a177e38f14c70e1d502283b14",
"score": "0.58301",
"text": "def setup\n\t# screen\n size displayWidth, displayHeight, P3D\n\n\n @root_path = File.expand_path File.dirname(__FILE__)\n\n @ball_img = load_image(@root_path + \"/images/ball.png\") \n \n frame_rate 60\n smooth\n @frame = 1\n\n # sounds\n load_sounds\n\n # text\n @font = create_font('Nokia Cellphone FC', 40)\n\n # menu\n @m_active = 0\n @m_selected = [0, 0, false]\n @m_text = [\n [\"Option\", [\"1 Player + Computer\", \"2 Player\"]],\n [\"Difficulty\", [\"Easy\", \"Medium\", \"Hard\"]],\n [\"Start\", []]\n ]\n\n # game\n @g_paused = false\n @g_started = 0\n @g_c_duration = 2*60\n @g_duration = @g_p_duration# Actual\n @g_players = 1\n @g_difficulty = 1\n @g_score = [0,0]\n @g_highscore = get_highscore\n\n # controller\n @keys1 = [\"w\",\"s\"]\n @player = Controller.new(30, width/2, @keys1)\n @keys2 = [38, 40]\n\n @player2 = Controller.new(width-70, height/2, @keys2)\n\t\n # ball\n @ball = Ball.new(@player.coord_x2 + 50, height/2)\n\n # lost ball\n @g_lost = false\n @g_lost_time = 0 \n\n # random coord for computer controller\n rand_coord\n \n # key pressed \n @keyup = false\n @keydown = false\n @keyup2 = false\n @keydown2 = false\nend",
"title": ""
},
{
"docid": "0a0b81fea8674a5f8a3c97a027253498",
"score": "0.58270574",
"text": "def initialize\n super(COLUMNS * SIZE, ROWS * SIZE)#creates the window based on number of rows and columns\n @fall_interval = 500 #used to determine how fast blocks fall, starts slow gets quicker as player score increases\n @grid = Grid.new(ROWS, COLUMNS) #creates the grid\n @current_shape = Shape.random(@grid) #makes the block to be placed\n \n \n @playingtime = Gosu.milliseconds #used to keep track of how long the game has been going on and how fast the blocks fall\n @font = Gosu::Font.new(self, Gosu::default_font_name, 20) #font to draw most of the game's text\n @game_over = false #variable to store if the game is over or not\n \n #music source: https://commons.wikimedia.org/wiki/File:Tetris_theme.ogg\n @music = Gosu::Song.new('tetristheme.ogg') #loads the song for the game\n @music.volume = 0.1 #makes it much quieter, it is a VERY loud file\n @music.play(true) #starts playing the music\n \n @speed = 1 #this is used to use the fall() method so that the shapes fall towards the bottom\n @scene = :start #the current scene of the game, either start, game, or end. \n\n @title_font = Gosu::Font.new(self, Gosu::default_font_name, 40) #the font for the title\n end",
"title": ""
},
{
"docid": "a3973f103e6c3822981c86510b557db9",
"score": "0.5810849",
"text": "def tick args\n # ====================================================\n # initialize default variables\n # ====================================================\n\n # ruby has an operator called ||= which means \"only initialize this if it's nil\"\n args.state.count_down ||= 25 * 60 # set the count down to 20 seconds\n # the game renders in 60 fps: 20s * 60fps = 1200 frames\n\n # set the width and the height of the target\n args.state.target_width ||= 100\n args.state.target_height ||= 100\n\n # set the initial position of the target\n args.state.target ||= { x: args.grid.w.half - args.state.target_width / 2,\n y: args.grid.h.half - args.state.target_height / 2,\n w: args.state.target_width,\n h: args.state.target_height }\n\n # set the width and the height of the left guard\n args.state.guard_width ||= 100\n args.state.guard_height ||= 100\n\n # set the initial position of the left guard\n args.state.guard_left ||= { x: args.grid.w.half - args.state.guard_width / 2 - 300,\n y: args.grid.h.half - args.state.guard_height / 2,\n w: args.state.guard_width,\n h: args.state.guard_height }\n\n # set the initial position of the right guard\n args.state.guard_right ||= { x: args.grid.w.half - args.state.guard_width / 2 + 300,\n y: args.grid.h.half - args.state.guard_height / 2,\n w: args.state.guard_width,\n h: args.state.guard_height }\n\n # set the guard speed\n args.state.guard_speed ||= 1\n\n # set the guard maxium speed\n args.state.guard_maximum_speed ||= 10\n\n # set the width and the height of the player\n args.state.player_width ||= 100\n args.state.player_height ||= 100\n\n # set the initial position of the player\n args.state.player ||= { x: 100,\n y: 100,\n w: args.state.player_width,\n h: args.state.player_height }\n\n # set the player movement speed\n args.state.player_speed ||= 1\n\n # set the player maxium speed\n args.state.player_maximum_speed ||= 10\n\n # set the player maxium speed\n args.state.player_life ||= 100\n\n # set the score and the score to win\n args.state.score ||= 0\n args.state.score_win ||= 10\n\n # set the instructions\n args.state.instructions_1 ||= \"Get #{args.state.score_win} DragonRuby icons!\"\n args.state.instructions_2 ||= \"Use arrow keys to move.\"\n args.state.instructions_3 ||= \"Press [Tab] to change difficulty.\"\n args.state.instructions_4 ||= \"Press [Enter] to start.\"\n\n # sprite frame\n args.state.sprite_frame = args.state.tick_count.idiv(4).mod(6)\n\n # guard frame\n args.state.guard_frame = args.state.tick_count.idiv(30).mod(2)\n\n # life frame\n args.state.life_frame = 5 * (args.state.tick_count.idiv(5).mod(2) + 1)\n\n # count down life\n args.state.count_down_life ||= 0\n\n # set direction speed\n args.state.dir_x ||= 0\n args.state.dir_y ||= 0\n\n # set border specs\n args.state.border_corner_x ||= 5\n args.state.border_corner_y ||= 5\n args.state.border_width ||= args.grid.w - 2 * args.state.border_corner_x\n args.state.border_height ||= args.grid.h - 2 * args.state.border_corner_y\n\n # set random coordinates for the target\n args.state.target_x ||= args.state.border_corner_x + (rand (args.state.border_width - args.state.player_width))\n args.state.target_y ||= args.state.border_corner_y + (rand (args.state.border_height - args.state.player_height))\n\n # set y coordinate of the left guard and the right guard\n args.state.guard_left_y ||= 5\n args.state.guard_right_y ||= -5\n\n # ====================================================\n # render the game\n # ====================================================\n # check if we are in the game menu \n if game_menu? args\n args.outputs.primitives << { x: args.grid.w.half, y: args.grid.h.half + 150,\n text: \"Dragon Quest Rush\",\n size_enum: 20, alignment_enum: 1,\n r: 255, g: 0, b: 0, a: 255,\n font: \"fonts/manaspc.ttf\" }.label\n\n args.outputs.labels << { x: args.grid.w.half, y: args.grid.h.half + 50,\n text: args.state.instructions_1,\n size_enum: 10, alignment_enum: 1,\n r: 0, g: 200, b: 255, a: 255, font: \"fonts/manaspc.ttf\" }\n\n args.outputs.labels << { x: args.grid.w.half, y: args.grid.h.half,\n text: args.state.instructions_2,\n size_enum: 10, alignment_enum: 1,\n r: 0, g: 120, b: 255, a: 255, font: \"fonts/manaspc.ttf\" }\n\n args.outputs.labels << { x: args.grid.w.half, y: args.grid.h.half - 50,\n text: args.state.instructions_3,\n size_enum: 10, alignment_enum: 1,\n r: 255, g: 200, b: 120, a: 255, font: \"fonts/manaspc.ttf\" }\n\n args.outputs.labels << { x: args.grid.w.half, y: args.grid.h.half - 100,\n text: args.state.instructions_4,\n size_enum: 10, alignment_enum: 1,\n r: 255, g: 200, b: 255, a: 255, font: \"fonts/manaspc.ttf\" }\n\n # render black menu background\n args.outputs.solids << { x: args.state.border_corner_x, y: args.state.border_corner_y, \n w: args.state.border_width, h: args.state.border_height, \n r: 0, g: 0, b: 0, a: 200 }\n\n # [ X , Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]\n args.outputs.labels << [args.grid.left.shift_right(10), args.grid.bottom.shift_up(95), \"Code: https://github.com/marcoandre1/mygame\", 3, 0, 255, 255, 255, 200]\n args.outputs.labels << [args.grid.left.shift_right(10), args.grid.bottom.shift_up(65), \"Art: @mobypixel (from flappy-dragon)\", 3, 0, 255, 255, 255, 200]\n args.outputs.labels << [args.grid.left.shift_right(10), args.grid.bottom.shift_up(35), \"Engine: DragonRuby GTK\", 3, 0, 255, 255, 255, 200]\n\n # change the difficulty if the player hits tab\n if args.inputs.keyboard.key_down.tab\n args.state.score_win = (args.state.score_win + 10).mod(30)\n args.state.score_win = 30 if args.state.score_win == 0\n args.state.instructions_1 = \"Get #{args.state.score_win} DragonRuby icons!\"\n end\n\n # start the game if player hits enter\n if args.inputs.keyboard.key_down.enter\n score_win_memory = args.state.score_win\n $gtk.reset\n args.state.count_down = 24 * 60\n args.state.score_win = score_win_memory\n return\n end\n end\n\n # check if it's game over\n # otherwise render the current time left\n if game_over? args\n if args.state.score == args.state.score_win\n # render label \"You win!\"\n args.outputs.primitives << { x: args.grid.w.half, y: args.grid.h.half + 75,\n text: \"Game over! You win!\",\n size_enum: 10, alignment_enum: 1,\n r: 0, g: 255, b: 0, a: 255,\n font: \"fonts/manaspc.ttf\" }.label\n else\n #check if player is dead\n if args.state.player_life == 0\n args.outputs.primitives << { x: args.grid.w.half, y: args.grid.h.half + 75,\n text: \"Game over! You are dead!\",\n size_enum: 10, alignment_enum: 1,\n r: 255, g: 0, b: 0, a: 255,\n font: \"fonts/manaspc.ttf\" }.label\n else\n # render label \"Game over!\"\n args.outputs.primitives << { x: args.grid.w.half, y: args.grid.h.half + 75,\n text: \"Game over! You lose!\",\n size_enum: 10, alignment_enum: 1,\n r: 255, g: 0, b: 0, a: 255,\n font: \"fonts/manaspc.ttf\" }.label\n end\n end\n\n # render total DragonRuby icons\n args.outputs.labels << { x: args.grid.w.half, y: args.grid.h.half + 25,\n text: \"DragonRuby icons: #{args.state.score}/#{args.state.score_win}\",\n size_enum: 10, alignment_enum: 1,\n r: 0, g: 0, b: 255, a: 255, font: \"fonts/manaspc.ttf\" }\n\n # render label \"Press [r] to start over\"\n args.outputs.labels << { x: args.grid.w.half, y: args.grid.h.half - 25,\n text: \"Press [r] to start over\",\n size_enum: 10, alignment_enum: 1,\n r: 0, g: 200, b: 255, a: 255, font: \"fonts/manaspc.ttf\" }\n\n # render label \"Press [Enter] to go back to menu\"\n args.outputs.labels << { x: args.grid.w.half, y: args.grid.h.half - 75,\n text: \"Press [Enter] to go back to menu\",\n size_enum: 10, alignment_enum: 1,\n r: 255, g: 200, b: 255, a: 255, font: \"fonts/manaspc.ttf\" }\n else\n # game is not over\n # check if we are in the game menu\n if !game_menu? args and game_start? args\n # Show warning label is maximum speed is over 10\n if args.state.player_maximum_speed > 10\n args.outputs.labels << { x: args.grid.left.shift_right(10),\n y: args.grid.h - 10,\n text: \"Be careful, hitting a wall increases you maximum speed!\",\n alignment_enum: 0, r: 255, g: 0, b: 0 }\n end\n\n # render the number of DragonRuby icons\n args.outputs.labels << { x: args.grid.left.shift_right(10), y: args.grid.h - 40,\n text: \"DragonRuby icons: #{args.state.score}/#{args.state.score_win}\",\n alignment_enum: 0 }\n\n # show time left\n args.outputs.labels << { x: args.grid.left.shift_right(10),\n y: args.grid.h - 70,\n text: \"Time left: #{(args.state.count_down.idiv 60) + 1}\",\n alignment_enum: 0 }\n\n # show dragon life label\n args.outputs.labels << { x: args.grid.left.shift_right(10),\n y: args.grid.h - 100,\n text: \"Life: \",\n alignment_enum: 0 }\n\n # render game background\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/background.png']\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/parallax_back.png']\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/parallax_middle.png']\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/parallax_front.png']\n if args.state.player_maximum_speed > 10\n args.outputs.sprites << [args.grid.left.shift_right(10), args.grid.h - 30, 545, 20, 'sprites/square-gray.png', 0, 200]\n end\n args.outputs.sprites << [args.grid.left.shift_right(10), args.grid.h - 60, 220, 20, 'sprites/square-gray.png', 0, 200]\n args.outputs.sprites << [args.grid.left.shift_right(10), args.grid.h - 90, 130, 20, 'sprites/square-gray.png', 0, 200]\n args.outputs.sprites << [args.grid.left.shift_right(10), args.grid.h - 120, 50, 20, 'sprites/square-gray.png', 0, 200]\n\n if (args.state.player.intersect_rect? args.state.guard_left) || (args.state.player.intersect_rect? args.state.guard_right)\n args.outputs.sprites << [args.grid.left.shift_right(70), args.grid.h - 120, args.state.player_life, 20, 'sprites/square-red.png', 0, 200]\n args.state.count_down_life = 4 * 60\n else\n args.outputs.sprites << [args.grid.left.shift_right(70), args.grid.h - 120, args.state.player_life, 20, 'sprites/square-green.png', 0, 200]\n end\n\n if args.state.count_down_life != 0\n args.state.count_down_life -= 4\n args.state.count_down_life = -1 if args.state.count_down_life < -1\n args.outputs.labels << { x: args.grid.w.half - 10 + args.state.life_frame, y: args.grid.h.half + 10 + args.state.life_frame,\n text: \"-#{args.state.player_life}\",\n size_enum: 20, alignment_enum: 1,\n r: 255, g: 0, b: 0, a: args.state.count_down_life, font: \"fonts/manaspc.ttf\" }\n end\n\n # render the target\n args.outputs.sprites << { x: args.state.target.x, y: args.state.target.y,\n w: args.state.target.w, h: args.state.target.h,\n path: 'sprites/icon.png' }\n\n # render the left guard\n args.outputs.sprites << { x: args.state.guard_left.x, y: args.state.guard_left.y,\n w: args.state.guard_left.w, h: args.state.guard_left.h,\n path: \"sprites/guard-HD-#{args.state.guard_frame}.png\" }\n\n # render the left guard\n args.outputs.sprites << { x: args.state.guard_right.x, y: args.state.guard_right.y,\n w: args.state.guard_right.w, h: args.state.guard_right.h,\n path: \"sprites/guard-HD-#{args.state.guard_frame}.png\" }\n\n args.outputs.sprites << { x: 200, y: 200,\n w: 100, h: 100,\n path: \"sprites/mini-dragon.png\" }\n\n args.outputs.sprites << { x: 400, y: 400,\n w: 100, h: 100,\n path: \"sprites/heart.png\" }\n\n args.outputs.sprites << { x: 500, y: 200,\n w: 75, h: 75,\n path: \"sprites/clock.png\" }\n end\n end\n\n # render the game border\n args.outputs.borders << { x: args.state.border_corner_x, \n y: args.state.border_corner_y,\n w: args.state.border_width,\n h: args.state.border_height, \n r: 0, \n g: 0, \n b: 0 }\n\n # ====================================================\n # run simulation\n # ====================================================\n # if we are not in the game menu, decrease count_down\n if !game_menu? args\n # count down calculation\n # if you look at the label \"time left\" we are doing a full division of the countdown:\n # args.state.count_down.idiv 60\n # which means that we are dividing the count_down by 60 at every frame and getting the integer portion\n # 1150/60 = 19\n # 1130/60 = 18\n args.state.count_down -= 1\n args.state.count_down = -1 if args.state.count_down < -1\n end\n\n # ====================================================\n # process player input\n # ====================================================\n # if it isn't game over and the game has started let them move (0 > args.state.count_down <= 20 * 60)\n if !game_over? args and game_start? args\n # collision with a wall will make the guard bounce back\n if args.state.guard_left.y < args.state.border_corner_y\n args.state.guard_left_y *= -1\n elsif args.state.guard_left.y > args.grid.h - args.state.guard_height - args.state.border_corner_y\n args.state.guard_left_y *= -1\n end\n\n # collision with a wall will make the guard bounce back\n if args.state.guard_right.y < args.state.border_corner_y\n args.state.guard_right_y *= -1\n elsif args.state.guard_right.y > args.grid.h - args.state.guard_height - args.state.border_corner_y\n args.state.guard_right_y *= -1\n end\n\n # collision with a wall will make the player bounce and increase maximum speed by one\n if args.state.player.x < args.state.border_corner_x\n args.state.dir_x *= -1\n args.state.player_maximum_speed += 1\n elsif args.state.player.x > args.grid.w - args.state.player_width - args.state.border_corner_x\n args.state.dir_x *= -1\n args.state.player_maximum_speed += 1\n end\n\n # collision with a wall will make the player bounce and increase maximum speed by one\n if args.state.player.y < args.state.border_corner_y\n args.state.dir_y *= -1\n args.state.player_maximum_speed += 1\n elsif args.state.player.y > args.grid.h - args.state.player_height - args.state.border_corner_y\n args.state.dir_y *= -1\n args.state.player_maximum_speed += 1\n end\n\n # game is not over but\n # check if we are in the game menu\n if !game_menu? args\n # determine the change vertically\n if args.inputs.keyboard.up && args.state.dir_y < args.state.player_maximum_speed \n args.state.dir_y += args.state.player_speed\n elsif args.inputs.keyboard.down && args.state.dir_y > -args.state.player_maximum_speed\n args.state.dir_y -= args.state.player_speed\n end\n\n # determine the change horizontally\n if args.inputs.keyboard.left && args.state.dir_x > -args.state.player_maximum_speed\n args.state.dir_x -= args.state.player_speed\n elsif args.inputs.keyboard.right && args.state.dir_x < args.state.player_maximum_speed\n args.state.dir_x += args.state.player_speed\n end\n end\n\n # change the direction of the dragon according to his direction\n if args.state.dir_x < 0\n args.outputs.sprites << { x: args.state.player.x,\n y: args.state.player.y,\n w: args.state.player.w,\n h: args.state.player.h,\n path: \"sprites/dragon-left-#{args.state.sprite_frame}.png\" }\n elsif args.state.dir_x > 0\n args.outputs.sprites << { x: args.state.player.x,\n y: args.state.player.y,\n w: args.state.player.w,\n h: args.state.player.h,\n path: \"sprites/dragon-right-#{args.state.sprite_frame}.png\" }\n else\n args.outputs.sprites << { x: args.state.player.x,\n y: args.state.player.y,\n w: args.state.player.w,\n h: args.state.player.h,\n path: \"sprites/dragon-right-#{args.state.sprite_frame}.png\" }\n end\n\n # apply change to left and the right guard\n args.state.guard_left.y += args.state.guard_left_y\n args.state.guard_right.y += args.state.guard_right_y\n\n # apply change to player\n args.state.player.x += args.state.dir_x\n args.state.player.y += args.state.dir_y\n else\n # args.state.count_down is inferior to 0 and greater than 20 * 60\n # check if game over (means args.state.count_down < 0)\n if game_over? args\n # render game over background\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/background.png']\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/parallax_back.png']\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/parallax_middle.png']\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/parallax_front.png']\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/square-gray.png', 0, 128]\n\n # keep the dragon flying in the good direction when game over\n if args.state.dir_x < 0\n # check if dead\n if args.state.player_life == 0\n args.outputs.sprites << { x: args.state.player.x,\n y: args.state.player.y,\n w: args.state.player.w,\n h: args.state.player.h,\n path: \"sprites/dragon_die_left.png\" }\n else\n args.outputs.sprites << { x: args.state.player.x,\n y: args.state.player.y,\n w: args.state.player.w,\n h: args.state.player.h,\n path: \"sprites/dragon-left-#{args.state.sprite_frame}.png\" }\n end\n else\n # check if dead\n if args.state.player_life == 0\n args.outputs.sprites << { x: args.state.player.x,\n y: args.state.player.y,\n w: args.state.player.w,\n h: args.state.player.h,\n path: \"sprites/dragon_die_right.png\" }\n else\n args.outputs.sprites << { x: args.state.player.x,\n y: args.state.player.y,\n w: args.state.player.w,\n h: args.state.player.h,\n path: \"sprites/dragon-right-#{args.state.sprite_frame}.png\" }\n end\n end\n\n # if r is pressed, reset the game\n # else if enter is pressed, return to game menu\n if args.inputs.keyboard.key_down.r\n score_win_memory = args.state.score_win\n $gtk.reset\n args.state.count_down = 20 * 60\n args.state.score_win = score_win_memory\n return\n elsif args.inputs.keyboard.key_down.enter\n score_win_memory = args.state.score_win\n $gtk.reset\n args.state.count_down = 25 * 60\n args.state.score_win = score_win_memory\n return\n end\n else\n # game is not over\n # check if we are in game prelude (means args.state.count_down between 20 and 25)\n if game_prelude? args\n # render prelude background\n args.outputs.sprites << [args.state.border_corner_x, args.state.border_corner_y, args.state.border_width, args.state.border_height, 'sprites/D4yFN_XWsAAy7WZ.jpg']\n\n # render label \"Game loading!\"\n args.outputs.primitives << { x: args.grid.w.half, y: args.grid.h.half + 75,\n text: \"Game loading!\",\n size_enum: 10, alignment_enum: 1,\n r: 0, g: 255, b: 0, a: 255,\n font: \"fonts/manaspc.ttf\" }.label\n\n # show count down to start game\n args.outputs.labels << { x: args.grid.w.half,\n y: args.grid.h - 70,\n size_enum: 10,\n text: \"#{((args.state.count_down.idiv 60) + 1) - 21}\",\n alignment_enum: 0,\n font: \"fonts/manaspc.ttf\" }\n end\n end\n end\n\n # ====================================================\n # determine score\n # ====================================================\n\n # calculate new score if the player is at goal\n if !game_over? args and game_start? args\n # if the player is at the goal, then move the goal\n if args.state.player.intersect_rect? args.state.target\n # increment the goal\n args.state.score += 1\n\n # check if win else keep giving random DragonRuby icons\n if args.state.score == args.state.score_win\n args.state.count_down = 0\n else\n # random coordinates for target\n args.state.target_x = args.state.border_corner_x + (rand (args.state.border_width - args.state.player_width))\n args.state.target_y = args.state.border_corner_y + (rand (args.state.border_height - args.state.player_height))\n\n # move the goal to a random location\n args.state.target = { x: (args.state.target_x), y: (args.state.target_y), w: args.state.target_width, h: args.state.target_height }\n end\n end\n\n # if the player hits the left guard\n if args.state.player.intersect_rect? args.state.guard_left\n # increment the goal\n args.state.player_life -= 1\n\n # check if dead\n if args.state.player_life == 0\n args.state.count_down = 0\n end\n end\n\n # if the player hits the right guard\n if args.state.player.intersect_rect? args.state.guard_right\n # increment the goal\n args.state.player_life -= 1\n\n # check if dead\n if args.state.player_life == 0\n args.state.count_down = 0\n end\n end\n end\nend",
"title": ""
},
{
"docid": "6cf1c096d581ff1bd3cf5864fb84ef2a",
"score": "0.57915366",
"text": "def begin_loop\n\n\n Keyboard.begin_key_record\n @gameobjects.each do |id, gameobject|\n gameobject.start\n end\n #@logic_bits_start.each do |id, logic_bit|\n # logic_bit.call\n #end\n\n loop_start\n\n begin\n loop do\n sleep (0.1)\n loop_update_begin\n\n @gameobjects.each do |id, gameobject|\n gameobject.update\n end\n\n @graphics_factory.clear_screen\n\n @gameobjects.each do |id, gameobject|\n @graphics_factory.buffer_at_position(gameobject.get_x, gameobject.get_y, gameobject.get_sprite)\n end\n\n #@logic_bits_update.each do |id, logic_bit|\n # logic_bit.call\n # end\n\n loop_update_end\n\n @graphics_factory.draw\n\n Keyboard.reset_key_record\n end\n rescue SystemExit\n puts \"Terminated Safely\"\n rescue Exception => e\n time = Time.now\n RTermGame.println \"\\'#{@game_name}' ran into an exception during the game loop\"\n RTermGame.println \"Error Report Generated \" + time.inspect\n RTermGame.println \"==[Details]==============================================\"\n RTermGame.println e.inspect\n RTermGame.println \"==[Backtrace]==============================================\"\n RTermGame.println e.backtrace.join(\"\")\n quit_game \"Exception Quit\"\n end\n end",
"title": ""
},
{
"docid": "a9488117b2a8b4f574b43f6385ef4cd8",
"score": "0.5789225",
"text": "def outdoor(variant = false)\n # gets screen size\n hz = 8\n vz = 6\n width = @viewport.width/hz\n height = @viewport.height/vz\n bmp = Graphics.snap_to_bitmap\n # generates all sprite particles\n sps = {}\n if variant\n sps[\"black\"] = Sprite.new(@viewport)\n sps[\"black\"].create_rect(@viewport.width,@viewport.height,Color.black)\n end\n for j in 0...(hz*vz)\n # renders rectangle\n sps[j] = Sprite.new(@viewport)\n sps[j].ox = width/2\n # decides which snaking pattern to take\n pat = j < (hz*vz)/2 ? (j/hz)%2 == 0 : (j/hz)%2 == 1\n # determines positioning\n x = pat ? (width/2 + width*(j%hz)) : (@viewport.width - width/2 - width*(j%hz))\n y = height * (j/hz)\n sps[j].x = x\n sps[j].y = y\n if variant\n sps[j].bitmap = Bitmap.new(width,height)\n sps[j].bitmap.blt(0,0,bmp,Rect.new(x-width/2,y,width,height))\n else\n sps[j].create_rect(width,height,Color.black)\n end\n sps[j].zoom_x = variant ? 1 : 0\n end\n # animates pattern\n for i in 0...40.delta_add\n for j in 0...(hz*vz)\n k = j < (hz*vz)/2 ? j : (hz*vz) - j\n next if k > i*0.75\n if variant\n sps[j].zoom_x -= 0.15/self.delta if sps[j].zoom_x > 0\n else\n sps[j].zoom_x += 0.15/self.delta if sps[j].zoom_x < 1\n end\n end\n pbWait(1)\n end\n # ensures viewport is set to black\n @viewport.color = Color.new(0, 0, 0, 255)\n # disposes unused sprites\n pbDisposeSpriteHash(sps)\n return true\n end",
"title": ""
},
{
"docid": "0dc1339c7bbfbcf6de08a542f5207268",
"score": "0.57724404",
"text": "def input\n # The program has to remember that the user is dragging an object\n # even when the mouse is no longer over that object\n # So detecting input and processing input is separate\n detect_input\n process_input\n end",
"title": ""
},
{
"docid": "8767b975794835396ba72f2edeb70343",
"score": "0.5756308",
"text": "def draw\n @background_image.draw(0, 0, 0)\n @player.draw\n\t@earth.draw\n\t@projectiles.each {|proj| proj.draw }\n\t@enemies.each { |en| en.draw }\n @stars.each { |star| star.draw }\n\t\n\t#UI\n\tif @start\n @font.draw(\"-Level #{@level}- Score: #{@player.score} Planet Health: #{@earth.life} / 100\", 10, 10, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n elsif not @start and @level == 1 and not @lose\n\t @font.draw(\"Welcome to Alien Invaders!\", 538, 200, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n @font.draw(\"Protect the planet from the invading aliens.\", 470, 300, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\t @font.draw(\"Collect stars and destroy aliens to get points.\", 460, 350, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\t @font.draw(\"The aliens will get faster and more numerous the longer you can protect the planet. Good luck.\", 280, 400, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\t @font.draw(\"Use the left and right arrow keys to rotate, and the up arrow key to accelerate. Spacebar shoots projectiles.\", 230, 450, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\t @font.draw(\"Press ENTER to continue...\", 533, 500, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\telsif not @start and not @level == 1 and not @lose\n\t @font.draw(\"Welcome to level #{@level}!\", 560, 300, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\t @font.draw(\"Press ENTER to continue...\", 533, 400, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\telsif @lose\n\t @font.draw(\"Earth is destroyed!! You Lose...\", 520, 300, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\t @font.draw(\"You made it to level #{@level}.\", 560, 400, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\t @font.draw(\"Press ESCAPE to end the game...\", 520, 450, ZOrder::UI, 1.0, 1.0, Gosu::Color::YELLOW)\n\tend\n end",
"title": ""
},
{
"docid": "4a8c3e639b4ef9f8cb1e0956c4ff5e4a",
"score": "0.5752871",
"text": "def calc args\r\n\r\nif !args.state.inloop\r\nargs.state.tick_count < args.state.tickstart + 180\r\n # Since velocity is the change in position, the change in x increases by dx. Same with y and dy.\r\n args.state.player.x += args.state.player.dx\r\n args.state.player.y += args.state.player.dy\r\n\r\n # Since acceleration is the change in velocity, the change in y (dy) increases every frame\r\n args.state.player.dy += args.state.gravity\r\n\r\n # player's y position is either current y position or y position of top of\r\n # bridge, whichever has a greater value\r\n # ensures that the player never goes below the bridge\r\n args.state.player.y = args.state.player.y.greater(args.state.bridge_top)\r\n\r\n # player's x position is either the current x position or 0, whichever has a greater value\r\n # ensures that the player doesn't go too far left (out of the screen's scope)\r\n args.state.player.x = args.state.player.x.greater(0)\r\n\r\n # player is not falling if it is located on the top of the bridge\r\n args.state.player.falling = false if args.state.player.y == args.state.bridge_top\r\n #args.state.player.rect = [args.state.player.x, args.state.player.y, args.state.player.h, args.state.player.w] # sets definition for player\r\n\r\n end\r\n end",
"title": ""
},
{
"docid": "ed502db37ec135743cc965a4295cd024",
"score": "0.57443506",
"text": "def test_misc\n assert_match(/^[a-z]{2}/, Gosu.language)\n\n Gosu.user_languages.each do |lang|\n assert_match(/^[a-z]{2}/, lang)\n end\n\n # TODO: This test can cause trouble if run after other tests, which might have updated Gosu.fps.\n # assert_equal 0, Gosu.fps, \"Gosu.fps should be 0 as there is nothing drawn\"\n\n first_call = Gosu.milliseconds\n assert_kind_of Integer, Gosu.milliseconds, \"Gosu.milliseconds should return an integer\"\n sleep 0.2\n assert first_call < Gosu.milliseconds, \"Gosu.milliseconds should increase over time\"\n\n assert Gosu.default_font_name.is_a? String\n\n assert Gosu.available_height > 0\n assert Gosu.available_width > 0\n\n assert Gosu.screen_height >= Gosu.available_height\n assert Gosu.screen_width >= Gosu.available_width\n\n assert_match(\"g\", Gosu.button_id_to_char(Gosu::KB_G))\n assert_equal Gosu::KB_G, Gosu.char_to_button_id(\"g\")\n assert_equal Gosu::KB_G, Gosu.char_to_button_id(\"G\")\n\n refute Gosu.button_down?(Gosu::KB_A)\n end",
"title": ""
},
{
"docid": "8aaac5c18d8dd91f5e5835ea02cd2894",
"score": "0.5742524",
"text": "def tick(args)\n return if SMALL_SHAPE_SIZE == 5\n\n # draw game components to the screen\n render_game(args)\n\n # check status to see what's happening\n # and act accordingly\n case args.state.status\n when :in_progress\n # the game is afoot\n inputs_game(args)\n calc_game(args)\n when :won_challenge\n # won a point\n calc_game(args)\n calc_won_challenge(args)\n when :lost_challenge\n # game is about to be over\n calc_game(args)\n calc_lost_challenge(args)\n when :lost_game, :won_game\n # game over\n render_game_over(args)\n inputs_game_over(args)\n else\n # it's the very start of the game. Set it up!\n defaults(args)\n end\nend",
"title": ""
},
{
"docid": "5aa1badf1a64e29073cb63285de16048",
"score": "0.57377946",
"text": "def update_player args\n\n player = args.state.player\n player.fire_cooldown_wait -= 1 if player.fire_cooldown_wait > 0\n\n xo = 0\n\n if player.dx < 0\n xo = -20\n else\n xo = 20\n end\n\n yo = 0\n\n if player.dy < 0\n yo = -20\n else\n yo = 20\n end\n\n ipx = player.x.idiv 64.0\n ipx_add_xo = (player.x + xo).idiv 64.0\n ipx_sub_xo = (player.x - xo).idiv 64.0\n\n ipy = player.y.idiv 64.0\n ipy_add_yo = (player.y + yo).idiv 64.0\n ipy_sub_yo = (player.y - yo).idiv 64.0\n\n if args.inputs.keyboard.right\n player.angle -= 5\n player.angle = player.angle % 360\n player.dx = player.angle.cos_d\n player.dy = -player.angle.sin_d\n end\n\n if args.inputs.keyboard.left\n player.angle += 5\n player.angle = player.angle % 360\n player.dx = player.angle.cos_d\n player.dy = -player.angle.sin_d\n end\n\n if args.inputs.keyboard.up\n if args.state.stage.layout[ipy * args.state.stage.w + ipx_add_xo] == 0\n player.x += player.dx * 5\n end\n\n if args.state.stage.layout[ipy_add_yo * args.state.stage.w + ipx] == 0\n player.y += player.dy * 5\n end\n end\n\n if args.inputs.keyboard.down\n if args.state.stage.layout[ipy * args.state.stage.w + ipx_sub_xo] == 0\n player.x -= player.dx * 5\n end\n\n if args.state.stage.layout[ipy_sub_yo * args.state.stage.w + ipx] == 0\n player.y -= player.dy * 5\n end\n end\n\n if args.inputs.keyboard.key_down.space && player.fire_cooldown_wait == 0\n m = { x: player.x, y: player.y, angle: player.angle, speed: 6, type: :missile, bright: true, expired: false }\n # Immediately move the missile forward a frame so it spawns ahead of the player\n m.x += m.angle.cos_d * m.speed\n m.y -= m.angle.sin_d * m.speed\n args.state.missiles << m\n player.fire_cooldown_wait = player.fire_cooldown_duration\n end\nend",
"title": ""
},
{
"docid": "3935a10db0c00bd86657c88a0f53312f",
"score": "0.5734097",
"text": "def in_game?; end",
"title": ""
},
{
"docid": "aa8db00958fc8e931848b48644b94283",
"score": "0.5730954",
"text": "def tick args\n args.state.tile_size = 80\n args.state.player_speed = 4\n args.state.player ||= tile(args, 7, 3, 0, 128, 180)\n generate_map args\n\n # Adds walls, goal, and player to args.outputs.solids so they appear on screen\n args.outputs.solids << args.state.walls\n args.outputs.solids << args.state.goal\n args.outputs.solids << args.state.player\n\n # If player's box intersects with goal, a label is output onto the screen\n if args.state.player.intersect_rect? args.state.goal\n args.outputs.labels << [30, 720 - 30, \"You're a wizard Harry!!\"] # 30 pixels lower than top of screen\n end\n\n move_player args, -1, 0 if args.inputs.keyboard.left # x position decreases by 1 if left key is pressed\n move_player args, 1, 0 if args.inputs.keyboard.right # x position increases by 1 if right key is pressed\n move_player args, 0, 1 if args.inputs.keyboard.up # y position increases by 1 if up is pressed\n move_player args, 0, -1 if args.inputs.keyboard.down # y position decreases by 1 if down is pressed\nend",
"title": ""
},
{
"docid": "13f058b1ae338ddccf517744a2221071",
"score": "0.57225615",
"text": "def draw args\n\n #update args\n #args.outputs.solids << [@x, @y, @width, @height, 255, 255, 0];\n #args.outputs.sprits << {\n #x: @x,\n #y: @y,\n #w: @width,\n #h: @height,\n #path: \"sprites/ball10.png\"\n #}\n #args.outputs.sprites <<[@x, @y, @width, @height, \"sprites/ball10.png\"]\n args.outputs.sprites << {x: @x, y: @y, w: @width, h: @height, path:\"sprites/ball10.png\" }\n end",
"title": ""
},
{
"docid": "75d62db488ba9ffee58672d5beb3b5fe",
"score": "0.5705915",
"text": "def user_interface (args)\r\n ticks = args.state.tick_count\r\n \r\n args.outputs.labels << [1000, 720, ticks, 25, 0, 200, 050, 100, 25]\r\n args.outputs.labels << [640, 700, \"This is a game\", 0, 1] \r\n args.outputs.labels << { x: 10, y: 710, text: \"Lives:\", size_enum: -3, alignment_enum: 0, r: 155, g: 50, b: 50 } \r\n args.outputs.lines << [ 0, 600, 1280, 600, 0, 0, 0, 255 ]\r\n \r\n \r\n board_x = 540\r\n board_y = 668\r\n board_w = 200\r\n board_h = 45\r\n echo = 4 \r\n \r\n args.outputs.borders << [board_x, board_y, board_w, board_h, 0, 0, 200, 255 ] \r\n args.outputs.borders << [board_x-echo, board_y-echo, board_w+echo*2, board_h+echo*2, 200, 0, 0, 255 ]\r\n \r\n \r\n args.outputs.solids << [board_x-echo, board_y-echo, board_w+echo*2, board_h+echo*2, 35, 0, 50, 255 ]\r\n echo = echo -5\r\n \r\n args.outputs.solids << {\r\n x: board_x-echo,\r\n y: board_y-echo,\r\n w: board_w+echo*2,\r\n h: board_h+echo*2,\r\n r: 25,\r\n g: 100,\r\n b: 40,\r\n a: 255\r\n }\r\n echo = 10\r\n args.outputs.solids << [board_x-4, board_y-echo, board_w+echo+4, board_h+echo+4, 0, 35, 0, 20 ]\r\nend",
"title": ""
},
{
"docid": "30545b4c479b81642db1eba9ab6fa217",
"score": "0.5701186",
"text": "def player; end",
"title": ""
},
{
"docid": "62a06d3289950c6bab273ba4c3d92188",
"score": "0.56982785",
"text": "def draw\n @w.walk\n\n load_pixels\n\n if pixels[$y*width+$x] != 0\n text_size(32)\n text(\"you lose!\", 10, 30)\n no_loop\n else\n @w.display\n end\n\nend",
"title": ""
},
{
"docid": "89b2fd153448d4a9d75fb5131c44bb6f",
"score": "0.56954277",
"text": "def draw_game_over_presenter(window, state)\n # background\n window.draw_rect(0, 0, window.width, window.height, Gosu::Color.argb(DARK_GRAY_COLOR))\n\n # Game Title\n heading_font_size = 80\n heading_font = Gosu::Font.new(heading_font_size, options = {:name => 'assets/fonts/hahmlet_font.ttf'})\n heading = state[:win] ? 'YOU WIN!!!' : 'YOU LOST :('\n heading_width = heading_font.text_width(heading)\n heading_font.draw_text(heading, # Text\n (window.width - heading_width) / 2, # draw x\n (window.height - heading_font_size) / 2 - 40, # draw y\n 1, # draw z\n 1, # scale x\n 1, # scale y\n Gosu::Color.argb(LIGHT_GREEN_COLOR)) # color\n\n # Navigation Information\n subheading = \"Press spacebar to return to main menu.\\nPress R to view your maze navigation.\"\n subheading_font = Gosu::Font.new(20)\n subheading_width = subheading_font.text_width(subheading)\n subheading_font.draw_text(subheading,\n (window.width - subheading_width) / 2,\n window.height / 2 + 40,\n 1)\n\nend",
"title": ""
},
{
"docid": "e2c17dffcdf70a51ebf9b7a7598daf32",
"score": "0.569366",
"text": "def tick args\n # set up the things that happen only once\n if args.tick_count.zero?\n # double buffer alternates between two render targets (buffers) each tick\n # this tracks which one is currently active\n args.state.active_buffer = :buffer_b\n\n # create the buffers\n args.render_target(:buffer_a)\n # note, in the tweetcart, buffer_b is created when it is first used\n args.render_target(:buffer_b)\n\n # create a rectangular texture to avoid importing an external file\n args.render_target(:rectangle).solids << {\n x: 0,\n y: 0,\n w: 1280,\n h: 720\n }\n\n # make a circle texture by rotating the rectangle through 90 degrees\n args.render_target(:circle).sprites << 90.times.map do |angle|\n {\n x: 20, # leave some space or the rotated sprite will get clipped\n y: 20,\n w: 20,\n h: 20,\n path: :rectangle,\n angle: angle\n }\n end\n else\n # draw if the left mouse button is down\n if args.inputs.mouse.button_left\n # figure out where to put the circle sprite based on the\n # mouse location. Shift it so the mouse location is\n # approximately in the middle of the sprite\n x = args.inputs.mouse.x - 30\n y = args.inputs.mouse.y - 30\n \n # draw into the currently active buffer\n args.render_target(args.state.active_buffer).sprites << {\n x: x,\n y: y,\n w: 1280,\n h: 720,\n path: :circle\n }\n end\n\n # we need to flip the active buffer from a to b or b to a every tick\n # get ready to change it but don't flip it yet\n if args.state.active_buffer == :buffer_a\n non_active_buffer = :buffer_b # temp variable\n else\n non_active_buffer = :buffer_a\n end\n\n # draw the non-active buffer into the active buffer\n args.render_target(args.state.active_buffer).sprites << [\n 0,\n 0,\n 1280,\n 720,\n non_active_buffer\n ]\n\n # now flip the buffers\n args.state.active_buffer = non_active_buffer\n\n # output the newly active buffer to the screen\n args.sprites << {\n x: 0,\n y: 0,\n w: 1280,\n h: 720,\n path: args.state.active_buffer\n }\n end\n\n # clear one of buffers when the right mouse button is clicked\n if args.inputs.mouse.button_right\n # it's a bit of a hack\n args.render_target(:buffer_a).w = 1\n end\nend",
"title": ""
},
{
"docid": "c7e40750361d055cc1ccfd8035c9c3b1",
"score": "0.5689582",
"text": "def run(player)\n print \"Nothing happens.\\n\\n\"\n end",
"title": ""
},
{
"docid": "c7e40750361d055cc1ccfd8035c9c3b1",
"score": "0.5689582",
"text": "def run(player)\n print \"Nothing happens.\\n\\n\"\n end",
"title": ""
},
{
"docid": "678d46993f9d565c70f1ad75bca81624",
"score": "0.56889004",
"text": "def inputs_game_over(args)\n return unless args.inputs.mouse.click\n\n # start again\n defaults(args)\n args.state.status = :in_progress\nend",
"title": ""
},
{
"docid": "58561a01a3184926b000633d2e376ee9",
"score": "0.56880796",
"text": "def drawing; end",
"title": ""
},
{
"docid": "58561a01a3184926b000633d2e376ee9",
"score": "0.56880796",
"text": "def drawing; end",
"title": ""
},
{
"docid": "58561a01a3184926b000633d2e376ee9",
"score": "0.56880796",
"text": "def drawing; end",
"title": ""
},
{
"docid": "58561a01a3184926b000633d2e376ee9",
"score": "0.56880796",
"text": "def drawing; end",
"title": ""
},
{
"docid": "6f306c83167b37c9d63377b93bdd8c30",
"score": "0.5686842",
"text": "def react\n try_moving\n sense\n end",
"title": ""
},
{
"docid": "322a27ef69b3160c7def00d493fcec74",
"score": "0.5682333",
"text": "def draw\n white = Gosu::Color.new(0, 0, 0)\n blue_background = Gosu::Color.new(59, 178, 247)\n green_tile = Gosu::Color.new(16, 204, 185)\n\n draw_rect(0,0, SCREEN_WIDTH, SCREEN_HEIGHT, blue_background)\n @board_bg.draw(103, 103, 1, 1, 1)\n #draw white dots\n draw_back_dots\n\n #draw play button\n if @state == :begin\n @background_music.play\n draw_play_butt\n draw_instructions\n #draw_pause_butt\n end\n\n\n if @second_state == :paused\n draw_pause_dots\n # if draw_pause_dots == :finished\n # @state = :running\n # end\n end\n\n #draw color dots over white dots every second\n if @state == :running\n #draw_pause_butt\n @background_music.stop\n draw_color_dots\n draw_score\n end\n\n if @state == :finished\n draw_finished\n draw_play_butt\n @score = 0\n @background_music.play\n @game_board = Board.new\n end\n\n # if @state == :playing\n # draw_pause_butt\n # end\n # if @state == :paused\n # draw_pause_dots\n # #@state = :running\n # end\n\n @game_board.board.each_with_index do |row, row_idx|\n row.each_with_index do |tile, col_idx|\n if tile.content != \"empty\"\n # draw_rect(tile.x, tile.y, CELL_SIZE_X, CELL_SIZE_Y, GREY)\n if tile.color == \"Green\"\n @green_tile.draw(tile.x, tile.y, 2, 1, 1)\n elsif tile.color == \"Yellow\"\n @yellow_tile.draw(tile.x, tile.y, 2, 1, 1)\n end\n\n draw_tile_letter(tile.center[0] - 10, tile.center[1] - 33, tile.content, @default_font, Gosu::Color::WHITE)\n # draw_rect(tile.x + 2, tile.y + 2, CELL_SIZE_X - 4, CELL_SIZE_Y - 4, TEAL)\n if tile.locked\n next\n else\n if surrounding_tile_empty?(@game_board.board, :up, [row_idx, col_idx])\n @arrow_up.draw_rot(tile.center_top[0], tile.center_top[1], 3, 0)\n end\n if surrounding_tile_empty?(@game_board.board, :right, [row_idx, col_idx])\n @arrow_right.draw_rot(tile.center_right[0], tile.center_right[1], 3, 0)\n end\n if surrounding_tile_empty?(@game_board.board, :left, [row_idx, col_idx])\n @arrow_left.draw_rot(tile.center_left[0], tile.center_left[1], 3, 0)\n end\n if surrounding_tile_empty?(@game_board.board, :down, [row_idx, col_idx])\n @arrow_down.draw_rot(tile.center_bottom[0], tile.center_bottom[1], 3, 0)\n end\n end\n else\n @white_tile.draw(tile.x, tile.y, 2, 1, 1)\n # draw_rect(tile.x, tile.y, CELL_SIZE_X, CELL_SIZE_Y, tile.color)\n # draw_rect(tile.x + 2, tile.y + 2, CELL_SIZE_X - 4, CELL_SIZE_Y - 4, Gosu::Color::WHITE)\n end\n # draw_rect(tile.x, tile.y, CELL_SIZE_X, CELL_SIZE_Y, tile.color)\n # draw_rect(tile.x + 2, tile.y + 2, CELL_SIZE_X - 4, CELL_SIZE_Y - 4, Gosu::Color::WHITE)\n # use draw_rot to put image centered on top of coordinates\n end\n end\n end",
"title": ""
},
{
"docid": "c35461a4cfbc8f2c0b37ba67b05cff2b",
"score": "0.5669306",
"text": "def run\n draw\n end",
"title": ""
},
{
"docid": "b33b05ed170e5053e34a4e52bbd915c3",
"score": "0.5666467",
"text": "def setup(args)\n args.state.player = Player.new() do\n # IDLE STATE :\n add_state :idle do\n define_setup do\n @glyph = '|'\n end\n\n add_event(next_state: :walking) do |args|\n if args[:input].key_held.left then\n @side = :left\n true\n\n elsif args[:input].key_held.right then\n @side = :right\n true\n\n else\n false\n\n end\n end\n\n add_event(next_state: :jumping) do |args|\n args[:input].key_held.space\n end\n end\n\n # WALKING STATE :\n add_state :walking do\n define_setup do\n @glyph = ( @side == :right ? '>' : '<' )\n end\n\n add_event(next_state: :idle) do |args|\n !args[:input].key_held.left && !args[:input].key_held.right\n end\n\n add_event(next_state: :jumping) do |args|\n args[:input].key_held.space\n end\n end\n\n # JUMPING STATE :\n add_state :jumping do\n define_setup do\n @dy = JUMP_STRENGTH\n @glyph = '^'\n end\n\n add_event(next_state: :idle) do |args|\n if @y < 0 then\n @dy, @y = 0, 0\n true\n else\n false\n end\n end\n end\n\n set_initial_state :idle\n end\n\n args.state.setup_done = true\nend",
"title": ""
},
{
"docid": "feb545998bb1820d64f521423a6e9532",
"score": "0.56656265",
"text": "def draw; end",
"title": ""
},
{
"docid": "feb545998bb1820d64f521423a6e9532",
"score": "0.56656265",
"text": "def draw; end",
"title": ""
},
{
"docid": "feb545998bb1820d64f521423a6e9532",
"score": "0.56656265",
"text": "def draw; end",
"title": ""
},
{
"docid": "7b3f9202aa6b00fb441d3938e7f0537e",
"score": "0.56469816",
"text": "def game_over_screen\n @subtitle_font.draw_text \"Final Score for player 1: #{@p1.score}\", 170, 130, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::WHITE\n \n if @game_settings.p2_init # 2Player mode\n @subtitle_font.draw_text \"Final Score for player 2: #{@p2.score}\", 170, 150, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::WHITE\n @background_image = Gosu::Image.new \"media/gob.png\", :tileable => true\n\n if @p1.score> @p2.score #P1 win\n @image = Gosu::Image.new \"media/p1win.png\"\n elsif @p2.score > @p1.score #P2 win\n @image = Gosu::Image.new \"media/p2win.png\"\n else #TIE\n @image = Gosu::Image.new \"media/tie.png\"\n end\n\n elsif @game_settings.is_cpu_player_enabled #CPU mode\n @subtitle_font.draw_text \"Final Score for CPU: #{@computer_signal.score}\", 170, 150, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::WHITE\n if @computer_signal.score < @p1.score\n @background_image = Gosu::Image.new \"media/youwin.png\", :tileable => true\n @image = Gosu::Image.new \"media/youwinText.png\"\n else\n @image = Gosu::Image.new \"media/Gameover.png\"\n @background_image = Gosu::Image.new \"media/gob.png\", :tileable => true\n\n end\n else #Single Player mode\n @image = Gosu::Image.new \"media/Gameover.png\"\n @background_image = Gosu::Image.new \"media/gob.png\", :tileable => true\n end\n\n @button_option.draw 190, 220, ZOrder::BUTTON, 0.15, 0.15\n @button_option.draw 360, 220, ZOrder::BUTTON, 0.15, 0.15\n @subtitle_font.draw_text Options::GAMEOVER_SCREEN[0], 240, 282, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n @subtitle_font.draw_text Options::GAMEOVER_SCREEN[1], 395, 282, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n\n # draw player movement\n left_x ,right_x, top_y, bottom_y, button_distance = 200, 310, 260, 310, 170\n\n # reflects each corner \n if @settings_hovered == Options::GAMEOVER_SCREEN[0]\n draw_rect left_x, top_y, 120, 10, Gosu::Color::GRAY,ZOrder::TEXT\n draw_rect left_x, top_y, 10, 50, Gosu::Color::GRAY,ZOrder::TEXT\n draw_rect left_x, bottom_y, 120, 10, Gosu::Color::GRAY,ZOrder::TEXT\n draw_rect right_x, top_y, 10, 50, Gosu::Color::GRAY,ZOrder::TEXT\n else\n draw_rect left_x + button_distance, top_y, 120, 10, Gosu::Color::GRAY,ZOrder::TEXT\n draw_rect left_x + button_distance, top_y, 10, 50, Gosu::Color::GRAY,ZOrder::TEXT\n draw_rect left_x + button_distance, bottom_y, 120, 10, Gosu::Color::GRAY,ZOrder::TEXT\n draw_rect right_x + button_distance, top_y, 10, 50, Gosu::Color::GRAY,ZOrder::TEXT\n end\n\n @image.draw 190, 30, 20\n end",
"title": ""
},
{
"docid": "10d298be393401c557b9a3ce057b1730",
"score": "0.564076",
"text": "def tick(args)\n\n # --- Setup :\n setup(args) unless args.state.setup_done\n\n\n # --- Main Loop :\n case args.state.scene\n when :commands\n args.render_target(:display).solids << { x: 0, y: 0, w: 64, h: 64, r:0, g:0, b:0, a:255 }\n\n case args.state.tick_count\n when 0..63\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/commands.png', r: 255, g: 255, b: 255, a: 4 * args.state.tick_count }\n\n when 64...(64 + COMMANDS_DELAY * 60)\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/commands.png' }\n\n when (64 + COMMANDS_DELAY * 60)..(127 + COMMANDS_DELAY * 60)\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/commands.png', r: 255, g: 255, b: 255, a: 255 - 4 * ( args.state.tick_count - 64 - COMMANDS_DELAY * 60 ) }\n\n else\n args.state.scene = :hints\n\n end\n\n\n when :hints\n args.render_target(:display).solids << { x: 0, y: 0, w: 64, h: 64, r:0, g:0, b:0, a:255 }\n\n case args.state.tick_count\n when (127 + COMMANDS_DELAY * 60)..(127 + 63 + COMMANDS_DELAY * 60)\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/hints.png', r: 255, g: 255, b: 255, a: 4 * ( args.state.tick_count - (127 + COMMANDS_DELAY * 60) ) }\n\n when (127 + 64 + COMMANDS_DELAY * 60)...(127 + 64 + ( COMMANDS_DELAY + HINTS_DELAY ) * 60)\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/hints.png' }\n\n when (127 + 64 + ( COMMANDS_DELAY + HINTS_DELAY ) * 60)..(127 + 127 + ( COMMANDS_DELAY + HINTS_DELAY ) * 60)\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/hints.png', r: 255, g: 255, b: 255, a: 255 - 4 * ( args.state.tick_count - (127 + 64 + ( COMMANDS_DELAY + HINTS_DELAY ) * 60) ) }\n\n else\n args.state.scene = :start_screen\n\n end\n\n\n when :start_screen\n $gtk.stop_music\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/field_background_bitmaps.png', source_x: 0, source_y: 192, source_w: 64, source_h: 64 }\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/field_background_bitmaps.png', source_x: 0, source_y: 128, source_w: 64, source_h: 64 }\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/field_background_bitmaps.png', source_x: 0, source_y: 64, source_w: 64, source_h: 64 }\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 8, path: 'sprites/field_start_tiles.png' }\n args.render_target(:display).sprites << { x: 4, y: 41, w: 56, h: 16, path: 'sprites/title.png', source_x: ( ( args.state.tick_count >> 3 ) % 32 ) * 56, source_y: 0, source_w: 56, source_h: 16 }\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/field_background_bitmaps.png', source_x: 0, source_y: 0, source_w: 64, source_h: 64 }\n args.render_target(:display).sprites << { x: 0, y: 0, w: 32, h: 7, path: 'sprites/version.png' }\n\n if args.state.start_pushed == false then\n args.render_target(:display).sprites << { x: 4, y: 12, w: 56, h: 5, path: 'sprites/press_start.png' } if ( ( args.state.tick_count >> 5 ) % 2 == 0 )\n\n if args.inputs.keyboard.key_down.space || args.inputs.controller_one.key_down.start\n args.state.start_pushed = true \n args.state.start_time = args.state.tick_count\n args.outputs.sounds << 'sounds/start.wav'\n end\n\n else\n args.render_target(:display).sprites << { x: 4, y: 12, w: 56, h: 5, path: 'sprites/press_start.png' } if ( ( args.state.tick_count >> 2 ) % 2 == 0 )\n\n if args.state.tick_count - args.state.start_time > START_DELAY then\n args.state.level = 0\n setup_level( args, LEVELS[args.state.level], INITIAL_HEALTH )\n args.outputs.sounds << 'sounds/win_soft.ogg'\n args.state.scene = :game \n end\n end\n\n\n when :game\n # 1. Actors Updates :\n args.state.player.update(args)\n\n args.state.back.each { |layer| layer.update(args.state.player.dx) }\n args.state.front.each { |layer| layer.update(args.state.player.dx) }\n args.state.ground.update(args.state.player.dx)\n\n args.state.monsters.each { |monster| monster.update(args) }\n args.state.monsters = remove_dead_monsters(args)\n args.state.monsters = remove_passed_monsters(args)\n \n args.state.door.update(args)\n\n args.state.props.each { |prop| prop.update(args) }\n args.state.props = remove_used_props(args.state.props)\n\n args.state.effects.each { |effect| effect.update }\n args.state.effects = remove_finished_effects(args.state.effects)\n\n\n # 2. Render :\n \n # 2.1 Render to the virtual 64x64 screen :\n args.state.back.each { |layer| args.render_target(:display).sprites << layer.render }\n args.render_target(:display).sprites << args.state.ground.render\n\n args.render_target(:display).sprites << args.state.door.render(args)\n\n args.state.monsters.each { |monster| args.render_target(:display).sprites << monster.render(args) }\n\n args.state.props.each { |prop| args.render_target(:display).sprites << prop.render(args) }\n\n args.render_target(:display).sprites << args.state.player.render\n\n args.state.effects.each { |effect| args.render_target(:display).sprites << effect.render(args) }\n\n args.state.front.each { |layer| args.render_target(:display).sprites << layer.render }\n\n args.state.player.health.times do |i|\n args.render_target(:display).sprites << { x: 9 * i,\n y: 54,\n w: 8,\n h: 8,\n path: 'sprites/life_8px.png' }\n end\n\n # 2.2 Render debug visual aides if necessary :\n #args.state.debug_mode = ( args.state.debug_mode + 1 ) % MODE_COUNT if args.inputs.keyboard.key_down.tab\n #if args.state.debug_mode == 1 then\n # Debug::draw_box args.state.player.hit_box, [ 153, 229, 80, 255 ]\n # Debug::draw_player_v [ 91, 110, 225, 255 ], [ 95, 205, 228, 255 ]\n # args.state.monsters.each do |monster|\n # Debug::draw_box( monster.hit_box(args.state.ground.position), [229, 153, 80, 255] )\n # monster.limbs.each do |limb|\n # Debug::draw_box( limb.hit_box(monster,args.state.ground.position), [ 210, 80, 234, 255 ] )\n # end\n # end\n #end\n\n\n # 3. Spawning :\n args.state.monsters += spawn_monsters(args) if args.state.monsters.empty?\n\n\n # 4. Death or Next Level :\n if args.state.player.current_state == :dying &&\n args.state.player.animation_status == :finished then\n args.state.scene = :game_over\n args.state.game_over_time = args.state.tick_count\n end\n\n if args.state.player.current_state == :shifting &&\n args.state.player.animation_status == :finished then\n args.state.scene = :next_level\n end\n\n\n when :next_level\n args.state.level += 1\n\n if args.state.level < LEVELS.length then\n next_health = args.state.player.health < 3 ? 3 : args.state.player.health\n setup_level( args, LEVELS[args.state.level], next_health )\n args.state.scene = :game \n\n else\n args.state.scene = :end\n args.state.end_start_time = args.state.tick_count\n\n end\n\n\n when :end\n if args.state.tick_count - args.state.end_start_time < END_SCROLL_DELAY * 60 then\n y_offset = END_SCROLL_HEIGHT - 64\n else\n y_offset = END_SCROLL_HEIGHT - 64 - ( ( args.state.tick_count - args.state.end_start_time - END_SCROLL_DELAY * 60 ) >> 4 )\n end\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: 'sprites/end.png', source_x: 0, source_y: y_offset, source_w: 64, source_h: 64 }\n\n if args.inputs.keyboard.key_down.space || args.inputs.controller_one.key_down.start || y_offset == 0 then\n args.state.scene = :start_screen \n args.state.start_pushed = false\n end\n\n\n when :game_over\n $gtk.stop_music\n x_index = ( args.state.tick_count - args.state.game_over_time >> 2 ) % 23\n y_index = ( args.state.tick_count - args.state.game_over_time >> 2 ) < 23 ? 1 : 0\n args.render_target(:display).sprites << { x: 0, y: 0, w: 64, h: 64, path: \"sprites/game_over.png\", source_x: x_index * 64, source_y: y_index * 64, source_w: 64, source_h: 64 }\n\n if args.inputs.keyboard.key_down.space || args.inputs.controller_one.key_down.start then\n args.state.scene = :start_screen \n args.state.start_pushed = false\n end\n\n end\n\n\n # --- Render to DragonRuby window :\n args.outputs.solids << [ 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255 ]\n args.outputs.sprites << { x: DISPLAY_X,\n y: DISPLAY_Y,\n w: DISPLAY_SIZE,\n h: DISPLAY_SIZE,\n path: :display,\n tile_x: 0,\n tile_y: 720 - DISPLAY_BASE_SIZE,\n tile_w: DISPLAY_BASE_SIZE,\n tile_h: DISPLAY_BASE_SIZE }\nend",
"title": ""
},
{
"docid": "0acfbe327fd91f7de597c914970e4f9b",
"score": "0.56323653",
"text": "def tick args\n args.outputs.background_color = [0, 0, 0]\n\n # setup things that run only once\n if args.tick_count.zero?\n # create the first target buffer symbols\n args.state.buffer_a = :symbol_1\n args.state.buffer_b = :symbol_2\n\n # initialize the first render target\n args.render_target(args.state.buffer_a)\n end\n\n # flip the render targets every tick\n args.state.buffer_a, args.state.buffer_b = args.state.buffer_b, args.state.buffer_a \n\n # copy the texture of the non-active buffer to the active buffer\n # rotate it by 45 degrees to create the rotational pattern\n args.render_target(args.state.buffer_a).sprites << {\n x: 0,\n y: 0,\n w: 1280,\n h: 720,\n path: args.state.buffer_b,\n angle: 45 # this angle makes the rotational pattern\n }\n\n # output the texture of the non-active buffer to the screen\n args.outputs.sprites << {\n x: 0,\n y: 0,\n w: 1280,\n h: 720,\n path: args.state.buffer_b\n }\n\n # add primitives to the active buffer\n\n # move the primitive in a small circle\n # moves the primitive gently left and right\n x = 600 + args.tick_count.sin * 25\n # moves the primitive gently up and down\n y = d = 300 + args.tick_count.cos * 25\n\n # makes the primitive width move smoothly back and forth\n # from about -10 to 10 pixels in width\n w = args.tick_count.cos * 10\n\n # makes the primitive width move smoothly back and forth\n # from about -100 to 100 pixels in height\n h = args.tick_count.sin * 100\n\n # adds red when the primitive is widest\n red = Math.atan(args.tick_count.cos) * y\n\n # adds green based on strength of red and x position\n green = red + args.tick_count.sin * 255\n\n # draw to the buffer\n args.render_target(args.state.buffer_a).primitives << {\n x: x,\n y: y,\n w: w,\n h: h,\n r: red,\n g: green\n }.solid\nend",
"title": ""
},
{
"docid": "80ba4a5701f5fef51901f9cd6f980925",
"score": "0.56215364",
"text": "def tick args\n # The defaults function intitializes the game.\n defaults args\n\n # After the game is initialized, render it.\n render args\n\n # After rendering the player should be able to respond to input.\n input args\n\n # After responding to input, the game performs any additional calculations.\n calc args\nend",
"title": ""
},
{
"docid": "ddb4898c4e9a22cebbba4598e9ac1ab4",
"score": "0.56185293",
"text": "def initialize(p_win, filename, save_gosu_image = false, alpha = true)\n filename.is_a?(Gosu::Image) ? gosu_image = filename : gosu_image = Gosu::Image.new(p_win, filename, true)\n @width, @height = gosu_image.width, gosu_image.height\n array_of_pixels = gosu_image.to_blob\n @texture_id = glGenTextures(1)\n glBindTexture(GL_TEXTURE_2D, @texture_id[0])\n if alpha\n glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, gosu_image.width, gosu_image.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, array_of_pixels)\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)\n else\n glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, gosu_image.width, gosu_image.height, 0, GL_RGB, GL_UNSIGNED_BYTE, array_of_pixels)\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) \n end\n \n if save_gosu_image\n @gosu_image = gosu_image\n else\n gosu_image = nil\n end \n end",
"title": ""
},
{
"docid": "416b878e63844a557173a5f2c63a3c73",
"score": "0.5611854",
"text": "def setup \n size 640, 360 \n no_stroke\n no_loop\nend",
"title": ""
},
{
"docid": "416b878e63844a557173a5f2c63a3c73",
"score": "0.5611854",
"text": "def setup \n size 640, 360 \n no_stroke\n no_loop\nend",
"title": ""
},
{
"docid": "d06003083d513aaf61b5096d9f91bd7b",
"score": "0.5607519",
"text": "def tick args\r\n args.state.random ||= 1000000000 # Random variable for enemy spawn\r\n # This is a shortcut, using args.state.x ||= 0 is the same as an if not ex:\r\n # args.state.x ||= 0 is a short version of if !args.state.x then args.state.x = 0\r\n\r\n user_interface args # The user interface function\r\n\r\n sprite args # The player sprite function\r\n\r\n bullet_physics args # this function deals with the bullet physics\r\n\r\n amimation args # This function animates the little sprites by the title\r\n\r\n enemy args # This function deals with enemy spawning\r\n \r\nend",
"title": ""
},
{
"docid": "22d1f721109ca5bf344fc777c792e245",
"score": "0.56074584",
"text": "def main\r\n init\r\n Graphics.transition\r\n loop do Graphics.update end\r\n end",
"title": ""
},
{
"docid": "b829607a682756a92876c117e2c1566a",
"score": "0.55989504",
"text": "def inputs args\n @deck.inputs args\n @discard.inputs args\n @hand.inputs args\n @enemiesOnScreen.inputs args\n @player.inputs args\n @UI.inputs args\n\n\t\tif args.inputs.keyboard.key_down.i\n\t\t\t$gtk.args.state.watching = true\n\t\t\t$gtk.args.state.sending = false\n\t\tend\n\n\t\tif args.inputs.keyboard.key_down.o\n\t\t\t$gtk.args.state.watching = false\n\t\t\t$gtk.args.state.sending = true\n\t\tend\n\n\t\tif args.inputs.keyboard.key_down.p\n\t\t\t$gtk.args.state.watching = false\n\t\t\t$gtk.args.state.sending = false\n\t\tend\n end",
"title": ""
},
{
"docid": "4778406b3b3c343d19b46d37e46d6602",
"score": "0.55982953",
"text": "def update\n \n #--- Updating | Velocity ---# \n \n @y += @velocity_y #Move the image each frame on the Y axis\n @x += @velocity_x #Move the image each frame on the X axis\n \n @velocity_x *= -1 if @x + @width / 2 > 800 || @x - @width / 2 < 0 #Check to see if the Ruby is going off screen on the X axis\n @velocity_y *= -1 if @y + @height / 2 > 600 || @y - @height / 2 < 0 #Check to see if the Ruby is going off screen on the Y axis\n\n @visible -= 1 #Each frame remove 1 to the value of visible\n @visible = 50 if @visible < -10 && rand < 0.05 #If @visible has been negative for 10 frames, there is a 0.05% chance that the Ruby appear\n\n @time_left = (30 - ((Gosu.milliseconds - @start_time) / 1000)) #Calculate the time left to play (30 seconds total)\n\n @playing = false if @time_left < 0\n \nend",
"title": ""
},
{
"docid": "6dbc23dacc41511753ac5019cdcf9cb6",
"score": "0.5597283",
"text": "def initialize(options = {})\r\n super\r\n\r\n self.input = { e: :edit }\r\n\r\n Sound[\"fruit.wav\"] # cache sound by accessing it once\r\n\r\n self.viewport.lag = 0 # 0 = no lag, 0.99 = a lot of lag.\r\n self.viewport.game_area = [0, 0, 500, 100000] # Viewport restrictions, full \"game world/map/area\"\r\n @score = 0\r\n @lavatimer = 0\r\n every(600) { @lavatimer += 1 }\r\n every(300) { @score+=1 }\r\n every(600) { @lava.y += 1 + @lavatimer }\r\n\r\n #\r\n # Create 40 stars scattered around the map. This is now replaced by load_game_objects()\r\n # ## 40.times { |nr| Star.create(:x => rand * self.viewport.x_max, :y => rand * self.viewport.y_max) }\r\n #\r\n @parallaxes = []\r\n tmp = Chingu::Parallax.create(:x => 0, :y => 0)\r\n tmp << { :image => \"sand.png\", :repeat_x => true, :repeat_y => true, damping: 10}\r\n @parallaxes << tmp\r\n\r\n @lava = Chingu::Parallax.create(:x => 250, :y => -360)\r\n @lava << { :image => \"lava.png\", zorder: 900 }\r\n\r\n\r\n @score_text = Text.create(\"Score: #{@score}\", :x => self.viewport.x + 10, :y => self.viewport.y + 10, :size=>30, :color => Color::BLACK, zorder: 1000)\r\n load_game_objects( :file => \"map.yml\")\r\n\r\n @player = Player.create(:x => 100, :y => 100)\r\n\r\n end",
"title": ""
},
{
"docid": "fc55a3a2e7e837e0cf5da6cf87000295",
"score": "0.55960596",
"text": "def movement ; end",
"title": ""
},
{
"docid": "f0f5a178312c59d3d034d8deb4e3efb6",
"score": "0.55864805",
"text": "def update\n if idle?\n if Gosu.distance(@hb.x, @hb.y, $WINDOW.player.hb.x, $WINDOW.player.hb.y) < 75\n # If distance is 75 or less, behaviour changes to moving\n change_state(GameStates::States::WALKING)\n @vect_v = 1.7\n @vect_angle = Gosu.angle(@hb.x, @hb.y, $WINDOW.player.hb.x, $WINDOW.player.hb.y)\n end\n elsif moving?\n if Gosu.distance(@hb.x, @hb.y, $WINDOW.player.hb.x, $WINDOW.player.hb.y) > 50 && @approaching\n # While distance is more than 50, the bat approaches the main character.\n @vect_angle = Gosu.angle(@hb.x, @hb.y, $WINDOW.player.hb.x, $WINDOW.player.hb.y)\n elsif @event_tiks > 0\n @approaching ? approach($WINDOW.player,1) : distance_from($WINDOW.player,2)\n else\n decide_what_to_do_next\n end\n elsif attacking?\n if @event_tiks > 0\n if @attack_type == :random\n @hb.x += 3*@dir*@axis_x\n @hb.y += 3*@dir*@axis_y\n @dir = @event_tiks == 17 ? -1*@dir : @dir\n elsif @attack_type == :dart\n @hb.x -= @attack_x_speed\n @hb.y -= @attack_y_speed\n end\n else\n change_state(GameStates::States::WALKING)\n @event_tiks = @approaching ? 60 : 15\n end\n elsif recoiling?\n recoil\n elsif dying?\n @event_tiks == 0 ? die : nil\n end\n\n if normal? && $WINDOW.player.inv_frames <= 0 && !$WINDOW.player.recoiling? && @hb.check_brute_collision($WINDOW.player.hb)\n $WINDOW.player.impacted(@hb.center, @attack_dmg)\n end\n\n if !idle? && Gosu.distance(@hb.x, @hb.y, $WINDOW.player.hb.x, $WINDOW.player.hb.y) > 250\n change_state(GameStates::States::IDLE)\n end\n\n @event_tiks -= 1 unless recoiling? || (Gosu.distance(@hb.x, @hb.y, $WINDOW.player.hb.x, $WINDOW.player.hb.y) > 50 && !attacking? && @approaching)\n end",
"title": ""
},
{
"docid": "9bb476b5e7421af2937126a109c9ab1d",
"score": "0.55841804",
"text": "def render_game(args)\n args.outputs.labels << [10, 710, \"Time remaining: #{(args.state.game_timer / 60).to_int} seconds\"]\n args.outputs.labels << [10, 690, \"Score: #{args.state.score} / #{WIN_SCORE}\"]\n args.outputs.sprites << args.state.shapes\n\n # outputting these labels to primitives because we want to control the z order\n args.outputs.primitives << args.state.labels\n args.outputs.primitives << args.state.hint_letters\nend",
"title": ""
},
{
"docid": "16a4690d702590d87a72bb979728aec4",
"score": "0.558325",
"text": "def draw\n\t\t#@background_image.draw(0, 0, 0);\n\t\t@font.draw(\"Player Score: #{@game.player_score}\", 10, 10, 1, 1.0, 1.0, 0xffffff00)\n\t\t@font.draw(\"Cards: #{@game.player}\", 10, 40, 1, 1.0, 1.0, 0xffffff00)\n\t\t@font.draw(\"Dealer Score: #{@game.dealer_score}\", 510, 10, 1, 1.0, 1.0, 0xffffff00)\n\t\t@font.draw(\"Cards: #{@game.dealer}\", 510, 40, 1, 1.0, 1.0, 0xffffff00)\n\t\t\n\t\tdraw_quad(0, 300, Gosu::Color.argb(0xff808080), 100, 300, Gosu::Color.argb(0xff808080), 100, 250, Gosu::Color.argb(0xff808080), 0, 250, Gosu::Color.argb(0xff808080), z = 0, mode = :default)\n\t\tdraw_quad(653, 300, Gosu::Color.argb(0xff808080), 553, 300, Gosu::Color.argb(0xff808080), 553, 250, Gosu::Color.argb(0xff808080), 653, 250, Gosu::Color.argb(0xff808080), z = 0, mode = :default)\n\t\tdraw_quad(285, 95, Gosu::Color.argb(0xffffffff), 300, 95, Gosu::Color.argb(0xffffffff), 285, 120, Gosu::Color.argb(0xffffffff), 300, 120, Gosu::Color.argb(0xfffffff))\n\t\tdraw_quad(295, 95, Gosu::Color.argb(0xffffffff), 310, 95, Gosu::Color.argb(0xffffffff), 295, 120, Gosu::Color.argb(0xffffffff), 310, 120, Gosu::Color.argb(0xfffffff))\n\t\t@font.draw(\"Hit\", 30, 265, 1, 1.0, 1.0, 0xffff00ff)\n\t\t@font.draw(\"Stay\", 583, 265, 1, 1.0, 1.0, 0xffff00ff)\n\t\t\n\t\t\n\t\tdraw_player_win\n\t\tdraw_dealer_win\n\t\tdraw_game_tie\n\t\tdraw_card\n\tend",
"title": ""
},
{
"docid": "45c4b07c8dd7fedbdda3edb5fdc7c908",
"score": "0.55782235",
"text": "def defaults args\r\n fiddle args\r\n \r\n args.state.tick_count = args.state.tick_count\r\n args.state.bridge_top = 128\r\n args.state.player.x ||= 0 # initializes player's properties\r\n args.state.player.y ||= args.state.bridge_top\r\n args.state.player.w ||= 64\r\n args.state.player.h ||= 64\r\n args.state.player.dy ||= 0\r\n args.state.player.dx ||= 0\r\n args.state.player.r ||= 0\r\n args.state.game_over_at ||= 0\r\n args.state.player.sliding||= false\r\n args.state.loopy.r ||= 200\r\n args.state.loopy.hide||= 128\r\n args.state.tickstart ||= 0\r\n args.state.inloop ||= false\r\n args.state.looptime ||= 120\r\n\r\n \r\nend",
"title": ""
},
{
"docid": "3925ce509e3c8bb6bc30e22b21f49a28",
"score": "0.55763084",
"text": "def tick args\n # ====================================================\n # initialize default variables\n # ====================================================\n\n # ruby has an operator called ||= which means \"only initialize this if it's nil\"\n args.state.count_down ||= 20 * 60 # set the count down to 20 seconds\n # set the initial position of the target\n args.state.target ||= { x: args.grid.w.half,\n y: args.grid.h.half,\n w: 20,\n h: 20 }\n\n # set the initial position of the player\n args.state.player ||= { x: 50,\n y: 50,\n w: 20,\n h: 20 }\n\n # set the player movement speed\n args.state.player_speed ||= 5\n\n # set the score\n args.state.score ||= 0\n args.state.teleports ||= 3\n\n # set the instructions\n args.state.instructions ||= \"Get to the red goal! Use arrow keys to move. Spacebar to teleport (use them carefully)!\"\n\n # ====================================================\n # render the game\n # ====================================================\n args.outputs.labels << { x: args.grid.w.half, y: args.grid.h - 10,\n text: args.state.instructions,\n alignment_enum: 1 }\n\n # check if it's game over. if so, then render game over\n # otherwise render the current time left\n if game_over? args\n args.outputs.labels << { x: args.grid.w.half,\n y: args.grid.h - 40,\n text: \"game over! (press r to start over)\",\n alignment_enum: 1 }\n else\n args.outputs.labels << { x: args.grid.w.half,\n y: args.grid.h - 40,\n text: \"time left: #{(args.state.count_down.idiv 60) + 1}\",\n alignment_enum: 1 }\n end\n\n # render the score\n args.outputs.labels << { x: args.grid.w.half,\n y: args.grid.h - 70,\n text: \"score: #{args.state.score}\",\n alignment_enum: 1 }\n\n # render the player with teleport count\n args.outputs.sprites << { x: args.state.player.x,\n y: args.state.player.y,\n w: args.state.player.w,\n h: args.state.player.h,\n path: 'sprites/square-green.png' }\n\n args.outputs.labels << { x: args.state.player.x + 10,\n y: args.state.player.y + 40,\n text: \"teleports: #{args.state.teleports}\",\n alignment_enum: 1, size_enum: -2 }\n\n # render the target\n args.outputs.sprites << { x: args.state.target.x,\n y: args.state.target.y,\n w: args.state.target.w,\n h: args.state.target.h,\n path: 'sprites/square-red.png' }\n\n # ====================================================\n # run simulation\n # ====================================================\n\n # count down calculation\n args.state.count_down -= 1\n args.state.count_down = -1 if args.state.count_down < -1\n\n # ====================================================\n # process player input\n # ====================================================\n # if it isn't game over let them move\n if !game_over? args\n dir_y = 0\n dir_x = 0\n\n # determine the change horizontally\n if args.inputs.keyboard.up\n dir_y += args.state.player_speed\n elsif args.inputs.keyboard.down\n dir_y -= args.state.player_speed\n end\n\n # determine the change vertically\n if args.inputs.keyboard.left\n dir_x -= args.state.player_speed\n elsif args.inputs.keyboard.right\n dir_x += args.state.player_speed\n end\n\n # determine if teleport can be used\n if args.inputs.keyboard.key_down.space && args.state.teleports > 0\n args.state.teleports -= 1\n dir_x *= 20\n dir_y *= 20\n end\n\n # apply change to player\n args.state.player.x += dir_x\n args.state.player.y += dir_y\n else\n # if r is pressed, reset the game\n if args.inputs.keyboard.key_down.r\n $gtk.reset\n return\n end\n end\n\n # ====================================================\n # determine score\n # ====================================================\n\n # calculate new score if the player is at goal\n if !game_over? args\n\n # if the player is at the goal, then move the goal\n if args.state.player.intersect_rect? args.state.target\n # increment the goal\n args.state.score += 1\n\n # move the goal to a random location\n args.state.target = { x: (rand args.grid.w), y: (rand args.grid.h), w: 20, h: 20 }\n\n # make sure the goal is inside the view area\n if args.state.target.x < 0\n args.state.target.x += 20\n elsif args.state.target.x > 1280\n args.state.target.x -= 20\n end\n\n # make sure the goal is inside the view area\n if args.state.target.y < 0\n args.state.target.y += 20\n elsif args.state.target.y > 720\n args.state.target.y -= 20\n end\n end\n end\nend",
"title": ""
},
{
"docid": "99b7b46c5e2095118b0588a877d419e6",
"score": "0.55759865",
"text": "def falcon_input\n @falcon.move_left if (Gosu.button_down? Gosu::KbLeft) && @falcon.move_left_possible?\n @falcon.move_right if (Gosu.button_down? Gosu::KbRight) && @falcon.move_right_possible?(width, height)\n @falcon.move_up if (Gosu.button_down? Gosu::KbUp) && @falcon.move_up_possible?\n @falcon.move_down if (Gosu.button_down? Gosu::KbDown) && @falcon.move_down_possible?(height)\n end",
"title": ""
},
{
"docid": "5e394ede1e9e01b0fa6354be762f82a6",
"score": "0.5574802",
"text": "def draw_how_to_presenter(window, state)\n\n # background\n window.draw_rect(0, 0, window.width, window.height, Gosu::Color.argb(DARK_GRAY_COLOR))\n\n # Game Title\n heading = 'How to play?'\n heading_font = Gosu::Font.new(80, options = {:name => 'assets/fonts/hahmlet_font.ttf'})\n heading_width = heading_font.text_width(heading)\n heading_font.draw_text(heading, # Text\n (window.width - heading_width) / 2, # draw x\n 50, # draw y\n 1, # draw z\n 1, # scale x\n 1, # scale y\n Gosu::Color.argb(LIGHT_GREEN_COLOR)) # color\n card_width = 400\n card_height = 400\n card_start_x = (window.width - card_width) / 2\n card_start_y = 140\n window.draw_rect(card_start_x,\n card_start_y,\n card_width,\n card_height,\n Gosu::Color.argb(GRAY_COLOR))\n\n draw_string_array(state[:instructions], card_start_x + 10, card_start_y + 10, card_width - 20)\n\n main_menu_string = 'Press space to navigate back'\n main_menu_font = Gosu::Font.new(20, options={italic: true})\n main_menu_width = main_menu_font.text_width(main_menu_string)\n main_menu_font.draw_text(main_menu_string,\n (window.width - main_menu_width) / 2,\n card_start_y + card_height + 10,\n 1 ,\n 1 ,\n 1 ,\n Gosu::Color.argb(LIGHT_GREEN_COLOR))\n\nend",
"title": ""
},
{
"docid": "73bc36de6b42e206f175245a5a8a9ed9",
"score": "0.55719817",
"text": "def draw\n # Draw Background and Panes\n @background.draw(0, 0, 0)\n @header.draw(0, 0, 1)\n @player_background.draw(0, SCREEN_HEIGHT - @player_background.height, 1)\n @ai_background.draw(SCREEN_WIDTH / 2, SCREEN_HEIGHT - @ai_background.height, 1)\n\n\n # GUI Details and Buttons\n if !@paused\n pause = @pause\n if self.mouse_x >= PAUSE_X and self.mouse_x <= PAUSE_X + @pause.width and self.mouse_y >= PAUSE_Y and self.mouse_y <= PAUSE_Y + @pause.height\n pause = @hover_pause\n end\n pause.draw(PAUSE_X, PAUSE_Y, 2)\n else\n play = @play\n if self.mouse_x >= PAUSE_X and self.mouse_x <= PAUSE_X + @play.width and self.mouse_y >= PAUSE_Y and self.mouse_y <= PAUSE_Y + @play.height\n play = @hover_play\n end\n play.draw(PAUSE_X, PAUSE_Y, 2)\n end\n\n new_game = @new_game\n if self.mouse_x >= NEW_GAME_X and self.mouse_x <= NEW_GAME_X + @new_game.width and self.mouse_y >= NEW_GAME_Y and self.mouse_y <= NEW_GAME_Y + @new_game.height\n new_game = @hover_new_game\n end\n new_game.draw(NEW_GAME_X, NEW_GAME_Y, 2)\n\n plus_three = @plus_three\n if self.mouse_x >= PLUS_THREE_X and self.mouse_x <= PLUS_THREE_X + @plus_three.width and self.mouse_y >= PLUS_THREE_Y and self.mouse_y <= PLUS_THREE_Y + @plus_three.height\n plus_three = @hover_plus_three\n end\n plus_three.draw(PLUS_THREE_X, PLUS_THREE_Y, 2)\n\n score_y = 755;\n @@score[@player_score].draw(470, score_y, 2)\n @@score[@ai.get_score].draw(970, score_y, 2)\n\n\n # Draw Cards\n hover_x_dif, hover_y_dif = (@hover_card.width - CARD_WIDTH) / 2, (@hover_card.height - CARD_HEIGHT) / 2\n\n for y in 0...3 do\n for x in 0...(@cards.count / 3) do\n image = @card_images[y * (@cards.count / 3) + x]\n\n card_x = get_card_x(x)\n card_y = get_card_y(y)\n\n # Highlights the card if it is selected or moused over\n selected = @player_cards.include? @cards[y * (@cards.count / 3) + x]\n hovered = self.mouse_x >= card_x && self.mouse_x <= card_x + CARD_WIDTH && self.mouse_y >= card_y && self.mouse_y <= card_y + CARD_HEIGHT\n \n if selected && hovered\n @hover_player_select.draw(card_x - hover_x_dif, card_y - hover_y_dif, 2)\n elsif selected\n @player_select.draw(card_x - hover_x_dif, card_y - hover_y_dif, 2)\n elsif hovered\n @hover_card.draw(card_x - hover_x_dif, card_y - hover_y_dif, 2)\n end\n\n image.draw(card_x, card_y, 3)\n end\n end\n end",
"title": ""
},
{
"docid": "9e3a627292b9d9891976b2e1922b90a1",
"score": "0.5570563",
"text": "def demo_vision\n \n guy = Guy.new(20,20)\n Map.attach(guy)\n \n loop do\n\n guy.dest[0] = rand(guy.win.maxy)\n guy.dest[1] = rand(guy.win.maxx)\n guy.update\n guy.get_sight\n\n\n\n Map.refresh\n\n sleep 0.2\n Map.clear\n\n end\n\nend",
"title": ""
},
{
"docid": "f5003a383e560c40cbf951bf84cc796b",
"score": "0.5563932",
"text": "def button_down(id)\n if @playing\n if (id== Gosu::MsLeft) #Check to see if the button pressed is the left one\n if Gosu.distance(mouse_x, mouse_y, @x, @y) < 50 && @visible >= 0 #Check to see if the center of the Ruby is at less than 50 pixels\n @hit = 1\n @score += 5\n else\n @hit = -1\n @score -=1\n end\n end\n end\nclearelse\n if (id == Gosu::KbSpace)\n @playing =true\n @visible = -10\n @start_time = Gosu.milliseconds\n @score = 0\n end\nend",
"title": ""
},
{
"docid": "f0795f5a7819c7ad21416d33133767be",
"score": "0.55618155",
"text": "def pbEvolution(cancancel = true)\n # stops BGM and displays message\n pbBGMStop()\n 16.times do\n Graphics.update\n self.update\n @sprites[\"bar1\"].y -= @sprites[\"bar1\"].bitmap.height/16\n @sprites[\"bar2\"].y += @sprites[\"bar2\"].bitmap.height/16\n end\n pbMEPlay(\"EBDX/Evolution Start\")\n @sprites[\"msgwindow\"].visible = true\n pbMessageDisplay(@sprites[\"msgwindow\"],_INTL(\"\\\\se[]What?\\r\\n{1} is evolving!\\\\^\",@pokemon.name)) { self.update }\n pbMessageWaitForInput(@sprites[\"msgwindow\"],100,true) { self.update }\n @sprites[\"msgwindow\"].visible = false\n # plays Pokemon's cry\n GameData::Species.play_cry(@pokemon)\n GameData::Species.cry_length(@pokemon.species, @pokemon.form).times { Graphics.update; self.update }\n pbBGMPlay(\"EBDX/Evolution\")\n canceled = false\n # beginning glow effect\n self.glow\n k1 = 1 # zoom factor for the Pokemon\n k2 = 1 # zoom factor for the shine\n s = 1 # speed of the animation\n @viewport.color = Color.new(255,255,255,0)\n pbSEPlay(\"Heal4\")\n # main animation loop\n for i in 0...256\n k1 *= -1 if i%(32/s) == 0\n k2 *= -1 if i%(16) == 0\n s *= 2 if i%64 == 0 && i > 0 && s < 8\n Graphics.update\n Input.update\n self.update(false)\n self.updateParticles\n self.updateRays(i)\n @sprites[\"poke\"].zoom_x += 0.03125*k1*s\n @sprites[\"poke\"].zoom_y += 0.03125*k1*s\n @sprites[\"poke\"].tone.red += 16\n @sprites[\"poke\"].tone.green += 16\n @sprites[\"poke\"].tone.blue += 16\n @sprites[\"poke2\"].zoom_x -= 0.03125*k1*s\n @sprites[\"poke2\"].zoom_y -= 0.03125*k1*s\n if @sprites[\"shine2\"].opacity < 255\n @sprites[\"shine2\"].opacity += 16\n @sprites[\"shine2\"].zoom_x += 0.08\n @sprites[\"shine2\"].zoom_y += 0.08\n else\n @sprites[\"shine2\"].zoom_x += 0.01*k2\n @sprites[\"shine2\"].zoom_y += 0.01*k2\n @sprites[\"shine2\"].tone.red += 0.5\n @sprites[\"shine2\"].tone.green += 0.5\n @sprites[\"shine2\"].tone.blue += 0.5\n end\n if i >= 240\n @sprites[\"shine3\"].opacity += 16\n @sprites[\"shine3\"].zoom_x += 0.1\n @sprites[\"shine3\"].zoom_y += 0.1\n end\n @viewport.color.alpha += 32 if i >= 248\n if Input.trigger?(Input::B) && cancancel\n pbBGMStop()\n canceled = true\n break\n end\n end\n @viewport.color = Color.white\n self.flash(canceled)\n if canceled\n # prints message when evolution is cancelled\n @sprites[\"msgwindow\"].visible = true\n pbMessageDisplay(@sprites[\"msgwindow\"],_INTL(\"Huh?\\r\\n{1} stopped evolving!\", @pokemon.name)) { self.update }\n else\n # creates the actual evolved Pokemon\n self.createEvolved\n end\n end",
"title": ""
},
{
"docid": "15044b66b9dcf1378c0e434a9fa73ec2",
"score": "0.5557558",
"text": "def initialize(window, relative_position)\n @relative_position = relative_position\n @image = Gosu::Image.new(window, \"./media/Player.png\")\n super @image.width, @image.height, Gosu::Color::NONE, relative_position\n @speed = [0.0, 0.0].to_vec2d\n @stop_down = false\n @jump_speed = [0.0, 0.0].to_vec2d\n @health = 1.0\n @score = 0\n end",
"title": ""
},
{
"docid": "5d420a44ae944dd55f162d8c5a5102de",
"score": "0.5556096",
"text": "def play_game\n \n end",
"title": ""
},
{
"docid": "6fad29d96f993d38291496d1e5a8d7aa",
"score": "0.5551468",
"text": "def start_game()\n initialize_word()\n clear_screen()\n user_input()\nend",
"title": ""
},
{
"docid": "f4eb96f8fdd4403dadf957bcac953db9",
"score": "0.55512154",
"text": "def tick args\n\n # One of the things in \"args\" is the \"outputs\" object that your game uses\n # to draw things. Afraid of rendering APIs? No problem. In DragonRuby,\n # you use arrays to draw things and we figure out the details.\n # If you want to draw text on the screen, you give it an array (the thing\n # in the [ brackets ]), with an X and Y coordinate and the text to draw.\n # The \"<<\" thing says \"append this array onto the list of them at\n # args.outputs.labels)\n args.state.rotation ||= 0\n args.state.x ||= 576\n args.state.y ||= 100\n\n args.state.x += 1\n args.state.y += 1 \n\n args.outputs.sprites << [args.state.x,\n args.state.y,\n 128,\n 101,\n 'sprites/circle/black.png',\n args.state.rotation]\n args.outputs.labels << [580, 400, 'Hello World!']\n\n args.state.rotation -= 1\nend",
"title": ""
},
{
"docid": "e1d82cf6517e97b1bcaf2c8d8e11be02",
"score": "0.55477166",
"text": "def draw size\n # upper left coordinates of player\n px = @window.width / (2 * size) - WIDTH / 2\n py = @window.height / (2 * size) - HEIGHT / 2\n px *= size\n py *= size\n\n # draw the text statistics in the upper left of the screen\n # score\n # ammo\n # kills\n Gosu::Image.from_text(@window, \"Score: #{@score.to_s}\", Gosu.default_font_name, 12 * size, 1, 200, :left).draw(5, 5, 0)\n Gosu::Image.from_text(@window, \"Ammo: #{@bullets.to_s}\", Gosu.default_font_name, 12 * size, 1, 200, :left).draw(5, 40, 0)\n Gosu::Image.from_text(@window, \"Kills: #{@kills.to_s}\", Gosu.default_font_name, 12 * size, 1, 200, :left).draw(5, 80, 0)\n\n # draw a heart for each life in the upper right of the screen\n @lives.times do |i|\n @heart[0].draw((@window.width / size - 20 * i - 20) * size, 2 * size, 0, size, size)\n end\n\n # dying animation\n if @action == :dying\n # draw the image scaled to size\n image = @sprites[(Gosu::milliseconds / 520 % 2) + 32]\n image.draw(px, py, 0, size, size)\n return\n end\n\n # split based on the direction the player is facing\n # from there choose the image based on the current action\n if @direction == :right\n if @action == :jumping || @action == :falling\n image = @sprites[(Gosu::milliseconds / 520 % 2) + 5]\n elsif @action == :pogoing || @action == :pogo_falling\n if Gosu::milliseconds - @bounce_start_milliseconds >= BOUNCE_TIME\n image = @sprites[18]\n else\n image = @sprites[19]\n end\n elsif (@window.button_down?(Gosu::KbRight) || @window.button_down?(Gosu::GpRight)) && @action == :none\n image = @sprites[(Gosu::milliseconds / 120 % 4) + 1]\n elsif @action == :none\n image = @sprites[0]\n elsif @action == :hang\n px += 21\n py -= 90\n image = @pullup[5]\n elsif @action == :pullup\n px += 42\n py -= 90\n if Gosu.milliseconds - @action_start_milliseconds >= PULLUP_TIME * 3\n image = @pullup[9]\n elsif Gosu.milliseconds - @action_start_milliseconds >= PULLUP_TIME * 2\n image = @pullup[8]\n elsif Gosu.milliseconds - @action_start_milliseconds >= PULLUP_TIME * 1\n image = @pullup[7]\n else\n image = @pullup[6]\n end\n end\n else\n if @action == :jumping || @action == :falling\n image = @sprites[(Gosu::milliseconds / 520 % 2) + 14]\n elsif @action == :pogoing || @action == :pogo_falling\n if Gosu::milliseconds - @bounce_start_milliseconds >= BOUNCE_TIME\n image = @sprites[26]\n else\n image = @sprites[27]\n end\n elsif (@window.button_down?(Gosu::KbLeft) || @window.button_down?(Gosu::GpLeft)) && @action == :none\n image = @sprites[(Gosu::milliseconds / 120 % 4) + 9]\n elsif @action == :none\n image = @sprites[8]\n elsif @action == :hang\n px += 3\n py -= 90\n image = @pullup[0]\n elsif @action == :pullup\n px -= 6\n py -= 90\n if Gosu.milliseconds - @action_start_milliseconds >= PULLUP_TIME * 3\n image = @pullup[4]\n elsif Gosu.milliseconds - @action_start_milliseconds >= PULLUP_TIME * 2\n image = @pullup[3]\n elsif Gosu.milliseconds - @action_start_milliseconds >= PULLUP_TIME * 1\n image = @pullup[2]\n else\n image = @pullup[1]\n end\n end\n end\n\n # ~shooting\n # if player is shooting\n if @isViolent \n case @shoot_anim\n when 0..9\n #On the ground\n if @direction == :right\n image = @sprites[16]\n else\n image = @sprites[24]\n end\n when 11..20\n #In the air\n if @direction == :right\n image = @sprites[17]\n else\n image = @sprites[25]\n end\n end\n @shoot_anim += 1\n @isViolent = false if @shoot_anim % 10 == 0\n else\n @shoot_anim = 0\n end\n \n #if any bullets exist, draw them\n @blast.each do |b|\n b.draw(size, @x*size, @y*size)\n end\n\n # draw the image scaled to size\n image.draw(px, py, 0, size, size) unless @action == :leave\n end",
"title": ""
},
{
"docid": "de70bdd08670915588c3552859d211d6",
"score": "0.5547027",
"text": "def draw\n nil\n end",
"title": ""
},
{
"docid": "9315c880e2ae36d4200c3e4585a338f3",
"score": "0.55452204",
"text": "def draw\r\n @background_image.draw(0,0,0)\r\n @background_image.draw(225,0,0)\r\n @background_image.draw(0,225,0)\r\n @background_image.draw(225,225,0)\r\n @background_image.draw(450,0,0)\r\n @background_image.draw(0,450,0)\r\n @background_image.draw(450,450,0)\r\n @background_image.draw(450,225,0)\r\n @background_image.draw(225,450,0)\r\n @road_image.draw(0, 30, 0)\r\n @road_image.draw(475, 30, 0)\r\n @tree_1.draw(100, 500, 0)\r\n @player.draw\r\n @level_text = Gosu::Image.from_text(self, \"Level: #{@player.get_level} \", Gosu.default_font_name, 25)\r\n @level_text.draw(475, 5, 0)\r\n #@mouse_text = Gosu::Image.from_text(self, \"X: #{@player.get_x} Y: #{@player.get_y}\", Gosu.default_font_name, 25)\r\n #@mouse_text.draw(0,0,0)\r\n @title_text = Gosu::Image.from_text(self, \"Frogger\", Gosu.default_font_name, 25)\r\n @title_text.draw(0,0,0)\r\n\r\n @cars.each do |car|\r\n has_car_collided? car\r\n car.draw\r\n end\r\n if !@has_been_eaten\r\n @insect.draw\r\n end\r\n end",
"title": ""
},
{
"docid": "c80c1c6c5d0dd8bec0b1990e6bf4cc3e",
"score": "0.5541335",
"text": "def tick args\n # Load variables\n setup args\n \n if args.state.data_loaded == 0\n data = $gtk.deserialize_state(\"cakestate.txt\")\n \n if data\n $gtk.args.state = data\n end\n \n args.state.data_loaded = 1\n end\n \n args.state.touched_previously = args.state.touched\n args.state.touched = !args.inputs.finger_one.nil? ? 1 : 0\n \n # Draw game background\n args.outputs.primitives << {\n x: 0,\n y: 0,\n w: 1280,\n h: 720,\n path: \"sprites/background.jpg\"\n }.to_sprite\n \n # Draw FPS\n args.outputs.primitives << {\n x: 1240,\n y: 10.from_top,\n text: args.gtk.current_framerate.to_i,\n size_enum: 8,\n r: 0,\n g: 0,\n b: 255,\n a: 255,\n }.to_label\n \n # Check and render current scene\n if args.state.scene == 0\n game args\n elsif args.state.scene == 1\n lose args\n end\n \n # ESC: Exit game\n if args.inputs.keyboard.escape\n $gtk.exit\n end\n \n # TAB or R key: Restart game\n if args.inputs.keyboard.tab || args.inputs.keyboard.r\n $gtk.reset seed: (Time.now.to_f * 100).to_i\n end\nend",
"title": ""
},
{
"docid": "e19374a6337c4c97343a9c27c700de49",
"score": "0.55342865",
"text": "def process_input\n\t\td = Input.dir8\n\t\t\n\t\tif d.zero?\n\t\t\tself.stop\n\t\telse\t\n\t\t\ta = 0\n\t\t\n\t\t\tcase d\n\t\t\twhen 1\n\t\t\t\ta = -Math::PI * 3 / 4\n\t\t\twhen 2\n\t\t\t\ta = -Math::PI / 2\n\t\t\twhen 3\n\t\t\t\ta = -Math::PI / 4\n\t\t\twhen 4\n\t\t\t\ta = Math::PI\n\t\t\twhen 6\n\t\t\t\ta = 0\n\t\t\twhen 7\n\t\t\t\ta = Math::PI * 3 / 4\n\t\t\twhen 8\n\t\t\t\ta = Math::PI / 2\n\t\t\twhen 9\n\t\t\t\ta = Math::PI / 4\n\t\t\tend\n\t\t\t\n\t\t\tself.velocity = Vec2.for_angle(a)\n\t\t\t\n\t\t\tif Input.press? :SHIFT\n\t\t\t\tself.velocity *= PLAYER_SPEED\n\t\t\telse\n\t\t\t\tself.velocity *= PLAYER_FAST_SPEED\n\t\t\tend\n\t\tend\n\t\t\n\t\tshoot if should_shoot?\n\tend",
"title": ""
},
{
"docid": "842e8af9be5d1ee6dd4b499c5f4670af",
"score": "0.55331624",
"text": "def movement; end",
"title": ""
},
{
"docid": "842e8af9be5d1ee6dd4b499c5f4670af",
"score": "0.55331624",
"text": "def movement; end",
"title": ""
},
{
"docid": "efd484744b25cac8045c866c3a11e2f2",
"score": "0.5522585",
"text": "def aim_system(game)\n \n end",
"title": ""
}
] |
e809e1c55267e72eba6cb72dc4ac9adb
|
GET /registrations GET /registrations.json
|
[
{
"docid": "141b7fad4b99fab73c3e7fa9caa79e28",
"score": "0.6216609",
"text": "def index\n @registrations = Registration.order(:last_name).where(\"created_at >= ?\", Date.today.beginning_of_year)\n\n respond_to do |format|\n format.html\n format.json { render json: @registrations, include: { students: { only: [:first_name, :last_name, :shirt_size]}} }\n end\n end",
"title": ""
}
] |
[
{
"docid": "6550a3fdc86733c553417757d71a8fa4",
"score": "0.7722891",
"text": "def index\n @registrations = Registration.all\n \n render json: @registrations\n end",
"title": ""
},
{
"docid": "4b192d9054befc7bc5c6597459caf015",
"score": "0.7635744",
"text": "def index\n @registrations = Registration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registrations }\n end\n end",
"title": ""
},
{
"docid": "f785bdbb43909db1950f6195ba99d9b1",
"score": "0.7459565",
"text": "def index\n @registrations = current_user.registrations\n end",
"title": ""
},
{
"docid": "ac390140f7685801586fed00843cc796",
"score": "0.7147055",
"text": "def index\n @registrations = Registration.all\n end",
"title": ""
},
{
"docid": "ac390140f7685801586fed00843cc796",
"score": "0.7147055",
"text": "def index\n @registrations = Registration.all\n end",
"title": ""
},
{
"docid": "ac390140f7685801586fed00843cc796",
"score": "0.7147055",
"text": "def index\n @registrations = Registration.all\n end",
"title": ""
},
{
"docid": "ac390140f7685801586fed00843cc796",
"score": "0.7147055",
"text": "def index\n @registrations = Registration.all\n end",
"title": ""
},
{
"docid": "ac390140f7685801586fed00843cc796",
"score": "0.7147055",
"text": "def index\n @registrations = Registration.all\n end",
"title": ""
},
{
"docid": "1a2eab9a4550a394fc1e2909940c392c",
"score": "0.70149106",
"text": "def index\n @registries = Registry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registries }\n end\n end",
"title": ""
},
{
"docid": "85355803811e612edcd1c4d03a131a18",
"score": "0.6947169",
"text": "def index\n @admin_registrations = Registration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_registrations }\n end\n end",
"title": ""
},
{
"docid": "69bfdcbc6eb4d37feba631e15bc4036e",
"score": "0.689261",
"text": "def index\n @registrations = Tournament.find(params[:tournament_id]).registrations\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registrations }\n end\n end",
"title": ""
},
{
"docid": "07251536bcb4266b09e312fcab4dbbf3",
"score": "0.6832592",
"text": "def index\n @myregistrations = Myregistration.all\n end",
"title": ""
},
{
"docid": "56295b40bc35d6198e0d30bc86737448",
"score": "0.68277705",
"text": "def registrar\n contact.registrar.as_json(only: %i[name website])\n end",
"title": ""
},
{
"docid": "2892c6e129f62a9f612fbf7e15b06f2a",
"score": "0.68191713",
"text": "def index\n @registrers = Registrer.all\n end",
"title": ""
},
{
"docid": "68a8bcea60b5dd6657c925d839b28303",
"score": "0.68175954",
"text": "def get_registration\n path = self.api_root + '/register'\n process_firecloud_request(:get, path)\n end",
"title": ""
},
{
"docid": "f701ec23b8b95f83928cccb62cfef455",
"score": "0.6779641",
"text": "def index\n @registrants = Registrant.all\n end",
"title": ""
},
{
"docid": "bbcb1cf64d76bfebe2f71498ab27712e",
"score": "0.65601885",
"text": "def index\n @registration_requests = RegistrationRequest.all\n\n render json: @registration_requests\n end",
"title": ""
},
{
"docid": "0a99a9274e76ddf491e16d4b5f334a90",
"score": "0.654374",
"text": "def index\n @registrations = Registration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @registrations }\n end\n end",
"title": ""
},
{
"docid": "0a99a9274e76ddf491e16d4b5f334a90",
"score": "0.654374",
"text": "def index\n @registrations = Registration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @registrations }\n end\n end",
"title": ""
},
{
"docid": "8f1fe690225d54b5eba73af0801231b3",
"score": "0.64858365",
"text": "def show\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registration }\n end\n end",
"title": ""
},
{
"docid": "710a26249b19248c7e94721562eec7ed",
"score": "0.647771",
"text": "def show\n render json: @registration_request\n end",
"title": ""
},
{
"docid": "8daef0e32ae2e38ec91bd22cb6fd295c",
"score": "0.64480937",
"text": "def index\n @bridal_registries = spree_current_user.bridal_registries\n respond_with(@bridal_registry)\n end",
"title": ""
},
{
"docid": "8fa336ac5a0be4c39bebd645f55cc6d0",
"score": "0.6388362",
"text": "def show\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registration }\n end\n end",
"title": ""
},
{
"docid": "8fa336ac5a0be4c39bebd645f55cc6d0",
"score": "0.6388362",
"text": "def show\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registration }\n end\n end",
"title": ""
},
{
"docid": "57d507330c3d5052fd5542e36be445d6",
"score": "0.63423795",
"text": "def show\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @registration }\n end\n end",
"title": ""
},
{
"docid": "47390fbab590bbd125427c701a40c681",
"score": "0.6286372",
"text": "def new\n @registry = @user.registries.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @registry }\n end\n end",
"title": ""
},
{
"docid": "76e91fd5369010910275a467d9322153",
"score": "0.6249257",
"text": "def show\n @all_registration = AllRegistration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @all_registration }\n end\n end",
"title": ""
},
{
"docid": "0861d9a4f68717a58795dc16e5ab843e",
"score": "0.6225385",
"text": "def get_user_registrations(opts = {})\n data, _status_code, _headers = get_user_registrations_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "2b084f749d54204ba312bda5de36ff2f",
"score": "0.618352",
"text": "def show\n @registration = Registration.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registration }\n end\n end",
"title": ""
},
{
"docid": "0081e655d36bd115986d27b3f6bbf8a4",
"score": "0.61485416",
"text": "def new\n @registration = Registration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registration }\n end\n end",
"title": ""
},
{
"docid": "f1c2a318132b5b1c9979b8eb8e0e7018",
"score": "0.6117754",
"text": "def new\n @registration = Registration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @registration }\n end\n end",
"title": ""
},
{
"docid": "bd74532eaddbd17d05321f1633f687bd",
"score": "0.6043763",
"text": "def index\n @device_registrations = DeviceRegistration.all\n end",
"title": ""
},
{
"docid": "85ed243456f32a04e469fd97a5e4b8a1",
"score": "0.6041874",
"text": "def index\n @registrars = Registrar.all\n end",
"title": ""
},
{
"docid": "62efc320e8fec3b5e52b419b38ddd820",
"score": "0.59697133",
"text": "def show\n @admin_registration = Registration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_registration }\n end\n end",
"title": ""
},
{
"docid": "a67e32600499e492a90ed7525b60f5bf",
"score": "0.5966315",
"text": "def index\n @preregistrations = Preregistration.all\n end",
"title": ""
},
{
"docid": "a67e32600499e492a90ed7525b60f5bf",
"score": "0.5966315",
"text": "def index\n @preregistrations = Preregistration.all\n end",
"title": ""
},
{
"docid": "13f50248be4ae4aaf0565310bc210786",
"score": "0.59599453",
"text": "def index\n @course = params[:course] ? Course.find(params[:course]) : current_user.courses.last\n @assignments = @course.assignments\n @template = \"registrations/roster\"\n\n sortable = @course.registrations.map { |r| { registration: r, sort_key: key(r) } }\n sortable.sort! do |a,b|\n result = a[:sort_key] <=> b[:sort_key]\n sort_direction == 'desc' ? - result : result\n end\n @registrations = sortable.map{|record| record[:registration] }\n respond_to do |format|\n format.html #index.html\n format.json { render json: @registrations }\n end\n end",
"title": ""
},
{
"docid": "d9f0909c55fd3dc2f927862d4ef3cfcd",
"score": "0.5947049",
"text": "def show\n if @registration.registerable_type == \"Student\"\n @registrants = [@registration.registerable]\n else\n @registrants= @registration.registerable.students.to_a\n end\n @registrants\n end",
"title": ""
},
{
"docid": "ef04ea0351ad6b4cc4b9d9309934efe9",
"score": "0.5924177",
"text": "def index\n @registrations = Registration.find(:all, :order => \"camp_id ASC\")\n \n @registration = Registration.find(params[:id]) unless params[:id].blank?\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @registrations }\n end\n end",
"title": ""
},
{
"docid": "52f30bea1e17866e35af7e60093f764c",
"score": "0.590712",
"text": "def get_user_registrations_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ReportingUsersApi.get_user_registrations ...\"\n end\n if @api_client.config.client_side_validation && opts[:'granularity'] && !['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'].include?(opts[:'granularity'])\n fail ArgumentError, 'invalid value for \"granularity\", must be one of millisecond, second, minute, hour, day, week, month, year'\n end\n # resource path\n local_var_path = \"/reporting/users/registrations\"\n\n # query parameters\n query_params = {}\n query_params[:'granularity'] = opts[:'granularity'] if !opts[:'granularity'].nil?\n query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?\n query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceAggregateCountResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ReportingUsersApi#get_user_registrations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "923eeac66ff43037228fbe0cc4390297",
"score": "0.590468",
"text": "def RetrieveAllRegistrations\n response = @registration_getter.RetrieveAllRegistrations(\n {\"customerUserName\" => @username,\n \"customerPassword\" => @password,\n \"eventID\" => @event_id})\n \n registrations = RegonlineConnector::Client::zip_to_xml(\n response.retrieveAllRegistrationsResult)\n end",
"title": ""
},
{
"docid": "b9e80aa4c261861be2ee01920de7f3f4",
"score": "0.58663917",
"text": "def create\n @registrer = Registrer.new(registrer_params)\n\n respond_to do |format|\n if @registrer.save\n format.html { redirect_to @registrer, notice: 'Registrer was successfully created.' }\n format.json { render :show, status: :created, location: @registrer }\n else\n format.html { render :new }\n format.json { render json: @registrer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac5a39c14d3df93ac96b0225a1ee8e36",
"score": "0.5864169",
"text": "def all\n url = url_for(\"organizers\", credentials.organizer_key, \"trainings\", training.key, \"registrants\")\n response = http_client.get(url)\n\n if response.ok?\n registrants = response.data.map do |attrs|\n Resource::Registrant.new Resource::Registrant.deserialize(attrs)\n end\n end\n\n [response, registrants]\n end",
"title": ""
},
{
"docid": "9e1bdbcf1703c7938090b8c3b4e89586",
"score": "0.58620065",
"text": "def index\n @registereds = Registered.all\n end",
"title": ""
},
{
"docid": "fb581719973e38ab3ad1942acb66a54d",
"score": "0.5827421",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registration_period }\n end\n end",
"title": ""
},
{
"docid": "108ca67f79f9630cea00d4ae270f7d05",
"score": "0.5816565",
"text": "def registrations\n @search = User.metasearch(params[:search])\n @users = @search.where(:state => 'new').paginate(:page => @page, :per_page => @per_page)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "26002f4814e38a3c87768ecaa93d2d92",
"score": "0.5815068",
"text": "def registrations\n @field_trip = FieldTrip.find(params[:id])\n @students = @field_trip.students\n end",
"title": ""
},
{
"docid": "14f323c92730f3401318f828cbb8d549",
"score": "0.5806619",
"text": "def index\n @registration_statuses = RegistrationStatus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @registration_statuses }\n end\n end",
"title": ""
},
{
"docid": "e95184b9fd8fd051e4603ddb2f7d40c8",
"score": "0.58049315",
"text": "def create\n @registry = @user.registries.new(registry_params)\n\n respond_to do |format|\n if @registry.save\n flash[:notice] = 'Registry was successfully created.'\n format.html { redirect_to user_registry_path(@user, @registry) }\n format.xml { render :xml => @registry, :status => :created, :location => [ @user, @registry] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @registry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff9cccf3560febab347bde42396d5302",
"score": "0.5800412",
"text": "def registration_params\n params[:registration]\n end",
"title": ""
},
{
"docid": "7a01559b942c1134c4516da65b8f3928",
"score": "0.5799037",
"text": "def new\n @registration = Registration.new\n\n respond_to do |format|\n format.html { render :layout => 'startup_page' }\n format.json { render json: @registration }\n end\n end",
"title": ""
},
{
"docid": "6df63f7a72ac2476c32d7187163015f2",
"score": "0.5783845",
"text": "def show\n @registration = Registration.find(params[:id])\n end",
"title": ""
},
{
"docid": "c9dcac7a4175e111469f980537af97f4",
"score": "0.57751405",
"text": "def index\n @one_reg_institutions = OneRegInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @one_reg_institutions }\n end\n end",
"title": ""
},
{
"docid": "435d231c5a71a7f350642a572a0e1a6b",
"score": "0.5775118",
"text": "def create\n @registration = Registration.new(registration_params)\n\n if @registration.save\n @registration.generate_invoices\n\n render :show, status: :created\n else\n render json: @registration.errors.full_messages, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "35d1e58af76b928cf23bda0ef69df85d",
"score": "0.57712847",
"text": "def show\n @enregistrement = Enregistrement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enregistrement }\n end\n end",
"title": ""
},
{
"docid": "7b36c2421abaa0661e9fd370eca21bac",
"score": "0.5760209",
"text": "def RetrieveRegistrationInfo\n response = @registrant_getter.RetrieveRegistrationInfo(\n {\"login\" => @username,\n \"password\" => @password,\n \"eventID\" => @event_id})\n response.retrieveRegistrationInfoResult\n end",
"title": ""
},
{
"docid": "797e4ff4eb8fd469d5cec4fa2fe2b27e",
"score": "0.575824",
"text": "def index\n @registrations = Registration.search(params[:page], params['sort'], params['status'], params['patients'], session[:cas_user], params['search'])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @registrations }\n end\n end",
"title": ""
},
{
"docid": "bfeb3beaa3b769e7136233c35242bf32",
"score": "0.5753352",
"text": "def index\n @registrant_groups = RegistrantGroup.all\n @registrant_group = RegistrantGroup.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registrant_groups }\n end\n end",
"title": ""
},
{
"docid": "bfeb3beaa3b769e7136233c35242bf32",
"score": "0.5753352",
"text": "def index\n @registrant_groups = RegistrantGroup.all\n @registrant_group = RegistrantGroup.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registrant_groups }\n end\n end",
"title": ""
},
{
"docid": "dd8a9d6ad83113025c0c503743f4924c",
"score": "0.5749186",
"text": "def show\n @registration_status = RegistrationStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @registration_status }\n end\n end",
"title": ""
},
{
"docid": "d835a6893b2939fc6993a58adde6c0d7",
"score": "0.57418156",
"text": "def new\n @admin_registration = Registration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_registration }\n end\n end",
"title": ""
},
{
"docid": "b84469a79b9bfcb51044c3300e05ea4f",
"score": "0.57172865",
"text": "def index\n @registers = Register.all\n end",
"title": ""
},
{
"docid": "3e53464d6ca0caf0197d9db0b32451d8",
"score": "0.5710314",
"text": "def index\n @registrations = Registration.all.order('created_at DESC')\n end",
"title": ""
},
{
"docid": "4c609de9d6dee782f4250d8b03118afc",
"score": "0.5693928",
"text": "def index\n @registration_periods = RegistrationPeriod.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registration_periods }\n end\n end",
"title": ""
},
{
"docid": "178c8d7caec5449f13ffdc8addb84ac3",
"score": "0.5685839",
"text": "def index\n @people = Person.includes(:registry).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "3062b11c7667f92d7f79701e4b6db1fb",
"score": "0.56744653",
"text": "def signed_up_registrants\n registrants = []\n if event_category.present?\n registrants = event_category.signed_up_registrants\n end\n\n if competition.present?\n registrants = signed_up_competitors.map { |comp| comp.registrants }.flatten\n end\n\n registrants.select { |reg| registrant_passes_filters(reg) }\n end",
"title": ""
},
{
"docid": "3b6996184bbff9e4390efdf7ff94868d",
"score": "0.5670908",
"text": "def index\n @registration_numbers = RegistrationNumber.all\n end",
"title": ""
},
{
"docid": "8e2e346860ae557ce4b646195f875d1f",
"score": "0.5669775",
"text": "def index\n @registration_forms = RegistrationForm.all\n end",
"title": ""
},
{
"docid": "5bd5ec1ec980cc3b5a26da42eae91a8e",
"score": "0.5660863",
"text": "def index\n @gt_registrations = GtRegistration.all.where(payed: true)\n end",
"title": ""
},
{
"docid": "d6090799f57750d0c3375553fe1894ca",
"score": "0.5640666",
"text": "def index\n @additional_registrant_accesses = @user.additional_registrant_accesses\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @additional_registrant_accesses }\n end\n end",
"title": ""
},
{
"docid": "6f75e6d02394585f02c3ea3f02fe8f83",
"score": "0.5638299",
"text": "def new\n @user_account_registration = UserAccountRegistration.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_account_registration }\n end\n end",
"title": ""
},
{
"docid": "1e3c23793ccb3d4e4b3dab35ce703fcc",
"score": "0.56340384",
"text": "def create\n respond_to do |format|\n if @organization.save\n @organization.registrations << @registration if @registration\n flash[:notice] = 'Organization was successfully created.'\n format.html { redirect_to(@organization) }\n format.xml { render :xml => @organization, :status => :created, :location => @organization }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fae10c5def7e530857cee4645fadf136",
"score": "0.56339896",
"text": "def show\n @person = Person.find(params[:id])\n @registry = Registry.where('email = ?', @person.email).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "f3bbc5f3f7597fb9e94f1d236cd9d27d",
"score": "0.5628578",
"text": "def index\n @vc_registrations = VcRegistration.all\n end",
"title": ""
},
{
"docid": "3a86b8f5424eea3aa2f08f94c597ce17",
"score": "0.55967826",
"text": "def create\n logger.debug params\n @registration = User.new(:user_id => User.last.id + 1, :user_name => params[:registration][:user_name])\n\n respond_to do |format|\n if @registration.save\n format.html { redirect_to user_albums_path(@registration), notice: 'Registration was successfully created.' }\n format.json { render action: 'show', status: :created, location: @registration }\n else\n format.html { render action: 'new' }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9dee4daeca7259caf322b55a54f5daef",
"score": "0.5596254",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registrant_group }\n end\n end",
"title": ""
},
{
"docid": "bd81aef33d5118522739eb847808d6f6",
"score": "0.559113",
"text": "def show\n authorize! :read, Registro\n respond_to do |format|\n format.html { redirect_to registros_url}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7f7a113c2ad86ed5c56fe184d67288e2",
"score": "0.5588884",
"text": "def index\n @course_registrants = CourseRegistrant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @course_registrants }\n end\n end",
"title": ""
},
{
"docid": "d642e82aa5407dd9c2059b54d25a8547",
"score": "0.55867815",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registrant_group }\n end\n end",
"title": ""
},
{
"docid": "81bacfc53ea8727e5cd0050916990c12",
"score": "0.55855566",
"text": "def index\n @devises = Devise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @devises }\n end\n end",
"title": ""
},
{
"docid": "b297c9c973f28349d3bee690c39c9bc3",
"score": "0.55832314",
"text": "def show\n @registry = Registry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registry }\n end\n end",
"title": ""
},
{
"docid": "0731df16543733a959a75d4002d01150",
"score": "0.5563927",
"text": "def index\n @time_registrations = TimeRegistration.all\n end",
"title": ""
},
{
"docid": "ebc7a78e96d01c7d1e1f6c548f0e47cc",
"score": "0.5562616",
"text": "def create_for_all_registrants\n signed_up_registrants.each do |registrant_sign_up|\n registrant_sign_up.create_reg_item\n end\n end",
"title": ""
},
{
"docid": "7aa5397bdd74f25882799b0cc542949b",
"score": "0.55624515",
"text": "def index\n\t @owes_user = Register.current_user_owns(current_user.id)\n\t @user_owes = Register.current_user_owes(current_user.id)\n\t #need to add method to get registers where you owe someone else something\n\n\t respond_to do |format|\n\t format.html # index.html.erb\n\t format.json { render json: @registers }\n\t end\n\tend",
"title": ""
},
{
"docid": "270941fd6ec96679888f0a5516fd611c",
"score": "0.55527306",
"text": "def list_device_registries request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_device_registries_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Iot::V1::ListDeviceRegistriesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "5961475c468d7152720ea305511817b6",
"score": "0.5547996",
"text": "def create\n @registration = Registration.new(registration_params)\n\n respond_to do |format|\n if @registration.save\n format.html { redirect_to @registration, notice: \"Registration was successfully created.\" }\n format.json { render :show, status: :created, location: @registration }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42bf941ed608e09339117081753c6930",
"score": "0.5531058",
"text": "def create\n @registered = Registered.new(registered_params)\n\n respond_to do |format|\n if @registered.save\n format.html { redirect_to @registered, notice: 'Registered was successfully created.' }\n format.json { render :show, status: :created, location: @registered }\n else\n format.html { render :new }\n format.json { render json: @registered.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdd8361bb88f44db0457940ed2e58e2f",
"score": "0.55305797",
"text": "def show\n @registration_contract = Registration::Contract.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registration_contract }\n end\n end",
"title": ""
},
{
"docid": "650544fa86acc6dc7d29808319a508c2",
"score": "0.5529048",
"text": "def new\n @additional_registrant_access = AdditionalRegistrantAccess.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @additional_registrant_access }\n end\n end",
"title": ""
},
{
"docid": "a178c0dce6992a9f2ef8cfabda61418f",
"score": "0.5507867",
"text": "def show\n @register_group = RegisterGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @register_group }\n end\n end",
"title": ""
},
{
"docid": "62b2637fdb4508daf7e970d4956c6941",
"score": "0.55015767",
"text": "def new\n @registry = Registry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registry }\n end\n end",
"title": ""
},
{
"docid": "772b6d450616d45e793b52c80d8e069f",
"score": "0.55011374",
"text": "def index\n @registration_forms = RegistrationForm.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @registration_forms }\n end\n end",
"title": ""
},
{
"docid": "39881af835013a9ad936d642fe2c2902",
"score": "0.54983574",
"text": "def new\n @enregistrement = Enregistrement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @enregistrement }\n end\n end",
"title": ""
},
{
"docid": "4f5a24625b8b2527b7dfcb9b429aada2",
"score": "0.5496872",
"text": "def index\n if params[:event_id]\n set_event\n @registrations = @event.registrations\n else\n @registrations = Registration.all\n end\n end",
"title": ""
},
{
"docid": "ab5795584f86190eed876fe73904fe87",
"score": "0.54883605",
"text": "def new\n tournament = Tournament.find(params[:tournament_id])\n @registration = Registration.new(tournament:tournament)\n tournament.draws.order('draws.is_single DESC, draws.title').each do |draw|\n @registration.draw_registrations.build(draw_id: draw.id)\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registration }\n end\n end",
"title": ""
},
{
"docid": "aa568e0c89e9276f2839ecf9656b1826",
"score": "0.54871315",
"text": "def index\n @patientregistrations = Patientregistration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @patientregistrations }\n end\n end",
"title": ""
},
{
"docid": "d82cd0b12c8c178cf2028e65a8482c95",
"score": "0.547929",
"text": "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registration_period }\n end\n end",
"title": ""
},
{
"docid": "f3f692af80b159ac114b56ec66cfb432",
"score": "0.54758096",
"text": "def show\r\n @registerd_user = RegisterdUser.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @registerd_user }\r\n end\r\n end",
"title": ""
},
{
"docid": "86032fcc213e1b366a83746435bbfa9f",
"score": "0.5472877",
"text": "def show\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @registration }\n end\n end",
"title": ""
},
{
"docid": "86032fcc213e1b366a83746435bbfa9f",
"score": "0.5472877",
"text": "def show\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @registration }\n end\n end",
"title": ""
}
] |
0c692f94e0553140e2c30097825689ca
|
Update a &39;capability.ChassisManufacturingDef&39; resource.
|
[
{
"docid": "b4893ae1b4aba37ecf60bee87d77cfbb",
"score": "0.6543395",
"text": "def update_capability_chassis_manufacturing_def_with_http_info(moid, capability_chassis_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_chassis_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_chassis_manufacturing_def\"\n end\n # verify the required parameter 'capability_chassis_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_chassis_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_manufacturing_def' when calling CapabilityApi.update_capability_chassis_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_chassis_manufacturing_def\",\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: CapabilityApi#update_capability_chassis_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "e77796eebb240b7f1811834099329466",
"score": "0.7213708",
"text": "def update_capability_chassis_manufacturing_def(moid, capability_chassis_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_chassis_manufacturing_def_with_http_info(moid, capability_chassis_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "bb302ccd1eec3c62539e88fa0df050de",
"score": "0.6917482",
"text": "def patch_capability_chassis_manufacturing_def(moid, capability_chassis_manufacturing_def, opts = {})\n data, _status_code, _headers = patch_capability_chassis_manufacturing_def_with_http_info(moid, capability_chassis_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "cfec83e64d15743b42c2b805fbc48eaa",
"score": "0.6317915",
"text": "def update_capability_sioc_module_manufacturing_def(moid, capability_sioc_module_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_sioc_module_manufacturing_def_with_http_info(moid, capability_sioc_module_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "4e7dce2654f6b8a38f970d6b66924e7f",
"score": "0.62968874",
"text": "def update_capability_io_card_manufacturing_def(moid, capability_io_card_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_io_card_manufacturing_def_with_http_info(moid, capability_io_card_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "093ca0de41867dbe42ece79209a395c6",
"score": "0.62944186",
"text": "def create_capability_chassis_manufacturing_def_with_http_info(capability_chassis_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_chassis_manufacturing_def ...'\n end\n # verify the required parameter 'capability_chassis_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_chassis_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_manufacturing_def' when calling CapabilityApi.create_capability_chassis_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisManufacturingDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_chassis_manufacturing_def\",\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: CapabilityApi#create_capability_chassis_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ff1855cf025c2aa2e59a1ddf78aadfa5",
"score": "0.620579",
"text": "def patch_capability_chassis_manufacturing_def_with_http_info(moid, capability_chassis_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_chassis_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_chassis_manufacturing_def\"\n end\n # verify the required parameter 'capability_chassis_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_chassis_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_manufacturing_def' when calling CapabilityApi.patch_capability_chassis_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_chassis_manufacturing_def\",\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: CapabilityApi#patch_capability_chassis_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e5be95ae06f714eb0a068e0ab6e36789",
"score": "0.6010862",
"text": "def update_capability_fan_module_manufacturing_def(moid, capability_fan_module_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_fan_module_manufacturing_def_with_http_info(moid, capability_fan_module_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "2dca748812b04c4b47980d27a1ac4631",
"score": "0.5969369",
"text": "def update_capability_switch_manufacturing_def(moid, capability_switch_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_switch_manufacturing_def_with_http_info(moid, capability_switch_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "2281ec52090eb7ad335c769a2127787c",
"score": "0.5855634",
"text": "def update_capability_psu_manufacturing_def(moid, capability_psu_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_psu_manufacturing_def_with_http_info(moid, capability_psu_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "92a930c09f65c6b405563926b010ec79",
"score": "0.58205706",
"text": "def patch_capability_sioc_module_manufacturing_def(moid, capability_sioc_module_manufacturing_def, opts = {})\n data, _status_code, _headers = patch_capability_sioc_module_manufacturing_def_with_http_info(moid, capability_sioc_module_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "831d0ea60bdf367e0c3e30002532f2dc",
"score": "0.58075017",
"text": "def update_capability_io_card_manufacturing_def_with_http_info(moid, capability_io_card_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_io_card_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_io_card_manufacturing_def\"\n end\n # verify the required parameter 'capability_io_card_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_io_card_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_manufacturing_def' when calling CapabilityApi.update_capability_io_card_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_io_card_manufacturing_def\",\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: CapabilityApi#update_capability_io_card_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "fd72a060c77cff32667b51b6a562a6c4",
"score": "0.5797521",
"text": "def patch_capability_io_card_manufacturing_def(moid, capability_io_card_manufacturing_def, opts = {})\n data, _status_code, _headers = patch_capability_io_card_manufacturing_def_with_http_info(moid, capability_io_card_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "42b9cf0d32f77320b0481e3d35525b9c",
"score": "0.57858837",
"text": "def update_capability_chassis_descriptor_with_http_info(moid, capability_chassis_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_chassis_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_chassis_descriptor\"\n end\n # verify the required parameter 'capability_chassis_descriptor' is set\n if @api_client.config.client_side_validation && capability_chassis_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_descriptor' when calling CapabilityApi.update_capability_chassis_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_chassis_descriptor\",\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: CapabilityApi#update_capability_chassis_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "8125d19e995986de68cba5bbd6f54260",
"score": "0.5773835",
"text": "def update_capability_psu_manufacturing_def_with_http_info(moid, capability_psu_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_psu_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_psu_manufacturing_def\"\n end\n # verify the required parameter 'capability_psu_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_psu_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_psu_manufacturing_def' when calling CapabilityApi.update_capability_psu_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/PsuManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_psu_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityPsuManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_psu_manufacturing_def\",\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: CapabilityApi#update_capability_psu_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e19ae72c961a0c213c863a235081bcf2",
"score": "0.5765768",
"text": "def update_capability_sioc_module_manufacturing_def_with_http_info(moid, capability_sioc_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_sioc_module_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_sioc_module_manufacturing_def\"\n end\n # verify the required parameter 'capability_sioc_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_manufacturing_def' when calling CapabilityApi.update_capability_sioc_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_sioc_module_manufacturing_def\",\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: CapabilityApi#update_capability_sioc_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "31b6bfb279e46bc0cb5acb19b38b9197",
"score": "0.5726972",
"text": "def update\n if @device_manufacturer.update(device_manufacturer_params)\n respond_with(@device_manufacturer, location: device_manufacturers_url, notice: 'Device manufacturer was successfully updated.')\n else\n respond_with(@device_manufacturer)\n end\n end",
"title": ""
},
{
"docid": "9c7eafaad08abe306343738433cffc87",
"score": "0.5718976",
"text": "def update_capability_switch_manufacturing_def_with_http_info(moid, capability_switch_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_switch_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_switch_manufacturing_def\"\n end\n # verify the required parameter 'capability_switch_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_switch_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_manufacturing_def' when calling CapabilityApi.update_capability_switch_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_switch_manufacturing_def\",\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: CapabilityApi#update_capability_switch_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5bfd25ffdb82dcd71b459e102f93a7ec",
"score": "0.56459486",
"text": "def create_capability_chassis_manufacturing_def(capability_chassis_manufacturing_def, opts = {})\n data, _status_code, _headers = create_capability_chassis_manufacturing_def_with_http_info(capability_chassis_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "6e5d23126068d3d693190b8a590da883",
"score": "0.5624008",
"text": "def update_definition(definition) update_attribute(:descriptor, definition) end",
"title": ""
},
{
"docid": "a20b1e34777075fc50321387312ddbda",
"score": "0.5597058",
"text": "def update_capability_fan_module_manufacturing_def_with_http_info(moid, capability_fan_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_fan_module_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_fan_module_manufacturing_def\"\n end\n # verify the required parameter 'capability_fan_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_fan_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_fan_module_manufacturing_def' when calling CapabilityApi.update_capability_fan_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/FanModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_fan_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityFanModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_fan_module_manufacturing_def\",\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: CapabilityApi#update_capability_fan_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "43c2afab2fa1e5cff01a7f1748db70eb",
"score": "0.55777615",
"text": "def update_capability_chassis_descriptor(moid, capability_chassis_descriptor, opts = {})\n data, _status_code, _headers = update_capability_chassis_descriptor_with_http_info(moid, capability_chassis_descriptor, opts)\n data\n end",
"title": ""
},
{
"docid": "8c0bcd5d3f9c742e1b0ca2348ef0eb7f",
"score": "0.5557785",
"text": "def patch_capability_switch_manufacturing_def(moid, capability_switch_manufacturing_def, opts = {})\n data, _status_code, _headers = patch_capability_switch_manufacturing_def_with_http_info(moid, capability_switch_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "c72df4fe91eaa2bc8ffb62ccec8d0510",
"score": "0.5555274",
"text": "def update!(**args)\n @bid_modifier = args[:bid_modifier] if args.key?(:bid_modifier)\n @device = args[:device] if args.key?(:device)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"title": ""
},
{
"docid": "2723484c2e195721ac0d9be82bf1ad82",
"score": "0.5536037",
"text": "def update\n respond_to do |format|\n if @hardware.update(permitted_params[:hardware])\n format.html { redirect_to @hardware, notice: 'Hardware was successfully updated.' }\n format.json { render :show, status: :ok, location: @hardware }\n else\n format.html { render :edit }\n format.json { render json: @hardware.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89fc33e049d8d63c037cecea282931bb",
"score": "0.5529293",
"text": "def patch_capability_chassis_descriptor(moid, capability_chassis_descriptor, opts = {})\n data, _status_code, _headers = patch_capability_chassis_descriptor_with_http_info(moid, capability_chassis_descriptor, opts)\n data\n end",
"title": ""
},
{
"docid": "85d1d9daa3b3f3bce3dc6c37831820fa",
"score": "0.55215347",
"text": "def create_capability_sioc_module_manufacturing_def_with_http_info(capability_sioc_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_sioc_module_manufacturing_def ...'\n end\n # verify the required parameter 'capability_sioc_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_manufacturing_def' when calling CapabilityApi.create_capability_sioc_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleManufacturingDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_sioc_module_manufacturing_def\",\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: CapabilityApi#create_capability_sioc_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "82494586aa1199910c86ccf865538d5c",
"score": "0.5517367",
"text": "def delete_capability_chassis_manufacturing_def(moid, opts = {})\n delete_capability_chassis_manufacturing_def_with_http_info(moid, opts)\n nil\n end",
"title": ""
},
{
"docid": "2172f1bfb16934fca41239efd094e82f",
"score": "0.55172706",
"text": "def patch_capability_chassis_descriptor_with_http_info(moid, capability_chassis_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_chassis_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_chassis_descriptor\"\n end\n # verify the required parameter 'capability_chassis_descriptor' is set\n if @api_client.config.client_side_validation && capability_chassis_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_descriptor' when calling CapabilityApi.patch_capability_chassis_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_chassis_descriptor\",\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: CapabilityApi#patch_capability_chassis_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "d3e4b075b1cc39524cd6ed1cac43c2f8",
"score": "0.5516556",
"text": "def get_capability_chassis_manufacturing_def_list(opts = {})\n data, _status_code, _headers = get_capability_chassis_manufacturing_def_list_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "e1b1be7710b1b5aa92d3a56769a3396c",
"score": "0.5516393",
"text": "def update\n @appliance_manufacturer = ApplianceManufacturer.find(params[:id])\n\n respond_to do |format|\n if @appliance_manufacturer.update_attributes(params[:appliance_manufacturer])\n format.html { redirect_to @appliance_manufacturer, notice: 'Appliance manufacturer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @appliance_manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ade1993685c36e6fc0a7b2fc6db5849",
"score": "0.55132776",
"text": "def patch_capability_fan_module_manufacturing_def(moid, capability_fan_module_manufacturing_def, opts = {})\n data, _status_code, _headers = patch_capability_fan_module_manufacturing_def_with_http_info(moid, capability_fan_module_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "0dc45224bf4f3ac832f3ff522eba1c0e",
"score": "0.54993904",
"text": "def delete_capability_chassis_manufacturing_def_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.delete_capability_chassis_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.delete_capability_chassis_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.delete_capability_chassis_manufacturing_def\",\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#delete_capability_chassis_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7631a3dee652c4434e02949e99f8e1f6",
"score": "0.54887855",
"text": "def patch_capability_psu_manufacturing_def(moid, capability_psu_manufacturing_def, opts = {})\n data, _status_code, _headers = patch_capability_psu_manufacturing_def_with_http_info(moid, capability_psu_manufacturing_def, opts)\n data\n end",
"title": ""
},
{
"docid": "aa08191f6115043691b9cad9e550e6ee",
"score": "0.547977",
"text": "def patch_capability_io_card_manufacturing_def_with_http_info(moid, capability_io_card_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_io_card_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_io_card_manufacturing_def\"\n end\n # verify the required parameter 'capability_io_card_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_io_card_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_manufacturing_def' when calling CapabilityApi.patch_capability_io_card_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_io_card_manufacturing_def\",\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: CapabilityApi#patch_capability_io_card_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "209127bdc25c6ad95be92fe7d1c5b7e3",
"score": "0.5464088",
"text": "def create_capability_switch_manufacturing_def_with_http_info(capability_switch_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_switch_manufacturing_def ...'\n end\n # verify the required parameter 'capability_switch_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_switch_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_manufacturing_def' when calling CapabilityApi.create_capability_switch_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchManufacturingDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_switch_manufacturing_def\",\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: CapabilityApi#create_capability_switch_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a60fdf7304e3824df45b84205ae59b34",
"score": "0.5438107",
"text": "def patch_capability_psu_manufacturing_def_with_http_info(moid, capability_psu_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_psu_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_psu_manufacturing_def\"\n end\n # verify the required parameter 'capability_psu_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_psu_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_psu_manufacturing_def' when calling CapabilityApi.patch_capability_psu_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/PsuManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_psu_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityPsuManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_psu_manufacturing_def\",\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: CapabilityApi#patch_capability_psu_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "8c3130d303953811b324962fb2165457",
"score": "0.54257125",
"text": "def update\n Puppet.debug(\"Debconf: updating #{resource[:name]}\")\n\n # Build the string to send\n args = [:package, :item, :type, :value].map { |e| resource[e] }.join(' ')\n\n IO.popen('/usr/bin/debconf-set-selections', 'w+') do |pipe|\n Puppet.debug(\"Debconf: debconf-set-selections #{args}\")\n pipe.puts(args)\n\n # Ignore remaining output from command\n pipe.close_write\n pipe.read(nil)\n end\n end",
"title": ""
},
{
"docid": "a9e2a59801f1bb04603772700416cb1f",
"score": "0.5425296",
"text": "def create_capability_psu_manufacturing_def_with_http_info(capability_psu_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_psu_manufacturing_def ...'\n end\n # verify the required parameter 'capability_psu_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_psu_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_psu_manufacturing_def' when calling CapabilityApi.create_capability_psu_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/PsuManufacturingDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_psu_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityPsuManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_psu_manufacturing_def\",\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: CapabilityApi#create_capability_psu_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "eea0d4aa31fe4db445dd1d98d67e6835",
"score": "0.5424877",
"text": "def create_capability_io_card_manufacturing_def_with_http_info(capability_io_card_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_io_card_manufacturing_def ...'\n end\n # verify the required parameter 'capability_io_card_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_io_card_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_manufacturing_def' when calling CapabilityApi.create_capability_io_card_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardManufacturingDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_io_card_manufacturing_def\",\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: CapabilityApi#create_capability_io_card_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0aaefb32afe06c62b83b1841c845ac64",
"score": "0.54242194",
"text": "def patch_capability_sioc_module_manufacturing_def_with_http_info(moid, capability_sioc_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_sioc_module_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_sioc_module_manufacturing_def\"\n end\n # verify the required parameter 'capability_sioc_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_manufacturing_def' when calling CapabilityApi.patch_capability_sioc_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_sioc_module_manufacturing_def\",\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: CapabilityApi#patch_capability_sioc_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5669c0f3b52feec65da37177aaa63de7",
"score": "0.5423",
"text": "def update_resource(resource_desc, resource_type, authorizer, new_attributes)\n debug \"update_resource: resource_descr: #{resource_desc}, type: #{resource_type}, new_attrs: #{new_attributes}\"\n raise 'Method not implemented because the Central Manager just need to pass the same requisition to the other' \\\n ' brokers and create the concatenated results'\n end",
"title": ""
},
{
"docid": "ee3a2d528bc6539360f0c266e5eba7e8",
"score": "0.54013056",
"text": "def update_capability_equipment_physical_def_with_http_info(moid, capability_equipment_physical_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_equipment_physical_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_equipment_physical_def\"\n end\n # verify the required parameter 'capability_equipment_physical_def' is set\n if @api_client.config.client_side_validation && capability_equipment_physical_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_equipment_physical_def' when calling CapabilityApi.update_capability_equipment_physical_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/EquipmentPhysicalDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_equipment_physical_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityEquipmentPhysicalDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_equipment_physical_def\",\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: CapabilityApi#update_capability_equipment_physical_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4f73b5d5cff8d710e22b3e8528e3ea5f",
"score": "0.540128",
"text": "def update\n respond_to do |format|\n if @manufacturer.update(manufacturer_params)\n format.html { redirect_to @manufacturer, notice: 'Combination dose was successfully updated.' }\n format.json { render :show, status: :ok, location: @manufacturer }\n else\n format.html { render :edit }\n format.json { render json: @manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8749bd2545dcdddaf09d5e1edc730d4",
"score": "0.53612083",
"text": "def get_capability_chassis_manufacturing_def_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.get_capability_chassis_manufacturing_def_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/capability/ChassisManufacturingDefs'\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] || 'CapabilityChassisManufacturingDefResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.get_capability_chassis_manufacturing_def_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: CapabilityApi#get_capability_chassis_manufacturing_def_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9d27c5ad194cb0801eaf33dbf8dc7d0c",
"score": "0.5359631",
"text": "def patch_capability_switch_manufacturing_def_with_http_info(moid, capability_switch_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_switch_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_switch_manufacturing_def\"\n end\n # verify the required parameter 'capability_switch_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_switch_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_manufacturing_def' when calling CapabilityApi.patch_capability_switch_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_switch_manufacturing_def\",\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: CapabilityApi#patch_capability_switch_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "13795c42dae1df39b0736228c049e103",
"score": "0.5343227",
"text": "def update!(**args)\n @plate_support = args[:plate_support] if args.key?(:plate_support)\n end",
"title": ""
},
{
"docid": "d867e9b1f766fc4fc2386b4a037aa940",
"score": "0.53191406",
"text": "def update\n @hardware = Hardware.find(params[:id])\n\n respond_to do |format|\n if @hardware.update_attributes(params[:hardware])\n format.html { redirect_to @hardware, :notice => 'Hardware was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @hardware.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b21ba24c00f00853e4bd3460f561ccf5",
"score": "0.52996963",
"text": "def update\n respond_to do |format|\n if @seat_manufacturer.update_attributes(params[:seat_manufacturer])\n format.html { redirect_to @seat_manufacturer, notice: 'Seat manufacturer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seat_manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0849ba992622008002b1fef7cc63f87b",
"score": "0.52799284",
"text": "def update!(**args)\n @resource_family = args[:resource_family] if args.key?(:resource_family)\n @resource_group = args[:resource_group] if args.key?(:resource_group)\n @service_display_name = args[:service_display_name] if args.key?(:service_display_name)\n @usage_type = args[:usage_type] if args.key?(:usage_type)\n end",
"title": ""
},
{
"docid": "071220955e6704ca4c227fa4b169c640",
"score": "0.5266888",
"text": "def update\n @hardware_type = HardwareType.find(params[:id])\n\n respond_to do |format|\n if @hardware_type.update_attributes(params[:hardware_type])\n format.html { redirect_to @hardware_type, notice: 'Hardware type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hardware_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e070489950f08e527126a04333b178c7",
"score": "0.5232823",
"text": "def update\n @chiropractic_compliance = ChiropracticCompliance.find(params[:id])\n\n respond_to do |format|\n if @chiropractic_compliance.update_attributes(params[:chiropractic_compliance])\n format.html { redirect_to @chiropractic_compliance, notice: 'Chiropractic compliance was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chiropractic_compliance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f902d8dcdec904eed5f159e4a4f33456",
"score": "0.52161765",
"text": "def update\n respond_to do |format|\n if @supplier.update(supplier_params)\n\t\t\n\t\t@hz_manufacturer = HzManufacturer.find_by_manufacturer_id @supplier.shop_id\n\t\t@hz_manufacturer.address=params[:supplier][:address]\n\t\t@hz_manufacturer.manufacturer_id=params[:supplier][:shop_id]\n\t\t@hz_manufacturer.tel=params[:supplier][:contact_no]\n\t\t@hz_manufacturer.hz_country_code=params[:supplier][:country_code]\n\t\t@hz_manufacturer.save\n\t \n format.html { redirect_to @supplier, notice: 'Supplier was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @supplier.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea95e1b0c1ce639fffd0fd9f21452ff1",
"score": "0.5210441",
"text": "def update_firmware(attributes = {})\n patch('replace', '/firmware', attributes)\n end",
"title": ""
},
{
"docid": "0412a7b0e6080b2ffb9cca506d329621",
"score": "0.52094895",
"text": "def patch_capability_fan_module_manufacturing_def_with_http_info(moid, capability_fan_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_fan_module_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_fan_module_manufacturing_def\"\n end\n # verify the required parameter 'capability_fan_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_fan_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_fan_module_manufacturing_def' when calling CapabilityApi.patch_capability_fan_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/FanModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_fan_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityFanModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_fan_module_manufacturing_def\",\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: CapabilityApi#patch_capability_fan_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2b9f2ccb6f3f0ae60fd4d3de03583ec8",
"score": "0.5202025",
"text": "def create_capability_fan_module_manufacturing_def_with_http_info(capability_fan_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_fan_module_manufacturing_def ...'\n end\n # verify the required parameter 'capability_fan_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_fan_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_fan_module_manufacturing_def' when calling CapabilityApi.create_capability_fan_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/FanModuleManufacturingDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_fan_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityFanModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_fan_module_manufacturing_def\",\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: CapabilityApi#create_capability_fan_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "be358f64d65a7b06b82fc9e6967dfec1",
"score": "0.5201424",
"text": "def update\n @manufacturer_warranty_type = ManufacturerWarrantyType.find(params[:id])\n\n respond_to do |format|\n if @manufacturer_warranty_type.update_attributes(params.require(:manufacturer_warranty_type).permit(:name))\n format.html { redirect_to manufacturer_warranty_types_url,\n notice: 'Manufacturer warranty type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manufacturer_warranty_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe71c03a1de5e5fcab724d80799c615e",
"score": "0.5189319",
"text": "def update\n @haptic_fidelity = HapticFidelity.find(params[:id])\n\n respond_to do |format|\n if @haptic_fidelity.update_attributes(params[:haptic_fidelity])\n format.html { redirect_to @haptic_fidelity, notice: 'Haptic fidelity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @haptic_fidelity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "256786ab41367005c306df76ce2606c6",
"score": "0.5168564",
"text": "def update\n respond_to do |format|\n if @vehicle_manufacturer.update(vehicle_manufacturer_params)\n format.html { redirect_to @vehicle_manufacturer, notice: 'Vehicle manufacturer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vehicle_manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdfdf39e8cdfb372d3c4269aba71d46b",
"score": "0.5159454",
"text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @resource_id = args[:resource_id] if args.key?(:resource_id)\n @resource_type = args[:resource_type] if args.key?(:resource_type)\n end",
"title": ""
},
{
"docid": "69ab0ec5511ce2a9f27f6cd074c0112a",
"score": "0.5159218",
"text": "def update\r\n @ph_electric_component = PhElectricComponent.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @ph_electric_component.update_attributes(params[:ph_electric_component])\r\n format.html { redirect_to(ph_maintenance_path(@ph_electric_component.ph_product)) }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @ph_electric_component.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "2b56717c0d96521fe89258bb61ff7887",
"score": "0.51549",
"text": "def update_capability_equipment_physical_def(moid, capability_equipment_physical_def, opts = {})\n data, _status_code, _headers = update_capability_equipment_physical_def_with_http_info(moid, capability_equipment_physical_def, opts)\n data\n end",
"title": ""
},
{
"docid": "71f117c1a54585dab55d8513b006600b",
"score": "0.5146267",
"text": "def patch_capability_equipment_physical_def_with_http_info(moid, capability_equipment_physical_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_equipment_physical_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_equipment_physical_def\"\n end\n # verify the required parameter 'capability_equipment_physical_def' is set\n if @api_client.config.client_side_validation && capability_equipment_physical_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_equipment_physical_def' when calling CapabilityApi.patch_capability_equipment_physical_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/EquipmentPhysicalDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_equipment_physical_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityEquipmentPhysicalDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_equipment_physical_def\",\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: CapabilityApi#patch_capability_equipment_physical_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "dd1814b9fbc22c680845c38d060684fc",
"score": "0.51453",
"text": "def update\n @paint_manufacturer = PaintManufacturer.find(params[:id])\n\n respond_to do |format|\n if @paint_manufacturer.update_attributes(params[:paint_manufacturer])\n format.html { redirect_to @paint_manufacturer, notice: 'Paint manufacturer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @paint_manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "611757a5ec17db6a1011ff79e4ea5542",
"score": "0.51374775",
"text": "def update\n respond_to do |format|\n if @car_manufacturer.update(car_manufacturer_params)\n format.html { redirect_to @car_manufacturer, notice: 'Car manufacturer was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_manufacturer }\n else\n format.html { render :edit }\n format.json { render json: @car_manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2d7a88f0a0476fa99800dc7a766b6ef",
"score": "0.5123096",
"text": "def update\n @manufacturer = Manufacturer.find_by_id(params[:id])\n @manufacturer.name = params[:name]\n @manufacturer.rebate = params[:rebate]\n @manufacturer.rebate_description = params[:rebate_description]\n\n if @manufacturer.save\n redirect_to manufacturers_url\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "3dd5770f19449f06972f62e89679ae07",
"score": "0.5121659",
"text": "def update\n resource_instance_variable.assign_attributes(building_params)\n respond_to do |format|\n if resource_instance_variable.save\n format.html { redirect_to resource_instance_variable, notice: 'Building was successfully updated.' }\n format.json { render :show, status: :ok, location: resource_instance_variable }\n else\n format.html { render :edit }\n format.json { render json: resource_instance_variable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17de4702049ecf8e677660e333459555",
"score": "0.5114189",
"text": "def update\n authorize @fuel_supply\n respond_to do |format|\n if @fuel_supply.update(fuel_supply_params)\n format.html { redirect_to @fuel_supply, notice: 'Fuel supply was successfully updated.' }\n format.json { render :show, status: :ok, location: @fuel_supply }\n else\n format.html { render :edit }\n format.json { render json: @fuel_supply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e9a2ecd489f93a1da6abf0790c17a9c",
"score": "0.510323",
"text": "def create_capability_chassis_descriptor_with_http_info(capability_chassis_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_chassis_descriptor ...'\n end\n # verify the required parameter 'capability_chassis_descriptor' is set\n if @api_client.config.client_side_validation && capability_chassis_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_descriptor' when calling CapabilityApi.create_capability_chassis_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisDescriptors'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_chassis_descriptor\",\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: CapabilityApi#create_capability_chassis_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "391ae0e440c3ec395e4840ddc5cb7512",
"score": "0.5097366",
"text": "def create_capability_equipment_physical_def_with_http_info(capability_equipment_physical_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_equipment_physical_def ...'\n end\n # verify the required parameter 'capability_equipment_physical_def' is set\n if @api_client.config.client_side_validation && capability_equipment_physical_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_equipment_physical_def' when calling CapabilityApi.create_capability_equipment_physical_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/EquipmentPhysicalDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_equipment_physical_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityEquipmentPhysicalDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_equipment_physical_def\",\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: CapabilityApi#create_capability_equipment_physical_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "78fdaad1868a71926f8cf0085e38a4fe",
"score": "0.5087664",
"text": "def update_kapp_attribute_definition(kapp_slug, name, body, headers=default_headers)\n @logger.info(\"Updating the \\\"#{name}\\\" Kapp attribute definition in the \\\"#{kapp_slug}\\\" kapp.\")\n put(\"#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}\",body, headers)\n end",
"title": ""
},
{
"docid": "d8b398f039024ae92ea203052200f5f2",
"score": "0.5086462",
"text": "def update\n respond_to do |format|\n if @admin_hardware_type.update(admin_hardware_type_params)\n format.html { redirect_to @admin_hardware_type, notice: 'Hardware type was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_hardware_type }\n else\n format.html { render :edit }\n format.json { render json: @admin_hardware_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae70b592bb3f0ccfeb147eaa6508ad65",
"score": "0.50861114",
"text": "def update_firmware_pcie_descriptor_with_http_info(moid, firmware_pcie_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FirmwareApi.update_firmware_pcie_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling FirmwareApi.update_firmware_pcie_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/firmware/PcieDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(firmware_pcie_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'FirmwarePcieDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"FirmwareApi.update_firmware_pcie_descriptor\",\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: FirmwareApi#update_firmware_pcie_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "457e84b7743cb712d89f3f31ae2d979d",
"score": "0.5076055",
"text": "def update\n respond_to do |format|\n if @dispensible_combination.update(dispensible_combination_params)\n format.html { redirect_to @dispensible_combination, notice: 'Dispensible combination was successfully updated.' }\n format.json { render :show, status: :ok, location: @dispensible_combination }\n else\n format.html { render :edit }\n format.json { render json: @dispensible_combination.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35fdf002929d568b8a072a57d34f6a06",
"score": "0.5064181",
"text": "def update!(**args)\n @allergen_absent = args[:allergen_absent] if args.key?(:allergen_absent)\n @allergen_present = args[:allergen_present] if args.key?(:allergen_present)\n @calories = args[:calories] if args.key?(:calories)\n @ingredients = args[:ingredients] if args.key?(:ingredients)\n @media = args[:media] if args.key?(:media)\n @name_info = args[:name_info] if args.key?(:name_info)\n @nutrition_facts = args[:nutrition_facts] if args.key?(:nutrition_facts)\n @portion_size = args[:portion_size] if args.key?(:portion_size)\n @preparation_methods = args[:preparation_methods] if args.key?(:preparation_methods)\n @price = args[:price] if args.key?(:price)\n @restriction = args[:restriction] if args.key?(:restriction)\n @serves_num_people = args[:serves_num_people] if args.key?(:serves_num_people)\n @spiciness = args[:spiciness] if args.key?(:spiciness)\n end",
"title": ""
},
{
"docid": "c1676220ba095dabbda87f94c19075d9",
"score": "0.5062271",
"text": "def update_form_attribute_definition(kapp_slug, name, body, headers=default_headers)\n @logger.info(\"Updating the \\\"#{name}\\\" Form attribute definition in the \\\"#{kapp_slug}\\\" kapp.\")\n put(\"#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions/#{encode(name)}\",body, headers)\n end",
"title": ""
},
{
"docid": "cbd67b0095b91294711cd953de7355e7",
"score": "0.5043105",
"text": "def set_manufacturer\n @manufacturer = DisManufacturer.find(params[:id])\n end",
"title": ""
},
{
"docid": "0fd91629ef52a7721816df1e23f849a9",
"score": "0.5032739",
"text": "def update_attribute(id, name, estimated_time, clue, description)\n req = UpdateAttributeRequest.new(id, name, estimated_time, clue, description)\n resp = @@room_service.update_attribute(req)\n render json: { success: resp.success, message: resp.message }, status: :ok\n rescue StandardError\n render json: { success: false, message: 'Server Error when Updating' }, status: :bad_request\n end",
"title": ""
},
{
"docid": "5f05531d0f832c16b0d934b222db6e23",
"score": "0.50318265",
"text": "def update\n respond_to do |format|\n if @asformulary.update(asformulary_params)\n format.html { redirect_to @asformulary, notice: 'Asformulary was successfully updated.' }\n format.json { render :show, status: :ok, location: @asformulary }\n else\n format.html { render :edit }\n format.json { render json: @asformulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a55e5b6f51eccced8952ceecbdb60b9",
"score": "0.50091267",
"text": "def update\n respond_to do |format|\n if @chef_resource.update(chef_resource_params)\n format.html { redirect_to edit_chef_resource_path(@chef_resource), notice: 'Chef resource was successfully updated.' }\n format.json { render :show, status: :ok, location: edit_chef_resource_path(@chef_resource) }\n else\n format.html { render :edit }\n format.json { render json: @chef_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ed40b58c6c30e736d85143df78a2235",
"score": "0.5008873",
"text": "def update\n @f_characteristic = FCharacteristic.find(params[:id])\n\n respond_to do |format|\n if @f_characteristic.update_attributes(params[:f_characteristic])\n format.html { redirect_to @f_characteristic }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @f_characteristic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6162056558be8144f986cbdcc4bb1fc7",
"score": "0.50072587",
"text": "def update_category_attribute_definition(kapp_slug, name, body, headers=default_headers)\n @logger.info(\"Updating the \\\"#{name}\\\" Category attribute definition in the \\\"#{kapp_slug}\\\" kapp.\")\n put(\"#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions/#{encode(name)}\",body, headers)\n end",
"title": ""
},
{
"docid": "77452f12d90b1ff8ada15ff55a869d85",
"score": "0.49995616",
"text": "def update\n # updating hard info\n hard_info = HardInfo.where(use_case_no: @use_case.use_case_no, client_name: @use_case.client_name, product_name: @use_case.product_name)\n hard_info.first.update(use_case_params.except(\n :division,\n :sc_tel,\n :project_no,\n :industry,\n :service_product,\n :customer_count,\n :vendor_count,\n :product_count,\n :vehicle_count,\n :driver_count,\n :sc_name,\n :memo,\n :use_case_code\n )\n )\n #--\n respond_to do |format|\n if @use_case.update(use_case_params)\n format.html { redirect_to @use_case }\n format.json { render :show, status: :ok, location: @use_case }\n else\n format.html { render :edit }\n format.json { render json: @use_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b946bb162ea850778d4bb5f848f45e2e",
"score": "0.49991208",
"text": "def update\n respond_to do |format|\n if @home_facility.update(home_facility_params)\n format.html { redirect_to @home_facility, notice: 'Home facility was successfully updated.' }\n format.json { render :show, status: :ok, location: @home_facility }\n else\n format.html { render :edit }\n format.json { render json: @home_facility.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe58dde1d2d934706727a1611038b5c6",
"score": "0.49886474",
"text": "def get_capability_chassis_manufacturing_def_by_moid(moid, opts = {})\n data, _status_code, _headers = get_capability_chassis_manufacturing_def_by_moid_with_http_info(moid, opts)\n data\n end",
"title": ""
},
{
"docid": "569e282cadc286b963ef20511c29a8ad",
"score": "0.4987494",
"text": "def set_device_manufacturer\n @device_manufacturer = DeviceManufacturer.find(params[:id])\n end",
"title": ""
},
{
"docid": "9bf56b6438e2a46dc3d3bf9dd46ac106",
"score": "0.49843305",
"text": "def update_a_resource(resource_descr, type_to_create, authorizer)\n debug \"update_a_resource: resource_descr: #{resource_descr}, type_to_create: #{type_to_create}\"\n raise 'Method not implemented because the Central Manager just need to pass the same requisition to the other' \\\n ' brokers and create the concatenated results'\n end",
"title": ""
},
{
"docid": "e086d261f71070a21ddfe47157232dc4",
"score": "0.4976031",
"text": "def update\n @brief_vendor = BriefVendor.find(params[:id])\n\n respond_to do |format|\n if @brief_vendor.update_attributes(params[:brief_vendor])\n format.html { redirect_to @brief_vendor, notice: 'Brief vendor was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brief_vendor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de62b9dad47c95f68182c7684e74a486",
"score": "0.49743092",
"text": "def update_firmware_hba_descriptor_with_http_info(moid, firmware_hba_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FirmwareApi.update_firmware_hba_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling FirmwareApi.update_firmware_hba_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/firmware/HbaDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(firmware_hba_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'FirmwareHbaDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"FirmwareApi.update_firmware_hba_descriptor\",\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: FirmwareApi#update_firmware_hba_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ed7e9a5123bfce99145babe0488ab797",
"score": "0.497084",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @id = args[:id] if args.key?(:id)\n @name = args[:name] if args.key?(:name)\n @queryable = args[:queryable] if args.key?(:queryable)\n @referenced_system_columns = args[:referenced_system_columns] if args.key?(:referenced_system_columns)\n @references_attributes = args[:references_attributes] if args.key?(:references_attributes)\n @references_metrics = args[:references_metrics] if args.key?(:references_metrics)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n @value_type = args[:value_type] if args.key?(:value_type)\n end",
"title": ""
},
{
"docid": "dd625e6ee197ab40a6c07202e31445e1",
"score": "0.49678382",
"text": "def update!(**args)\n @commodity_strength = args[:commodity_strength] if args.key?(:commodity_strength)\n @gcidsyns_override = args[:gcidsyns_override] if args.key?(:gcidsyns_override)\n @hyper_reliable = args[:hyper_reliable] if args.key?(:hyper_reliable)\n @retrieval_gcids = args[:retrieval_gcids] if args.key?(:retrieval_gcids)\n end",
"title": ""
},
{
"docid": "d3e08de52d1b0868fc9fb1e3025bf6a0",
"score": "0.49514118",
"text": "def update!(**args)\n @arbitration_device_id = args[:arbitration_device_id] if args.key?(:arbitration_device_id)\n @connectivity = args[:connectivity] if args.key?(:connectivity)\n @device_id = args[:device_id] if args.key?(:device_id)\n @device_id_log = args[:device_id_log] if args.key?(:device_id_log)\n @device_index = args[:device_index] if args.key?(:device_index)\n @device_model_id = args[:device_model_id] if args.key?(:device_model_id)\n @distance = args[:distance] if args.key?(:distance)\n @eliminating_lumos_processor = args[:eliminating_lumos_processor] if args.key?(:eliminating_lumos_processor)\n @home_structure_id = args[:home_structure_id] if args.key?(:home_structure_id)\n @is_remote = args[:is_remote] if args.key?(:is_remote)\n @is_tethered = args[:is_tethered] if args.key?(:is_tethered)\n @media_capabilities = args[:media_capabilities] if args.key?(:media_capabilities)\n @media_device_type = args[:media_device_type] if args.key?(:media_device_type)\n @name = args[:name] if args.key?(:name)\n @sessions = args[:sessions] if args.key?(:sessions)\n @surface_type = args[:surface_type] if args.key?(:surface_type)\n end",
"title": ""
},
{
"docid": "a2733b4b2463969812d41fdf3d2c391c",
"score": "0.4949652",
"text": "def set_manufacturing\n @manufacturing = Manufacturing.find(params[:id])\n \n end",
"title": ""
},
{
"docid": "0e93eae705c2bf790f7082763af66906",
"score": "0.49401182",
"text": "def update_space_attribute_definition(name, body, headers=default_headers)\n @logger.info(\"Updating the \\\"#{name}\\\" Space Attribute Definition.\")\n put(\"#{@api_url}/spaceAttributeDefinitions/#{encode(name)}\",body, headers)\n end",
"title": ""
},
{
"docid": "52be8ba7d23733a08e48efca2b708002",
"score": "0.4934343",
"text": "def description=(value)\n start = Time.now\n debug \"Updating description on device group: \\\"#{resource[:full_path]}\\\"\"\n connection = self.class.get_connection(resource[:account])\n update_device_group(connection,\n resource[:full_path],\n value,\n resource[:properties],\n resource[:disable_alerting])\n debug \"Finished in #{(Time.now-start)*1000.0} ms\"\n end",
"title": ""
},
{
"docid": "04dc0810ee24007afe73cc2c23d20510",
"score": "0.4930492",
"text": "def flush\n device.command do |dev|\n ensure_absent = resource[:ensure]\n feature_name = resource[:feature]\n dev.update_feature_set(resource[:name], former_properties, properties, feature_name, ensure_absent)\n end\n super\n end",
"title": ""
},
{
"docid": "69e8850dee976523f92a7b2e1f53cd9a",
"score": "0.49286842",
"text": "def update!(**args)\n @release_ready_condition = args[:release_ready_condition] if args.key?(:release_ready_condition)\n @skaffold_supported_condition = args[:skaffold_supported_condition] if args.key?(:skaffold_supported_condition)\n end",
"title": ""
},
{
"docid": "ccaf30e51e45daf6be639a6877230fe0",
"score": "0.4926742",
"text": "def update!(**args)\n @attribute_resources = args[:attribute_resources] if args.key?(:attribute_resources)\n @category = args[:category] if args.key?(:category)\n @data_type = args[:data_type] if args.key?(:data_type)\n @enum_values = args[:enum_values] if args.key?(:enum_values)\n @filterable = args[:filterable] if args.key?(:filterable)\n @is_repeated = args[:is_repeated] if args.key?(:is_repeated)\n @metrics = args[:metrics] if args.key?(:metrics)\n @name = args[:name] if args.key?(:name)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n @segments = args[:segments] if args.key?(:segments)\n @selectable = args[:selectable] if args.key?(:selectable)\n @selectable_with = args[:selectable_with] if args.key?(:selectable_with)\n @sortable = args[:sortable] if args.key?(:sortable)\n @type_url = args[:type_url] if args.key?(:type_url)\n end",
"title": ""
},
{
"docid": "2f975846c5e88e06a394df025130c742",
"score": "0.49250394",
"text": "def update\n @undergraduate_major = UndergraduateMajor.find(params[:id])\n\n respond_to do |format|\n if @undergraduate_major.update_attributes(params[:undergraduate_major])\n format.html { redirect_to @undergraduate_major, notice: 'Undergraduate major was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @undergraduate_major.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76a833626244269577475eba3958e1f2",
"score": "0.492232",
"text": "def update\n @lookup_hardware = LookupHardware.find(params[:id])\n\n respond_to do |format|\n if @lookup_hardware.update(params[:lookup_hardware], :without_protection => true)\n format.html { redirect_to(@lookup_hardware, :notice => 'Lookup hardware was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lookup_hardware.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "decb6a1a76c2fce1ccae2a15129fcb37",
"score": "0.4921155",
"text": "def update\n respond_to do |format|\n if @gpu_conf.update(gpu_conf_params)\n format.html { redirect_to @gpu_conf, notice: 'Gpu conf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gpu_conf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
e1039ff82d62ed784b41a6dbf3b61667
|
GET /tickets GET /tickets.json
|
[
{
"docid": "d27715208ae228b99697ea8bee05538a",
"score": "0.76279",
"text": "def index\n @tickets = Ticket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
}
] |
[
{
"docid": "bca922a42971ac7e819a20e8b5f19079",
"score": "0.812432",
"text": "def GetTickets params = {}\n\n params = params.merge(path: 'tickets.json')\n APICall(params)\n\n end",
"title": ""
},
{
"docid": "485d99e64672b1c96f45b9fa9ff259cb",
"score": "0.7915244",
"text": "def getUserTickets\n @user = User.find(params[:id])\n render json: @user.tickets\n end",
"title": ""
},
{
"docid": "a00fc20ce8f2d326ec05fdf64ec0f60e",
"score": "0.76198745",
"text": "def index\n @title = \"Tickets\"\n @tickets = Ticket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tickets }\n end\n end",
"title": ""
},
{
"docid": "0e10df41347d080313303ba2fb797599",
"score": "0.7595226",
"text": "def GetTicket id\n\n APICall(path: \"tickets/#{id}.json\")\n\n end",
"title": ""
},
{
"docid": "7aaa2cb3ccec32609de2ca9eae30f705",
"score": "0.7439142",
"text": "def index\n\t @tickets = Ticket.order('created_at DESC').page(params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tickets }\n end\n end",
"title": ""
},
{
"docid": "4d84783166df7b8ce04d9bc3142c65c8",
"score": "0.7317611",
"text": "def index\n @tickets = current_user.tickets.last(15).reverse\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tickets }\n end\n end",
"title": ""
},
{
"docid": "5a750e2ebefebe9628cc3f4d896ca0de",
"score": "0.7301728",
"text": "def index\n respond_with(@tickets)\n end",
"title": ""
},
{
"docid": "7524972862cfe80e7283b97f8ac17e02",
"score": "0.73013884",
"text": "def index_all\n @tickets = Ticket.all_tickets\n render json: @tickets, status: 200\n end",
"title": ""
},
{
"docid": "13fbebf42cfcaed94e2f83f0b492a5df",
"score": "0.7277282",
"text": "def index\n if params[:tickets] == 'closed'\n @tickets = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).closed.page(params[:page])\n else\n @tickets = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).active.page(params[:page])\n end\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tickets }\n end\n end",
"title": ""
},
{
"docid": "3e6821e6f753767f3e3b97bd42a74e11",
"score": "0.7274308",
"text": "def show\n @ticket = Ticket.find(params[:id])\n respond_to do |format|\n format.html\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "75bb3e744036022225361d664309fba5",
"score": "0.7272302",
"text": "def show\n render json: @ticket\n end",
"title": ""
},
{
"docid": "f88381114d5f56d5246b65cda6dd75a2",
"score": "0.7221539",
"text": "def my_tickets\n user = current_user.id if !current_user.nil?\n # OCO\n init_oco if !session[:organization]\n\n @search = Ticket.search do\n fulltext params[:search]\n if session[:organization] != '0'\n with :organization_id, session[:organization]\n end\n if !user.blank?\n with :created_by, user\n end\n with(:ticket_status_id).less_than(4)\n order_by :id, :desc\n paginate :page => params[:page] || 1, :per_page => per_page\n end\n\n @tickets = @search.results\n\n respond_to do |format|\n format.html # my_tickets.html.erb\n format.json { render json: @tickets }\n end\n end",
"title": ""
},
{
"docid": "cb7de65bf8d4dd886f7fb54ce87f6c1a",
"score": "0.71765393",
"text": "def show\n @tickets_count = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).active.count\n @ticket = Helpdesk::Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "65c8bcef735bae339350852dd37552f1",
"score": "0.7173541",
"text": "def index\n @sprint = params[:sprint].presence || Sprint.current!\n @tickets = Ticket.for_sprint(@sprint).by_created_at_desc\n @tickets = @tickets.for_project(params[:project]) if params[:project].present?\n @tickets = @tickets.for_user(params[:user]) if params[:user].present?\n @tickets = @tickets.search_name(params[:description]) if params[:description].present?\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tickets }\n end\n end",
"title": ""
},
{
"docid": "a679c3ceced396046692df291393772f",
"score": "0.7116907",
"text": "def show\n @ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "a679c3ceced396046692df291393772f",
"score": "0.7116907",
"text": "def show\n @ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "a679c3ceced396046692df291393772f",
"score": "0.7116907",
"text": "def show\n @ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "a679c3ceced396046692df291393772f",
"score": "0.7116907",
"text": "def show\n @ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "a679c3ceced396046692df291393772f",
"score": "0.7116907",
"text": "def show\n @ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "a679c3ceced396046692df291393772f",
"score": "0.7116907",
"text": "def show\n @ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.70597136",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "4431292f1c330d33697e94cc6b8ab91d",
"score": "0.7059027",
"text": "def index\n @tickets = Ticket.all\n end",
"title": ""
},
{
"docid": "1cf82ef14e8a08a898a4d1e973256938",
"score": "0.70448697",
"text": "def index_user\n @tickets = Ticket.all_for_user(current_user.id)\n render json: @tickets, status: 200\n end",
"title": ""
},
{
"docid": "095c31033df204565e35fd8bc0c3b4b7",
"score": "0.6963253",
"text": "def index\n @tickets = current_user.tickets.page(params[:page]||1)\n respond_to do |format|\n format.html\n format.xml { render :xml => @tickets }\n format.json { render :json => @tickets }\n end\n end",
"title": ""
},
{
"docid": "9ae721947bfafdbea7042bfd9536486f",
"score": "0.69538486",
"text": "def tickets_for_project(project_id)\n tickets = send(:get , \"/api/v1/projects/#{project_id}/tickets.json\")\n\n process_list_response( tickets , Unfuddled::Ticket )\n end",
"title": ""
},
{
"docid": "0a055325f0cb6fa1824a1deb3192272b",
"score": "0.693455",
"text": "def index\n # @tickets = policy_scope(Ticket)\n render json: @tickets\n end",
"title": ""
},
{
"docid": "73789f218edb159659dd3d40b0d5cd10",
"score": "0.69333595",
"text": "def index\n @tickets = current_user.tickets\n end",
"title": ""
},
{
"docid": "73789f218edb159659dd3d40b0d5cd10",
"score": "0.69333595",
"text": "def index\n @tickets = current_user.tickets\n end",
"title": ""
},
{
"docid": "b276bf1698348b67f598fe4e904e7f3d",
"score": "0.6930567",
"text": "def index\n if params[:status]\n @tickets = Ticket.where(status: params[:status])\n else\n @tickets = Ticket.all\n @tickets_waiting = Ticket.where(status:\"waiting\")\n @tickets_resolved = Ticket.where(status:\"resolved\")\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tickets }\n end\n end",
"title": ""
},
{
"docid": "719c4e19f260fc377457801f7ea2ac1e",
"score": "0.6920131",
"text": "def index\n @support_tickets = SupportTicket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @support_tickets }\n end\n end",
"title": ""
},
{
"docid": "4aeb3b2858b2770de67913e00958d8fd",
"score": "0.69026566",
"text": "def index\n @tickets = @event.tickets\n end",
"title": ""
},
{
"docid": "73c7ec67f9497cd100e732937b7cc972",
"score": "0.68610364",
"text": "def index\n @tickets = get_current_user_ticket_list(@user)\n end",
"title": ""
},
{
"docid": "c90b51a7a9dcd0b39be5ae081cfd5c54",
"score": "0.68440115",
"text": "def index\n if current_user.is? :admin\n if params[:user_id]\n @tickets = User.find(params[:user_id]).tickets.paginate(:page => params[:page])\n elsif params[:team_id]\n @tickets = Team.find(params[:team_id]).tickets.paginate(:page => params[:page])\n else\n @tickets = Ticket.paginate(:page => params[:page])\n end\n else\n @tickets = current_user.tickets.paginate(:page => params[:page])\n end\n\n if params[:status] == \"closed\"\n @tickets = @tickets.closed\n else\n @tickets = @tickets.open\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tickets }\n end\n end",
"title": ""
},
{
"docid": "d9a29fc4cf0a05383070e27166f1de9a",
"score": "0.67981356",
"text": "def show\n @breadcrumb = 'read'\n @ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "41fce6f711115719ef8e2aefd22adbb3",
"score": "0.6762969",
"text": "def index\n @tickets = OTRS::Ticket.where(params[:q])\n\n respond_to do |wants|\n wants.html # index.html.erb\n wants.xml { render :xml => @tickets }\n wants.json { render :json => @tickets }\n end\n end",
"title": ""
},
{
"docid": "42a4f66ad894fe9e7dfc0dd7177b3e70",
"score": "0.6756395",
"text": "def list\r\n # the base uri for api requests\r\n _query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n _query_builder << '/tickets'\r\n\r\n # validate and preprocess url\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'accept' => 'application/json',\r\n 'X-API-TOKEN' => Configuration.x_api_token,\r\n 'X-API-EMAIL' => Configuration.x_api_email\r\n }\r\n\r\n # append custom auth authorization\r\n CustomAuthUtility.append_custom_auth_params _headers\r\n\r\n # invoke the API call request to fetch the response\r\n _response = Unirest.get _query_url, headers: _headers\r\n\r\n # Error handling using HTTP status codes\r\n if _response.code == 401\r\n raise APIException.new 'Your API key is incorrect', 401, _response.body\r\n elsif _response.code == 400\r\n raise APIException.new 'There is an error in the parameters you send', 400, _response.body\r\n elsif _response.code == 404\r\n raise APIException.new 'Cannot find the resource specified', 404, _response.body\r\n elsif !_response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', _response.code, _response.body\r\n end\r\n \r\n # Try to cast response to list of desired type\r\n if _response.body.instance_of? Array\r\n value = Array.new\r\n _response.body.each do |item|\r\n begin\r\n value << (Ticket.from_hash(item))\r\n rescue Exception\r\n raise APIException.new \"Invalid JSON returned.\", _response.code, _response.body\r\n end\r\n end\r\n value\r\n end\r\n end",
"title": ""
},
{
"docid": "99ae94dcd4c91725dfabd31de5123605",
"score": "0.66756487",
"text": "def index\n @ticket_owners = TicketOwner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ticket_owners }\n end\n end",
"title": ""
},
{
"docid": "c04570f5cb129853fc51f59a540e13c4",
"score": "0.6674713",
"text": "def getUserTicketsByType\n @conditions = {user_id: params[:id], ticket_type: params[:ticket_type]}\n @tickets = Ticket.find(:all, :conditions => @conditions)\n\n # Handle empty results\n if @tickets.empty?\n raise(ActiveRecord::RecordNotFound)\n end\n\n render json: @tickets\n end",
"title": ""
},
{
"docid": "63c85e190b408709102f85f3aad293d8",
"score": "0.66669565",
"text": "def find_tickets(res)\n if res.key?(\"tickets\")\n tickets_info = res[\"tickets\"]\n @tickets = []\n tickets_info.each do |ticket_info|\n ticket = Ticket.new(ticket_info) \n @tickets << ticket\n end\n @tickets\n elsif res.key?(\"error\")\n raise res[\"error\"]\n else\n raise \"unknown error from API\"\n end\n end",
"title": ""
},
{
"docid": "8abb8bc2ca002ca5046cf4db9923156c",
"score": "0.66641426",
"text": "def show\n render json: @ticket.to_json(include: :conversations), status: 200\n end",
"title": ""
},
{
"docid": "5fc84978b8d6cc134f8612e1dbb35ffd",
"score": "0.66604596",
"text": "def index\n @tickets = @project.tickets.desc.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tickets }\n end\n end",
"title": ""
},
{
"docid": "2b719a8ca4c4e81cab90aa47f2e71726",
"score": "0.6650193",
"text": "def show\n # @tickets = @user.tickets\n @conditions = {user_id: @user.id, ticket_type: 1}\n @t1 = Ticket.find(:all, :conditions => @conditions, :limit => 10)\n @conditions = {user_id: @user.id, ticket_type: 2}\n @t2 = Ticket.find(:all, :conditions => @conditions, :limit => 10)\n @conditions = {user_id: @user.id, ticket_type: 3}\n @t3 = Ticket.find(:all, :conditions => @conditions, :limit => 10)\n @used_tickets = UsedTicket.where(user_id: @user.id).limit(10)\n render :json => \n {\n :status => 0,\n :user => {\n :id => @user.id,\n :name => @user.name,\n :email => @user.email,\n :tickets => {\n :t1 => @t1,\n :t2 => @t2,\n :t3 => @t3,\n :used => @used_tickets\n }\n }\n }\n end",
"title": ""
},
{
"docid": "74035696c6dd72af5b04d219de5f0034",
"score": "0.66495144",
"text": "def get(ticket_id)\r\n\r\n # Validate required parameters\r\n if ticket_id == nil\r\n raise ArgumentError.new \"Required parameter 'ticket_id' cannot be nil.\"\r\n end\r\n\r\n # the base uri for api requests\r\n _query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n _query_builder << '/tickets/{ticket_id}'\r\n\r\n # process optional query parameters\r\n _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {\r\n 'ticket_id' => ticket_id\r\n }\r\n\r\n # validate and preprocess url\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'accept' => 'application/json',\r\n 'X-API-TOKEN' => Configuration.x_api_token,\r\n 'X-API-EMAIL' => Configuration.x_api_email\r\n }\r\n\r\n # append custom auth authorization\r\n CustomAuthUtility.append_custom_auth_params _headers\r\n\r\n # invoke the API call request to fetch the response\r\n _response = Unirest.get _query_url, headers: _headers\r\n\r\n # Error handling using HTTP status codes\r\n if _response.code == 401\r\n raise APIException.new 'Your API key is incorrect', 401, _response.body\r\n elsif _response.code == 400\r\n raise APIException.new 'There is an error in the parameters you send', 400, _response.body\r\n elsif _response.code == 404\r\n raise APIException.new 'Cannot find the resource specified', 404, _response.body\r\n elsif !_response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', _response.code, _response.body\r\n end\r\n\r\n # Try to cast response to desired type\r\n if _response.body.instance_of? Hash\r\n begin\r\n Ticket.from_hash(_response.body)\r\n rescue Exception\r\n raise APIException.new \"Invalid JSON returned.\", _response.code, _response.body\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "3f9b3775caed8df3e331ff9fdfc25b27",
"score": "0.6647248",
"text": "def get_ticket(ticket_id:)\n ZendeskAPI::Ticket.find(client, id: ticket_id)\n end",
"title": ""
},
{
"docid": "89ca5e968283c313c4114d22a2cab72d",
"score": "0.66166365",
"text": "def show\n @tickets = @event.tickets.find(params[:id])\n end",
"title": ""
},
{
"docid": "b27e76be164cace297892609ba6b5a10",
"score": "0.6596757",
"text": "def index\n tickets = Ticket.all_relevant_tickets\n @pagy, @tickets = pagy(tickets)\n ticket_records_with_associations =\n TicketSerializer.new(@tickets, { params: { :ticketlist => true } }).hash_for_collection[:data].map { | ticket |\n ticket[:attributes]\n }\n # When we need pagination lets use the below\n #render json: { data: ticket_records_with_associations,\n # pagy: pagy_metadata(@pagy) }\n paginate json: ticket_records_with_associations\n end",
"title": ""
},
{
"docid": "0dbb966c93405df39e311068038abc8a",
"score": "0.65937644",
"text": "def index\n @tickets = Ticket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tickets }\n end\n end",
"title": ""
},
{
"docid": "85ca2e853aa0a5e9706568174e6aa41a",
"score": "0.658707",
"text": "def show\n @admin_ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_ticket }\n end\n end",
"title": ""
},
{
"docid": "10ae4e7aa236a82511c4c39d5c4901eb",
"score": "0.6577375",
"text": "def index\n @tickets = Ticket.where(user: current_user)\n end",
"title": ""
},
{
"docid": "39f9906b07b8818b0f769dfafd6bb3a9",
"score": "0.6547883",
"text": "def show\n @ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home }\n end\n end",
"title": ""
},
{
"docid": "0e13afad26b45365ee46c9fa00289ecd",
"score": "0.65350646",
"text": "def index\n authorize @ticket\n render :json => @ticket.tags\n end",
"title": ""
},
{
"docid": "99df6183e95d21cde3aae43053347b08",
"score": "0.65208495",
"text": "def new\n @ticket = Ticket.new(sprint: Sprint.current!)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "8ef24f25ba3660ab74510d3fc431c0cc",
"score": "0.65142405",
"text": "def index\n @tickets = Ticket.all\n render_default_format(@ticket, true)\n end",
"title": ""
},
{
"docid": "af1d250e82f588fc1d5be8afc148df47",
"score": "0.6509762",
"text": "def show\n @ticket = Ticket.find(params[:id])\n @help_text = \"\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "2b523b911dd44101958883a565f539ab",
"score": "0.64759195",
"text": "def show\n @ticket_owner = TicketOwner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket_owner }\n end\n end",
"title": ""
},
{
"docid": "ac51011ca643a0f5a0ee4ebffca92fb2",
"score": "0.64643925",
"text": "def new\n @ticket = Ticket.new\n @event = Event.find params[:event_id]\n @tiers = @event.tiers\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "3d9bf9bdcce7e8ae80dc056491eb3abf",
"score": "0.6456677",
"text": "def ticket\n @ticket ||= @api.get_ticket['ticket']\n end",
"title": ""
},
{
"docid": "84e86b449117bf92173e085103406899",
"score": "0.644489",
"text": "def index\n @comments = Comment.paginate(:page => params[:page])\n @ticket = Ticket.find(params[:ticket_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"title": ""
},
{
"docid": "477c86bb4ffc7e19c7d7c41bc75619a6",
"score": "0.64383787",
"text": "def tickets(filters = {})\n tickets = send(:get , '/api/v1/ticket_reports/dynamic.json', filters)\n\n tickets = tickets[:body][\"groups\"].first[\"tickets\"]\n\n process_list_response( tickets , Unfuddled::Ticket)\n end",
"title": ""
},
{
"docid": "6659dc6933696935bf0cebd0657f40c5",
"score": "0.6436595",
"text": "def load_tickets(page_number)\n begin\n conn = Faraday.new\n conn.basic_auth(@credentials[:username], @credentials[:password])\n response = conn.get(\"https://jackiesun2.zendesk.com/api/v2/tickets.json?page=#{page_number}\")\n raise StandardError if response.status.to_i >= 400 \n @zendesk_tickets = JSON.parse(response.body, symbolize_names: true)\n rescue \n puts \"This path is incorrect, please check again\"\n exit\n end \n end",
"title": ""
},
{
"docid": "708b460031da1306a3f8f8f8c811d7aa",
"score": "0.6432851",
"text": "def get_trucker_tickets\n @tickets = Ticket.find_all_by_job_id_and_paid_to_trucker(params[:id], false, :order => \"number\")\n render \"get_tickets.html.erb\"\n end",
"title": ""
},
{
"docid": "043efbd2589fd2a44267b55fd8c506ee",
"score": "0.64296776",
"text": "def new\n @ticket = Ticket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "043efbd2589fd2a44267b55fd8c506ee",
"score": "0.64296776",
"text": "def new\n @ticket = Ticket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "043efbd2589fd2a44267b55fd8c506ee",
"score": "0.64296776",
"text": "def new\n @ticket = Ticket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "043efbd2589fd2a44267b55fd8c506ee",
"score": "0.64296776",
"text": "def new\n @ticket = Ticket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "4921e90a76e4b01dc0d3e92ddc15e50b",
"score": "0.6423045",
"text": "def show\n ticket = Ticket.find(params[:address])\n\n render json: {\n address: ticket.address,\n salt: ticket.salt,\n status: ticket.status,\n event: ticket.event.name,\n event_id: ticket.event_id,\n }\n end",
"title": ""
},
{
"docid": "eea72c36ea3564c9f5048cc8aaf9e4b2",
"score": "0.6416854",
"text": "def tickets\n Ticket.find_all_by_project_id_and_milestone_id(project_id, id)\n end",
"title": ""
},
{
"docid": "2004302e06925ee0a5ac1f89b7298202",
"score": "0.64116496",
"text": "def index\n @ticketings = Ticketing.all\n end",
"title": ""
},
{
"docid": "2e306b62fad556cd45fc9f17156f550a",
"score": "0.64114094",
"text": "def index\n @ticket_codes = TicketCode.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ticket_codes }\n end\n end",
"title": ""
},
{
"docid": "76a878735445eaba253219a657ac08d6",
"score": "0.64014053",
"text": "def index\n if params[:event_id]\n @tickets = Ticket.find_all_by_event_id(params[:event_id])\n else\n @tickets = Ticket.find(:all)\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tickets }\n end\n end",
"title": ""
},
{
"docid": "07d9e7ea77cc5f66a878a14480b871de",
"score": "0.63879246",
"text": "def total_tickets\n respond_with json_response('total_tickets', Ticket.count)\n end",
"title": ""
},
{
"docid": "1fb94813b38ae5d324fe997d7c47dfbb",
"score": "0.63823366",
"text": "def show\n @tickets = Ticket.get_from_event @event\n end",
"title": ""
},
{
"docid": "56269c2bdb7926ad17b207b65cdef83f",
"score": "0.6334986",
"text": "def new\n @tickets_count = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).active.count\n @ticket = Helpdesk::Ticket.new\n @ticket.status = Helpdesk::Ticket::STATUSES[0][0]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ticket }\n end\n end",
"title": ""
},
{
"docid": "550df8717474d055fd4b906470270521",
"score": "0.63316983",
"text": "def show\n @ticket = Ticket.find(params[:id])\n end",
"title": ""
},
{
"docid": "7dca15b0d42070dd142bd5ecd40990da",
"score": "0.6299465",
"text": "def find(id)\n info(\"https://jrcodn.zendesk.com/api/v2/tickets/#{id}\")[:ticket]\n rescue\n @view.id_error\n end",
"title": ""
},
{
"docid": "90d92c40cf8da423392a35bd0e5017bb",
"score": "0.6271112",
"text": "def show\n @ticket = Ticket.find(params[:id].to_i) rescue nil\n respond_to do |format|\n unless @ticket.blank?\n format.xml { render :xml => ticket_presenter }\n format.json { render :json => ticket_presenter }\n else\n format.xml { head :not_found }\n format.json { head :not_found }\n end\n end\n end",
"title": ""
},
{
"docid": "42d86a31178b2bca4279ecb488569770",
"score": "0.62639266",
"text": "def all_ticket_entries\n @ac = ApplicationController.new\n @tickets = Ticket.find(:all, :order => \"created_at\")[0..5000].reverse!\n @species = Specie.all\n @woodtypes = WoodType.all\n end",
"title": ""
},
{
"docid": "9003c04d429c835285f6f2e6e88fee96",
"score": "0.6263105",
"text": "def get_logger_tickets\n @tickets = Ticket.find_all_by_job_id_and_paid_to_logger(params[:id], false, :order => \"number\")\n render \"get_tickets.html.erb\"\n end",
"title": ""
},
{
"docid": "142b8222e4f087862d11ac03539966c0",
"score": "0.62624973",
"text": "def show\n @ticket = Ticket.find(params[:id])\n \n end",
"title": ""
},
{
"docid": "2ffdb2b67b1552edb52b1e4605bebb80",
"score": "0.6251863",
"text": "def get_hfi_tickets\n @tickets = Ticket.find_all_by_job_id_and_paid_to_hfi(params[:id], false, :order => \"number\")\n render \"get_tickets.html.erb\"\n end",
"title": ""
},
{
"docid": "b59de59a381d4198fab371c2a6f9da08",
"score": "0.62461483",
"text": "def index\n @tickets = Ticket.order(id: :desc).all\n end",
"title": ""
},
{
"docid": "7ca5b716f4b94b00dd88d0ecea52be95",
"score": "0.6225275",
"text": "def show\n @ticket_code = TicketCode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket_code }\n end\n end",
"title": ""
},
{
"docid": "d8ca803accf900176bbd77bc18f5ca98",
"score": "0.6221005",
"text": "def index\n if params[:status] \n status = params[:status].to_sym\n if Status.statuses.has_key? status\n status_id = Status.statuses[status] \n @tickets = Ticket.where(status_id: status_id)\n end\n elsif params[:search]\n search = Ticket.search{fulltext params[:search]}\n @tickets = search.results\n else\n @tickets = Ticket.all\n end\n end",
"title": ""
},
{
"docid": "cb1c108f277ea86e37641993a32caec9",
"score": "0.62141854",
"text": "def index\n respond_to do |format|\n format.json { render json: Api::V1::Datatables::TicketsDatatable.new(self.view_context) }\n end\n end",
"title": ""
},
{
"docid": "9fb860b31447ae5682c6a6743fc818ee",
"score": "0.62006205",
"text": "def index\n @ticket_items = TicketItem.all\n end",
"title": ""
},
{
"docid": "0db6ddc6eb344571462f998ce1751a5a",
"score": "0.6199752",
"text": "def index\n @tickets = Ticket.all\n @result = []\n @tickets.each do |ticket|\n @obj = {\n id: ticket.id,\n title: ticket.title,\n body: ticket.body,\n statu_id: ticket.statu_id,\n user_id: ticket.user_id,\n active: ticket.active,\n image: ticket.image.attached? ? url_for(ticket.image) : nil,\n media: ticket.image.attached? ? url_for(ticket.image) : nil,\n created_at: ticket.created_at,\n updated_at: ticket.updated_at\n }\n @result << @obj\n end\n render json: @result\n end",
"title": ""
},
{
"docid": "84577fd27748eef3601c2158ee8ef1ba",
"score": "0.61882377",
"text": "def show\n if @ticket\n if ProjectUser.verify_role(current_user.id, @ticket.project_id, 'client')\n render json: Ticket.build_ticket_object(@ticket, current_user.id), status: 200\n else\n render json: { error: 'You must be a member of a project to see its content' }, status: :unauthorized\n end\n else\n render json: { error: \"no ticket found with id of #{params[:project_id]}\" }, status: 404\n end\n end",
"title": ""
},
{
"docid": "161c49ee1da847c7c82e442c79a994b1",
"score": "0.6185131",
"text": "def tickets()\n sql = \"SELECT * FROM tickets where customer_id = $1\"\n values = [@id]\n ticket_data = SqlRunner.run(sql, values)\n return ticket_data.map{|ticket| Ticket.new(ticket)}\n end",
"title": ""
},
{
"docid": "e90749155b90fe79d831161f82c1b803",
"score": "0.6182493",
"text": "def index\n if @project\n if ProjectUser.verify_role(current_user.id, @project, 'client')\n @tickets = Ticket.all_for_project(@project)\n render json: @tickets, status: 200\n else\n render json: { error: 'You must be a member of a project to see its content' }, status: :unauthorized\n end\n else\n render json: { error: \"no project found with id of #{params[:project_id]}\" }, status: 404\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "b44e36739422ea3cbad563038ecd8ca2",
"score": "0.0",
"text": "def program_roster_params\n params.require(:program_roster).permit(:program_schedule_id, :customer_id)\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6980957",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6783065",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6747844",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.6741468",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.67356336",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6592548",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.65036845",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.64978707",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.64825076",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64795035",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.64560914",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.64397955",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.6379666",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.6376688",
"text": "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",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.6366702",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.6319728",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.6300833",
"text": "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",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.6300629",
"text": "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",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6294277",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.6293905",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6291174",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62905735",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6283171",
"text": "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",
"title": ""
},
{
"docid": "1dfca9e0e667b83a9e2312940f7dc40c",
"score": "0.6242344",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62403613",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6218049",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.62143815",
"text": "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",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.62104696",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.61949855",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6178671",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6176147",
"text": "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",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.6173327",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "9d589006a5ea3bb58e5649f404ab60fb",
"score": "0.6163395",
"text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6153005",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.6151833",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.6147288",
"text": "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",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.61224324",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6118827",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.61075264",
"text": "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",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.61054534",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6092497",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6080082",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.60710967",
"text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60627776",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.60219413",
"text": "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",
"title": ""
},
{
"docid": "5eaf08f3ad47cc781c4c1a5453555b9c",
"score": "0.60175914",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.60153484",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.60107356",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60081726",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60081726",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "74c092f6d50c271d51256cf52450605f",
"score": "0.60013986",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.6000165",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59978646",
"text": "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",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.59936947",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.59925723",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.5992084",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.59796256",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.5967569",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.5960056",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.59589803",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5958441",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5958401",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.5952607",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5952406",
"text": "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",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.5944409",
"text": "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",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.59391016",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.593842",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.593842",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.5933845",
"text": "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",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.59312123",
"text": "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",
"title": ""
},
{
"docid": "d9483565c400cd4cb1096081599a7afc",
"score": "0.5926475",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.59248453",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59179676",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59109294",
"text": "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",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.59101623",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.5908172",
"text": "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",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.59058356",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.5899052",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.5897749",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.5896101",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.58942914",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.58939576",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5892063",
"text": "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",
"title": ""
},
{
"docid": "b85a12ab41643078cb8da859e342acd5",
"score": "0.5887407",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.588292",
"text": "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",
"title": ""
},
{
"docid": "abca6170eec412a7337563085a3a4af2",
"score": "0.58797663",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.587367",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.58681566",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.5868038",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5866578",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.58665025",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.58655846",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.58640826",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.5863465",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.5862226",
"text": "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",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.586065",
"text": "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",
"title": ""
},
{
"docid": "46cb58d8f18fe71db8662f81ed404ed8",
"score": "0.58581287",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.5854443",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5854172",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.58507544",
"text": "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",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.5849934",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
1e68b23fe47d22f97080639c85e6796f
|
Adds package/packages into group which will be picked up.
|
[
{
"docid": "ed3da05a39173b407a26c23748b14169",
"score": "0.0",
"text": "def add(transporter, data)\n endpoint_url = \"#{@api_url}/#{transporter}/add\"\n body = data\n RequestMaker.new(@api_user, @api_secret).send_post_request(endpoint_url, body)\n end",
"title": ""
}
] |
[
{
"docid": "4a54c497c123deec82953b7247690136",
"score": "0.6851714",
"text": "def add(package)\n @packages << package\n end",
"title": ""
},
{
"docid": "f2faf1261e6387ab72f5c77a239abbb4",
"score": "0.65984446",
"text": "def _add_to_group(group, gems_code)\n # convert group to string formatted like `:development, :test`\n group_top = Array(group).join(\", \").gsub(/\\b(?=\\w)/, \":\")\n # find top of block under `group .. do` and `end`\n pattern = \"group #{group_top} do\\n\"\n\n # add padding to text\n gems_code.gsub!(/^/, \" \")\n\n cli.insert_into_file(gemfile, gems_code, after: pattern)\n end",
"title": ""
},
{
"docid": "0070647113dde325f6a3c24210713a85",
"score": "0.6524443",
"text": "def add_group(group)\n groups << group\n end",
"title": ""
},
{
"docid": "b10b549287773697e1d6aa0e1479dc08",
"score": "0.63371533",
"text": "def add_to_gem_group(*names, &block)\n name = names.map(&:inspect).join(', ')\n @gem_groups_buffer ||= {}\n @gem_groups_buffer[name] ||= []\n @gem_groups_buffer[name] << block\nend",
"title": ""
},
{
"docid": "af4195996195646463b288d8008e5dc4",
"score": "0.63199425",
"text": "def gem_group(*names, &block); end",
"title": ""
},
{
"docid": "3ccf8785bca3a2e3c10ef465d69c27f6",
"score": "0.628387",
"text": "def gem_group(*names, &block)\n name = names.map(&:inspect).join(\", \")\n log :gemfile, \"group #{name}\"\n\n in_root do\n append_file \"Gemfile\", \"\\ngroup #{name} do\", :force => true\n\n @in_group = true\n instance_eval(&block)\n @in_group = false\n\n append_file \"Gemfile\", \"\\nend\\n\", :force => true\n end\n end",
"title": ""
},
{
"docid": "4dee6a2ac6609df26c90a925d55683e5",
"score": "0.628068",
"text": "def addApplication(app)\n super(app)\n groups.each { |g|\n # inform all enclosed groups, but do not request another install\n g.addApplication(app)\n }\n end",
"title": ""
},
{
"docid": "6d9799f441f21557873ea5f9d17f0f98",
"score": "0.62201804",
"text": "def add_group(group)\n @groups << group\n group.is_parented = true\n group.init\n end",
"title": ""
},
{
"docid": "f9f0b299535d835aeada311bb4ae79ae",
"score": "0.62151223",
"text": "def groupadd(group, options={})\n via = options.delete(:via) || run_method\n invoke_command \"grep '#{group}:' /etc/group || #{sudo} /usr/sbin/groupadd #{group}\", :via => via\n end",
"title": ""
},
{
"docid": "fb64702a9c7835f7b196ac17c22bc220",
"score": "0.6208823",
"text": "def add_packages(packages)\n packages.each { |package| self.add_package(package) }\n end",
"title": ""
},
{
"docid": "3ca4537635ed90a2eb2ec8faf35933b1",
"score": "0.61990964",
"text": "def install\n execute([command(:cmd), \"-y\", \"groupinstall\", @resource[:name]])\n end",
"title": ""
},
{
"docid": "54737da433629db4594116998a3c46f9",
"score": "0.6168769",
"text": "def inherited(package)\n (@@packages ||= []) << package\n end",
"title": ""
},
{
"docid": "4a0b2f2a12ab547c0ac73705d0c008e4",
"score": "0.6162288",
"text": "def add_group(group)\n @groups << group\n end",
"title": ""
},
{
"docid": "191d5f0f97699625e0fc8bb3649fcf83",
"score": "0.61359394",
"text": "def register_package_set(pkg_set)\n metapackage(pkg_set.name)\n metapackage(\"#{pkg_set.name}.all\")\n @package_sets << pkg_set\n end",
"title": ""
},
{
"docid": "8d8e95442fa6aef98db86ceed54ad243",
"score": "0.61357224",
"text": "def add(package)\n\t\t# package could be a ConstraintPackage, or it could just be a raw Constraint\n\t\t# (the latter case is an optimization, not a \"normal\" thing)\n\t\t@list << package\n\tend",
"title": ""
},
{
"docid": "466ea84967802f4dfdb63a150d0a970e",
"score": "0.6132131",
"text": "def add(group)\r\n @groupList.push(group)\r\n end",
"title": ""
},
{
"docid": "11b8140fe9dd3719ff4fc2489b2fcb15",
"score": "0.6120539",
"text": "def _add_to_default(gems_code)\n # starting the the top with \"source\", find the very last line\n # in the default group, before the gem \"group\"\n pattern = /(?:source).+?(?=\\ngroup)/m\n\n cli.insert_into_file(gemfile, gems_code, after: pattern)\n end",
"title": ""
},
{
"docid": "b185f49a07037093912f0bab55918080",
"score": "0.6117579",
"text": "def add_to_group(group)\n group.members << self\n @parent = group\n end",
"title": ""
},
{
"docid": "b185f49a07037093912f0bab55918080",
"score": "0.6117579",
"text": "def add_to_group(group)\n group.members << self\n @parent = group\n end",
"title": ""
},
{
"docid": "73686fb874ef8a09ac757e748091ce9c",
"score": "0.6112062",
"text": "def add_group(info)\r\n\t\t## TBI\r\n\tend",
"title": ""
},
{
"docid": "5a26e593d9c0dd0aab302d345049e6d9",
"score": "0.6094745",
"text": "def add_to_omni_group\n groups << Group.find_by_name('_omni')\n end",
"title": ""
},
{
"docid": "be414a35f406c039e6bcfc1b4ea15344",
"score": "0.60933936",
"text": "def find_new_packages()\n Avalon::Batch::Package.locate(@base_directory, @collection)\n end",
"title": ""
},
{
"docid": "95a589babb666637dc7870cca80f8170",
"score": "0.60921246",
"text": "def update_gemfile\n in_root do\n first_group = true\n @gem_groups_buffer.sort.each do |group, blocks|\n log :gemfile, \"group #{group}\"\n if first_group\n append_file 'Gemfile', \"\\n\", force: true\n first_group = false\n end\n append_file 'Gemfile', \"\\ngroup #{group} do\", force: true\n @in_group = true\n blocks.each { |block| instance_eval(&block) }\n @in_group = false\n append_file 'Gemfile', \"\\nend\\n\", force: true\n end\n end\nend",
"title": ""
},
{
"docid": "ffc192dac67a09d22ef6918ff9e7e2f4",
"score": "0.60549045",
"text": "def add_to_descendants\n parent_project.descendants.each do |project|\n project.project_groups << self\n end\n end",
"title": ""
},
{
"docid": "4b6df76310fc3b708e8791122dd1149a",
"score": "0.60399306",
"text": "def gem_group(*names, &block)\n options = names.extract_options!\n str = names.map(&:inspect)\n str << quote(options) unless options.empty?\n str = str.join(\", \")\n log :gemfile, \"group #{str}\"\n\n in_root do\n append_file_with_newline \"Gemfile\", \"\\ngroup #{str} do\", force: true\n with_indentation(&block)\n append_file_with_newline \"Gemfile\", \"end\", force: true\n end\n end",
"title": ""
},
{
"docid": "813635513509921d6a385c7f4063c734",
"score": "0.60250384",
"text": "def package_add\n load_content_package(Package.add(params))\n end",
"title": ""
},
{
"docid": "73ea92c6fd23a6c2a8805f3504523c33",
"score": "0.60186917",
"text": "def top!\n\t\t\t@packages << @package\n\t\tend",
"title": ""
},
{
"docid": "4eaae378d1a59edf87dc11d5d40ab4b4",
"score": "0.59934855",
"text": "def package(name, *args, &block)\n packages << Package.new(name, root, *args, &block)\n end",
"title": ""
},
{
"docid": "7bfe8adc2fdfa09ff8611e998605a76c",
"score": "0.59864515",
"text": "def add_file_to_group(name, guid, group)\n\t\t#project_data = self.get_project_data()\n\n\t\t#match = re.search('\\/\\* '+re.escape(group)+' \\*\\/ = \\{\\n[ \\t]+isa = PBXGroup;\\n[ \\t]+children = \\(\\n((?:.|\\n)+?)\\);', project_data)\n\t\t#if not match:\n\t\t\t@@logger.error(\"Couldn't find the \"+group+\" children.\")\n\t\t#\treturn False\n\n\t\t#(children,) = match.groups()\n\t\t#match = re.search(re.escape(guid), children)\n\t\t#if match:\n\t\t\t@@logger.info(\"This file is already a member of the \"+name+\" group.\")\n\t\t#else:\n\t\t#\tmatch = re.search('\\/\\* '+re.escape(group)+' \\*\\/ = \\{\\n[ \\t]+isa = PBXGroup;\\n[ \\t]+children = \\(\\n', project_data)\n\n\t\t#\tif not match:\n\t\t\t\t@@logger.error(\"Couldn't find the \"+group+\" group.\")\n\t\t#\t\treturn False\n\n\t\t#\tpbxgroup = \"\\t\\t\\t\\t\"+guid+\" /* \"+name+\" */,\\n\"\n\t\t#\tproject_data = project_data[:match.end()] + pbxgroup + project_data[match.end():]\n\n\t\t#self.set_project_data(project_data)\n\n\t\t#return True\n end",
"title": ""
},
{
"docid": "7e6eb03e2ce21606f7c228df83f8f65b",
"score": "0.5973942",
"text": "def add_packages(label,packages)\n base.default_call(\"#{API_NS}.addPackages\",label,packages)\n end",
"title": ""
},
{
"docid": "04e8e48f31a5398eca0b3cdbc5d57027",
"score": "0.5960903",
"text": "def add_package package\n appliance_basesystem = appliance.basesystem\n result = appliance.search_software(package)#.find{|s| s.name == package }\n #TODO: better handling\n #Blocked by bnc#\n if result.empty? #it is not found in available repos\n puts \"'#{package}' has not been found in the repositories currently \"\\\n \"added to your appliance.\"\n keep_trying = @shell.yes?('Would you like to search for this package '\\\n 'inside other repositories? (y/n)')\n if keep_trying\n matches = appliance.search_software(package, :all_repos => true)\\\n .find_all { |s| s.name == package }\n repositories = matches.map do |r|\n StudioApi::Repository.find r.repository_id\n end.find_all{|r| r.base_system == appliance_basesystem}\n\n if repositories.empty?\n puts \"Cannot find #{package}, please look at this page: \"\n puts URI.encode \"http://software.opensuse.org/search?p=1&\"\\\n \"baseproject=ALL&q=#{package}\"\n else\n puts \"Package #{package} can be installed from one of the \"\\\n \"following repositories:\"\n repositories.each_with_index do |repo, index|\n puts \"#{index+1} - #{repo.name} (#{repo.base_url})\"\n end\n puts \"#{repositories.size+1} - None of them.\"\n begin\n choice = @shell.ask(\"Which repo do you want to use? \"\\\n \"[1-#{repositories.size+1}]\")\n end while (choice.to_i > (repositories.size+1) || choice.to_i < 1)\n if (choice.to_i == (repositories.size+1))\n abort(\"Package not added.\")\n else\n repo_id = repositories[choice.to_i-1].id\n end\n appliance.add_repository repo_id\n end\n else\n exit 0\n end\n # add repo which contain samba\n #appliance.add_repository result.repository_id\n end\n Utils::execute_printing_progress \"Adding #{package} package\" do\n appliance.add_package(package)\n end\n end",
"title": ""
},
{
"docid": "f21af12c2405805c92c93518386262b5",
"score": "0.5948225",
"text": "def add_groups_to_descendants!\n descendants.each do |project|\n project.project_groups << child_groups\n end\n end",
"title": ""
},
{
"docid": "d80e4eae1e0efbaf3fa1180aff5d7162",
"score": "0.59348214",
"text": "def addFilesToGroup(project, aTarget, aGroup)\n Dir.foreach(aGroup.real_path) do |entry|\n filePath = File.join(aGroup.real_path, entry)\n # 过滤目录和.DS_Store文件\n if !File.directory?(filePath) && entry != \".DS_Store\" then\n # 向group中增加文件引用\n fileReference = aGroup.new_reference(filePath)\n # 如果不是头文件则继续增加到Build Phase中,PB文件需要加编译标志\n if filePath.to_s.end_with?(\"pbobjc.m\", \"pbobjc.mm\") then\n aTarget.add_file_references([fileReference], '-fno-objc-arc')\n elsif filePath.to_s.end_with?(\".m\", \".mm\", \".cpp\") then\n aTarget.source_build_phase.add_file_reference(fileReference, true)\n elsif filePath.to_s.end_with?(\".plist\") then\n aTarget.resources_build_phase.add_file_reference(fileReference, true)\n end\n # 目录情况下, 递归添加\n elsif File.directory?(filePath) && entry != '.' && entry != '..' then\n hierarchy_path = aGroup.hierarchy_path[1, aGroup.hierarchy_path.length]\n subGroup = project.main_group.find_subpath(hierarchy_path + '/' + entry, true)\n subGroup.set_source_tree('<group>')\n subGroup.set_path(aGroup.real_path + entry)\n addFilesToGroup(project, aTarget, subGroup)\n end\n end\nend",
"title": ""
},
{
"docid": "7a10a29f8a9eabe7ce7c7fa6f28c4106",
"score": "0.5929997",
"text": "def add_dependencies groups, dependencies # :nodoc:\n return unless (groups & @without_groups).empty?\n\n dependencies.each do |dep|\n @set.gem dep.name, *dep.requirement\n end\n end",
"title": ""
},
{
"docid": "6f19ebaaed0b4c192ca78a3c6015d861",
"score": "0.58937025",
"text": "def append_package_install(package)\n begin\n # Try to find the package, unless we have a package instance\n package = Package.find(package) unless package.class == Package\n rescue\n raise ComputerException.new(\"Malformed argument passed to append_package_install method\")\n end\n its = self.install_items\n # Remove install items referring to the same package branch as \"package\"\n its = its.map do |it|\n it unless it.package_branch.id == package.package_branch.id\n end\n its = its.compact\n its << self.install_items.build({:package_id => package.id, :package_branch_id => package.package_branch.id})\n self.install_items = its\n end",
"title": ""
},
{
"docid": "c6a83b214f7dc93bb4e834e36de4c8b0",
"score": "0.5888146",
"text": "def assign_groups(gem_ref, seen)\n gem_ref.dependencies.each do |dep|\n next if seen.include?(dep)\n next unless gems[dep]\n gem_ref.groups.each { |group| gems[dep].groups << group }\n assign_groups(gems[dep], seen + [dep])\n end\n end",
"title": ""
},
{
"docid": "863ef80a3b99f35951d2fb2c7cb3c869",
"score": "0.5883719",
"text": "def add(item)\n @groups << item\n self\n end",
"title": ""
},
{
"docid": "d4b9e91cd78dcff217d963be71936f95",
"score": "0.5878809",
"text": "def gem_group name, options # :nodoc:\n g = options.delete :group\n all_groups = g ? Array(g) : []\n\n groups = options.delete :groups\n all_groups |= groups if groups\n\n all_groups |= @current_groups if @current_groups\n\n all_groups\n end",
"title": ""
},
{
"docid": "d941e1f72059a73449c73928c9c164f8",
"score": "0.5868056",
"text": "def add_to_group(group)\n expects group, Adauth::AdObjects::Group\n group.modify([[:add, :member, @ldap_object.dn]])\n end",
"title": ""
},
{
"docid": "e7d307cc9ee71754117acd5f68498189",
"score": "0.58524007",
"text": "def add_group!( group )\n save if add_group( group )\n end",
"title": ""
},
{
"docid": "6f44cb3f9e1a10744c09ced4bca99adb",
"score": "0.5848349",
"text": "def append_package_installs(packages)\n packages.map {|package| self.append_package_branch_install(package) }\n end",
"title": ""
},
{
"docid": "0def07c90dbfa93b235434168c7f4244",
"score": "0.5844674",
"text": "def add_to_project(to_add)\n to_add.each do |entry|\n path = entry.path\n root_group = find_group_containing(path)\n\n # Find or create the group to contain the path.\n dir_rel_path = path.relative_path_from(root_group.real_path).dirname\n group = root_group.find_subpath(dir_rel_path.to_s, true)\n\n file_ref = group.new_file(path.to_s)\n ext = path.extname\n\n entry.ref = file_ref\n end\n end",
"title": ""
},
{
"docid": "213105f396f8582e7222733a7b58d5a0",
"score": "0.58420277",
"text": "def add_to_group(link, group_name = nil)\n add_to = root\n add_to = group_name.split('.').inject(root) { |group, name| group.send(name) } if group_name\n add_to << link unless link.nil?\n end",
"title": ""
},
{
"docid": "b4ed48feb3d1f08a8c598e986398c12b",
"score": "0.58199066",
"text": "def app_to_group(name)\n @name_array.push(name)\n end",
"title": ""
},
{
"docid": "7ccbd9bca84468b2b2d0cda3f770ebbb",
"score": "0.5813827",
"text": "def add_to_group(link, group = nil)\n add_to = root\n add_to = group.split('.').inject(root){|group, group_name| group.send(group_name)} if group\n add_to << link unless link.nil?\n end",
"title": ""
},
{
"docid": "c5b880f37bb8490ea65fa661d8b73c4a",
"score": "0.5802337",
"text": "def add_missing_groups_and_files!(dry_run: false)\n missing_groups = self.find_missing_groups.to_set\n unless missing_groups.length > 0\n UI.verbose(\"No missing groups found, so we don't need to worry about adding new groups\")\n return false\n end\n\n # well, we know we have some changes to make, so if this is a dry run,\n # don't bother doing anything and just return true\n return true if dry_run\n\n missing_groups.each do |missing_group_name|\n new_group = @root_group.new_group(missing_group_name)\n\n # find every file in the manifest that belongs to the new group, and add it to the new group\n self.manifest_hash.each do |filename, group|\n next unless group.casecmp(missing_group_name.downcase).zero?\n # assumes this is a new file, we don't handle moving files between groups\n new_file_reference = new_group.new_file(\"#{RELATIVE_SOURCE_FILE_PATH}#{filename}\")\n\n # add references to the target, and make sure they are added to the build phase to\n self.fastlane_runner_target.source_build_phase.add_file_reference(new_file_reference)\n end\n end\n\n return true # yup, we definitely updated groups\n end",
"title": ""
},
{
"docid": "396e64efd98888ce7d613ca6eb020222",
"score": "0.57875055",
"text": "def configure_group(group); end",
"title": ""
},
{
"docid": "5575699056eb49937279f33860e2cf47",
"score": "0.5766269",
"text": "def merge_package_files(opts={})\n\n # initial settings\n opts[:previous_package_file] ||= previous_package_file\n opts[:new_packages] ||= @opts[:packages].collect{|p| p.to_h}.sort{|a,b| a['Package'] <=> b['Package'] }\n opts[:new_package_file] ||= \"\"\n\n # if we are at the end of both the old package list and the new set of packages then finish\n return opts[:new_package_file] \\\n if opts[:previous_package_file].strip.empty? \\\n and opts[:new_packages].empty? \n\n # if we don't have any new packages to add then return the current list with the old appended\n return (opts[:new_package_file] << opts[:previous_package_file]) \\\n if opts[:new_packages].empty?\n \n # parse next package stub\n stub, stub_end, next_package = parse_package_stub(opts[:previous_package_file])\n\n # if we don't have and more old packages to add then return the\n # current list with the new appended\n return (opts[:new_package_file] << opts[:new_packages].collect{|p| FRM::Package.hash_to_stub(p)}.join(\"\\n\")) if stub.nil?\n\n # compare the next previous existing pacakge to the next new package\n case next_package <=> opts[:new_packages].first['Package']\n when -1 \n opts[:new_package_file] << stub\n opts[:previous_package_file].slice!(0..stub_end)\n when 1\n opts[:new_package_file] << FRM::Package.hash_to_stub(opts[:new_packages].shift) \n when 0\n # both packages have the same name\n STDERR.puts \"I see two version of this pakcage: #{next_package}\"\n previous_version_line = stub[/^Version: .*$/]\n raise \"could not get version from package stub: \\n#{stub}\" if previous_version_line.nil?\n\n previous_version_raw = previous_version_line.sub('Version: ','').strip\n raise \"could not get version from package stub: \\n#{stub}\" if previous_version_raw.empty?\n previous_version = Gem::Version.new(previous_version_raw)\n\n newer_version_raw = opts[:new_packages].first['Version']\n newer_version = Gem::Version.new(newer_version_raw)\n\n raise \"previous version #{previous_version_raw} is equal to #{newer_version_raw}. Exiting...\" \\\n if previous_version == newer_version\n\n raise \"previous version #{previous_version_raw} is newer than #{newer_version_raw}. Exiting...\" \\\n if previous_version > newer_version\n \n opts[:new_package_file] << FRM::Package.hash_to_stub(opts[:new_packages].shift)\n opts[:previous_package_file].slice!(0..stub_end)\n end\n\n return merge_package_files(opts)\n end",
"title": ""
},
{
"docid": "98e9aa260918a768ec7cc3b35984f02d",
"score": "0.57592505",
"text": "def add_package(package)\n return false unless package.respond_to?(:unwrap)\n package.unwrap.each do |item|\n add_system(item) if item.kind_of?(Peregrine::System)\n add_entity(item) if item.kind_of?(Peregrine::Entity)\n end\n true\n end",
"title": ""
},
{
"docid": "cc6b32ae07ba2315605894d901a52cf8",
"score": "0.5729927",
"text": "def join_group(group)\n groups << group\n end",
"title": ""
},
{
"docid": "f540083e8fd14d404cb8673da0f37f52",
"score": "0.5725544",
"text": "def add_packages(xml)\n package_count = @packages.size\n xml.PackageCount package_count\n @packages.each do |package|\n xml.RequestedPackageLineItems{\n xml.GroupPackageCount 1\n xml.Weight{\n xml.Units package[:weight][:units]\n xml.Value package[:weight][:value]\n }\n if package[:dimensions]\n xml.Dimensions{\n xml.Length package[:dimensions][:length]\n xml.Width package[:dimensions][:width]\n xml.Height package[:dimensions][:height]\n xml.Units package[:dimensions][:units]\n }\n end\n add_customer_references(xml, package)\n if package[:special_services_requested] && package[:special_services_requested][:special_service_types]\n xml.SpecialServicesRequested{\n if package[:special_services_requested][:special_service_types].is_a? Array\n package[:special_services_requested][:special_service_types].each do |type|\n xml.SpecialServiceTypes type\n end\n else\n xml.SpecialServiceTypes package[:special_services_requested][:special_service_types]\n end\n # Handle COD Options\n if package[:special_services_requested][:cod_detail]\n xml.CodDetail{\n xml.CodCollectionAmount{\n xml.Currency package[:special_services_requested][:cod_detail][:cod_collection_amount][:currency]\n xml.Amount package[:special_services_requested][:cod_detail][:cod_collection_amount][:amount]\n }\n if package[:special_services_requested][:cod_detail][:add_transportation_charges]\n xml.AddTransportationCharges package[:special_services_requested][:cod_detail][:add_transportation_charges]\n end\n xml.CollectionType package[:special_services_requested][:cod_detail][:collection_type]\n xml.CodRecipient {\n add_shipper(xml)\n }\n if package[:special_services_requested][:cod_detail][:reference_indicator]\n xml.ReferenceIndicator package[:special_services_requested][:cod_detail][:reference_indicator]\n end\n }\n end\n # DangerousGoodsDetail goes here\n if package[:special_services_requested][:dry_ice_weight]\n xml.DryIceWeight{\n xml.Units package[:special_services_requested][:dry_ice_weight][:units]\n xml.Value package[:special_services_requested][:dry_ice_weight][:value]\n }\n end\n if package[:special_services_requested][:signature_option_detail]\n xml.SignatureOptionDetail{\n xml.OptionType package[:special_services_requested][:signature_option_detail][:signature_option_type]\n }\n end\n if package[:special_services_requested][:priority_alert_detail]\n xml.PriorityAlertDetail package[:special_services_requested][:priority_alert_detail]\n end\n }\n end\n }\n end\n end",
"title": ""
},
{
"docid": "0820ba6543a9508057c16d8955d755e4",
"score": "0.5698041",
"text": "def add_to_group(group_name)\n @ldap.add_to_group(self.uid, group_name)\n end",
"title": ""
},
{
"docid": "09864aff1eb0b6f4fe56a981c7804c44",
"score": "0.5677893",
"text": "def _add_group(e)\n # e.name should be group\n Msg.give_up('No group in cdb') unless e.name == 'group'\n gid = e.attr2item(@grps)\n ___add_member(e, gid)\n end",
"title": ""
},
{
"docid": "559be9ee6609553a198aed760bdeef28",
"score": "0.5669458",
"text": "def packages\n\t\treturn @all_packages unless @all_packages.nil?\n\t\t@all_packages = Array.new\n\n\t\tadd_package(@packages)\n\t\t\n\t\t@all_packages.sort!\n\t\t@all_packages\n\tend",
"title": ""
},
{
"docid": "4a2645a0d39e9d5cb1d0fc01dad200ed",
"score": "0.56550854",
"text": "def add_pkg_to_fs(package=@pkg)\n FileUtils.mkpath(package['install_path'])\n source = package['pkg_source_path']\n basename = Pathname.new(package['pkg_source_path']).basename\n dest = package['install_path']\n FileUtils.mv(source, \"#{dest}/#{basename}\")\n package['pkg_source_path'] = \"#{dest}/#{basename}\"\n extract(package)\n end",
"title": ""
},
{
"docid": "7795babbc683d9edcc93e5ee3ec03c5a",
"score": "0.56459844",
"text": "def yum_groupinstall(transport, groups)\n grouplist = groups.map{ |g| \"\\\"#{g}\\\"\" }.join(' ')\n transport.exec(\"yum groupinstall #{quiet} -y #{grouplist}\", sudo: true)\n end",
"title": ""
},
{
"docid": "4c386bee33178d435847788be8911c40",
"score": "0.56425536",
"text": "def add_group(name, options = {})\n unless group = group(name)\n group = ::Guard::Group.new(name, options)\n @groups << group\n end\n\n group\n end",
"title": ""
},
{
"docid": "98915cf47860d1508507366f7d2c803c",
"score": "0.5632193",
"text": "def add_gems(gems_code, group: nil)\n check_for_gemfile\n\n # ensure a newline at the end\n gems_code = gems_code.chomp << \"\\n\"\n\n if group\n _add_to_group(group, gems_code)\n else\n _add_to_default(gems_code)\n end\n end",
"title": ""
},
{
"docid": "3673a53225d244231d76384c87a1096b",
"score": "0.56115353",
"text": "def add_spec_group(name, parent_group)\n groups = parent_group.groups\n group = nil\n name.split('/').each do |name|\n group = groups.where(:name => name) || groups.new('name' => name)\n groups = group.groups\n end\n group\n end",
"title": ""
},
{
"docid": "fb6bed6ec93fda144321398b7fd40282",
"score": "0.56049263",
"text": "def add_group(name, options = {})\n group = groups(name)\n if group.nil?\n group = ::Guard::Group.new(name, options)\n @groups << group\n end\n group\n end",
"title": ""
},
{
"docid": "7fc57ee5c6fafab77ecb9f8d5aaa9057",
"score": "0.56009144",
"text": "def reorganize_packages(pkgs, tmp, platform_independent = false, nonfinal = false)\n new_pkgs = []\n pkgs.each do |pkg|\n if platform_independent\n path = 'pkg'\n else\n platform_tag = Pkg::Paths.tag_from_artifact_path(pkg)\n path = Pkg::Paths.artifacts_path(platform_tag, 'pkg', nonfinal)\n end\n FileUtils.mkdir_p File.join(tmp, path)\n FileUtils.cp pkg, File.join(tmp, path)\n new_pkgs << File.join(path, File.basename(pkg))\n end\n new_pkgs\n end",
"title": ""
},
{
"docid": "117a7bd56d242727d218d15834274040",
"score": "0.55994725",
"text": "def add_root_group\n @root_group = add_group(nil, \"root\")\n end",
"title": ""
},
{
"docid": "6dfdaf84fa0554b002bf8863bf40fb85",
"score": "0.5598387",
"text": "def addGroup name\n group = Modeles::Group.new :name => name\n ret = group.save\n if ret\n GroupInfos.new group\n end\n end",
"title": ""
},
{
"docid": "10e21d8fd6e3cff548303382c3dbaf60",
"score": "0.5596147",
"text": "def update_package_xml\n project_package = Nokogiri::XML(File.open(\"#{ENV['TM_PROJECT_DIRECTORY']}/src/package.xml\"))\n project_package.remove_namespaces!\n project_package.xpath(\"//types/name\").each do |node| \n if CORE_METADATA_TYPES.include?(node.text) && node.previous_element.text != \"*\"\n meta_type = get_meta_type_by_name(node.text) \n node.parent.children.each do |n|\n n.remove if n.name == \"members\"\n end\n Dir.foreach(\"#{ENV['TM_PROJECT_DIRECTORY']}/src/#{meta_type[:directory_name]}\") do |entry| \n next if entry == \".\" or entry == \"..\" or entry.include? \"-meta\"\n entry = entry.split(\".\")[0]\n node.add_previous_sibling(\"\\t\\t<members>#{entry}</members>\\n\")\n end\n node.add_previous_sibling(\"\\t\\t\")\n node.parent.children.each_with_index do |n, i|\n next if i == 0\n break if n.name != \"text\" \n n.remove\n end\n end\n end\n File.open(\"#{ENV['TM_PROJECT_DIRECTORY']}/src/package.xml\", 'w') {|f| f.write(project_package.to_xml) }\n end",
"title": ""
},
{
"docid": "69298574802725c784e55db4fc1916c0",
"score": "0.55677134",
"text": "def add_spec_group(spec_name, root_group)\n current_group = root_group\n group = nil\n spec_name.split('/').each do |name|\n group = current_group[name] || current_group.new_group(name)\n current_group = group\n end\n group\n end",
"title": ""
},
{
"docid": "3f480873d8a068a9d809acb0353f3e92",
"score": "0.5555583",
"text": "def addGroupName(group) \n group = group.to_s\n if (group[0] == ?/)\n group = group[1..-1]\n end\n debug(\"Added to group '#{group}'\")\n @groups[group] = false \n TraceState.nodeAddGroup(self, group)\n # Send an ALIAS command to this resource\n send(ECCommunicator.instance.create_message(:cmdtype => :ALIAS,\n :target => @nodeID,\n :name => group))\n # Now listen for messages on that new ALIAS address\n addr = ECCommunicator.instance.make_address(:name => group) \n ECCommunicator.instance.listen(addr)\n end",
"title": ""
},
{
"docid": "a6f158e9b74327f9dc862b75ec0baba4",
"score": "0.55527973",
"text": "def update(packages)\n OCPM.command(\"createrepo #{@path}\")\n true \n end",
"title": ""
},
{
"docid": "e48f1cfacf2f8e885f7191e4e9de18e0",
"score": "0.5544837",
"text": "def packages\n @packages ||= FileSyncer.glob(@pattern).map { |path| Package.new(path) }\n end",
"title": ""
},
{
"docid": "8ad10569a11d55399bf7a90bff2505a1",
"score": "0.55385303",
"text": "def add_feature_to_group(inventory_hash, feature_name, group_name)\n i = 0\n inventory_hash['groups'].each do |group|\n if group['name'] == group_name\n if group['features'].nil? == true\n group = group.merge('features' => [])\n end\n group['features'].push feature_name unless group['features'].include?(feature_name)\n inventory_hash['groups'][i] = group\n end\n i += 1\n end\n inventory_hash\n end",
"title": ""
},
{
"docid": "8ad10569a11d55399bf7a90bff2505a1",
"score": "0.55385303",
"text": "def add_feature_to_group(inventory_hash, feature_name, group_name)\n i = 0\n inventory_hash['groups'].each do |group|\n if group['name'] == group_name\n if group['features'].nil? == true\n group = group.merge('features' => [])\n end\n group['features'].push feature_name unless group['features'].include?(feature_name)\n inventory_hash['groups'][i] = group\n end\n i += 1\n end\n inventory_hash\n end",
"title": ""
},
{
"docid": "a66b976288152e8ba2895acd86e71c7f",
"score": "0.55364054",
"text": "def register_group(object, group = extra_state.group)\n if group\n unless object.namespace.is_a?(Proxy)\n object.namespace.groups |= [group]\n end\n object.group = group\n end\n end",
"title": ""
},
{
"docid": "17a72d379fb15cc19a0a0f1f0beb239d",
"score": "0.55310565",
"text": "def add_user_groups\n new_resource.groups.each do |userGroup|\n # Ensure the group is added to the system before adding it to the user\n add_group(userGroup)\n \n Chef::Log.debug \"Adding unix group '#{ userGroup }' for user '#{ new_resource.name }'\"\n\n execute \"add_user_group_#{ userGroup }\" do\n command \"usermod -G #{ userGroup } #{ new_resource.name }\"\n action :run\n end\n end\nend",
"title": ""
},
{
"docid": "f81d55eeab9777b0297c2c2c4c077735",
"score": "0.55197746",
"text": "def create_groups_from_dir(root_dir, parent_group, target, is_example_project = false)\n Dir.glob(root_dir).select{|d| File.directory? d}.each do |subdirectory|\n dir_name = File.basename(subdirectory)\n\n Dir.chdir(subdirectory)\n g = parent_group.new_group(dir_name)\n\n if !is_example_project\n Dir.glob(\"#{target}-Bridging-Header.h\") do |f|\n file_to_add = g.new_file(Dir.pwd + '/' + f)\n target.build_configurations.each do |bc|\n bc.build_settings['SWIFT_OBJC_BRIDGING_HEADER'] = \"#{target}/#{f}\"\n end\n end\n end\n\n Dir.glob(\"*.pch\") do |f|\n g.new_file(Dir.pwd + '/' + f)\n target.build_configurations.each do |bc|\n bc.build_settings['GCC_PREFIX_HEADER'] = \"#{target}/#{f}\"\n end\n end\n\n Dir.glob(\"Info.plist\") do |f|\n file_to_add = g.new_file(Dir.pwd + '/' + f)\n target.build_configurations.each do |bc|\n bc.build_settings['INFOPLIST_FILE'] = \"$(SRCROOT)/#{target}/#{f}\"\n end\n end\n\n Dir.glob(\"*.xcassets\") do |f|\n file_to_add = g.new_file(Dir.pwd + '/' + f)\n target.add_resources([file_to_add])\n end\n\n Dir.glob(\"*.storyboard\") do |f|\n file_to_add = g.new_file(Dir.pwd + '/' + f)\n target.add_resources([file_to_add])\n end\n\n Dir.glob(\"*.swift\") do |f|\n file_to_add = g.new_file(Dir.pwd + '/' + f)\n target.source_build_phase.add_file_reference(file_to_add, true)\n end\n\n if !is_example_project\n Dir.glob(\"*.m\") do |f|\n file_to_add = g.new_file(Dir.pwd + '/' + f)\n target.source_build_phase.add_file_reference(file_to_add, true)\n end\n Dir.glob(\"*.aiff\") do |f|\n file_to_add = g.new_file(Dir.pwd + '/' + f)\n target.source_build_phase.add_file_reference(file_to_add, true)\n end\n\n public_patterns = [\n # Core\n /UADS(.*)MetaData\\.h/,\n /UnityServices\\.h/,\n /USRVJsonStorage\\.h/,\n\n # Ads\n /UnityAdsFinishState\\.h/,\n /UnityAdsExtended\\.h/,\n /UnityAdsExtendedDelegate\\.h/,\n /UnityAdsDelegate\\.h/,\n /UnityAdsError\\.h/,\n /UnityAdsPlacementState\\.h/,\n\n # Banners\n /UADSBanner\\.h/,\n /UADSBannerView\\.h/,\n /UADSBannerViewDelegate\\.h/,\n /UnityAdsBannerDelegate\\.h/,\n /UADSBannerError\\.h/,\n\n # Analytics\n /UANAApiAnalytics.h/,\n /UnityAnalytics(.*).h/,\n\n # Purchasing\n /UADSPurchasing\\.h/,\n /USRVUnityPurchasing.h/,\n\n # BYOP\n /USRVUnityPurchasingDelegate.h/,\n /UPURProduct.h/,\n /UPURTransactionDetails.h/,\n /UPURTransactionError.h/,\n /UPURStore.h/,\n /UPURTransactionErrorDetails.h/,\n\n # Monetization\n /UnityMonetization.h/,\n /UnityMonetizationDelegate.h/,\n /UnityMonetizationPlacementContentState.h/,\n /UMONPlacementContent.h/,\n /UMONCustomEvent.h/,\n /UMONRewardablePlacementContent.h/,\n /UMONShowAdPlacementContent.h/,\n /UMONPromoAdPlacementContent.h/,\n /UMONPromoMetaData.h/,\n /UMONPromoProduct.h/,\n /UMONItem.h/,\n /UMONNativePromoAdapter.h/\n ]\n\n Dir.glob(\"*.h\") do |f|\n file_to_add = g.new_file(Dir.pwd + '/' + f)\n added_file = target.headers_build_phase.add_file_reference(file_to_add, true)\n added_file.settings ||= {}\n if \"#{f}\" == \"#{target}.h\" or public_patterns.select{ |p| \"#{f}\" =~ p }.length != 0\n added_file.settings['ATTRIBUTES'] = ['Public']\n else\n added_file.settings['ATTRIBUTES'] = ['Project']\n end\n end\n end\n\n create_groups_from_dir(\"#{Dir.pwd}/*\", g, target)\n\n Dir.chdir(\"../\")\n end\nend",
"title": ""
},
{
"docid": "4d8199911f7226ae0431df7be2f09ed0",
"score": "0.55186224",
"text": "def add_service_group(args)\n db[:routes_service_groups].insert(\n :route_id => self.id,\n :service_group_id => args[:service_group].id,\n :position => args[:position]\n )\n self.reload.service_groups\n end",
"title": ""
},
{
"docid": "b5867d6ab257368a04873bc26f527f60",
"score": "0.5515839",
"text": "def add_user_to_group(user, group)\n invoke_command \"groups #{user} | grep ' #{group} ' || #{sudo} /usr/sbin/usermod -G #{group} -a #{user}\", :via => run_method\n end",
"title": ""
},
{
"docid": "58f4cef8539f00a6c63e6d9e3e94d32f",
"score": "0.55136037",
"text": "def add_group(group, gid=nil)\n\t\t\t\tCfruby.controller.attempt(\"Adding group \\\"#{group}\\\"\", 'destructive') {\n\t\t\t\t\t# Only add the group if it's not already there\n\t\t\t\t\tif !group?(group)\n\t\t\t\t\t\tif(gid == nil)\n\t\t\t\t\t\t\t`/usr/sbin/pw groupadd '#{shellescape(group)}'`\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t`/usr/sbin/pw groupadd '#{shellescape(group)}' -g #{gid.to_i()}`\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\tend",
"title": ""
},
{
"docid": "27d60218d8eff9a761243debd5388518",
"score": "0.5513012",
"text": "def identify_packages\n prepare_package :common if File.directory?(File.join(Dir.pwd, \"util\"))\n prepare_package :agent if File.directory?(File.join(Dir.pwd, \"agent\"))\n prepare_package :application if File.directory?(File.join(Dir.pwd, \"application\"))\n end",
"title": ""
},
{
"docid": "1842c505a53d7cc29c872e1be9c7fc01",
"score": "0.5511904",
"text": "def add_gem(*args)\n gem = Gem.new(*args)\n fail GemAlreadyPresent if gems.include? gem\n gems << gem\n\n if groups.include?(gem.groups)\n gem_groups = gem.groups\n gem.groups = []\n\n if groups[gem_groups].size == 1\n gem_to_group_block!(groups[gem_groups].first)\n end\n\n append_to_group_block! gem.to_node, groups: gem_groups\n else\n groups[gem.groups] = [gem] unless gem.groups.empty?\n append_before_first_block! gem.to_node\n end\n end",
"title": ""
},
{
"docid": "bb494e8ae7dcce360830316104dd7f11",
"score": "0.5511505",
"text": "def add_group(group, gid=nil)\n\t\t\t\tCfruby.controller.attempt(\"Adding group \\\"#{groupname}\\\"\", 'destructive') {\n\t\t\t\t\tif(gid == nil)\n\t\t\t\t\t\t`/usr/sbin/pw groupadd '#{shellescape(group)}'`\n\t\t\t\t\telse\n\t\t\t\t\t\t`/usr/sbin/pw groupadd '#{shellescape(group)}' -g #{gid.to_i()}`\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\tend",
"title": ""
},
{
"docid": "550a3da64485e764e85724f7b92d87c6",
"score": "0.55030906",
"text": "def add_packages(xml)\n xml.MasterTrackingId {\n xml.TrackingNumber @mps_details[:master_tracking_id]\n } if @mps_details && @mps_details[:master_tracking_id]\n if [\"FEDEX_FREIGHT_ECONOMY\", \"FEDEX_FREIGHT_PRIORITY\"].include?(@service_type)\n packages = [@packages.first]\n else\n packages = @packages\n end\n package_count = packages.size\n xml.PackageCount (@mps_details && @mps_details[:package_count]) || 1\n packages.each do |package|\n xml.RequestedPackageLineItems{\n xml.SequenceNumber @mps_details[:sequence_number] if @mps_details\n xml.GroupPackageCount 1\n xml.InsuredValue {\n xml.Currency \"USD\"\n xml.Amount package[:value]\n } if package[:value] && ![\"FEDEX_FREIGHT_ECONOMY\", \"FEDEX_FREIGHT_PRIORITY\", \"SMART_POST\"].include?(@service_type)\n xml.Weight{\n xml.Units package[:weight][:units]\n xml.Value package[:weight][:value]\n }\n xml.Dimensions {\n xml.Length package[:dimensions][:length].to_i\n xml.Width package[:dimensions][:width].to_i\n xml.Height package[:dimensions][:height].to_i\n xml.Units package[:dimensions][:units]\n } if package[:dimensions]\n xml.CustomerReferences {\n xml.CustomerReferenceType \"CUSTOMER_REFERENCE\"\n xml.Value package[:reference]\n }\n hash_to_xml(xml, package[:special_services]) if package[:special_services]\n }\n end\n end",
"title": ""
},
{
"docid": "63f3e7206fd6ece02b721807f15ae31e",
"score": "0.5498533",
"text": "def add_feature_to_group(inventory_hash, feature_name, group_name)\n i = 0\n inventory_hash['groups'].each do |group|\n if group['name'] == group_name\n group = group.merge('features' => []) if group['features'].nil? == true\n group['features'].push feature_name unless group['features'].include?(feature_name)\n inventory_hash['groups'][i] = group\n end\n i += 1\n end\n inventory_hash\n end",
"title": ""
},
{
"docid": "dc52a4b1095d8e2f03a8c673db00902e",
"score": "0.54952633",
"text": "def new_group(name, path = nil)\n main_group.new_group(name, path)\n end",
"title": ""
},
{
"docid": "2f2cb65f4eb1a72a39d518cfb4a2c7da",
"score": "0.5492851",
"text": "def add(e, group)\n get_entities(group) << e\n get_groups(e) << group\n end",
"title": ""
},
{
"docid": "a7d436cb0c05592deb7a2f7343ac4e83",
"score": "0.5492603",
"text": "def add_package (name, options={})\n\t\t\tsoftware_command \"add_package\",{:name => name}.merge(options)\n\t\tend",
"title": ""
},
{
"docid": "7fb14fdb538cf834baa92c5a18358fd7",
"score": "0.5492311",
"text": "def add_group(user)\n \"group groupname=#{user.group}\"\n end",
"title": ""
},
{
"docid": "b0ed7566cf263686395ee48a65ca58f3",
"score": "0.5489586",
"text": "def insert_group(user_agent:)\n @groups << []\n @content << \"User-agent: #{user_agent}\\n\"\n end",
"title": ""
},
{
"docid": "a1c0be7f603b7d17bd612fc5213c56bc",
"score": "0.54825675",
"text": "def reorganize_packages(pkgs, tmp, platform_independent = false, nonfinal = false)\n pkgs.map do |pkg|\n path = 'pkg'\n unless platform_independent\n platform_tag = Pkg::Paths.tag_from_artifact_path(pkg)\n path = Pkg::Paths.artifacts_path(platform_tag, 'pkg', nonfinal)\n end\n FileUtils.mkdir_p File.join(tmp, path)\n FileUtils.cp pkg, File.join(tmp, path)\n File.join(path, File.basename(pkg))\n end\n end",
"title": ""
},
{
"docid": "91f939bdd1373df6c7f3477d4bb500bc",
"score": "0.5482537",
"text": "def addAdditionalPackage(package)\n Builtins.y2warning(\n \"OBSOLETE! Please, use PackagesProposal::AddResolvables() instead\"\n )\n @additional_packages = Builtins.add(@additional_packages, package)\n\n nil\n end",
"title": ""
},
{
"docid": "b91feb665386b40593241ba17a25306c",
"score": "0.54788023",
"text": "def create_suport_files_group\n @support_files_group = project.support_files_group.new_group(library.name)\n end",
"title": ""
},
{
"docid": "942cc36c613f1b3915ebe8ef17304c56",
"score": "0.5478562",
"text": "def generate_packages(pkg)\n @project.generate_packages = pkg\n end",
"title": ""
},
{
"docid": "35f012164a818607908c8e8a06445c1e",
"score": "0.5473292",
"text": "def join(group)\n\t\t@groups << group\n\tend",
"title": ""
},
{
"docid": "c71695c46b518e5ce286121c43089943",
"score": "0.5469431",
"text": "def add_classes_to_group\n if @options[:ng] && @options[:classes]\n group_id = get_group_id\n \n if group_id.nil?\n return false\n end\n \n egr = @puppetclassify.groups.get_group(group_id)\n \n group = Hash.new\n \n group['id'] = group_id unless group_id.nil?\n group['classes'] = egr['classes']\n \n @options[:classes].each do |cl|\n cl_hash = Hash.new\n cl_hash[cl] = {}\n group['classes'].merge!(cl_hash)\n end\n\n begin\n @puppetclassify.groups.update_group(group)\n rescue Exception => e\n puts e.message\n puts e.backtrace\n end\n \n return true\n end\n end",
"title": ""
},
{
"docid": "14b21131709a8103cdce82c3df40437a",
"score": "0.5468381",
"text": "def packages\n @packages ||= objects('packages').values.each_with_object({}) do |package_hash, hash|\n package = Package.new(package_hash.first, self)\n hash[package.name] = package\n end\n end",
"title": ""
},
{
"docid": "f2d8604bcfa64a9e737152042eec53a8",
"score": "0.54672956",
"text": "def add_to_users_group\n\t\tc = Command.new(\"usermod -g users -a -G users \\\"#{self.login}\\\"\")\n\t\tc.execute\n\tend",
"title": ""
},
{
"docid": "de35700cf76c35769ec0bef9245275c3",
"score": "0.5461893",
"text": "def add_to_default_group\n group = Group.where(name: \"Default\").first_or_create!\n group.projects << self\n end",
"title": ""
},
{
"docid": "509d1cc1ab7d3541214eb3a751ab457e",
"score": "0.54447204",
"text": "def add_pkg_to_db(package)\n write_to_db(package)\n end",
"title": ""
},
{
"docid": "181ebbe2e3d5b1aeaa22ca8eae020ca0",
"score": "0.54421544",
"text": "def register_group group\n group.command_line_options.each{ |opt| register_option opt }\n end",
"title": ""
},
{
"docid": "039637760b36061263788c813db7ed0d",
"score": "0.5439039",
"text": "def add_to_group(uid, group_name)\n ops = [[:add, :memberuid, uid]]\n groupdn = self.find_group(group_name).dn\n @ldap.modify :dn => groupdn, :operations => ops\n end",
"title": ""
},
{
"docid": "5de0e3df38378c402e54b8e92f4a5520",
"score": "0.5438901",
"text": "def add_example_group(example_group)\n super\n my_add_example_group(example_group.description, example_group)\n end",
"title": ""
},
{
"docid": "d240fbd1563f80bdded9a543b3a06425",
"score": "0.54305863",
"text": "def register_package(package, block = nil, package_set = main_package_set, file = nil)\n pkg = PackageDefinition.new(package, package_set, file)\n if block\n pkg.add_setup_block(block)\n end\n @packages[package.name] = pkg\n metapackage pkg.package_set.name, pkg.autobuild\n metapackage \"#{pkg.package_set.name}.all\", pkg.autobuild\n pkg\n end",
"title": ""
},
{
"docid": "75014d98d26fa316d8b871e92f2b7896",
"score": "0.542961",
"text": "def join(group)\n @groups << group\n end",
"title": ""
}
] |
a85cfca8cbc8fd337e534684739bcd2b
|
DELETE /places_interests/1 DELETE /places_interests/1.json
|
[
{
"docid": "b71d966bcb272bd8e4186cf37a97372b",
"score": "0.794088",
"text": "def destroy\n @places_interest = PlacesInterest.find(params[:id])\n @places_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to places_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "158f376b5b9cfe328c4e14032648cd77",
"score": "0.7435881",
"text": "def destroy\n @interest_place.destroy\n respond_to do |format|\n format.html { redirect_to interest_places_url, notice: \"Interest place was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "272ddfbe655c6c08b0fef5a96517840d",
"score": "0.73810416",
"text": "def destroy\n @place_of_interest.destroy\n respond_to do |format|\n format.html { redirect_to place_of_interests_url, notice: \"Place of interest was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "02ba39c117c1a85994c3724c980b8284",
"score": "0.71517074",
"text": "def destroy\n @point_of_interest = PointOfInterest.find(params[:id])\n @point_of_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to point_of_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a33808c2cc5c3a5723e22973f37890a4",
"score": "0.7109217",
"text": "def destroy\n @interest_point = InterestPoint.find(params[:id])\n @interest_point.destroy\n\n respond_to do |format|\n format.html { redirect_to interest_points_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "61c86dfede0f5864265fe7b13076ac13",
"score": "0.70984924",
"text": "def destroy\n @person_of_interest = PersonOfInterest.find(params[:id])\n @person_of_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to person_of_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5c2b2258e4203ac347ac24e011cfcdf6",
"score": "0.70403713",
"text": "def destroy\n @area_interest.destroy\n respond_to do |format|\n format.html { redirect_to area_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b23e598165686b31c7991465b08f262e",
"score": "0.70325404",
"text": "def destroy\n\n if !params[\"user\"][\"interests\"].nil?\n\n UserInterest.find_by(user_id: current_user.id, interest_id: params[\"user\"][\"interests\"][\"id\"]).delete\n\n render json: {\n interests: current_user.interests\n }\n \n end\n\n end",
"title": ""
},
{
"docid": "205034f9d75848b118c63349c96df1b0",
"score": "0.7009263",
"text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "205034f9d75848b118c63349c96df1b0",
"score": "0.7009263",
"text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "205034f9d75848b118c63349c96df1b0",
"score": "0.7009263",
"text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "205034f9d75848b118c63349c96df1b0",
"score": "0.7009263",
"text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "79b9331ba8c3bd93b590f40537b6d2bb",
"score": "0.6934059",
"text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to user_person_path(the_user, the_person), notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "88f1f231482b4aac500366b964f5b03e",
"score": "0.69238985",
"text": "def destroy\n @api_v1_mentoring_request_interest.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentoring_request_interests_url, notice: 'Mentoring request interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a7f5d572d6152be9ad044b318fa876fb",
"score": "0.6897532",
"text": "def destroy\n @user_interest = UserInterest.find(params[:id])\n @user_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to user_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a7fe3e5141f16fe1c75c6d13e6e2c641",
"score": "0.68800217",
"text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(interests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0622678a44992f97fd1378dbb14ff3d7",
"score": "0.68621886",
"text": "def destroy\n @point_of_interest = PointOfInterest.find(params[:id])\n @point_of_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(point_of_interests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8a6f1c1ebf404618afd90c0562c88af8",
"score": "0.68576884",
"text": "def destroy\n @api_v1_mentoring_interest.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentoring_interests_url, notice: 'Mentoring interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ff7d26874170ebf59fce276dd6865d1c",
"score": "0.68412167",
"text": "def destroy\n @people_interest.destroy\n respond_to do |format|\n format.html { redirect_to people_interests_url, notice: 'People interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3082c1943e4ece3a4c27427082eb2de4",
"score": "0.683902",
"text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_interests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.6828308",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "6bad8af37497a5d93b67ba5e2e894b22",
"score": "0.68047714",
"text": "def destroy\n @dailyinterest = Dailyinterest.find(params[:id])\n @dailyinterest.destroy\n\n respond_to do |format|\n format.html { redirect_to dailyinterests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "020a52248f7542fe214d35651b8b44be",
"score": "0.678852",
"text": "def destroy\n @point_of_interest.destroy\n respond_to do |format|\n format.html { redirect_to point_of_interests_url, notice: 'Point of interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7daa76ab77d9b2868e2bfe06b86841a7",
"score": "0.67849827",
"text": "def destroy\n @interest_location.destroy\n respond_to do |format|\n format.html { redirect_to interest_locations_url, notice: 'Interest location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "220e92bdff36fc78d9d6004db97677c1",
"score": "0.6750532",
"text": "def destroy\n @place = Place.find(params[:id])\n @place.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0f1a491fb3d7b1d3af95c36e2b72223",
"score": "0.6744546",
"text": "def destroy\n @interest_type.destroy\n respond_to do |format|\n format.html { redirect_to interest_types_url, notice: 'Interest type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "63fbb702846a88631395e13e4a7710a5",
"score": "0.67148185",
"text": "def destroy\n @research_interest.destroy\n respond_to do |format|\n format.html { redirect_to research_interests_url, notice: 'Research interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d750e6c617804560f5f0c04fb3e2d419",
"score": "0.67050403",
"text": "def destroy\n @shared_interest_point = SharedInterestPoint.find(params[:id])\n @shared_interest_point.destroy\n\n respond_to do |format|\n format.html { redirect_to(shared_interest_points_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9cd19787c787a0ecc32a7dceae7d93d5",
"score": "0.6679389",
"text": "def destroy\n @area_of_interest = AreaOfInterest.find(params[:id])\n @area_of_interest.destroy\n RemovedAreas.create(area_identifier: Integer(params[:id]))\n\n respond_to do |format|\n format.html { redirect_to area_of_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7c03a1ae8d83e5d6151b8def51d979a",
"score": "0.66626984",
"text": "def destroy\n @interest_area.destroy\n respond_to do |format|\n format.html { redirect_to interest_areas_url, notice: 'Interest area was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a7bd707e8abbc9fdab3c9e3d39f42170",
"score": "0.6652419",
"text": "def destroy\n @common_interest.destroy\n respond_to do |format|\n format.html do\n redirect_to common_interests_url,\n notice: 'Common interest was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "37dc64d52223140c8fc3cf1a1e89b7db",
"score": "0.66458845",
"text": "def destroy\n place.destroy\n\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "773e5d611adeb09776f9c841e1b876cc",
"score": "0.6625271",
"text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end",
"title": ""
},
{
"docid": "6f24660bd2ae3e56262ca20b917466e6",
"score": "0.66035146",
"text": "def destroy\n @mma_interest.destroy\n respond_to do |format|\n format.html { redirect_to mma_interests_url, notice: 'Mma interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf4a1a12f16d189480b6188819761589",
"score": "0.65742314",
"text": "def destroy\n @place = Place.find(params[:id])\n @place.destroy\n\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf4a1a12f16d189480b6188819761589",
"score": "0.65742314",
"text": "def destroy\n @place = Place.find(params[:id])\n @place.destroy\n\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf4a1a12f16d189480b6188819761589",
"score": "0.65742314",
"text": "def destroy\n @place = Place.find(params[:id])\n @place.destroy\n\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf4a1a12f16d189480b6188819761589",
"score": "0.65742314",
"text": "def destroy\n @place = Place.find(params[:id])\n @place.destroy\n\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "76be5b90f5bbbbb04ea896f988fe3ed1",
"score": "0.65606517",
"text": "def destroy\n puts '>>> index'\n @place = SavedPlace.find(params[:id])\n \n @place.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "495c6cc50bd531b16ec57c995ccdb5f3",
"score": "0.65435743",
"text": "def destroy\n\n @place = Place.find params[:id]\n @place.destroy\n render json: {message: \"Place has been deleted\"}, success: true, status: 200\n end",
"title": ""
},
{
"docid": "8928adce9b31384fc3426965d28ac472",
"score": "0.65357196",
"text": "def destroy\n @place.destroy\n respond_to do |format|\n format.html { redirect_to helpers.places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eab0f44df9acd7e7ab8a2ea00c5450f3",
"score": "0.6533722",
"text": "def destroy\n @place.destroy\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eab0f44df9acd7e7ab8a2ea00c5450f3",
"score": "0.6533722",
"text": "def destroy\n @place.destroy\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eab0f44df9acd7e7ab8a2ea00c5450f3",
"score": "0.6533722",
"text": "def destroy\n @place.destroy\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eab0f44df9acd7e7ab8a2ea00c5450f3",
"score": "0.6533722",
"text": "def destroy\n @place.destroy\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eab0f44df9acd7e7ab8a2ea00c5450f3",
"score": "0.6533722",
"text": "def destroy\n @place.destroy\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eab0f44df9acd7e7ab8a2ea00c5450f3",
"score": "0.6533722",
"text": "def destroy\n @place.destroy\n respond_to do |format|\n format.html { redirect_to places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6fa065ba62fe9ff106f3f6e553e507c0",
"score": "0.6525396",
"text": "def destroy\n @blr_place = BlrPlace.find(params[:id])\n @blr_place.destroy\n\n respond_to do |format|\n format.html { redirect_to blr_places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.6525195",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "57b799133d29316426c358002043baa2",
"score": "0.6506678",
"text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end",
"title": ""
},
{
"docid": "8a5a0cc7f1dbe97f5d330369d9834144",
"score": "0.65065587",
"text": "def destroy\n @neighborhood.destroy\n\n respond_to do |format|\n format.html { redirect_to neighborhoods_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4002562a1883323b45eaf5b25617f15",
"score": "0.6502959",
"text": "def destroy\n @neighboorhood.destroy\n respond_to do |format|\n format.html { redirect_to neighboorhoods_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31a8347d2dae3dbd27b43846aa4c8b9e",
"score": "0.6491998",
"text": "def destroy\n @interest_rate.destroy\n respond_to do |format|\n format.html { redirect_to interest_rates_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "780c044d85a984b52d7d3747f34541b6",
"score": "0.6490631",
"text": "def destroy\n @point_of_interest.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "fc3eb0b40adbc43eb3489d677b8dd7ff",
"score": "0.64777243",
"text": "def destroy\n @interest_list.destroy\n respond_to do |format|\n format.html { redirect_to interest_lists_url, notice: 'Interest list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a447f237a0d4cb2b0436f263a473f186",
"score": "0.6472504",
"text": "def destroy\n\t\t@interest = Interest.find(params[:id])\n\t\t@interest.destroy\n\t\trender nothing: true\n\tend",
"title": ""
},
{
"docid": "78dc8086de12b85dac21c2043a9e7a64",
"score": "0.64627063",
"text": "def destroy\n @interest_name.destroy\n respond_to do |format|\n format.html { redirect_to interest_names_url, notice: 'Interest name was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7fcf68b7378b6b2e190928ec3d3e44a5",
"score": "0.64523554",
"text": "def destroy\n @place_information = PlaceInformation.find(params[:id])\n @place_information.destroy\n\n respond_to do |format|\n format.html { redirect_to place_informations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1eddf16ad68d400d01d83d4dc4f33cb",
"score": "0.6450952",
"text": "def destroy\n @place = Place.find(params[:id])\n @place.destroy\n\n respond_to do |format|\n format.html { redirect_to places_url, notice: 'Place was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fc85d766676e6efdf427285c7a0c7fae",
"score": "0.645044",
"text": "def destroy\n @place_of_work = PlaceOfWork.find(params[:id])\n @place_of_work.destroy\n\n respond_to do |format|\n format.html { redirect_to place_of_works_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1964ec126622a69521330a63a80b120",
"score": "0.644927",
"text": "def destroy\n @tourist_place.destroy\n respond_to do |format|\n format.html { redirect_to tourist_places_url, notice: 'Tourist place was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e07b473aa37ad9d1dd9762825199c1de",
"score": "0.6445607",
"text": "def destroy\n @favorite_place = current_user.favorite_places.find(params[:id])\n @favorite_place.destroy\n\n respond_to do |format|\n format.html { redirect_to favorite_places_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fc27240d33a7020ea96116e3c519b27f",
"score": "0.64424384",
"text": "def destroy\n @sport_interest.destroy\n respond_to do |format|\n format.html { redirect_to sport_interests_url, notice: 'Sport interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "60e2f3e7bfde2cdbae29697cddc1b0e6",
"score": "0.644189",
"text": "def destroy\n @interest_link.destroy\n respond_to do |format|\n format.html { redirect_to interest_links_url, notice: 'El link de interés se ha eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ab89f0b27f1060fe416ef9b2815d4ece",
"score": "0.643972",
"text": "def destroy\n @device_interest.destroy\n respond_to do |format|\n format.html { redirect_to device_interests_url, notice: 'Device interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.6429169",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6428096",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6428096",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6428096",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "cb81059b2d91fba89a61dd46d92d6bc1",
"score": "0.6427877",
"text": "def destroy\n @interest_news.destroy\n respond_to do |format|\n format.html { redirect_to interest_news_index_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c334300f439eea9b00c0709fa0abeb95",
"score": "0.6422254",
"text": "def destroy\n @hood = Hood.find(params[:id])\n @hood.destroy\n\n respond_to do |format|\n format.html { redirect_to hoods_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bebf9940139fa42cd5e8612c4cb55a14",
"score": "0.6420845",
"text": "def destroy\n @place_info.destroy\n respond_to do |format|\n format.html { redirect_to place_infos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dad5f027126346b38d3d5485b947eb0c",
"score": "0.6415541",
"text": "def destroy\n @place = Place.find(params[:id])\n @place.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_places_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0c35b20ee97bd9bb28f1628d12c721d6",
"score": "0.6414753",
"text": "def destroy\n @sampleplace = Sampleplace.find(params[:id])\n @sampleplace.destroy\n\n respond_to do |format|\n format.html { redirect_to(sampleplaces_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5c181505ac0deedddfba684db419e428",
"score": "0.6414602",
"text": "def delete\n render json: Own.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "817cc731f1501d9067014cdc5562ba75",
"score": "0.6413367",
"text": "def destroy\n @pinhole.destroy\n respond_to do |format|\n format.html { redirect_to pinholes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1e9e7ea78c3df4fe1298e43987c9039b",
"score": "0.6409989",
"text": "def destroy\n @neighborhood = Neighborhood.find(params[:id])\n @neighborhood.destroy\n\n respond_to do |format|\n format.html { redirect_to neighborhoods_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e12c7f2ff6622e66d3abeeb8baff9c1b",
"score": "0.6407208",
"text": "def destroy\n PathwayImage.find_by_xref(params[:xref]).destroy rescue nil\n PathwayMap.destroy_all(:xref => params[:xref])\n PathwayCount.destroy_all(:xref => params[:xref])\n respond_to do |format|\n format.html { redirect_to :action => 'index', alert: 'Pathway was removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "825ee2ef310b6972c811608d4ae55981",
"score": "0.6404362",
"text": "def destroy\n\n @delete = Pantry.find_by_ingredient_id params[:ingredient_id]\n\n if @delete.destroy\n render json: { result: @delete }\n else\n format.json { render json: @delete.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "5b71f123f09fd5e05dbfdba55fb360ea",
"score": "0.640409",
"text": "def destroy\n @place = Place.find(params[:id])\n @place.destroy\n\n respond_to do |format|\n format.html { redirect_to request.referer }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "feb05fa712cede2232b7a79bf0cdeb56",
"score": "0.6398349",
"text": "def delete\n render json: Entry.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "14fb42e4ff2932fa5a0ee28ef9c49106",
"score": "0.6397815",
"text": "def destroy\n @society.destroy\n respond_to do |format|\n format.html { redirect_to societies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.63964343",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "ff41c12a3365e2c3df09cd596484424f",
"score": "0.63946885",
"text": "def destroy\n p \"places controller, @place: \" + @place.to_s\n if @user.id = current_user.id\n if @place.destroy\n places = Place.where(flat_id: params[:flat_id])\n flat = Flat.find_by(id: params[:flat_id])\n places_serializer = parse_json places\n flat_serializer = parse_json flat\n json_response \"Deleted place succesfully, Sending updated places\", true, {places: places_serializer, flat: flat_serializer}, :ok\n else\n json_response \"Delete place failed\", false, {}, :unprocessable_entity\n end\n else\n json_response \"Delete place failed\", false, {}, :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0a4a725b959ef861357278c16188b610",
"score": "0.6393638",
"text": "def destroy\n PathwayMap.where(:annotation_collection_id => @annotation_collection.id).destroy_all\n PathwayCount.where(:countable_type=> 'AnnotationCollection', :countable_id => @annotation_collection.id).destroy_all\n @annotation_collection.destroy\n\n respond_to do |format|\n format.html { redirect_to :root }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b1cd95411388cd6a30d1720f9609031",
"score": "0.6391776",
"text": "def destroy\n @neighborhood_thought = NeighborhoodThought.find(params[:id])\n @neighborhood_thought.destroy\n\n respond_to do |format|\n format.html { redirect_to neighborhood_thoughts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2375b11675de0e152de07976b50e9c7",
"score": "0.6387472",
"text": "def delete_request(url, queries)\n results = @@client.delete url, queries\n results.to_json\nend",
"title": ""
},
{
"docid": "0223322a704cdeb2c5d0b6fc71048e7c",
"score": "0.638737",
"text": "def destroy\n @pathway = Pathway.find(params[:id])\n @pathway.destroy\n\n respond_to do |format|\n format.html { redirect_to pathways_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e1e206b8906dfb0b834600ed675234f5",
"score": "0.638726",
"text": "def destroy\n @society = Society.find(params[:id])\n @society.destroy\n\n respond_to do |format|\n format.html { redirect_to societies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d8175627245bc04b05ca8dadfdd3d658",
"score": "0.638171",
"text": "def destroy\n @restplace.destroy\n respond_to do |format|\n format.html { redirect_to restplaces_url, notice: 'Restplace was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.6373127",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "29c5346324687e5f4b8b7c741962badc",
"score": "0.636969",
"text": "def a_delete(path)\n a_request(:delete, Twitter::REST::Client::ENDPOINT + path)\nend",
"title": ""
},
{
"docid": "fd00fca3503bc233fa415693bd7f8295",
"score": "0.6364402",
"text": "def destroy\n @place.destroy\n respond_to do |format|\n format.html { redirect_to locate_places_url, notice: 'Place was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "460d3be3edefe4071946b1911fc55cd5",
"score": "0.6361469",
"text": "def destroy\n @map_place.destroy\n respond_to do |format|\n format.html { redirect_to map_places_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "870970739d8a7049a9a93ae6f23a7023",
"score": "0.63609064",
"text": "def destroy\n @ride_datum = RideDatum.find(params[:id])\n @ride_datum.destroy\n\n @ride_datum = RideDatum.delete_all\n\n respond_to do |format|\n format.html { redirect_to ride_data_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8bbcb3d5c1f1754993e1a205ad0b0250",
"score": "0.63590115",
"text": "def destroy\n @society = Society.find(params[:id])\n @society.destroy\n\n respond_to do |format|\n format.html { redirect_to societies_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c22e78d6cce92b091b6c886552cf2c55",
"score": "0.63576335",
"text": "def destroy\n @places_to_visit.destroy\n respond_to do |format|\n format.html { redirect_to places_to_visits_url, notice: 'Places to visit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "545a430f8de36d8a85ac96c28e787f7d",
"score": "0.6356393",
"text": "def destroy\n @json_sample = JsonSample.find(params[:id])\n @json_sample.destroy\n\n respond_to do |format|\n format.html { redirect_to json_samples_url }\n format.json { render json: {msg: \"complete\", status: \"OK\"} }\n end\n end",
"title": ""
},
{
"docid": "581c1d30825dc96e4e7154dd16850c47",
"score": "0.6349201",
"text": "def destroy\n @profile_interest = ProfileInterest.find(params[:id])\n @profile_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(profile_interests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0397dbc59b71cff99b2821a4d7641ed0",
"score": "0.6344045",
"text": "def destroy\n @interested = Interested.find(params[:id])\n @interested.destroy\n\n respond_to do |format|\n format.html { redirect_to interesteds_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
9d17ab106c60279a2d87291be7a1da6e
|
Method: tableAliasGen Remember a table alias when it is created. Method remembers any table alias that is generated in a FROM clause and puts it into the probe private metadata.
|
[
{
"docid": "a6a40c0c67ec0af1ece3524d783c8467",
"score": "0.7344085",
"text": "def tableAliasGen(theTree)\n # theTree.myText = \"ta_#{theTree.object_id}\"\n theTree.myText = @metadata.getAlias\n # theTree.probeData[:tableAliases].push(theTree.myText)\n end",
"title": ""
}
] |
[
{
"docid": "4f308509cfe127f2e51189b71af57114",
"score": "0.70008856",
"text": "def aliased_table; end",
"title": ""
},
{
"docid": "f823696d91127b7cfbe82499fa3e8051",
"score": "0.6987026",
"text": "def table_alias_for(table_name); end",
"title": ""
},
{
"docid": "539313d54b885be00668a55d83bfab2d",
"score": "0.688126",
"text": "def table_alias=(_arg0); end",
"title": ""
},
{
"docid": "a5d87cb86997e07dfde2c3ed48f773ad",
"score": "0.67061704",
"text": "def table_alias; end",
"title": ""
},
{
"docid": "afb07315f4cfc9b264ee40949d9c6516",
"score": "0.6649357",
"text": "def unused_table_alias(table_alias, used_aliases = [])\n table_alias = alias_symbol(table_alias)\n used_aliases += opts[:from].map{|t| alias_symbol(t)} if opts[:from]\n used_aliases += opts[:join].map{|j| j.table_alias ? alias_alias_symbol(j.table_alias) : alias_symbol(j.table)} if opts[:join]\n if used_aliases.include?(table_alias)\n i = 0\n loop do\n ta = :\"#{table_alias}_#{i}\"\n return ta unless used_aliases.include?(ta)\n i += 1 \n end\n else\n table_alias\n end\n end",
"title": ""
},
{
"docid": "3914464078d769cfd68479c9ee4a0db5",
"score": "0.6622344",
"text": "def create_table_alias(tableName, aliasName)\n return table_alias = TableAlias.create(tableName: tableName, aliasName: aliasName)\nend",
"title": ""
},
{
"docid": "5e78a076e4b5d4f1b364954c4827abd3",
"score": "0.65898407",
"text": "def table_aliases\n @table_aliases ||= {}\n end",
"title": ""
},
{
"docid": "5de8e00988bfea2c03ab8490811b09a9",
"score": "0.6485307",
"text": "def tableAliasRep(theTree)\n # tas = theTree.probeData[:tableAliases]\n # choose(tas) unless tas.empty?\n @metadata.chooseAlias\n end",
"title": ""
},
{
"docid": "933b97332a32e17f0ee0d50e966c0e64",
"score": "0.6400668",
"text": "def alias_to(alias_table)\n Arel::Nodes::As.new(table, Arel::Table.new(alias_table.name.tr('.', '_')))\n end",
"title": ""
},
{
"docid": "894070a4d002b799a8e121418dd88975",
"score": "0.63748306",
"text": "def target_alias\n @target_table.table_alias\n end",
"title": ""
},
{
"docid": "9b0c45cab1121be5f92a660b53be274a",
"score": "0.63390404",
"text": "def aliased_table_name\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9b0c45cab1121be5f92a660b53be274a",
"score": "0.63390404",
"text": "def aliased_table_name\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9b0c45cab1121be5f92a660b53be274a",
"score": "0.63390404",
"text": "def aliased_table_name\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "c1c0233f0a2b37dbff54c4bf30049769",
"score": "0.62983996",
"text": "def table_alias\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 191 )\n return_value = TableAliasReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n table_alias_start_index = @input.index\n\n root_0 = nil\n __DOT1052__ = nil\n __AT_SIGN1054__ = nil\n schema_name1051 = nil\n table_name1053 = nil\n link_name1055 = nil\n objalias1056 = nil\n\n tree_for_DOT1052 = nil\n tree_for_AT_SIGN1054 = nil\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 return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1011:4: ( schema_name DOT )? table_name ( AT_SIGN link_name )? ( objalias )?\n # at line 1011:4: ( schema_name DOT )?\n alt_274 = 2\n look_274_0 = @input.peek( 1 )\n\n if ( look_274_0.between?( ID, DOUBLEQUOTED_STRING ) )\n look_274_1 = @input.peek( 2 )\n\n if ( look_274_1 == DOT )\n alt_274 = 1\n end\n elsif ( look_274_0 == T__100 )\n look_274_2 = @input.peek( 2 )\n\n if ( look_274_2 == DOT )\n alt_274 = 1\n end\n end\n case alt_274\n when 1\n # at line 1011:6: schema_name DOT\n @state.following.push( TOKENS_FOLLOWING_schema_name_IN_table_alias_6361 )\n schema_name1051 = schema_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, schema_name1051.tree )\n end\n __DOT1052__ = match( DOT, TOKENS_FOLLOWING_DOT_IN_table_alias_6363 )\n if @state.backtracking == 0\n\n tree_for_DOT1052 = @adaptor.create_with_payload( __DOT1052__ )\n @adaptor.add_child( root_0, tree_for_DOT1052 )\n\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_table_name_IN_table_alias_6368 )\n table_name1053 = table_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, table_name1053.tree )\n end\n # at line 1011:36: ( AT_SIGN link_name )?\n alt_275 = 2\n look_275_0 = @input.peek( 1 )\n\n if ( look_275_0 == AT_SIGN )\n alt_275 = 1\n end\n case alt_275\n when 1\n # at line 1011:38: AT_SIGN link_name\n __AT_SIGN1054__ = match( AT_SIGN, TOKENS_FOLLOWING_AT_SIGN_IN_table_alias_6372 )\n if @state.backtracking == 0\n\n tree_for_AT_SIGN1054 = @adaptor.create_with_payload( __AT_SIGN1054__ )\n @adaptor.add_child( root_0, tree_for_AT_SIGN1054 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_link_name_IN_table_alias_6374 )\n link_name1055 = link_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, link_name1055.tree )\n end\n\n end\n # at line 1011:59: ( objalias )?\n alt_276 = 2\n look_276_0 = @input.peek( 1 )\n\n if ( look_276_0.between?( ID, DOUBLEQUOTED_STRING ) || look_276_0 == T__53 || look_276_0 == T__100 )\n alt_276 = 1\n end\n case alt_276\n when 1\n # at line 1011:61: objalias\n @state.following.push( TOKENS_FOLLOWING_objalias_IN_table_alias_6381 )\n objalias1056 = objalias\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, objalias1056.tree )\n end\n\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 191 )\n memoize( __method__, table_alias_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "12f0affc74c131a625725227d0be65fa",
"score": "0.62836325",
"text": "def _merge_alias_tables\n\t alias_num = @opts[:num_dataset_sources]||0\n\t [:into, :using].each do |k|\n\t\t if Symbol===@opts[k]\n\t\t u_table, u_column, u_alias = split_symbol(@opts[k])\n\t\t @opts[k] = \"#{@opts[k]}___#{dataset_alias(alias_num += 1)}\".to_sym unless u_alias\n\t\t else\n\t\t @opts[k] = @opts[k].as dataset_alias(alias_num += 1) unless @opts[k].respond_to? :aliaz\n\t\t end\n\t end\n\t end",
"title": ""
},
{
"docid": "44714717c71007904ebe2f383325f424",
"score": "0.61956376",
"text": "def table_alias_for( path )\n table_aliases[path] ||= map_table_alias_for( path )\n end",
"title": ""
},
{
"docid": "8ef00cdf1c5dfbae1d45d29f0125f967",
"score": "0.6191422",
"text": "def map_table_alias_for( path )\n return \"table alias for #{path.inspect} already exists\" unless table_aliases[path].nil?\n\n reflection = reflection_for( path )\n table_alias = reflection.table_name\n if table_aliases.values.include?( table_alias )\n max_length = reflection.active_record.connection.table_alias_length\n # Rails seems to pluralize reflection names\n table_alias = \"#{reflection.name.to_s.pluralize}_#{reflection.active_record.table_name}\".to(max_length-1)\n end\n while table_aliases.values.include?( table_alias )\n if table_alias =~ /\\w(_\\d+?)$/\n table_index = $1.succ\n table_alias = \"#{table_alias[0..-(table_index.length+1)]}_#{table_index}\"\n else\n table_alias = \"#{table_alias[0..(max_length-3)]}_2\"\n end\n end\n table_aliases[path] = table_alias\n end",
"title": ""
},
{
"docid": "034a3029fa6bae2e10156ba81338b7ad",
"score": "0.6175838",
"text": "def table_reference_with_alias!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n\n \n # - - - - main rule block - - - -\n # at line 220:5: PLAIN_TABLE_REF WS OBJ_ALIAS\n plain_table_ref!\n ws!\n obj_alias!\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end",
"title": ""
},
{
"docid": "89557164fcefe6273ce79f58a8097762",
"score": "0.6165892",
"text": "def aliased_table_name\n reflection.klass.table_name\n end",
"title": ""
},
{
"docid": "1eee0be35a00ed9d4b663517cb93ff21",
"score": "0.6146519",
"text": "def _merge_table_aliases\n\t @opts.values_at(:into, :using).map{|t| Symbol===t ? split_symbol(t).last : t.aliaz.to_s}\n\t end",
"title": ""
},
{
"docid": "9d17638e4bb1d74fcc37186da4eebb14",
"score": "0.6130489",
"text": "def alias_to(alias_table)\n Arel::Nodes::As.new(table, alias_table)\n end",
"title": ""
},
{
"docid": "2254afbd8e3d1dc437cac857688bb1cf",
"score": "0.61210257",
"text": "def aliased_table_name\n klass.table_name\n end",
"title": ""
},
{
"docid": "80f9626aba73632fa6592cff5bfac168",
"score": "0.60775423",
"text": "def aliases\n @aliases ||= if tap\n tap.alias_reverse_table[full_name] || []\n else\n []\n end\n end",
"title": ""
},
{
"docid": "a1b1f23a34a1734013e484e9859411f2",
"score": "0.60484624",
"text": "def table_alias\n false\n end",
"title": ""
},
{
"docid": "27454c7c3c4c1bacfa48e7ec3784eea6",
"score": "0.6040807",
"text": "def alias(alias_tbl = 'Default')\n @aliases[alias_tbl]\n end",
"title": ""
},
{
"docid": "34d91c2ad9305bf6bcf5e285ee703b70",
"score": "0.59789604",
"text": "def getAlias\n @st.getTable[:ALIAS]\n end",
"title": ""
},
{
"docid": "c47a9977555d8532ce4c4c3398389fc0",
"score": "0.59107196",
"text": "def as(table_alias)\n t = Table.new(name, options.merge(:as => table_alias))\n t.instance_variable_set(:@columns, columns)\n t\n end",
"title": ""
},
{
"docid": "59131a173a3c162ac5980fdc94cab89c",
"score": "0.5829016",
"text": "def table_alias_for(table_name)\n table_name[0...table_alias_length].gsub(/\\./, '_')\n end",
"title": ""
},
{
"docid": "74578b5ea88a1192794da6b6f1f38542",
"score": "0.5806485",
"text": "def append_table_alias(name,fields)\n fields.gsub(',' ,','+ name +'.')\nend",
"title": ""
},
{
"docid": "a217c9f860235f77ef45392abfd10751",
"score": "0.5735769",
"text": "def aliased\n if alias?\n self.class.new(to_h.merge({\n \"tag\" => metadata.aliased_tag\n }))\n end\n end",
"title": ""
},
{
"docid": "287cdf45868d09e9c68308e99f6a9c46",
"score": "0.568803",
"text": "def table_aliases_for(parent, node)\n node.reflection.chain.map do |reflection|\n is_root_reflection = reflection == node.reflection\n table = alias_tracker.aliased_table_for(\n reflection.table_name,\n table_alias_for(reflection, parent, !is_root_reflection),\n reflection.klass.type_caster\n )\n # through tables do not need a special alias_path alias (as they shouldn't really referenced by the client)\n if is_root_reflection && node.alias_path\n table = table.left if table.is_a?(Arel::Nodes::TableAlias) # un-alias it if necessary\n table = table.alias(node.alias_path.join('/'))\n end\n table\n end\n end",
"title": ""
},
{
"docid": "287cdf45868d09e9c68308e99f6a9c46",
"score": "0.568803",
"text": "def table_aliases_for(parent, node)\n node.reflection.chain.map do |reflection|\n is_root_reflection = reflection == node.reflection\n table = alias_tracker.aliased_table_for(\n reflection.table_name,\n table_alias_for(reflection, parent, !is_root_reflection),\n reflection.klass.type_caster\n )\n # through tables do not need a special alias_path alias (as they shouldn't really referenced by the client)\n if is_root_reflection && node.alias_path\n table = table.left if table.is_a?(Arel::Nodes::TableAlias) # un-alias it if necessary\n table = table.alias(node.alias_path.join('/'))\n end\n table\n end\n end",
"title": ""
},
{
"docid": "243a6ac66be9f4d5bfb967e75be17cd6",
"score": "0.5684987",
"text": "def visitAliasedQuerySource(ctx)\n sdc = ctx.query_source.accept(self)\n _alias = ctx.alias.text\n sdc.precondition_id = next_id\n return sdc,_alias\n end",
"title": ""
},
{
"docid": "5a3a54e198b204a871b04f43184f5a22",
"score": "0.5673994",
"text": "def columnAliasRep(theTree)\n # theTree.myText = \"ca_#{theTree.object_id}\"\n theTree.myText = @metadata.chooseAlias\n # theTree.probeData[:columnAliases].push(theTree.myText)\n end",
"title": ""
},
{
"docid": "e1ead985838f63a884348c90ece91645",
"score": "0.5665857",
"text": "def _alias_queries(deps, options={})\n use_aliases = _use_aliases?(options)\n\n aliases = {}\n current_alias = \"a\"\n\n deps.each do |key|\n if use_aliases\n aliases[key] = Arel::Table.new(current_alias)\n current_alias = current_alias.succ\n else\n aliases[key] = Arel::Table.new(key)\n end\n end\n\n aliases\n end",
"title": ""
},
{
"docid": "c551898bcafb231dd4e97be1073cee9e",
"score": "0.5623003",
"text": "def chooseAlias \n case @cursrc[0][:STATE]\n\twhen 0\n\t tableAlias = @st.getTable[:ALIAS]\n\t @cursrc[0][:ALIAS] = tableAlias\n\t @cursrc[0][:STATE] = 1\n\twhen 1\n\t tableAlias = @cursrc[0][:ALIAS]\n\twhen 2\n\t tableAlias = @cursrc[0][:ALIAS]\n\t @cursrc.clear\n\t @cursrc[0] = {:STATE => 0}\n\twhen 3\n\t @cursrc.clear\n\t tableAlias = @st.getTable[:ALIAS]\n\t @cursrc[0] = {:STATE => 1, :ALIAS => tableAlias}\n\telse\n\t errorExit(\"@cursrc is in wrong state #{@cursrc[0][:STATE]} in chooseAlias\")\n end\n tableAlias\n end",
"title": ""
},
{
"docid": "b81e35267f77a4ef37aa244c977de09e",
"score": "0.56148833",
"text": "def aliased\n self.class.new(name, relation.rename(aliases))\n end",
"title": ""
},
{
"docid": "217ba6b696f8d0b69c4f2698ffd03f17",
"score": "0.56063163",
"text": "def t_alias_keyword\n (ActiveRecord::Base.connection.adapter_name.to_sym == :OracleEnhanced) ? \"\" : \"AS\"\n end",
"title": ""
},
{
"docid": "cc8a024a432a433d3f8c327730c915ac",
"score": "0.5592641",
"text": "def eager_unique_table_alias(ds, table_alias)\n if (graph = ds.opts[:graph]) && (table_aliases = graph[:table_aliases]) && (table_aliases.include?(table_alias))\n i = 0\n loop do\n ta = :\"#{table_alias}_#{i}\"\n return ta unless table_aliases[ta]\n i += 1\n end\n else\n table_alias\n end\n end",
"title": ""
},
{
"docid": "c2aeefa2e8b4292e26c6e601da2c16dd",
"score": "0.5582157",
"text": "def obj_alias!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n # - - - - label initialization - - - -\n __ID1__ = nil\n\n\n \n # - - - - main rule block - - - -\n # at line 203:5: {...}? ID\n unless ( ( (KEYS.find { |key| next_word() == key }).nil? ) )\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise FailedPredicate( \"OBJ_ALIAS\", \"(KEYS.find { |key| next_word() == key }).nil? \" )\n end\n __ID1___start_464 = self.character_index\n id!\n __ID1__ = create_token do |t|\n t.input = @input\n t.type = ANTLR3::INVALID_TOKEN_TYPE\n t.channel = ANTLR3::DEFAULT_CHANNEL\n t.start = __ID1___start_464\n t.stop = self.character_index - 1\n end\n # syntactic predicate action gate test\n if @state.backtracking == 1\n # --> action\n\n @last_alias = __ID1__.text\n \n # <-- action\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end",
"title": ""
},
{
"docid": "a987206f96f6fcf248bf4e97176114d2",
"score": "0.55728364",
"text": "def as(table_alias)\n @options ||= {}\n Arel::Table.new(name, options.merge(:as => table_alias))\n end",
"title": ""
},
{
"docid": "3fa8ca2802aea0fad9dbc16551c61afe",
"score": "0.5546077",
"text": "def table_alias_for(table_name)\n table_name[0...table_alias_length].tr('.', '_')\n end",
"title": ""
},
{
"docid": "fb57f7507b0a7b3e795abb7b922ac243",
"score": "0.55163646",
"text": "def table_alias_for(table_name)\n table_name[0...table_alias_length].tr(\".\", \"_\")\n end",
"title": ""
},
{
"docid": "a0c3d0851bcdd752d13ab646a2117a7f",
"score": "0.5510611",
"text": "def table_alias_length; end",
"title": ""
},
{
"docid": "4da1fe33d146fcac68d0a743c908432e",
"score": "0.55071324",
"text": "def create_alias_tc(id, name, original_type)\n raise ::CORBA::NO_IMPLEMENT\n end",
"title": ""
},
{
"docid": "6f930833a6f03248702d58ac49451eb9",
"score": "0.5498207",
"text": "def getAliasedSelectClause(table_override, prefix='', just_prefix=false)\n selCols = []\n idx = 0\n while idx < @aliases.length do\n if just_prefix\n selCols.push(\"#{table_override}.#{prefix}#{@aliases[idx]}\")\n else\n selCols.push(\"#{table_override}.#{@aliases[idx]} AS #{prefix}#{@aliases[idx]}\")\n end\n idx += 1\n end\n return selCols.join(', ')\n end",
"title": ""
},
{
"docid": "ac1f343524740296e313a9b200aa13a7",
"score": "0.5460897",
"text": "def alias_tabla(controlador)\n\t\tRails.configuration.tables[:alias][controlador].present? ? Rails.configuration.tables[:alias][controlador] : controlador\n\tend",
"title": ""
},
{
"docid": "94afb00681125972f03c64b7c88e3dce",
"score": "0.5460407",
"text": "def create(aliases_hash, pretend=false)\n aliases_array = self.class.maps_config(aliases_hash)\n delete_invalid_aliases(aliases_array)\n self.aliases = aliases + aliases_array unless pretend\n begin\n #td: create method for efficiently removing constants/methods in any namespace\n eval_string = Util.silence_warnings { self.class.generates_aliases(aliases_array) }\n pretend ? puts(\"\\n\", eval_string) : Kernel.eval(eval_string)\n rescue\n raise FailedAliasCreationError, $!\n end\n end",
"title": ""
},
{
"docid": "73fcafc6ea43e5b8d5c3877b0f3d5039",
"score": "0.5446974",
"text": "def from_table_name\n @from_table_name || (@from_table_name = @adapter.table(@primary_class).to_sql)\n end",
"title": ""
},
{
"docid": "ff034edd813bca8a363595ca1d37d988",
"score": "0.5396702",
"text": "def tableNameGen(theTree)\n theTable = @metadata.addTable\n theTree.myText = theTable\n # theTree.probeData[:tables].push(theTable)\n # theTree.probeData[:columns].concat(@metadata.columnsFromTable(theTable))\n end",
"title": ""
},
{
"docid": "bbdfed65525addf99c6294cd98d90c4f",
"score": "0.53863865",
"text": "def sql_from(fmt = '%s')\n \"#{fmt % @table.name} AS #{@alias}\"\n end",
"title": ""
},
{
"docid": "7ee12659c42a254c5e132947e9d6308f",
"score": "0.5371747",
"text": "def alias_name; end",
"title": ""
},
{
"docid": "7ee12659c42a254c5e132947e9d6308f",
"score": "0.5371747",
"text": "def alias_name; end",
"title": ""
},
{
"docid": "8e2d1a809eefc276eacc7a27958dc13d",
"score": "0.5347433",
"text": "def aliases; end",
"title": ""
},
{
"docid": "8e2d1a809eefc276eacc7a27958dc13d",
"score": "0.5347433",
"text": "def aliases; end",
"title": ""
},
{
"docid": "8e2d1a809eefc276eacc7a27958dc13d",
"score": "0.5347433",
"text": "def aliases; end",
"title": ""
},
{
"docid": "8e2d1a809eefc276eacc7a27958dc13d",
"score": "0.5347433",
"text": "def aliases; end",
"title": ""
},
{
"docid": "8e2d1a809eefc276eacc7a27958dc13d",
"score": "0.5347433",
"text": "def aliases; end",
"title": ""
},
{
"docid": "8e2d1a809eefc276eacc7a27958dc13d",
"score": "0.5347433",
"text": "def aliases; end",
"title": ""
},
{
"docid": "0b8a654395abc92dd5d99e7478d8e66f",
"score": "0.5337206",
"text": "def set_alias(alias_to)\n @plans.last.add_alias(alias_to)\n end",
"title": ""
},
{
"docid": "428e33482a3d8dc0feae60b64e99d234",
"score": "0.53344256",
"text": "def create_table_prefix_sql(name, options)\n if options[:temp]\n \"DECLARE GLOBAL TEMPORARY TABLE #{quote_identifier(name)}\"\n else\n super\n end\n end",
"title": ""
},
{
"docid": "fb995b2a373cacfa679488e1ac3fc628",
"score": "0.53332317",
"text": "def create_table_prefix_sql(name, options)\n if options[:temp]\n \"DECLARE GLOBAL TEMPORARY TABLE #{quote_identifier(name)}\"\n else\n super\n end\n end",
"title": ""
},
{
"docid": "68cf182d2e8342c1b8d45d8d13e6a16c",
"score": "0.5330062",
"text": "def make_alias(this)\n _aliased_name = aliased_name\n original_name = name\n\n alias_target(this).class_eval do\n alias_method _aliased_name, original_name\n end\n end",
"title": ""
},
{
"docid": "1463ff5a9695802b371e5cd09e4c999b",
"score": "0.5293177",
"text": "def tables_or_aliases\n raise Error, 'SQL string has not yet been set' if @sql.nil?\n\n @parsed_sql.aliases.keys + (tables - @parsed_sql.aliases.values)\n end",
"title": ""
},
{
"docid": "08e2d3fe03e1c63e5c503686a8a8e04b",
"score": "0.52891874",
"text": "def aliased_table_name_for_with_sqlserver_support(name,suffix=nil)\n if !parent.table_joins.blank? && parent.table_joins.to_s.downcase =~ %r{join(\\s+\\w+)?\\s+#{Regexp.escape(active_record.connection.quote_table_name(name.downcase))}\\son}i\n @join_dependency.table_aliases[name] += 1\n end\n unless @join_dependency.table_aliases[name].zero?\n # if the table name has been used, then use an alias\n name = active_record.connection.table_alias_for \"#{pluralize(reflection.name)}_#{parent_table_name}#{suffix}\"\n table_index = @join_dependency.table_aliases[name]\n @join_dependency.table_aliases[name] += 1\n name = name[0..active_record.connection.table_alias_length-3] + \"_#{table_index+1}\" if table_index > 0\n else\n @join_dependency.table_aliases[name] += 1\n end\n name\n end",
"title": ""
},
{
"docid": "6a6e672d6af507f712f1c108d8a96dc9",
"score": "0.5270737",
"text": "def quoted_table_name; end",
"title": ""
},
{
"docid": "ea035454f65fd27ebabbddb4b50fcada",
"score": "0.5267445",
"text": "def column_alias_for(*keys)\n table_name = keys.join(' ')\n table_name.downcase!\n table_name.gsub!(/\\*/, 'all')\n table_name.gsub!(/\\W+/, ' ')\n table_name.strip!\n table_name.gsub!(/ +/, '_')\n\n @klass.connection.table_alias_for(table_name)\n end",
"title": ""
},
{
"docid": "5b36771d53bd4fc4710617ea4a18f037",
"score": "0.5239091",
"text": "def aliases\n end",
"title": ""
},
{
"docid": "0ebd32eff8840ab0553872db8363d037",
"score": "0.5234577",
"text": "def column_alias_for(*keys)\n keys.map! {|k| k.respond_to?(:to_sql) ? k.to_sql : k}\n table_name = keys.join(' ')\n table_name.downcase!\n table_name.gsub!(/\\*/, 'all')\n table_name.gsub!(/\\W+/, ' ')\n table_name.strip!\n table_name.gsub!(/ +/, '_')\n\n @klass.connection.table_alias_for(table_name)\n end",
"title": ""
},
{
"docid": "3c5d7d814cc20a6d56b562ff7872aca9",
"score": "0.5233395",
"text": "def reset_table_name\n table = super\n\n adapter = ActiveRecord::ConnectionAdapters::PostgreSQLAdapter\n if Torque::PostgreSQL.config.eager_load && connection.is_a?(adapter)\n connection.schema_cache.add_model_name(table, self)\n end\n\n table\n end",
"title": ""
},
{
"docid": "41b88882377f8197dbc68ff3ee1c8c7b",
"score": "0.522658",
"text": "def print_alias(*) end",
"title": ""
},
{
"docid": "502504b6e43d9f09fbef78d930e8240a",
"score": "0.52214336",
"text": "def reset_table_name\n self.table_name = TableName.new(self, super)\n end",
"title": ""
},
{
"docid": "281d1d91b320c08884ee0213e9a79b25",
"score": "0.5214365",
"text": "def table_alias_length; IDENTIFIER_LENGTH; end",
"title": ""
},
{
"docid": "281d1d91b320c08884ee0213e9a79b25",
"score": "0.5214365",
"text": "def table_alias_length; IDENTIFIER_LENGTH; end",
"title": ""
},
{
"docid": "d784e2da1fcb6bb4aebe0906ddb3565d",
"score": "0.5212707",
"text": "def generate_metadata\n metadata = Metadata.new\n @table['(metadata)'] = metadata.to_h\n end",
"title": ""
},
{
"docid": "cb251852fe93670d727b92f82eb0b180",
"score": "0.5209903",
"text": "def column_alias_for(*keys)\n table_name = keys.join(' ')\n table_name.downcase!\n table_name.gsub!(/\\*/, 'all')\n table_name.gsub!(/\\W+/, ' ')\n table_name.strip!\n table_name.gsub!(/ +/, '_')\n\n connection.table_alias_for(table_name)\n end",
"title": ""
},
{
"docid": "263d9477f982455fee883adb5ea86ec2",
"score": "0.520142",
"text": "def column_alias(column)\r\n end",
"title": ""
},
{
"docid": "52fb354b85fa7e31beb009963b9402bb",
"score": "0.5198686",
"text": "def from(*source)\n table_alias_num = 0\n sources = []\n source.each do |s|\n case s\n when Hash\n s.each{|k,v| sources << SQL::AliasedExpression.new(k,v)}\n when Dataset\n sources << SQL::AliasedExpression.new(s, dataset_alias(table_alias_num+=1))\n when Symbol\n sch, table, aliaz = split_symbol(s)\n if aliaz\n s = sch ? SQL::QualifiedIdentifier.new(sch.to_sym, table.to_sym) : SQL::Identifier.new(table.to_sym)\n sources << SQL::AliasedExpression.new(s, aliaz.to_sym)\n else\n sources << s\n end\n else\n sources << s\n end\n end\n o = {:from=>sources.empty? ? nil : sources}\n o[:num_dataset_sources] = table_alias_num if table_alias_num > 0\n clone(o)\n end",
"title": ""
},
{
"docid": "7a3cfe0992800060e286ece6a07b68d7",
"score": "0.51959556",
"text": "def alias\n @alias ||= @interpreter.next_relation_alias\n end",
"title": ""
},
{
"docid": "8a78b69b5fb7eaefb839d03f5373e4b0",
"score": "0.519288",
"text": "def create_shared_alias(new_name)\n old_name, target = popm(2)\n\n unless target.is_a?(Class)\n error \"F13: The target of .alias: must be a class\"\n end\n\n old_spec = get_old_shared_spec(target, old_name)\n\n target.create_shared_method(new_name,\n get_alias_type(old_spec, new_name),\n old_spec.tags,\n &old_spec.does)\n clear_cast\n end",
"title": ""
},
{
"docid": "3162caa8d8b2f7cc79dd748204668624",
"score": "0.5185752",
"text": "def set_undecorated_table_name(new_table_name=nil)\n value = table_name ? \"'#{new_table_name}'\" :\n \"original_undecorated_table_name(class_name)\"\n class_eval <<-EOS\n def self.undecorated_table_name(class_name=self.class.name)\n #{value}\n end #def\n EOS\n end",
"title": ""
},
{
"docid": "1d6387ef2db60d220778b34ad57e7633",
"score": "0.5185631",
"text": "def alias_to(the_alias_id)\n self.alias = true\n self.alias_id = the_alias_id\n self.save\n end",
"title": ""
},
{
"docid": "f45f710dcbb1b47069db77da3c343110",
"score": "0.51831794",
"text": "def column_names_with_alias\n unless @column_names_with_alias\n @column_names_with_alias = []\n\n ([primary_key] + (column_names - [primary_key])).each_with_index do |column_name, i|\n @column_names_with_alias << [column_name, \"#{aliased_prefix}_r#{i}\"]\n end\n end\n @column_names_with_alias\n end",
"title": ""
},
{
"docid": "eb5f2b7ebb730bd53b5e93950b1ed14c",
"score": "0.51725894",
"text": "def column_alias(index)\r\n end",
"title": ""
},
{
"docid": "63126ed77fef096a63ed4e82cc949009",
"score": "0.5169053",
"text": "def aliases\n @aliases.dup\n end",
"title": ""
},
{
"docid": "e97e655e1592d554b4916182de4bc203",
"score": "0.51646835",
"text": "def set_sql_table(table)\n ann :self, :sql_table => table.to_s\n end",
"title": ""
},
{
"docid": "ccb566bc916441fbdf2d33e969593711",
"score": "0.5157463",
"text": "def aliases\r\n end",
"title": ""
},
{
"docid": "a584129bd04e927b8c289c5563f45bc6",
"score": "0.5156455",
"text": "def synpred37_Alias\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 55 )\n\n # at line 237:5: ( TABLE_REFERENCE_WITH_ALIAS ( WS )? )\n # at line 237:5: ( TABLE_REFERENCE_WITH_ALIAS ( WS )? )\n # at line 237:6: TABLE_REFERENCE_WITH_ALIAS ( WS )?\n table_reference_with_alias!\n # at line 237:33: ( WS )?\n alt_38 = 2\n look_38_0 = @input.peek( 1 )\n\n if ( look_38_0.between?( 0x9, 0xa ) || look_38_0 == 0x20 )\n alt_38 = 1\n end\n case alt_38\n when 1\n # at line 0:0: WS\n ws!\n\n end\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 55 )\n\n end",
"title": ""
},
{
"docid": "5f2c80988cf71c15198b2a7eba99360a",
"score": "0.5151578",
"text": "def column_names_with_alias\n unless @column_names_with_alias\n @column_names_with_alias = []\n\n ([primary_key] + (column_names - [primary_key])).compact.each_with_index do |column_name, i|\n @column_names_with_alias << [column_name, \"#{aliased_prefix}_r#{i}\"]\n end\n end\n @column_names_with_alias\n end",
"title": ""
},
{
"docid": "ddcc30093fec6438486cfae7046e53b2",
"score": "0.5148699",
"text": "def setup_index_alias(new_index_name)\n\n existing_alias = Tire::index(index.name).aliases.\n find { |a| a.name == index.name }\n\n if existing_alias\n ali = existing_alias\n ali.indices.each { |index_name| ali.indices.delete(index_name) }\n else\n #note:\n # Never used the model name as the name of a real index, used alias only\n Tire::index(index.name).delete #delete the real index that has the name\n ali = Tire::Alias.new(name: index.name)\n end\n\n #clean up all indcies which has the model's name as alias\n ali.indices.add(new_index_name)\n ali.save\n end",
"title": ""
},
{
"docid": "2864fb0e27b867a354f5a55e8407df4d",
"score": "0.5146034",
"text": "def set_alias(aliass)\n @alias = aliass\n end",
"title": ""
},
{
"docid": "85cc232474168143e36fa442291b2c0f",
"score": "0.5144134",
"text": "def alias_\n @alias_\n end",
"title": ""
},
{
"docid": "85cc232474168143e36fa442291b2c0f",
"score": "0.5144134",
"text": "def alias_\n @alias_\n end",
"title": ""
},
{
"docid": "8ae3149f2f7979d8797d6ebc733d6b3e",
"score": "0.51384443",
"text": "def alias_generator(real_name)\r\n\talias_name = []\t# Blank array to hold the final names\r\n\tswapped_names = name_swap(real_name) # Swap the first and last name\r\n\r\n\tswapped_names.each do |name| # for each array index, change the letters\r\n\t\tletters = name.split(\"\")\r\n\t\talias_letter = []\r\n\r\n\t\tletters.map! do |letter| # for each letter in letters, change to the next letter\r\n\t\t\tnew_letter = next_letter(letter)\r\n\t\t\tif new_letter == nil # if the value wasn't a letter (such as \"'\"), it will return nil\r\n\t\t\t\t\"\"\r\n\t\t\telse\r\n\t\t\t\tnew_letter\r\n\t\t\tend\r\n\t\tend\r\n\t\talias_name << letters.join\r\n\tend\r\n\talias_name.join(\" \")\r\nend",
"title": ""
},
{
"docid": "abd8dd994376bcde626f5e2c2a2959ac",
"score": "0.5131107",
"text": "def alias\n definition\n end",
"title": ""
},
{
"docid": "784889cd39b06c5094045e90790ff8e0",
"score": "0.5131097",
"text": "def table_name=(_); end",
"title": ""
},
{
"docid": "2751c5ff8a23ef13df1da5e3a8acfbec",
"score": "0.51282877",
"text": "def get_var_entity_set_alias(base)\n \"#{base.upcase}_ALIAS\"\nend",
"title": ""
},
{
"docid": "389c51aad523c4defdc9e8dd748c9ffe",
"score": "0.51271784",
"text": "def table_name\n if cti_tables\n if @cti_alias # SEQUEL5: remove if\n @cti_alias\n else\n cti_tables.last\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "e70947c009f5954de8ebb5e61ee0d2d5",
"score": "0.5125831",
"text": "def alias(alias_name)\n clone.alias! alias_name\n end",
"title": ""
},
{
"docid": "b43bd46de1fe271bc72b9c114b047adc",
"score": "0.51225895",
"text": "def split_alias(c)\n case c\n when Symbol\n c_table, column, aliaz = split_symbol(c)\n [c_table ? SQL::QualifiedIdentifier.new(c_table, column.to_sym) : column.to_sym, aliaz]\n when SQL::AliasedExpression\n [c.expression, c.alias]\n when SQL::JoinClause\n [c.table, c.table_alias]\n else\n [c, nil]\n end\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.