Hash traversal of ruby development Each_with_index

Source: Internet
Author: User

<div style= "Text-align:left;" ><span style= "font-family:arial, Helvetica, Sans-serif;" > #设置奖励信息 </span></div> def set_award_info (task_params,award_params) if task_params[:goods_i  D].to_i = = sequel::model::table # update Sys_task_award_account award_params[:account].split (/;/).              |params| Task_award = {} task_award[:account_id] = nil Task_award[:award_type] = nil Task_aw              Ard[:base_amount] = nil Task_award[:min_amount] = nil Task_award[:max_amount] = Nil Task_award[:award_equation] = Nil params = params.split (/:/) Task_award.each_with_index do |                (Key,value), index| Task_award[key] = Params[index] End task_award[:task_id] = task_params[:task_id] Ta Sk_award[:create_time] = Time.now Task_award[:update_time] = Time.now Sys_task_award_account = Caiqiuservice::coredao::systaskawardaccount.new Sys_task_award_account.save_hash (task_award) en D End #其他类型 TODO end

Hash traversal of ruby development Each_with_index

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.