class BlueCrossPets::Pet

Attributes

age[RW]
availability[RW]
bio[RW]
breed[RW]
breed_and_colour[RW]
can_live_with[RW]
gender[RW]
name[RW]
profile_url[RW]
reference[RW]

Public Class Methods

create_from_index(pet_array) click to toggle source
# File lib/blue_cross_pets/pet.rb, line 5
def self.create_from_index(pet_array)
  pet_array.each do |pet_hash|
    self.new(pet_hash)
  end
end

Public Instance Methods

add_attributes(attribute_hash) click to toggle source
# File lib/blue_cross_pets/pet.rb, line 18
def add_attributes(attribute_hash)
  attribute_hash.each do |attribute, value|
    self.send("#{attribute}=".to_sym, value)
  end
  self
end
get_more_info() click to toggle source
# File lib/blue_cross_pets/pet.rb, line 11
def get_more_info
  if !self.reference
    attribute_hash = BlueCrossPets::Scraper.new.scrape_profile(self.profile_url)
    self.add_attributes(attribute_hash)
  end 
end