About mime/types

Why does this MIME::Types[‘text/plain’] give ‘text/plaintext/plain’?

The thing is I’m trying to understand how to use mime/types
http://mime-types.rubyforge.org/classes/MIME/Types.html and I can’t
mimic this example:

plaintext = MIME::Types[‘text/plain’]
print plaintext.media_type # => ‘text’
print plaintext.sub_type # => ‘plain’

It doesn’t work unless I do MIME::Types[‘text/plain’].first. Why?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs