It’s a conditional assignment. If the variable is nil
or false
it will be replaced with the value on the right hand side; if it already has a value other than nil
or false
it will keep that value.
More Related Contents:
- Ruby syntax error, unexpected tIDENTIFIER, expecting end-of-input
- How to pass command line arguments to a rake task
- Parsing a JSON string in Ruby
- How to set TLS context options in Ruby (like OpenSSL::SSL::SSL_OP_NO_SSLv2)
- Ruby: kind_of? vs. instance_of? vs. is_a?
- Why does installing Nokogiri on Mac OS fail with libiconv is missing?
- Pass variables to Ruby script via command line
- How do I get the match data for all occurrences of a Ruby regular expression in a string?
- Why isn’t the eigenclass equivalent to self.class, when it looks so similar?
- Open an IO stream from a local file or url
- Performance of Arrays and Hashes in Ruby
- Ruby max integer
- Ruby Regular expression to match a url [duplicate]
- Installing Jekyll without root
- How can I update Ruby version 2.0.0 to the latest version in Mac OS X v10.10 (Yosemite)?
- Equivalent of cURL for Ruby?
- What is the difference between map, each, and collect? [duplicate]
- How do I create a class instance from a string name in ruby?
- Iterate through every file in one directory
- Running a command from Ruby displaying and capturing the output
- In Rails, how to add a new method to String class?
- Why isn’t self always needed in ruby / rails / activerecord?
- Ruby factorial function
- Read, edit, and write a text file line-wise using Ruby
- Ruby: filter array by regex?
- Overriding method by another defined in module
- Ruby gem for finding timezone of location [closed]
- What will give me something like ruby readline with a default value?
- Is it possible to have class.property = x return something other than x?
- Functional code examples in ruby