Skip to content

Commit

Permalink
✨ Add FetchData msg-att methods and update rdoc
Browse files Browse the repository at this point in the history
An accessor method has been created for every supported `msg-att` in
`#attrs`.  These attrs accessors also provide a place for documentation
for each of the supported message attributes.

With one exception, all of the methods return the value from `#attrs`,
unchanged.  The exception is `#internaldate`, which uses `parse_time` to
return a `Time` object rather than a string.

With one exception, these methods are given the same name as their
`msg-att` with "." changed to "_".  The exception is the "body section"
attributes (`"BODY[#{section_spec}]<#offset}>"`), which has been given
several methods (which all accept an `offset` keyword argument):

* `#message`         for `BODY[]`
* `#part(1, 2, 3)`   for `BODY[1.2.3]`
* `#text(1, 2, 3)`   for `BODY[1.2.3.TEXT]`
* `#mime(1, 2, 3)`   for `BODY[1.2.3.MIME]`
* `#header(1, 2, 3)` for `BODY[1.2.3.HEADER]`
* `#header(fields: %w[Foo Bar])` or `#header_fields("Foo", "Bar")`
  for `BODY[HEADER.FIELDS (Foo Bar)]`
* `#header(except: %w[Foo Bar])` or `#header_fields_not("Foo", "Bar")`
  for `BODY[HEADER.FIELDS.NOT (Foo Bar)]`
  • Loading branch information
nevans committed Nov 9, 2023
1 parent f27dd4c commit 8970ee6
Show file tree
Hide file tree
Showing 3 changed files with 573 additions and 205 deletions.
Loading

0 comments on commit 8970ee6

Please sign in to comment.