无法从HTTParty响应中访问数据

时间:2016-09-08 22:25:08

标签: ruby-on-rails httparty

我正在尝试访问“ticket_classes”但遇到问题。回复如下。这是我尝试过的:

响应[1] =>零 response.last =>错误 response [“ticket_classes”] =>零

我哪里错了?

> {
>         "pagination" => {
>         "object_count" => 1,
>          "page_number" => 1,
>            "page_size" => 50,
>           "page_count" => 1
>     },
>     "ticket_classes" => [
>         [0] {
>                                   "cost" => {
>                     "display" => "CA$13.00",
>                    "currency" => "CAD",
>                       "value" => 1300,
>                 "major_value" => "13.00"
>             },
>                                    "fee" => {
>                     "display" => "CA$1.39",
>                    "currency" => "CAD",
>                       "value" => 139,
>                 "major_value" => "1.39"
>             },
>                                    "tax" => {
>                     "display" => "CA$0.72",
>                    "currency" => "CAD",
>                       "value" => 72,
>                 "major_value" => "0.72"
>             },
>                           "resource_uri" => "https://www.eventbriteapi.com/v3/events/27059728376/ticket_classes/53350194/",
>                                   "name" => "General Admission",
>                            "description" => nil,
>                               "donation" => false,
>                                   "free" => false,
>                       "minimum_quantity" => 1,
>                       "maximum_quantity" => nil,
>             "maximum_quantity_per_order" => 10,
>                         "on_sale_status" => "AVAILABLE",
>                               "variants" => [],
>                         "has_pdf_ticket" => true,
>                         "sales_channels" => [
>                 [0] "online",
>                 [1] "atd"
>             ],
>                               "event_id" => "27059728376",
>                                     "id" => "53350194"
>         }
>     ] }

0 个答案:

没有答案