Method: GoodData::MdObject.replace_quoted
- Defined in:
- lib/gooddata/models/metadata.rb
.replace_quoted(obj, mapping) ⇒ GoodData::MdObject
Method used for replacing objects like Attribute, Fact or Metric. It takes the object. Scans its JSON representation and returns a new one with object references changed according to mapping. The references an be found either in the object structure or in the MAQL in bracketed form. This implementation takes care only of those in object structure where they are as a string in JSON.
56 57 58 59 60 |
# File 'lib/gooddata/models/metadata.rb', line 56 def replace_quoted(obj, mapping) replace(obj, mapping) do |e, a, b| e.gsub("\"#{a}\"", "\"#{b}\"") end end |