Class: Munificent::Bundle

Inherits:
ApplicationRecord show all
Defined in:
app/models/munificent/bundle.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

#to_s

Instance Method Details

#highest_tierObject



39
40
41
# File 'app/models/munificent/bundle.rb', line 39

def highest_tier
  bundle_tiers.max_by(&:price)
end

#lowest_tierObject



43
44
45
# File 'app/models/munificent/bundle.rb', line 43

def lowest_tier
  bundle_tiers.min_by(&:price)
end

#total_valueObject



47
48
49
# File 'app/models/munificent/bundle.rb', line 47

def total_value
  highest_tier.price
end