class BookwormBuddy::Category
Constants
- ALL
Attributes
bestsellers[RW]
name[RW]
url[RW]
Public Class Methods
create(category_array)
click to toggle source
# File lib/bookworm_buddy/category.rb, line 10 def self.create(category_array) category_array.each {|category| self.new(category)} end
list_categories()
click to toggle source
# File lib/bookworm_buddy/category.rb, line 14 def self.list_categories ALL.each.with_index(1) {|category, index| puts "#{index}. #{category.name}"} end
new(category_hash)
click to toggle source
# File lib/bookworm_buddy/category.rb, line 5 def initialize(category_hash) category_hash.each {|key, value| self.send("#{key}=", value)} ALL << self end