Class: BlueCrossPets::Pet
- Inherits:
-
Object
- Object
- BlueCrossPets::Pet
- Defined in:
- lib/blue_cross_pets/pet.rb
Instance Attribute Summary collapse
-
#age ⇒ Object
Returns the value of attribute age.
-
#availability ⇒ Object
Returns the value of attribute availability.
-
#bio ⇒ Object
Returns the value of attribute bio.
-
#breed ⇒ Object
Returns the value of attribute breed.
-
#breed_and_colour ⇒ Object
Returns the value of attribute breed_and_colour.
-
#can_live_with ⇒ Object
Returns the value of attribute can_live_with.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#name ⇒ Object
Returns the value of attribute name.
-
#profile_url ⇒ Object
Returns the value of attribute profile_url.
-
#reference ⇒ Object
Returns the value of attribute reference.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#age ⇒ Object
Returns the value of attribute age.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def age @age end |
#availability ⇒ Object
Returns the value of attribute availability.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def availability @availability end |
#bio ⇒ Object
Returns the value of attribute bio.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def bio @bio end |
#breed ⇒ Object
Returns the value of attribute breed.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def breed @breed end |
#breed_and_colour ⇒ Object
Returns the value of attribute breed_and_colour.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def breed_and_colour @breed_and_colour end |
#can_live_with ⇒ Object
Returns the value of attribute can_live_with.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def can_live_with @can_live_with end |
#gender ⇒ Object
Returns the value of attribute gender.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def gender @gender end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def name @name end |
#profile_url ⇒ Object
Returns the value of attribute profile_url.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def profile_url @profile_url end |
#reference ⇒ Object
Returns the value of attribute reference.
3 4 5 |
# File 'lib/blue_cross_pets/pet.rb', line 3 def reference @reference end |
Class Method Details
.create_from_index(pet_array) ⇒ Object
5 6 7 8 9 |
# 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 |
Instance Method Details
#add_attributes(attribute_hash) ⇒ Object
18 19 20 21 22 23 |
# 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 ⇒ Object
11 12 13 14 15 16 |
# 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 |