Sha256: 3c6e798283576e17ddaf8913cabbae61f0d2b10f86fe3ecd9924be09f74b848b

Contents?: true

Size: 724 Bytes

Versions: 14

Compression:

Stored size: 724 Bytes

Contents

module Access
  class Category
    include Access::MuchMeta

    def self.search(options = {})
      Access::Api.new.search_categories options
    end

    def self.find(category_key, options = {})
      Access::Api.new.find_category category_key, options
    end

    def self.process_batch(chunk)
      chunk.map { |category| new(category) }
    end

    def initialize(values)
      @used_fields = []
      set_up_methods(values)
      set_values(values)
      @links = Access::Link.new(@links) if @links
      @subcategories = Access::Category.process_batch(@subcategories) if @subcategories
      @subcategory_siblings = Access::Category.process_batch(@subcategory_siblings) if @subcategory_siblings
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
access-2.3.0.pre.rc2 lib/access/category.rb
access-2.3.0.pre.rc1 lib/access/category.rb
access-2.2.0 lib/access/category.rb
access-2.1.5 lib/access/category.rb
access-2.1.4 lib/access/category.rb
access-2.1.3 lib/access/category.rb
access-2.1.2 lib/access/category.rb
access-2.1.1 lib/access/category.rb
access-2.1.0 lib/access/category.rb
access-2.0.55 lib/access/category.rb
access-2.0.54 lib/access/category.rb
access-2.0.53 lib/access/category.rb
access-2.0.52 lib/access/category.rb
access-2.0.51 lib/access/category.rb