Class: YesMail

Inherits:
Object
  • Object
show all
Extended by:
Yescode::Strings
Includes:
Emote::Helpers
Defined in:
lib/yes_mail.rb

Constant Summary

Constants included from Yescode::Strings

Yescode::Strings::SNAKE_CASE_REGEX

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Yescode::Strings

camel_case, class_name, filename, pascal_case, snake_case

Methods included from Emote::Helpers

#emote, #emote_cache, #file_cache

Class Attribute Details

._fromObject

Returns the value of attribute _from.



13
14
15
# File 'lib/yes_mail.rb', line 13

def _from
  @_from
end

._html_viewObject

Returns the value of attribute _html_view.



13
14
15
# File 'lib/yes_mail.rb', line 13

def _html_view
  @_html_view
end

._layoutObject

Returns the value of attribute _layout.



13
14
15
# File 'lib/yes_mail.rb', line 13

def _layout
  @_layout
end

._text_viewObject

Returns the value of attribute _text_view.



13
14
15
# File 'lib/yes_mail.rb', line 13

def _text_view
  @_text_view
end

.template_pathObject



15
16
17
# File 'lib/yes_mail.rb', line 15

def template_path
  @template_path || File.join(".", "app", "emails")
end

Class Method Details

.from(arg) ⇒ Object



23
24
25
# File 'lib/yes_mail.rb', line 23

def from(arg)
  @_from = arg
end

.html_view(arg) ⇒ Object



27
28
29
# File 'lib/yes_mail.rb', line 27

def html_view(arg)
  @_html_view = arg
end

.inherited(subclass) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/yes_mail.rb', line 35

def inherited(subclass)
  subclass._from = @_from
  subclass._layout = @_layout
  subclass._html_view = @_html_view
  subclass._text_view = @_text_view
  super
end

.layout(arg) ⇒ Object



19
20
21
# File 'lib/yes_mail.rb', line 19

def layout(arg)
  @_layout = arg
end

.text_view(arg) ⇒ Object



31
32
33
# File 'lib/yes_mail.rb', line 31

def text_view(arg)
  @_text_view = arg
end

Instance Method Details

#deliverObject

Raises:

  • (NotImplementedError)


44
45
46
# File 'lib/yes_mail.rb', line 44

def deliver
  raise NotImplementedError
end

#mail(from: nil, to: nil, subject: nil) ⇒ Object



48
49
50
# File 'lib/yes_mail.rb', line 48

def mail(from: nil, to: nil, subject: nil)
  new_mail(from:, to:, subject:).deliver
end