Class: Effective::Stamp

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

Constant Summary collapse

CATEGORIES =

CATEGORIES = ['Physical', 'Digital-only']

['Physical']

Instance Method Summary collapse

Instance Method Details

#issued?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'app/models/effective/stamp.rb', line 60

def issued?
  issued_at.present?
end

#mark_as_issued!Object



56
57
58
# File 'app/models/effective/stamp.rb', line 56

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

#physical?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'app/models/effective/stamp.rb', line 64

def physical?
  category == 'Physical'
end

#to_sObject



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

def to_s
  ['Professional Stamp', *name.presence].join(' ')
end