Class: Mailercity::Message
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize(args) ⇒ Message
constructor
A new instance of Message.
- #mailer_name ⇒ Object
Methods included from Helper
Constructor Details
#initialize(args) ⇒ Message
Returns a new instance of Message.
63 64 65 66 |
# File 'lib/mailercity.rb', line 63 def initialize(args) @template = args.fetch(:template) @params = args.fetch(:params) end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
61 62 63 |
# File 'lib/mailercity.rb', line 61 def params @params end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
61 62 63 |
# File 'lib/mailercity.rb', line 61 def template @template end |
Instance Method Details
#deliver ⇒ Object
72 73 74 75 76 77 |
# File 'lib/mailercity.rb', line 72 def deliver return true if Mailercity.perform_deliveries == false response = Mailercity.request("/#{mailer_name}/#{template}", params) response.status == 201 end |
#mailer_name ⇒ Object
68 69 70 |
# File 'lib/mailercity.rb', line 68 def mailer_name underscore self.class.name.split(/::/).last end |