Sha256: 8e3800a47fb9229fc6de653c11e30920f50247afb610a50aa261de7224253725

Contents?: true

Size: 814 Bytes

Versions: 6

Compression:

Stored size: 814 Bytes

Contents

class Caren::ProductCategory < Caren::Base
    
  def self.keys
    [ :id,                    # Integer (Id of this category in Caren)
      :name,                  # String
      :description,           # Text
      :icon,                  # String
      :product_category_id    # Integer (Parent category; Caren id; Nil for root node)
    ] + super
  end
  
  def self.search key, value, session
    from_xml session.get( self.search_url(key,value) )
  end
  
  def self.find id, session
    from_xml session.get(self.resource_url(id))
  end
  
  def self.all session
    from_xml session.get(self.resource_url)
  end
    
  def self.array_root
    :product_categories
  end
  
  def self.node_root
    :product_category
  end
  
  def self.resource_location
    "/api/pro/store/product_categories/"
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
caren-api-0.4.12 lib/caren/product_category.rb
caren-api-0.4.11 lib/caren/product_category.rb
caren-api-0.4.10 lib/caren/product_category.rb
caren-api-0.4.9 lib/caren/product_category.rb
caren-api-0.4.8 lib/caren/product_category.rb
caren-api-0.4.7 lib/caren/product_category.rb