我有以下方法
def build_json
range = @model.OBJECT.item_ranges.object1.as_json
ranges.map do |range|
{
heading1: some_method(range["something"],
body: range["something1"]
}
end
end
["object1", "object2"]
@model.OBJECT.item_ranges.as_json.keys
如何在同一方法build_json中循环两个对象并创建json?
由于