class Gemgento::API::SOAP::Catalog::ProductAttributeSet

Public Class Methods

attribute_add() click to toggle source
# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 43
def self.attribute_add
  # TODO: add an attribute to a set on Magento
end
attribute_remove() click to toggle source
# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 47
def self.attribute_remove
  # TODO: remove an attribute from a set on Magento
end
create() click to toggle source

Create a new product attribute set in Magento

# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 34
def self.create
  # TODO: create a new product attribute set on Magento
end
fetch_all() click to toggle source

Pull all Magento ProductAttributeSet data into Gemgento.

@return [Void]

# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 10
def self.fetch_all
  response = list

  if response.success?
    response.body[:result][:item].each do |product_attribute_set|
      sync_magento_to_local(product_attribute_set)
    end
  end
end
group_add() click to toggle source
# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 51
def self.group_add
  # TODO: add a new group for attributes in the set on Magento
end
group_remove() click to toggle source
# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 55
def self.group_remove
  # TODO: remove a group of attributes in the set on Magento
end
group_rename() click to toggle source
# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 59
def self.group_rename
  # TODO: rename a group in the set on Magento
end
list() click to toggle source

Get a list of ProductAttributeSets from Magento.

@return [Gemgento::MagentoResponse]

# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 23
def self.list
  response = MagentoApi.create_call(:catalog_product_attribute_set_list)

  if response.success?
    response.body[:result][:item] = [response.body[:result][:item]] unless response.body[:result][:item].is_a? Array
  end

  return response
end
update() click to toggle source

Update existing Magento product attribute set

# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 39
def self.update
  # TODO: update a product attribute set on Magento
end

Private Class Methods

sync_magento_to_local(source) click to toggle source

Save Magento product attribute set to local.

@return [Void]

# File lib/gemgento/api/soap/catalog/product_attribute_set.rb, line 68
def self.sync_magento_to_local(source)
  product_attribute_set = ::Gemgento::ProductAttributeSet.where(magento_id: source[:set_id]).first_or_initialize
  product_attribute_set.magento_id = source[:set_id]
  product_attribute_set.name = source[:name]
  product_attribute_set.sync_needed = false
  product_attribute_set.save
end