dump in yaml & unexpected result

Discussion in 'Ruby' started by Siratinee Sukachai, Apr 22, 2011.

  1. I have a Hash which value is Array of Hashes. And I expected to generate
    the yaml like this:

    ---
    Session:
    singular: Session
    email: Email
    password: Password
    rememberMe: Remember Me!


    But when I use dump method to generate yaml file and the result is:

    ---
    - Session:
    - singular: |
    Session

    - email: |
    Email

    - password: |
    Password

    - rememberMe: |
    Remember Me!


    When I print out my hash on command line, it look like this:

    SessionsingularSession
    emailEmail
    passwordPassword
    rememberMeRemember Me!


    What do you think? Am I wrong with any steps?
    If I need to generate yaml look like above, how can I do?

    --
    Posted via http://www.ruby-forum.com/.
    Siratinee Sukachai, Apr 22, 2011
    #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. halfdog
    Replies:
    12
    Views:
    12,443
  2. Michael Tan
    Replies:
    32
    Views:
    968
    Ara.T.Howard
    Jul 21, 2005
  3. Paul Battley

    YAML.dump/YAML.load bug

    Paul Battley, Aug 3, 2005, in forum: Ruby
    Replies:
    0
    Views:
    176
    Paul Battley
    Aug 3, 2005
  4. Jonathan Gold
    Replies:
    0
    Views:
    137
    Jonathan Gold
    May 19, 2009
  5. Andy Tolle
    Replies:
    7
    Views:
    229
    Andy Tolle
    Nov 15, 2010
Loading...

Share This Page