class EmailDoc::Document

Attributes

context[R]
ex[R]
mail[R]

Public Class Methods

new(context, mail, ex) click to toggle source
# File lib/email_doc/document.rb, line 13
def initialize(context, mail, ex)
  @context = context
  @mail    = mail
  @ex      = ex
end

Public Instance Methods

pathname() click to toggle source
# File lib/email_doc/document.rb, line 38
def pathname
  @pathname ||= begin
    dir  = './doc/mail/'
    path = ex.file_path.gsub(%r<\./spec/mailers/(.+)_spec\.rb>, '\1.md')
    Pathname.new(dir + path)
  end
end
render() click to toggle source
# File lib/email_doc/document.rb, line 19
    def render
      ERB.new(<<-MD_END).result(binding)
# #{described_class}

## #{ex.description}

```
    From: #{from}
 Subject: #{subject}
      To: #{to}
Reply to: #{reply_to}
```

```
#{body.encoded}
```
MD_END
    end