class BlueCrossPets::Cat
require_relative “./pet”
Public Class Methods
all()
click to toggle source
# File lib/blue_cross_pets/cat.rb, line 15 def self.all @@cats end
create_cats()
click to toggle source
# File lib/blue_cross_pets/cat.rb, line 19 def self.create_cats if all.length == 0 cat_array = BlueCrossPets::Scraper.new.scrape_index("https://www.bluecross.org.uk/rehome/cat") create_from_index(cat_array) end end
new(pet_hash)
click to toggle source
# File lib/blue_cross_pets/cat.rb, line 7 def initialize(pet_hash) pet_hash.each do |attribute, value| self.send("#{attribute}=".to_sym, value) end @@cats << self end