Class: Effective::Ring

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/ring.rb

Constant Summary collapse

SIZES =
[3, 4, 5, 6, 7, 8]
TITANIUM_SIZES =
[3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
METALS =
['14k Yellow Gold', 'Sterling Silver', 'Titanium']

Instance Method Summary collapse

Instance Method Details

#issued?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'app/models/effective/ring.rb', line 59

def issued?
  issued_at.present?
end

#mark_as_issued!Object



51
52
53
# File 'app/models/effective/ring.rb', line 51

def mark_as_issued!
  update!(issued_at: Time.zone.now)
end

#submitted?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'app/models/effective/ring.rb', line 55

def 
  purchased?
end

#to_sObject



47
48
49
# File 'app/models/effective/ring.rb', line 47

def to_s
  ["Chemist's Ring", (" - #{metal} size #{size}" if metal.present? && size.present?)].compact.join
end