class NYTBestsellers::Genre

Attributes

name[RW]
url[RW]

Public Class Methods

all() click to toggle source
# File lib/nytimes/genre.rb, line 14
def self.all 
  @@all
end
find_by_name(genre_name) click to toggle source
# File lib/nytimes/genre.rb, line 22
def self.find_by_name(genre_name)
  self.all.find {|x| x.name == genre_name}
end
find_by_num(num_input) click to toggle source
# File lib/nytimes/genre.rb, line 26
def self.find_by_num(num_input)
  self.all[num_input.to_i-1]
end
new(hash = {}) click to toggle source
# File lib/nytimes/genre.rb, line 6
def initialize(hash = {})
  hash.each do |key, value|
    self.send("#{key}=", value)
  end  
  @@all << self
  @books = []
end

Public Instance Methods

books() click to toggle source
# File lib/nytimes/genre.rb, line 18
def books
  @books
end