Fat Comma - Subtleties - Ruby

Ruby

In Ruby, the fat comma is the token to create hashes. Ruby 1.9 introduced a special syntax to use symbols as badwords. In Ruby, the fat comma is occasionally called a hash rocket.

# Old syntax old_hash = { :name => 'Ruby', :influences => } # New syntax (Ruby 1.9 only) new_hash = { name: 'Ruby', influences: }

Read more about this topic:  Fat Comma, Subtleties

Famous quotes containing the word ruby:

    Thy great leaves enfold
    The ancient beards, the helms of ruby and gold
    Of the crowned Magi; and the king whose eyes
    Saw the Pierced Hands and Rood of elder rise
    In Druid vapour and make the torches dim....
    William Butler Yeats (1865–1939)

    A man in the house is worth two in the street.
    Mae West, U.S. actor, screenwriter, and Leo McCarey. Ruby Carter (Mae West)

    Its quick silver bell beating, beating
    And down the dark one ruby flare
    Pulsing out red light like an artery,
    Karl Shapiro (b. 1913)