Class: Item

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps::Created::Short
Defined in:
app/models/item.rb

Instance Method Summary collapse

Instance Method Details

#all_stats_dataObject


24
25
26
# File 'app/models/item.rb', line 24

def all_stats_data
  stats.map(&:data)
end

#all_time_min_price_highObject


20
21
22
# File 'app/models/item.rb', line 20

def all_time_min_price_high
  stats.max(:min_price_high)
end

#all_time_min_price_lowObject


16
17
18
# File 'app/models/item.rb', line 16

def all_time_min_price_low
  stats.min(:min_price_low)
end

#latest_priceObject


12
13
14
# File 'app/models/item.rb', line 12

def latest_price
  stats.last.min_price_low if stats.present?
end