class WebMerge::Notification
Attributes
from[RW]
html[RW]
password[RW]
security[RW]
subject[RW]
to[RW]
Public Class Methods
new(to: required(:to), from: required(:from), subject: "WebMerge Notification", security: WebMerge::Constants::SECURITY_LEVEL_LOW, html: nil, password: nil)
click to toggle source
# File lib/web_merge/notification.rb, line 12 def initialize(to: required(:to), from: required(:from), subject: "WebMerge Notification", security: WebMerge::Constants::SECURITY_LEVEL_LOW, html: nil, password: nil) @to = to @from = from @subject = subject @security = security @html = html @password = password end
Public Instance Methods
as_form_data()
click to toggle source
# File lib/web_merge/notification.rb, line 25 def as_form_data request_params = { to: to, from: from, subject: subject, html: html, security: security } request_params.merge!(password: password) if requires_password? request_params end
requires_password?()
click to toggle source
# File lib/web_merge/notification.rb, line 21 def requires_password? security == WebMerge::Constants::SECURITY_LEVEL_MEDIUM || security == WebMerge::Constants::SECURITY_LEVEL_HIGH end