Class: AdoptAPet::Pet::Photo
- Inherits:
-
Object
- Object
- AdoptAPet::Pet::Photo
- Defined in:
- lib/adopt_a_pet/pet.rb
Overview
Class for Adopt-A-Pet Pet Photos
Instance Attribute Summary collapse
-
#height ⇒ Integer
The height of the Photo.
-
#url ⇒ String
A URL where you can view the Photo.
-
#width ⇒ Integer
The width of the Photo.
Instance Method Summary collapse
-
#initialize(height, width, url) ⇒ Pet::Photo
constructor
Create a single instance of a Pet Photo.
Constructor Details
#initialize(height, width, url) ⇒ Pet::Photo
Create a single instance of a Pet Photo
263 264 265 266 267 |
# File 'lib/adopt_a_pet/pet.rb', line 263 def initialize(height, width, url) self.height = height self.width = width self.url = url end |
Instance Attribute Details
#height ⇒ Integer
Returns the height of the Photo.
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/adopt_a_pet/pet.rb', line 248 class Photo attr_accessor :height, :width, :url # Create a single instance of a Pet Photo # @author Stephen Dolan # # @param [Integer] height the height of the photo # @param [Integer] width the width of the Photo # @param [String] url a URL where you can view the photo # # @return [Pet::Photo] a new Pet Photo # # @example Create a new Photo # my_photo = Pet::Photo.new(100, 100, 'images.com/my_image') # height = my_photo.height def initialize(height, width, url) self.height = height self.width = width self.url = url end end |
#url ⇒ String
Returns a URL where you can view the Photo.
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/adopt_a_pet/pet.rb', line 248 class Photo attr_accessor :height, :width, :url # Create a single instance of a Pet Photo # @author Stephen Dolan # # @param [Integer] height the height of the photo # @param [Integer] width the width of the Photo # @param [String] url a URL where you can view the photo # # @return [Pet::Photo] a new Pet Photo # # @example Create a new Photo # my_photo = Pet::Photo.new(100, 100, 'images.com/my_image') # height = my_photo.height def initialize(height, width, url) self.height = height self.width = width self.url = url end end |
#width ⇒ Integer
Returns the width of the Photo.
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/adopt_a_pet/pet.rb', line 248 class Photo attr_accessor :height, :width, :url # Create a single instance of a Pet Photo # @author Stephen Dolan # # @param [Integer] height the height of the photo # @param [Integer] width the width of the Photo # @param [String] url a URL where you can view the photo # # @return [Pet::Photo] a new Pet Photo # # @example Create a new Photo # my_photo = Pet::Photo.new(100, 100, 'images.com/my_image') # height = my_photo.height def initialize(height, width, url) self.height = height self.width = width self.url = url end end |