lib/gooddata/models/metadata/variable.rb in gooddata-0.6.24 vs lib/gooddata/models/metadata/variable.rb in gooddata-0.6.25
- old
+ new
@@ -8,12 +8,10 @@
require_relative 'metadata'
module GoodData
class Variable < MdObject
- root_key :prompt
-
class << self
# Method intended to get all objects of that type in a specified project
#
# @param options [Hash] the options hash
# @option options [Boolean] :full if passed true the subclass can decide to pull in full objects. This is desirable from the usability POV but unfortunately has negative impact on performance so it is not the default
@@ -65,9 +63,17 @@
# Retrieves variable values and returns only those related to user
#
# @return [Array<GoodData::VariableUserFilter>] Values of variable related to user
def user_values
values.select { |x| x.level == :user }
+ end
+
+ # 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.
+ #
+ # @param [Array<Array>]Mapping specifying what should be exchanged for what. As mapping should be used output of GoodData::Helpers.prepare_mapping.
+ # @return [GoodData::Variable]
+ def replace(mapping)
+ GoodData::MdObject.replace_quoted(self, mapping)
end
# Retrieves variable values and returns only those related to project
#
# @return [Array<GoodData::VariableUserFilter>] Values of variable related to project