Class: Wco::Tag
- Inherits:
-
Object
- Object
- Wco::Tag
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- app/models/wco/tag.rb
Constant Summary collapse
- BOUNCE =
'bounce'- BOUNCED =
'bounced'- DONOTSEND =
'donotsend'- INBOX =
'inbox'- SPAM =
'spam'- NOT_SPAM =
'not-spam'- TRASH =
'trash'
Class Method Summary collapse
- .bounce ⇒ Object
- .bounced ⇒ Object
- .donotsend ⇒ Object
- .illustration ⇒ Object
- .inbox ⇒ Object
- .list ⇒ Object
- .not_spam ⇒ Object
- .spam ⇒ Object
- .trash ⇒ Object
Instance Method Summary collapse
Class Method Details
.bounce ⇒ Object
34 35 36 |
# File 'app/models/wco/tag.rb', line 34 def self.bounce find_or_create_by({ slug: BOUNCE }) end |
.bounced ⇒ Object
39 40 41 |
# File 'app/models/wco/tag.rb', line 39 def self.bounced find_or_create_by({ slug: BOUNCED }) end |
.donotsend ⇒ Object
44 45 46 |
# File 'app/models/wco/tag.rb', line 44 def self.donotsend find_or_create_by({ slug: DONOTSEND }) end |
.illustration ⇒ Object
48 49 50 |
# File 'app/models/wco/tag.rb', line 48 def self.illustration find_or_create_by({ slug: 'Illustration.' }) end |
.inbox ⇒ Object
53 54 55 |
# File 'app/models/wco/tag.rb', line 53 def self.inbox find_or_create_by({ slug: INBOX }) end |
.list ⇒ Object
76 77 78 |
# File 'app/models/wco/tag.rb', line 76 def self.list [[nil,nil]] + all.order_by( slug: :asc ).map { |p| [ p.slug, p.id ] } end |
.not_spam ⇒ Object
63 64 65 |
# File 'app/models/wco/tag.rb', line 63 def self.not_spam find_or_create_by({ slug: NOT_SPAM }) end |
.spam ⇒ Object
58 59 60 |
# File 'app/models/wco/tag.rb', line 58 def self.spam find_or_create_by({ slug: SPAM }) end |
.trash ⇒ Object
68 69 70 |
# File 'app/models/wco/tag.rb', line 68 def self.trash find_or_create_by({ slug: TRASH }) end |
Instance Method Details
#to_s ⇒ Object
73 74 75 |
# File 'app/models/wco/tag.rb', line 73 def to_s slug end |