Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

43 lines (27 sloc) 0.427 kB

!SLIDE subsection

Symbol

!SLIDE

Symbol

@@@ Ruby
var = :foo

var
# => :foo

var.to_s
# => "foo"

!SLIDE

Symbol

@@@ Ruby
:foo == :"foo"
# => true

:foo == "foo".intern
# => true

:foo == "foo".to_sym
# => true

!SLIDE

Symbol

@@@ Ruby
var = "Simone"

var.respond_to?(:upcase)
# => true

var.send(:upcase)
# => "SIMONE"
Jump to Line
Something went wrong with that request. Please try again.