You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.binary? will sample an input to determine if it's binary (or text)
.default_type will return application/octet-stream if the input is binary, text/plain otherwise
#parents will return the list of a type's immediate parents
#lineage will return a type's full list of ancestors
I also make a cursory affordance for type parameters in the constructor and inspect methods.
I'm filing this issue rather than coming in hot with a PR because I also change the behaviour of .by_magic and .all_by_magic, such that they will always return a value (the value of .default_type); I figured that merited some discussion. I'm happy to do the patch that addresses this and another issue.
The text was updated successfully, but these errors were encountered:
I have a subclass of
MimeMagic
that I use that has a handful of useful methods:.binary?
will sample an input to determine if it's binary (or text).default_type
will returnapplication/octet-stream
if the input is binary,text/plain
otherwise#parents
will return the list of a type's immediate parents#lineage
will return a type's full list of ancestorsI also make a cursory affordance for type parameters in the constructor and
inspect
methods.I'm filing this issue rather than coming in hot with a PR because I also change the behaviour of
.by_magic
and.all_by_magic
, such that they will always return a value (the value of.default_type
); I figured that merited some discussion. I'm happy to do the patch that addresses this and another issue.The text was updated successfully, but these errors were encountered: