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)


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

def issued?
  issued_at.present?
end

#mark_as_issued!Object



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

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

#to_sObject



44
45
46
# File 'app/models/effective/ring.rb', line 44

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