Method: GoodData::Metric#replace

Defined in:
lib/gooddata/models/metadata/metric.rb

#replace(mapping) ⇒ GoodData::Metric

Method used for replacing values in their state according to mapping. Can be used to replace any values but it is typically used to replace the URIs. Returns a new object of the same type.

Parameters:

  • Mapping (Array<Array>)

    specifying what should be exchanged for what. As mapping should be used output of GoodData::Helpers.prepare_mapping.

Returns:

[View source]

170
171
172
173
174
175
# File 'lib/gooddata/models/metadata/metric.rb', line 170

def replace(mapping)
  x = GoodData::MdObject.replace_quoted(self, mapping)
  x = GoodData::MdObject.replace_bracketed(x, mapping)
  vals = GoodData::MdObject.find_replaceable_values(x, mapping)
  GoodData::MdObject.replace_bracketed(x, vals)
end