About mime/types

Discussion in 'Ruby' started by Pål Bergström, Aug 28, 2008.

  1. 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?
    --
    Posted via http://www.ruby-forum.com/.
     
    Pål Bergström, Aug 28, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Awah Teh

    MIME Types in .Net (urgent)

    Awah Teh, Sep 18, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    3,431
    K. Shier
    Sep 24, 2003
  2. CJ
    Replies:
    1
    Views:
    1,575
    Andrew Thompson
    Oct 29, 2004
  3. Jan Arickx
    Replies:
    0
    Views:
    203
    Jan Arickx
    Aug 25, 2003
  4. joe
    Replies:
    0
    Views:
    200
  5. ecureuil
    Replies:
    0
    Views:
    329
    ecureuil
    May 28, 2006
Loading...

Share This Page