instance method
arrparse
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v3.0.20Available in: v2.3.18 v3.0.20
Signature
arrparse(ts)
Parses an “array” in the sense of RFC 4627. Returns the parsed value and any trailing tokens.
Parameters
-
tsreq
Source
# File activesupport/lib/active_support/json/backends/okjson.rb, line 137
def arrparse(ts)
ts = eat('[', ts)
arr = []
if ts[0][0] == ']'
return arr, ts[1..-1]
end
v, ts = valparse(ts)
arr << v
if ts[0][0] == ']'
return arr, ts[1..-1]
end
loop do
ts = eat(',', ts)
v, ts = valparse(ts)
arr << v
if ts[0][0] == ']'
return arr, ts[1..-1]
end
end
end
Defined in activesupport/lib/active_support/json/backends/okjson.rb line 137
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::OkJson