The other answers are not wrong, but they may not be clear.
Just as ||= sets the value of something if it doesn't already have one,
&&= sets the value of something if it *does* already have one.
irb(main):001:0> a = nil
=> nil
irb(main):002:0> b = 'foo'
=> "foo"
irb(main):003:0> a&&= b
=> nil
irb(main):004:0> a = 'foo'
=> "foo"
irb(main):005:0> b = 'bar'
=> "bar"
irb(main):006:0> a&&= b
=> "bar"
Consider the following practical use I gave in my solution for Ruby Quiz
144:
DAYNAMES=%w[Sun Mon Tue Wed Thu Fri Sat]
DAYNAME=%r{Sun|Mon|Tue|Wed|Thu|Fri|Sat}
TIME=%r{[0-9]+}
#find a single day, or a hyphenated range of days
clause.scan(/(#{DAYNAME})(?

?=\s)|$)|(#{DAYNAME})-(#{DAYNAME})/) \
do |single,start,finish|
#convert data in single, start, and finish only if they're not nil
#though the&&= is not strictly necessary since Array#index() handles
#nil properly, some conversions like obj.to_i will fail badly
#if obj is nil
single&&= DAYNAMES.index(single)
start&&= DAYNAMES.index(start)
finish&&= DAYNAMES.index(finish)
#do something with the ones that are not nil
end