class SoftwareBinder::Category

Attributes

name[RW]
slug[RW]

Public Class Methods

all() click to toggle source
# File lib/software_binder/category.rb, line 10
def self.all
  @@all
end
find_by_alphabet(alphabet) click to toggle source
# File lib/software_binder/category.rb, line 28
def self.find_by_alphabet(alphabet)
  if alphabet === "#"
    self.all.select do |category|
      category.name.chr.to_i.between?(1,9) == true
    end
  else
    self.all.select do |category|
      category.name.downcase.chr == alphabet.downcase
    end
  end
end
find_by_keyword(keyword) click to toggle source
# File lib/software_binder/category.rb, line 22
def self.find_by_keyword(keyword)
  self.all.select do |category|
    category.name.downcase.include?(keyword.downcase)
  end
end
new() click to toggle source
# File lib/software_binder/category.rb, line 6
def initialize
  self.save
end
reset() click to toggle source
# File lib/software_binder/category.rb, line 14
def self.reset
  @@all.clear
end

Public Instance Methods

save() click to toggle source
# File lib/software_binder/category.rb, line 18
def save
  @@all << self
end