Slides by Błażej Hadzik, Ruby on Rails developer at @netguru covering intro to Ruby on Rails.. Originally created for the RoR workshop at Silesian University of Technology.
21. Symbols
LOW_PRIORITY = 0
HIGH_PRIORITY = 1
priority = HIGH_PRIORITY
vs
priority = :high
Symbols are simply constants that you don’t have to predeclare and that are guaranteed to be unique.
27. Classes, objects
class School
def initialize(name)
@name = name
end
end
school = School.new(‘polsl’)
p school # =>#<School:0x007fa301836160 @name="polsl">