Class: Item
- Inherits:
-
Object
- Object
- Item
- Extended by:
- Concerns::Mergable, Concerns::Searchable
- Defined in:
- lib/item.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#cylinders ⇒ Object
Returns the value of attribute cylinders.
-
#drive ⇒ Object
Returns the value of attribute drive.
-
#fuel ⇒ Object
Returns the value of attribute fuel.
-
#link ⇒ Object
Returns the value of attribute link.
-
#location ⇒ Object
Returns the value of attribute location.
-
#make ⇒ Object
Returns the value of attribute make.
-
#model ⇒ Object
Returns the value of attribute model.
-
#number ⇒ Object
Returns the value of attribute number.
-
#odometer ⇒ Object
Returns the value of attribute odometer.
-
#other_ads ⇒ Object
Returns the value of attribute other_ads.
-
#paint ⇒ Object
Returns the value of attribute paint.
-
#pid ⇒ Object
Returns the value of attribute pid.
-
#postingbody ⇒ Object
Returns the value of attribute postingbody.
-
#price ⇒ Object
Returns the value of attribute price.
-
#size ⇒ Object
Returns the value of attribute size.
-
#timeago ⇒ Object
Returns the value of attribute timeago.
-
#title ⇒ Object
Returns the value of attribute title.
-
#transmission ⇒ Object
Returns the value of attribute transmission.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#venue ⇒ Object
Returns the value of attribute venue.
-
#venue_date ⇒ Object
Returns the value of attribute venue_date.
-
#VIN ⇒ Object
Returns the value of attribute VIN.
-
#year ⇒ Object
Returns the value of attribute year.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(item_hash) ⇒ Item
constructor
A new instance of Item.
Methods included from Concerns::Searchable
get_link_from_key, get_subcategory_info, items_in_price_range, items_with_price, search_by_category, search_by_pid, search_by_type, search_items
Methods included from Concerns::Mergable
merge_item, merge_price_manager_attr
Constructor Details
#initialize(item_hash) ⇒ Item
Returns a new instance of Item.
8 9 10 11 |
# File 'lib/item.rb', line 8 def initialize(item_hash) item_hash.each{|key,value| self.send("#{key}=", value)} @@all << self if @@all.none?{|item| item.pid == self.pid} end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
2 3 4 |
# File 'lib/item.rb', line 2 def category @category end |
#condition ⇒ Object
Returns the value of attribute condition.
2 3 4 |
# File 'lib/item.rb', line 2 def condition @condition end |
#cylinders ⇒ Object
Returns the value of attribute cylinders.
2 3 4 |
# File 'lib/item.rb', line 2 def cylinders @cylinders end |
#drive ⇒ Object
Returns the value of attribute drive.
2 3 4 |
# File 'lib/item.rb', line 2 def drive @drive end |
#fuel ⇒ Object
Returns the value of attribute fuel.
2 3 4 |
# File 'lib/item.rb', line 2 def fuel @fuel end |
#link ⇒ Object
Returns the value of attribute link.
2 3 4 |
# File 'lib/item.rb', line 2 def link @link end |
#location ⇒ Object
Returns the value of attribute location.
2 3 4 |
# File 'lib/item.rb', line 2 def location @location end |
#make ⇒ Object
Returns the value of attribute make.
2 3 4 |
# File 'lib/item.rb', line 2 def make @make end |
#model ⇒ Object
Returns the value of attribute model.
2 3 4 |
# File 'lib/item.rb', line 2 def model @model end |
#number ⇒ Object
Returns the value of attribute number.
2 3 4 |
# File 'lib/item.rb', line 2 def number @number end |
#odometer ⇒ Object
Returns the value of attribute odometer.
2 3 4 |
# File 'lib/item.rb', line 2 def odometer @odometer end |
#other_ads ⇒ Object
Returns the value of attribute other_ads.
2 3 4 |
# File 'lib/item.rb', line 2 def other_ads @other_ads end |
#paint ⇒ Object
Returns the value of attribute paint.
2 3 4 |
# File 'lib/item.rb', line 2 def paint @paint end |
#pid ⇒ Object
Returns the value of attribute pid.
2 3 4 |
# File 'lib/item.rb', line 2 def pid @pid end |
#postingbody ⇒ Object
Returns the value of attribute postingbody.
2 3 4 |
# File 'lib/item.rb', line 2 def postingbody @postingbody end |
#price ⇒ Object
Returns the value of attribute price.
2 3 4 |
# File 'lib/item.rb', line 2 def price @price end |
#size ⇒ Object
Returns the value of attribute size.
2 3 4 |
# File 'lib/item.rb', line 2 def size @size end |
#timeago ⇒ Object
Returns the value of attribute timeago.
2 3 4 |
# File 'lib/item.rb', line 2 def timeago @timeago end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/item.rb', line 2 def title @title end |
#transmission ⇒ Object
Returns the value of attribute transmission.
2 3 4 |
# File 'lib/item.rb', line 2 def transmission @transmission end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'lib/item.rb', line 2 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/item.rb', line 2 def url @url end |
#venue ⇒ Object
Returns the value of attribute venue.
2 3 4 |
# File 'lib/item.rb', line 2 def venue @venue end |
#venue_date ⇒ Object
Returns the value of attribute venue_date.
2 3 4 |
# File 'lib/item.rb', line 2 def venue_date @venue_date end |
#VIN ⇒ Object
Returns the value of attribute VIN.
2 3 4 |
# File 'lib/item.rb', line 2 def VIN @VIN end |
#year ⇒ Object
Returns the value of attribute year.
2 3 4 |
# File 'lib/item.rb', line 2 def year @year end |