module Springcm::Mixins::Attributes
Mixin for objects that have attributes.
Public Instance Methods
apply_attribute_group(group_name)
click to toggle source
Apply a skeleton attribute group to the Document
object. Calling patch or put before actually applying any data will have no effect on the document within SpringCM.
# File lib/springcm-sdk/mixins/attributes.rb, line 28 def apply_attribute_group(group_name) return if !attribute_group(group_name).nil? group_config = @client.account.attribute_group(name: group_name) @data["AttributeGroups"] ||= {} @data["AttributeGroups"].merge!({ "#{group_name}" => group_config.template }) end
attribute_group(group_name)
click to toggle source
# File lib/springcm-sdk/mixins/attributes.rb, line 15 def attribute_group(group_name) groups = @data["AttributeGroups"] || get.attribute_groups || {} group_data = groups[group_name] if group_data.nil? nil else AppliedAttributeGroup.new(group_data, group_name, self, @client) end end
attribute_groups=(value)
click to toggle source
# File lib/springcm-sdk/mixins/attributes.rb, line 11 def attribute_groups=(value) @data["AttributeGroups"] = value end