小编Kav*_*veh的帖子

Ruby on Rails:`没有将String隐式转换为Integer`来获取json字段

我从xml-rpc服务器得到了一个像这样的json文件:

{
  "total_asr": -1,
  "report": [
{
  "logout_time_formatted": "2013-12-07 15:19",
  "caller_id": "",
  "user_id": x,
  "bytes_in": "964826",
  "login_time_formatted": "2013-12-07 13:46",
  "details": [
    [
      "terminate_cause",
      "Lost-Carrier"
    ],
    [
      "service",
      "x"
    ],
    [
      "nas_port_type",
      "Ethernet"
    ],
    [
      "mac",
      "x:x:x:C6:63:DE"
    ],
    [
      "assigned_ip",
      "x.x.65.139"
    ],
    [
      "port",
      "x"
    ]
  ],
  "ras_description": "x",
  "service_type": "Internet",
  "username": "x",
  "successful": "t",
  "bytes_out": "423928",
  "before_credit": 10029.29841,
  "connection_log_id": 49038,
  "billed_duration": 5562,
  "credit_used": 11.25756,
  "retry_count": 1,
  "parent_isp_credit_used": 0.0,
  "duration_seconds": 5563.0,
  "remote_ip": "5.200.65.139"
},
.
.
.
],
  "total_rows": "85",
  "total_voip_provider_credit_used": …
Run Code Online (Sandbox Code Playgroud)

json ruby-on-rails

7
推荐指数
1
解决办法
9933
查看次数

标签 统计

json ×1

ruby-on-rails ×1