Class: Munificent::Bundle

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

Instance Method Summary collapse

Methods inherited from ApplicationRecord

#to_s

Instance Method Details

#highest_tierObject



41
42
43
# File 'app/models/munificent/bundle.rb', line 41

def highest_tier
  bundle_tiers.max_by(&:price)
end

#lowest_tierObject



45
46
47
# File 'app/models/munificent/bundle.rb', line 45

def lowest_tier
  bundle_tiers.min_by(&:price)
end

#total_valueObject



49
50
51
# File 'app/models/munificent/bundle.rb', line 49

def total_value
  highest_tier.price
end