✨ Add FetchData msg-att methods and update rdoc #220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An accessor method has been created for every supported
msg-att
in#attr
. These attr 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
#attr
, unchanged. The exception is#internaldate
, which usesparse_time
to return aTime
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 have been given several methods (which all accept anoffset
keyword argument):#message
forBODY[]
#part(1, 2, 3)
forBODY[1.2.3]
#text(1, 2, 3)
forBODY[1.2.3.TEXT]
#mime(1, 2, 3)
forBODY[1.2.3.MIME]
#header(1, 2, 3)
forBODY[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)]