我有以下OpenStruct對象,但如果我調用.class上的字符串。如何將其重新轉換爲OpenStruct對象?Ruby on Rails字符串到OpenStruct
[
#<OpenStruct source="hkepc.com", visits="8", visitBounceRate="37.5", avgTimeOnSite="199.375", pageviews="25", pageviewsPerVisit="3.125">,
#<OpenStruct source="1st-tag.co.uk", visits="6", visitBounceRate="100.0", avgTimeOnSite="0.0", pageviews="6", pageviewsPerVisit="1.0">,
#<OpenStruct source="facebook.com", visits="5", visitBounceRate="80.0", avgTimeOnSite="8.2", pageviews="6", pageviewsPerVisit="1.2">
]
這不是一個OpenStruct對象的數組 – Gerry
你能請張貼工作的例子來重現問題? – toro2k
所以我可以分裂嗎? –