Class: WcoEmail::EmailFilterAction

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/wco_email/email_filter_action.rb

Constant Summary collapse

KIND_ADD_TAG =
'add-tag'
KIND_RM_TAG =
'remove-tag'
KIND_AUTORESPOND =
'autorespond-template'
KIND_OAT =

KIND_EAT = 'autorespond-email-action' ## _TODO: not implemented! KIND_RM_EAT = 'rm-email-action' ## _TODO: not implemented!

'office-action-template'
KIND_RM_OAT =
'rm-office-action-template'
KINDS =
[ KIND_ADD_TAG, KIND_RM_TAG, KIND_AUTORESPOND, KIND_OAT,
  # KIND_EAT, KIND_RM_EAT,
]

Instance Method Summary collapse

Instance Method Details

#email_templateObject

validates :aject_id, presence: true



28
29
30
31
32
33
34
# File 'app/models/wco_email/email_filter_action.rb', line 28

def email_template
  if aject.class == WcoEmail::EmailTemplate
    return aject
  else
    throw 'this email_filter_action does not have an email_template'
  end
end

#to_sObject



50
51
52
# File 'app/models/wco_email/email_filter_action.rb', line 50

def to_s
  "<EFAction #{kind} #{aject} />\n"
end

#to_s_full(indent: 0) ⇒ Object



53
54
55
# File 'app/models/wco_email/email_filter_action.rb', line 53

def to_s_full indent: 0
  "#{" " * indent }<EFAction #{kind} `#{aject}` />\n"
end

#valueObject

for exe_rb only. otherwise, use aject



23
# File 'app/models/wco_email/email_filter_action.rb', line 23

field :value