Class: LocalRealEstate::Listing
- Inherits:
-
Object
- Object
- LocalRealEstate::Listing
- Defined in:
- lib/local_real_estate/listing.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#bathrooms ⇒ Object
Returns the value of attribute bathrooms.
-
#bedrooms ⇒ Object
Returns the value of attribute bedrooms.
-
#cars ⇒ Object
Returns the value of attribute cars.
-
#city ⇒ Object
Returns the value of attribute city.
-
#lot_size ⇒ Object
Returns the value of attribute lot_size.
-
#price ⇒ Object
Returns the value of attribute price.
-
#sqft ⇒ Object
Returns the value of attribute sqft.
-
#state ⇒ Object
Returns the value of attribute state.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(address: nil, city: nil, state: nil, url: nil, price: nil, bedrooms: nil, bathrooms: nil, sqft: nil, cars: "none", lot_size: nil) ⇒ Listing
constructor
A new instance of Listing.
Constructor Details
#initialize(address: nil, city: nil, state: nil, url: nil, price: nil, bedrooms: nil, bathrooms: nil, sqft: nil, cars: "none", lot_size: nil) ⇒ Listing
Returns a new instance of Listing.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/local_real_estate/listing.rb', line 6 def initialize(address: nil, city: nil, state: nil, url: nil, price: nil, bedrooms: nil, bathrooms: nil, sqft: nil, cars: "none", lot_size: nil) @address = address @city = city @state = state @url = url @price = price @bedrooms = bedrooms @bathrooms = bathrooms @sqft = sqft @cars = cars @lot_size = lot_size @@all << self end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def address @address end |
#bathrooms ⇒ Object
Returns the value of attribute bathrooms.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def bathrooms @bathrooms end |
#bedrooms ⇒ Object
Returns the value of attribute bedrooms.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def bedrooms @bedrooms end |
#cars ⇒ Object
Returns the value of attribute cars.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def cars @cars end |
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def city @city end |
#lot_size ⇒ Object
Returns the value of attribute lot_size.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def lot_size @lot_size end |
#price ⇒ Object
Returns the value of attribute price.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def price @price end |
#sqft ⇒ Object
Returns the value of attribute sqft.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def sqft @sqft end |
#state ⇒ Object
Returns the value of attribute state.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def state @state end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/local_real_estate/listing.rb', line 3 def url @url end |
Class Method Details
.all ⇒ Object
20 21 22 |
# File 'lib/local_real_estate/listing.rb', line 20 def self.all @@all end |
.current_city ⇒ Object
24 25 26 |
# File 'lib/local_real_estate/listing.rb', line 24 def self.current_city @@all[0].city end |