如何将params转换为xml?

时间:2015-04-15 17:42:07

标签: ruby-on-rails xml ruby-on-rails-4 parameters

我有这个参数:

Parameters:

 {"metodo"=>"cartao-credito",
 "formaPagamento"=>{"cartao"=>{"parcelas"=>"1"}},
 "tokenPagamento"=>"21162f8f1c2204a0c83fe9710437d5e1276f59fc"}

我需要将它们转换为像这样的xml:

<integracao>
<formaPagamento>
   <metodo>cartao-credito</metodo>
    <cartao>   
       <parcelas>2</parcelas>
    </cartao>
</formaPagamento>
<tokenPagamento>21162f8f1c2204a0c83fe9710437d5e1276f59fc</tokenPagamento>

我该怎么做? 感谢

0 个答案:

没有答案