class PetsSeekingPeople::Pets

Attributes

adoption_contact[RW]
adoption_website[RW]
age[RW]
animal_url[RW]
breed[RW]
detailed_info[RW]
gender[RW]
info[RW]
name[RW]

Public Class Methods

all() click to toggle source
# File lib/pets_seeking_people/pets.rb, line 23
def self.all
        @@all
end
create_from_collection(animals_array) click to toggle source
# File lib/pets_seeking_people/pets.rb, line 12
def self.create_from_collection(animals_array)
        animals_array.each do |animal|
                PetsSeekingPeople::Pets.new(animal)
        end
end
find(input) click to toggle source
# File lib/pets_seeking_people/pets.rb, line 27
def self.find(input)
        self.all[input.to_i-1]
end
new(animal_hash) click to toggle source
# File lib/pets_seeking_people/pets.rb, line 7
def initialize(animal_hash)
        animal_hash.each {|key, value| self.send(("#{key}="), value)}
        @@all << self
end

Public Instance Methods

add_animal_attributes(attributes_hash) click to toggle source
# File lib/pets_seeking_people/pets.rb, line 18
def add_animal_attributes(attributes_hash)
        attributes_hash.each {|key, value| self.send(("#{key}="), value)}
        self
end