There is famous and often used #ruby #trick for initializing with default values, ||=

options[:name] ||= 'Bond'
# instead of
options[:name] = 'Bond' unless options[:name]

But recently I discover for myself its brother, &&=. It's useful when you want to preprocess some value, but only when it exists. So instead

options[:name] = options[:name].strip if options[:name]

you can simply write

options[:name] &&= options[:name].strip