lib/bill_hicks/category.rb
# Returns an array of hashes with category details.
Returns an array of hashes with category details.
Returns an array of hashes with category details .
def all
      categories = []
      catalog = Catalog.all(@options)
      catalog.each do |item|
        categories << {
          code: item[:category_code],
          description: item[:category_description]
        }
      end
      categories.uniq! { |c| c[:description] }
      categories.sort_by! { |c| c[:description] }
      categories
    end
def all categories = [ ] catalog = Catalog . all ( @options ) catalog . each do | item | categories << { code : item [ :category_code ] , description : item [ :category_description ] } end categories . uniq! { | c | c [ :description ] } categories . sort_by! { | c | c [ :description ] } categories end
Returns an array of hashes with category details.
Returns an array of hashes with category details .
# Categories are listed in catalog csv, so fetch that.