class PIM::DataModelManager::CategoryManager::CategoryAttributes

Public Class Methods

new(data_model, category) click to toggle source
# File data-model-manager.rb, line 374
def initialize data_model, category
  super data_model
  @category = category
end

Public Instance Methods

add(attribute) click to toggle source
# File data-model-manager.rb, line 379
def add attribute
  if (category)
    attribute = PIM::Utils.to_sym(attribute)
    return if !data_model.all_attributes.include?(attribute)
    category.instance_eval do
      add_attribute attribute
    end
  else
    PIM.log_warn("Could not add Attribute '#{attribute}', because category is not defined")
  end
end
remove(attribute) click to toggle source
# File data-model-manager.rb, line 391
def remove attribute
  if (category)
    category.instance_eval do
      remove_attribute attribute
    end
  else
    PIM.log_warn("Could not remove Attribute '#{attribute}', because category is not defined")
  end
end